From ed2cfb176831fb3c1415d470b1fe1495b6f21239 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 1 Apr 2024 16:00:38 +0000 Subject: [PATCH 001/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index a5c49cdbb..11339c18a 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.5.0 + 2.5.1-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.5.0 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 958f25193..dd6ede53a 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.0 + 2.5.1-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index b802dee83..d83221c8c 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.0 + 2.5.1-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 0b4aa79fb..26ddadf7a 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.0 + 2.5.1-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 9b8ac4d47..8ffe7c7db 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.0 + 2.5.1-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index d987eb1c8..1f1c56b89 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.0 + 2.5.1-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 83ac3f9a5..f62280958 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.5.0 + 2.5.1-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 40ce8b31b..933aadce0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.0 + 2.5.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 120f11ccd..e719c73cf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.0 + 2.5.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 00f4a96f2..c937bd6fe 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.0 + 2.5.1-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 07d7babc8..24f81f82c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.0 + 2.5.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index 5e46d7d54..34d734fdb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.0 + 2.5.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index d89bef434..4435adfad 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.5.0 + 2.5.1-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index fc5b3cb86..ca833c0ec 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.0 + 2.5.1-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index e3c0655f7..a657bd3df 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.5.0 + 2.5.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 0b104114e..214de16ee 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.0 + 2.5.1-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 58eb8b1e3..745ee023f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.0 + 2.5.1-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 9beae556a..2b8da2454 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.5.0 + 2.5.1-SNAPSHOT springdoc-openapi-security-tests From 679fb4de835a4cae0816259a31d9ae12eba10b75 Mon Sep 17 00:00:00 2001 From: footaku <18702821+footaku@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:56:42 +0900 Subject: [PATCH 002/226] Add components parameter when calling AnnotationsUtils. The swagger-core's AnnotationsUtils has added an overload of the getHeaders method. A scenario where an NPE occurs if the components is not added as an argument has emerged. --- .../java/org/springdoc/core/service/OperationService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java index e673e6b1c..5a539b6b8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -412,7 +412,7 @@ private Optional getApiResponses( buildResponseContent(methodAttributes, components, classProduces, methodProduces, apiResponsesOp, response, apiResponseObject); - AnnotationsUtils.getHeaders(response.headers(), null, propertyResolverUtils.isOpenapi31()).ifPresent(apiResponseObject::headers); + AnnotationsUtils.getHeaders(response.headers(), components, null, propertyResolverUtils.isOpenapi31()).ifPresent(apiResponseObject::headers); // Make schema as string if empty calculateHeader(apiResponseObject); if (isResponseObject(apiResponseObject)) { From 7e78f059bd73b2c2bb8d890c00217f52f25515ed Mon Sep 17 00:00:00 2001 From: footaku <18702821+footaku@users.noreply.github.com> Date: Wed, 3 Apr 2024 18:08:17 +0900 Subject: [PATCH 003/226] Testing pattern with specifying Schema in response headers. Confirm that setting Header annotations specified in the Schema attribute in ApiResponse's headers attribute does not result in errors. --- .../api/v30/app218/HelloController.java | 63 +++++++++++++++++++ .../api/v30/app218/SpringDocApp218Test.java | 36 +++++++++++ .../test/resources/results/3.0.1/app218.json | 48 ++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/SpringDocApp218Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app218.json diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/HelloController.java new file mode 100644 index 000000000..6749896a4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/HelloController.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app218; + + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.headers.Header; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.net.URI; + + +@RestController +@RequestMapping("/") +public class HelloController { + + @Operation( + summary = "Summary", + description = "This is description.", + tags = {"Sample"}, + responses = { + @ApiResponse( + responseCode = "201", + description = "201 (Created)", + headers = + @Header( + name = HttpHeaders.LOCATION, + description = "Sample endpoint", + schema = @Schema(implementation = URI.class) + ) + ) + } + ) + @GetMapping + public String get() { + return "Hello World!"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/SpringDocApp218Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/SpringDocApp218Test.java new file mode 100644 index 000000000..24b9d92b4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/SpringDocApp218Test.java @@ -0,0 +1,36 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app218; + +import org.springdoc.core.customizers.SpecPropertiesCustomizer; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +/** + *

+ * A test for {@link SpecPropertiesCustomizer} + */ +@SpringBootTest +public class SpringDocApp218Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app218.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app218.json new file mode 100644 index 000000000..4aeec31eb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app218.json @@ -0,0 +1,48 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "Sample" + ], + "summary": "Summary", + "description": "This is description.", + "operationId": "get", + "responses": { + "201": { + "description": "201 (Created)", + "headers": { + "Location": { + "description": "Sample endpoint", + "style": "simple", + "schema": { + "type": "string", + "format": "uri" + } + } + }, + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} From 5f3fe3ac6981f3ab5ab7247d5e19707bc2e2ea86 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 9 Apr 2024 10:59:08 +0200 Subject: [PATCH 004/226] code review --- .../java/org/springdoc/core/service/GenericResponseService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index c54898caf..b3ad7e3df 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -397,7 +397,7 @@ private Map computeResponseFromDoc(Components components, M apiResponse.extensions(extensions); } } - AnnotationsUtils.getHeaders(apiResponseAnnotations.headers(), methodAttributes.getJsonViewAnnotation(), openapi31) + AnnotationsUtils.getHeaders(apiResponseAnnotations.headers(), components, methodAttributes.getJsonViewAnnotation(), openapi31) .ifPresent(apiResponse::headers); apiResponsesOp.addApiResponse(httpCode, apiResponse); } From 5a04f307f9c6201157caed37d1cb99beed2e333f Mon Sep 17 00:00:00 2001 From: Michael Schout Date: Thu, 18 Apr 2024 12:13:32 -0500 Subject: [PATCH 005/226] Fix missing exception response types in OpenAPI spec Since e893628d5494808fcc8a9ee9be0c1d446a805f47, some error response types referenced by the schema in `$ref`'s were missing from the spec. --- .../org/springdoc/core/service/GenericResponseService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index c54898caf..c46468783 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -66,6 +66,7 @@ import org.springdoc.core.parsers.ReturnTypeParser; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.providers.JavadocProvider; +import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.utils.PropertyResolverUtils; import org.springdoc.core.utils.SpringDocAnnotationsUtils; @@ -736,7 +737,7 @@ private Map getGenericMapResponse(HandlerMethod handlerMeth LinkedHashMap genericApiResponsesClone; try { - ObjectMapper objectMapper = new ObjectMapper(); + ObjectMapper objectMapper = ObjectMapperProvider.createJson(springDocConfigProperties); genericApiResponsesClone = objectMapper.readValue(objectMapper.writeValueAsString(genericApiResponseMap), ApiResponses.class); return genericApiResponsesClone; } From e2df1525876f40d4840bde0b6eb2c2db2920225e Mon Sep 17 00:00:00 2001 From: James Bradlee Date: Fri, 19 Apr 2024 22:12:37 +0200 Subject: [PATCH 006/226] fix: add support for leading tab characters with `trim-kotlin-indent`. --- .../java/org/springdoc/core/utils/PropertyResolverUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java index e70e9666e..dfa282e82 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java @@ -143,7 +143,7 @@ private int resolveMinIndent(String[] lines) { private int countLeadingSpaces(String line) { int count = 0; for (char ch : line.toCharArray()) { - if (ch != ' ') break; + if (ch != ' ' && ch != '\t') break; count++; } return count; @@ -222,4 +222,4 @@ public Map resolveExtensions(Locale locale, Map else return extensions; } -} \ No newline at end of file +} From bf2bd2fe5bd57f76457290e8d95dc3078fc4d081 Mon Sep 17 00:00:00 2001 From: Marcelo Boveto Shima Date: Mon, 6 May 2024 14:41:21 -0300 Subject: [PATCH 007/226] pass HttpRequest to ServerBaseUrlCustomizer --- .../customizers/ServerBaseUrlCustomizer.java | 5 ++++- .../core/service/OpenAPIService.java | 5 +++-- .../api/AbstractOpenApiResourceTest.java | 21 ++++++++++--------- .../webflux/api/OpenApiActuatorResource.java | 2 +- .../webflux/api/OpenApiResource.java | 2 +- .../springdoc/webmvc/api/OpenApiResource.java | 4 +++- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java index b209ba72e..47c5d3891 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java @@ -24,6 +24,8 @@ package org.springdoc.core.customizers; +import org.springframework.http.HttpRequest; + /** * The interface Server Base URL customiser. * @author skylar -stark @@ -35,7 +37,8 @@ public interface ServerBaseUrlCustomizer { * Customise. * * @param serverBaseUrl the serverBaseUrl. + * @param request the request. * @return the customised serverBaseUrl */ - String customize(String serverBaseUrl); + String customize(String serverBaseUrl, HttpRequest request); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java index 4a3fe8ad8..bb69b1a6c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java @@ -81,6 +81,7 @@ import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.type.filter.AnnotationTypeFilter; +import org.springframework.http.HttpRequest; import org.springframework.stereotype.Controller; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.ControllerAdvice; @@ -490,12 +491,12 @@ public Schema resolveProperties(Schema schema, Locale locale) { * * @param serverBaseUrl the server base url */ - public void setServerBaseUrl(String serverBaseUrl) { + public void setServerBaseUrl(String serverBaseUrl, HttpRequest httpRequest) { String customServerBaseUrl = serverBaseUrl; if (serverBaseUrlCustomizers.isPresent()) { for (ServerBaseUrlCustomizer customizer : serverBaseUrlCustomizers.get()) { - customServerBaseUrl = customizer.customize(customServerBaseUrl); + customServerBaseUrl = customizer.customize(customServerBaseUrl, httpRequest); } } diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java index fdf75d7b0..f670da701 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java @@ -62,6 +62,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.mock.http.client.MockClientHttpRequest; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; @@ -190,7 +191,7 @@ void preLoadingModeShouldNotOverwriteServers() throws InterruptedException { doCallRealMethod().when(openAPIService).updateServers(any()); when(openAPIService.getCachedOpenAPI(any())).thenCallRealMethod(); doAnswer(new CallsRealMethods()).when(openAPIService).setServersPresent(true); - doAnswer(new CallsRealMethods()).when(openAPIService).setServerBaseUrl(any()); + doAnswer(new CallsRealMethods()).when(openAPIService).setServerBaseUrl(any(), any()); doAnswer(new CallsRealMethods()).when(openAPIService).setCachedOpenAPI(any(), any()); String customUrl = "https://custom.com"; @@ -212,7 +213,7 @@ properties, springDocProviders, new SpringDocCustomizers(Optional.of(singletonLi Thread.sleep(1_000); // emulate generating base url - openAPIService.setServerBaseUrl(generatedUrl); + openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); openAPIService.updateServers(openAPI); Locale locale = Locale.US; OpenAPI after = resource.getOpenApi(locale); @@ -224,7 +225,7 @@ properties, springDocProviders, new SpringDocCustomizers(Optional.of(singletonLi void serverBaseUrlCustomisersTest() throws InterruptedException { doCallRealMethod().when(openAPIService).updateServers(any()); when(openAPIService.getCachedOpenAPI(any())).thenCallRealMethod(); - doAnswer(new CallsRealMethods()).when(openAPIService).setServerBaseUrl(any()); + doAnswer(new CallsRealMethods()).when(openAPIService).setServerBaseUrl(any(), any()); doAnswer(new CallsRealMethods()).when(openAPIService).setCachedOpenAPI(any(), any()); SpringDocConfigProperties properties = new SpringDocConfigProperties(); @@ -247,37 +248,37 @@ springDocProviders, new SpringDocCustomizers(Optional.empty(),Optional.empty(),O // Test that setting generated URL works fine with no customizers present String generatedUrl = "https://generated-url.com/context-path"; - openAPIService.setServerBaseUrl(generatedUrl); + openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); openAPIService.updateServers(openAPI); OpenAPI after = resource.getOpenApi(locale); assertThat(after.getServers().get(0).getUrl(), is(generatedUrl)); // Test that adding a serverBaseUrlCustomizer has the desired effect - ServerBaseUrlCustomizer serverBaseUrlCustomizer = serverBaseUrl -> serverBaseUrl.replace("/context-path", ""); + ServerBaseUrlCustomizer serverBaseUrlCustomizer = (serverBaseUrl, request) -> serverBaseUrl.replace("/context-path", ""); List serverBaseUrlCustomizerList = new ArrayList<>(); serverBaseUrlCustomizerList.add(serverBaseUrlCustomizer); ReflectionTestUtils.setField(openAPIService, "serverBaseUrlCustomizers", Optional.of(serverBaseUrlCustomizerList)); - openAPIService.setServerBaseUrl(generatedUrl); + openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); openAPIService.updateServers(openAPI); after = resource.getOpenApi(locale); assertThat(after.getServers().get(0).getUrl(), is("https://generated-url.com")); // Test that serverBaseUrlCustomisers are performed in order generatedUrl = "https://generated-url.com/context-path/second-path"; - ServerBaseUrlCustomizer serverBaseUrlCustomiser2 = serverBaseUrl -> serverBaseUrl.replace("/context-path/second-path", ""); + ServerBaseUrlCustomizer serverBaseUrlCustomiser2 = (serverBaseUrl, request) -> serverBaseUrl.replace("/context-path/second-path", ""); serverBaseUrlCustomizerList.add(serverBaseUrlCustomiser2); - openAPIService.setServerBaseUrl(generatedUrl); + openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); openAPIService.updateServers(openAPI); after = resource.getOpenApi(locale); assertThat(after.getServers().get(0).getUrl(), is("https://generated-url.com/second-path")); // Test that all serverBaseUrlCustomisers in the List are performed - ServerBaseUrlCustomizer serverBaseUrlCustomiser3 = serverBaseUrl -> serverBaseUrl.replace("/second-path", ""); + ServerBaseUrlCustomizer serverBaseUrlCustomiser3 = (serverBaseUrl, request) -> serverBaseUrl.replace("/second-path", ""); serverBaseUrlCustomizerList.add(serverBaseUrlCustomiser3); - openAPIService.setServerBaseUrl(generatedUrl); + openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); openAPIService.updateServers(openAPI); after = resource.getOpenApi(locale); assertThat(after.getServers().get(0).getUrl(), is("https://generated-url.com")); diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java index 75ad34354..3bee371a5 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java @@ -131,7 +131,7 @@ public Mono openapiYaml(ServerHttpRequest serverHttpRequest, Locale loca protected void calculateServerUrl(ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) { super.initOpenAPIBuilder(locale); URI uri = getActuatorURI(serverHttpRequest.getURI().getScheme(), serverHttpRequest.getURI().getHost()); - openAPIService.setServerBaseUrl(uri.toString()); + openAPIService.setServerBaseUrl(uri.toString(), serverHttpRequest); } @Override diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java index acbefce90..0b29503d1 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java @@ -229,7 +229,7 @@ protected void getWebFluxRouterFunctionPaths(Locale locale, OpenAPI openAPI) { protected void calculateServerUrl(ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) { initOpenAPIBuilder(locale); String serverUrl = getServerUrl(serverHttpRequest, apiDocsUrl); - openAPIService.setServerBaseUrl(serverUrl); + openAPIService.setServerBaseUrl(serverUrl, serverHttpRequest); } /** diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java index 4b5fd61a7..288496a80 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java @@ -55,6 +55,7 @@ import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.ObjectFactory; +import org.springframework.http.server.ServletServerHttpRequest; import org.springframework.util.CollectionUtils; import org.springframework.util.MimeType; import org.springframework.web.bind.annotation.RequestMethod; @@ -244,7 +245,8 @@ private Comparator byReversedRequestMappingInfos() { protected void calculateServerUrl(HttpServletRequest request, String apiDocsUrl, Locale locale) { super.initOpenAPIBuilder(locale); String calculatedUrl = getServerUrl(request, apiDocsUrl); - openAPIService.setServerBaseUrl(calculatedUrl); + ServletServerHttpRequest serverRequest = request != null ? new ServletServerHttpRequest(request) : null; + openAPIService.setServerBaseUrl(calculatedUrl, serverRequest); } /** From 8367ba9d61ad8582e295a33d2e7fd392c1eeb9b1 Mon Sep 17 00:00:00 2001 From: jsieczczynski Date: Fri, 24 May 2024 09:06:26 +0200 Subject: [PATCH 008/226] Add failing test case --- .../api/v30/app219/HelloController.java | 42 ++++++++++++++++ .../api/v30/app219/SpringDocApp219Test.java | 36 ++++++++++++++ .../springdoc/api/v30/app219/TestObject.java | 49 +++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/TestObject.java diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/HelloController.java new file mode 100644 index 000000000..0b2b37d5c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app219; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(value = "/api", produces = {"application/xml"}, consumes = {"application/json"}) +public class HelloController { + + @RequestMapping(value = "/testpost", method = RequestMethod.POST, produces = {"application/json"}, + consumes = {"application/json;charset=UTF-8", "application/json; charset=UTF-8"}) + public ResponseEntity testpost(@RequestBody TestObject dto) { + return ResponseEntity.ok(dto); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java new file mode 100644 index 000000000..a6ec97f84 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app219; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +@ActiveProfiles("219") +public class SpringDocApp219Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/TestObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/TestObject.java new file mode 100644 index 000000000..ca336cca3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/TestObject.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app219; + +import java.time.LocalDateTime; + +public class TestObject { + public String stringValue; + + public LocalDateTime localDateTime; + + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + public LocalDateTime getLocalDateTime() { + return localDateTime; + } + + public void setLocalDateTime(LocalDateTime localDateTime) { + this.localDateTime = localDateTime; + } +} From d6da952030fc86992ca6a32b7127cfd2e5c24b8f Mon Sep 17 00:00:00 2001 From: jsieczczynski Date: Fri, 24 May 2024 09:06:44 +0200 Subject: [PATCH 009/226] Correctly calculate consumes and produces --- .../core/models/MethodAttributes.java | 56 ++++++++++++------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java index bb2e4b69a..dbb545a98 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java @@ -25,6 +25,8 @@ package org.springdoc.core.models; import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; @@ -32,11 +34,13 @@ import com.fasterxml.jackson.annotation.JsonView; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; +import java.util.Set; +import java.util.stream.Collectors; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.Nullable; import org.springframework.core.annotation.AnnotatedElementUtils; -import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -275,28 +279,38 @@ else if (reqMappingClass != null) { * @param headers the headers */ private void fillMethods(String[] produces, String[] consumes, String[] headers) { - if (ArrayUtils.isEmpty(methodProduces)) { - if (ArrayUtils.isNotEmpty(produces)) - methodProduces = produces; - else if (ArrayUtils.isNotEmpty(classProduces)) - methodProduces = classProduces; - else - methodProduces = new String[] { defaultProducesMediaType }; - } - - if (ArrayUtils.isEmpty(methodConsumes)) { - if (ArrayUtils.isNotEmpty(consumes)) - methodConsumes = consumes; - else if (ArrayUtils.isNotEmpty(classConsumes)) - methodConsumes = classConsumes; - else - methodConsumes = new String[] { defaultConsumesMediaType }; - } - - if (CollectionUtils.isEmpty(this.headers)) - setHeaders(headers); + if (ArrayUtils.isNotEmpty(produces)) { + methodProduces = mergeArrays(methodProduces, produces); + } else if (ArrayUtils.isNotEmpty(classProduces)) { + methodProduces = mergeArrays(methodProduces, classProduces); + } else if (ArrayUtils.isEmpty(methodProduces)) { + methodProduces = new String[] {defaultProducesMediaType}; + } + + if (ArrayUtils.isNotEmpty(consumes)) { + methodConsumes = mergeArrays(methodConsumes, consumes); + } else if (ArrayUtils.isNotEmpty(classConsumes)) { + methodConsumes = mergeArrays(methodConsumes, classConsumes); + } else if (ArrayUtils.isEmpty(methodConsumes)) { + methodConsumes = new String[] {defaultConsumesMediaType}; + } + + setHeaders(headers); } + /** + * Merge string arrays into one array with unique values + * + * @param array1 the array1 + * @param array2 the array2 + * @return the string [ ] + */ + private String[] mergeArrays(@Nullable String[] array1, String[] array2) { + Set uniqueValues = array1 == null ? new HashSet<>() : Arrays.stream(array1).collect(Collectors.toSet()); + uniqueValues.addAll(Arrays.asList(array2)); + return uniqueValues.toArray(new String[0]); + } + /** * Is method overloaded boolean. * From adffea0f7a528b4adb68c9fd2ea3c8fe91ea391e Mon Sep 17 00:00:00 2001 From: Claudio Nave Date: Fri, 14 Jun 2024 00:08:31 +0200 Subject: [PATCH 010/226] Upgrade spring boot parent version to 3.3.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 11339c18a..19bd4b57c 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 3.2.4 + 3.3.0 From a9bd320d7c665126539b56de195852deb6a87ee1 Mon Sep 17 00:00:00 2001 From: Claudio Nave Date: Fri, 14 Jun 2024 00:37:46 +0200 Subject: [PATCH 011/226] Add actuator sbom to test cases --- .../src/test/resources/results/app146-1.json | 62 +++++++++++++++++++ .../src/test/resources/results/app147-1.json | 62 +++++++++++++++++++ .../src/test/resources/results/app148-2.json | 62 +++++++++++++++++++ .../src/test/resources/results/app186.json | 62 +++++++++++++++++++ .../src/test/resources/results/app147-1.json | 62 +++++++++++++++++++ .../src/test/resources/results/app148-2.json | 62 +++++++++++++++++++ .../src/test/resources/results/app186.json | 62 +++++++++++++++++++ 7 files changed, 434 insertions(+) diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json index 4d21f4405..dc3884dd2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json @@ -217,6 +217,68 @@ } } }, + "/application/sbom": { + "get": { + "operationId": "sbom", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom'", + "tags": [ + "Actuator" + ] + } + }, + "/application/sbom/{id}": { + "get": { + "operationId": "sbom-id", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom-id'", + "tags": [ + "Actuator" + ] + } + }, "/application/metrics": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json index cbcf7fd50..2140650d2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json @@ -217,6 +217,68 @@ } } }, + "/application/sbom": { + "get": { + "operationId": "sbom", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom'", + "tags": [ + "Actuator" + ] + } + }, + "/application/sbom/{id}": { + "get": { + "operationId": "sbom-id", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom-id'", + "tags": [ + "Actuator" + ] + } + }, "/application/metrics": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json index 837455a90..ab8724aca 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json @@ -217,6 +217,68 @@ } } }, + "/application/sbom": { + "get": { + "operationId": "sbom", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom'", + "tags": [ + "Actuator" + ] + } + }, + "/application/sbom/{id}": { + "get": { + "operationId": "sbom-id", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom-id'", + "tags": [ + "Actuator" + ] + } + }, "/application/metrics": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json index 6f5111c7a..dc6ace088 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json @@ -217,6 +217,68 @@ } } }, + "/actuator/sbom": { + "get": { + "operationId": "sbom", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom'", + "tags": [ + "Actuator" + ] + } + }, + "/actuator/sbom/{id}": { + "get": { + "operationId": "sbom-id", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom-id'", + "tags": [ + "Actuator" + ] + } + }, "/actuator/metrics": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json index 601c304ca..5cd279fa0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json @@ -297,6 +297,68 @@ } } }, + "/application/sbom": { + "get": { + "operationId": "sbom", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom'", + "tags": [ + "Actuator" + ] + } + }, + "/application/sbom/{id}": { + "get": { + "operationId": "sbom-id", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom-id'", + "tags": [ + "Actuator" + ] + } + }, "/application/mappings": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json index 1d726c0ba..210744fd1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json @@ -297,6 +297,68 @@ } } }, + "/application/sbom": { + "get": { + "operationId": "sbom", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom'", + "tags": [ + "Actuator" + ] + } + }, + "/application/sbom/{id}": { + "get": { + "operationId": "sbom-id", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom-id'", + "tags": [ + "Actuator" + ] + } + }, "/application/mappings": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json index c136df41f..77e236426 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json @@ -297,6 +297,68 @@ } } }, + "/actuator/sbom": { + "get": { + "operationId": "sbom", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom'", + "tags": [ + "Actuator" + ] + } + }, + "/actuator/sbom/{id}": { + "get": { + "operationId": "sbom-id", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Actuator web endpoint 'sbom-id'", + "tags": [ + "Actuator" + ] + } + }, "/actuator/mappings": { "get": { "tags": [ From dd30b9d0c8c707dae5de90cfbdc5d6b99ccaee3e Mon Sep 17 00:00:00 2001 From: Claudio Nave Date: Fri, 14 Jun 2024 00:06:48 +0200 Subject: [PATCH 012/226] Replace Page with PagedModel when pageSerializationMode is set to VIA_DTO --- .../SpringDocPageConfiguration.java | 96 ++++ .../core/converters/PageOpenAPIConverter.java | 108 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../test/org/springdoc/api/app10/Dummy.java | 34 ++ .../springdoc/api/app10/HelloController.java | 75 ++++ .../api/app10/SpringDocApp10DirectTest.java | 53 +++ .../app10/SpringDocApp10NotSpecifiedTest.java | 52 +++ .../api/app10/SpringDocApp10ViaDtoTest.java | 54 +++ .../test/resources/results/app10-direct.json | 409 ++++++++++++++++++ .../test/resources/results/app10-via_dto.json | 213 +++++++++ 10 files changed, 1095 insertions(+) create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageConfiguration.java create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/Dummy.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageConfiguration.java new file mode 100644 index 000000000..6df0b467a --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageConfiguration.java @@ -0,0 +1,96 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package org.springdoc.core.configuration; + +import org.springdoc.core.converters.PageOpenAPIConverter; +import org.springdoc.core.converters.SortOpenAPIConverter; +import org.springdoc.core.converters.models.SortObject; +import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; +import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer; +import org.springdoc.core.providers.ObjectMapperProvider; +import org.springdoc.core.providers.RepositoryRestConfigurationProvider; +import org.springdoc.core.providers.SpringDataWebPropertiesProvider; +import org.springframework.boot.autoconfigure.condition.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Sort; +import org.springframework.data.web.PagedModel; +import org.springframework.data.web.config.EnableSpringDataWebSupport; +import org.springframework.data.web.config.SpringDataWebSettings; + +import java.util.Optional; + +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLED; +import static org.springdoc.core.utils.Constants.SPRINGDOC_SORT_CONVERTER_ENABLED; +import static org.springdoc.core.utils.SpringDocUtils.getConfig; + +/** + * The type Spring doc page configuration. + * + * @author Claudio Nave + */ +@Lazy(false) +@Configuration(proxyBeanMethods = false) +@ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) +@ConditionalOnClass({ Page.class, PagedModel.class }) +@ConditionalOnWebApplication +@ConditionalOnBean(SpringDocConfiguration.class) +public class SpringDocPageConfiguration { + + /** + * Page open api converter. + * @param objectMapperProvider the object mapper provider + * @return the page open api converter + */ + @Bean + @ConditionalOnMissingBean + @ConditionalOnBean(SpringDataWebSettings.class) + @Lazy(false) + PageOpenAPIConverter pageOpenAPIConverter(SpringDataWebSettings settings, + ObjectMapperProvider objectMapperProvider) { + return new PageOpenAPIConverter( + settings.pageSerializationMode() == EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO, + objectMapperProvider); + } + + /** + * Delegating method parameter customizer delegating method parameter customizer. + * @param optionalSpringDataWebPropertiesProvider the optional spring data web + * properties + * @param optionalRepositoryRestConfiguration the optional repository rest + * configuration + * @return the delegating method parameter customizer + */ + @Bean + @ConditionalOnMissingBean + @Lazy(false) + DelegatingMethodParameterCustomizer delegatingMethodParameterCustomizer( + Optional optionalSpringDataWebPropertiesProvider, + Optional optionalRepositoryRestConfiguration) { + return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, + optionalRepositoryRestConfiguration); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java new file mode 100644 index 000000000..3fcada041 --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java @@ -0,0 +1,108 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package org.springdoc.core.converters; + +import com.fasterxml.jackson.databind.JavaType; +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverterContext; +import io.swagger.v3.oas.models.media.Schema; +import org.apache.commons.lang3.StringUtils; +import org.springdoc.core.providers.ObjectMapperProvider; +import org.springframework.core.ResolvableType; +import org.springframework.data.web.PagedModel; + +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.Iterator; + +/** + * The Spring Data Page type model converter. + * + * @author Claudio Nave + */ +public class PageOpenAPIConverter implements ModelConverter { + + private static final String PAGE_TO_REPLACE = "org.springframework.data.domain.Page"; + + /** + * The constant PAGED_MODEL. + */ + private static final AnnotatedType PAGED_MODEL = new AnnotatedType(PagedModel.class).resolveAsRef(true); + + /** + * The Spring doc object mapper. + */ + private final ObjectMapperProvider springDocObjectMapper; + /** + * Flag to replace Page with PagedModel or not. + */ + private final boolean replacePageWithPagedModel; + + /** + * Instantiates a new Page open api converter. + * @param replacePageWithPagedModel flag to replace Page with PagedModel or not + * @param springDocObjectMapper the spring doc object mapper + */ + public PageOpenAPIConverter(boolean replacePageWithPagedModel, ObjectMapperProvider springDocObjectMapper) { + this.replacePageWithPagedModel = replacePageWithPagedModel; + this.springDocObjectMapper = springDocObjectMapper; + } + + /** + * Resolve schema. + * @param type the type + * @param context the context + * @param chain the chain + * @return the schema + */ + @Override + public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator chain) { + JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); + if (javaType != null) { + Class cls = javaType.getRawClass(); + if (replacePageWithPagedModel && PAGE_TO_REPLACE.equals(cls.getCanonicalName())) { + if (!type.isSchemaProperty()) + type = resolvePagedModelType(type); + else + type.name(cls.getSimpleName() + StringUtils.capitalize(type.getParent().getType())); + } + } + return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; + } + + private AnnotatedType resolvePagedModelType(AnnotatedType type) { + Type pageType = type.getType(); + if (pageType instanceof ParameterizedType) { + Type argumentType = ((ParameterizedType) type.getType()).getActualTypeArguments()[0]; + Type pagedModelType = ResolvableType + .forClassWithGenerics(PagedModel.class, ResolvableType.forType(argumentType)) + .getType(); + return new AnnotatedType(pagedModelType).resolveAsRef(true); + } + else { + return PAGED_MODEL; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/springdoc-openapi-starter-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 12694c003..ad61f1fa5 100644 --- a/springdoc-openapi-starter-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/springdoc-openapi-starter-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -7,6 +7,7 @@ org.springdoc.core.configuration.SpringDocFunctionCatalogConfiguration org.springdoc.core.configuration.SpringDocHateoasConfiguration org.springdoc.core.configuration.SpringDocPageableConfiguration org.springdoc.core.configuration.SpringDocSortConfiguration +org.springdoc.core.configuration.SpringDocPageConfiguration org.springdoc.core.configuration.SpringDocSpecPropertiesConfiguration org.springdoc.core.configuration.SpringDocDataRestConfiguration org.springdoc.core.configuration.SpringDocKotlinConfiguration diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/Dummy.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/Dummy.java new file mode 100644 index 000000000..761794ae2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/Dummy.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.app10; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Dummy { + + private T value; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java new file mode 100644 index 000000000..0597d1fd4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.app10; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.web.PagedModel; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@SuppressWarnings("rawtypes") +@RestController +public class HelloController { + + @GetMapping("/page-simple") + public Page pageSimple() { + return pageImpl("test"); + } + + @GetMapping("/paged-model-simple") + public PagedModel pagedModelSimple() { + return pagedModel("test"); + } + + @GetMapping("/page-complex") + public Page>> pageComplex() { + return pageImpl(new Dummy<>(List.of("test"))); + } + + @GetMapping("/paged-model-complex") + public PagedModel>> pagedModelComplex() { + return pagedModel(new Dummy<>(List.of("test"))); + } + + @GetMapping("/page-raw") + public Page pageRaw() { + return pageSimple(); + } + + @GetMapping("/paged-model-raw") + public PagedModel pagedModelRaw() { + return pagedModelSimple(); + } + + private PagedModel pagedModel(T value) { + return new PagedModel<>(pageImpl(value)); + } + + private Page pageImpl(T value) { + return new PageImpl<>(List.of(value)); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java new file mode 100644 index 000000000..6ced6708d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.app10; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.web.config.EnableSpringDataWebSupport; +import test.org.springdoc.api.AbstractSpringDocTest; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +public class SpringDocApp10DirectTest extends AbstractSpringDocTest { + + @Override + @Test + public void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/app10-direct.json"), true)); + } + + @SpringBootApplication + @EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.DIRECT) + public static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java new file mode 100644 index 000000000..c6f6856dd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.app10; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.web.config.EnableSpringDataWebSupport; +import test.org.springdoc.api.AbstractSpringDocTest; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +public class SpringDocApp10NotSpecifiedTest extends AbstractSpringDocTest { + + @Override + @Test + public void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/app10-direct.json"), true)); + } + + @SpringBootApplication + public static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java new file mode 100644 index 000000000..7d37e9f38 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.app10; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.data.web.config.EnableSpringDataWebSupport; +import test.org.springdoc.api.AbstractSpringDocTest; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +public class SpringDocApp10ViaDtoTest extends AbstractSpringDocTest { + + @Override + @Test + public void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/app10-via_dto.json"), true)); + } + + @SpringBootApplication + @EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO) + public static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json new file mode 100644 index 000000000..886b96496 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json @@ -0,0 +1,409 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/paged-model-simple": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelSimple", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelString" + } + } + } + } + } + } + }, + "/paged-model-raw": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelRaw", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModel" + } + } + } + } + } + } + }, + "/paged-model-complex": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelComplex", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelDummyListString" + } + } + } + } + } + } + }, + "/page-simple": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageSimple", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PageString" + } + } + } + } + } + } + }, + "/page-raw": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageRaw", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Page" + } + } + } + } + } + } + }, + "/page-complex": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageComplex", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PageDummyListString" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelString": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "type": "string" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "PagedModel": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "type": "object" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "DummyListString": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PagedModelDummyListString": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DummyListString" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "PageString": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "string" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortObject" + } + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + }, + "PageableObject": { + "type": "object", + "properties": { + "paged": { + "type": "boolean" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortObject" + } + }, + "unpaged": { + "type": "boolean" + } + } + }, + "SortObject": { + "type": "object", + "properties": { + "direction": { + "type": "string" + }, + "nullHandling": { + "type": "string" + }, + "ascending": { + "type": "boolean" + }, + "property": { + "type": "string" + }, + "ignoreCase": { + "type": "boolean" + } + } + }, + "Page": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "object" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortObject" + } + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + }, + "PageDummyListString": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DummyListString" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortObject" + } + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json new file mode 100644 index 000000000..32cad61c1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json @@ -0,0 +1,213 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/paged-model-simple": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelSimple", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelString" + } + } + } + } + } + } + }, + "/paged-model-raw": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelRaw", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModel" + } + } + } + } + } + } + }, + "/paged-model-complex": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelComplex", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelDummyListString" + } + } + } + } + } + } + }, + "/page-simple": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageSimple", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelString" + } + } + } + } + } + } + }, + "/page-raw": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageRaw", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModel" + } + } + } + } + } + } + }, + "/page-complex": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageComplex", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelDummyListString" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelString": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "type": "string" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "PagedModel": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "type": "object" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "DummyListString": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PagedModelDummyListString": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DummyListString" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + } + } + } +} \ No newline at end of file From 9dda7a981c2bc2ce8433d564db11d7bec7405c27 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 15 Jun 2024 17:46:27 +0200 Subject: [PATCH 013/226] Upgrade spring-boot to 3.3.0 Upgrade swagger-core to 2.2.22 Upgrade swagger-ui to 5.17.14 Upgrade spring-cloud-function to 4.1.2 Upgrade spring-security-oauth2-authorization-server to 1.3.0 --- pom.xml | 12 +- .../SpringDocSecurityOAuth2Customizer.java | 24 +- .../src/test/resources/logback-test.xml | 1 - .../test/resources/results/3.0.1/app38.json | 7 +- .../org/springdoc/api/AbstractCommonTest.java | 19 + .../api/AbstractSpringDocActuatorTest.java | 18 + .../springdoc/api/AbstractSpringDocTest.java | 31 +- .../api/app146/SpringDocApp146Test.java | 26 +- .../api/app147/SpringDocApp147Test.java | 21 +- .../api/app148/SpringDocApp148Test.java | 10 +- .../api/app186/SpringDocApp186Test.java | 6 +- .../api/app76/SpringDocApp76Test.java | 7 +- .../src/test/resources/logback-test.xml | 1 - .../src/test/resources/results/app146-1.json | 62 ++ .../src/test/resources/results/app147-1.json | 62 ++ .../src/test/resources/results/app147-2.json | 835 +++++++++++++++++- .../src/test/resources/results/app148-2.json | 62 ++ .../src/test/resources/results/app186.json | 62 ++ .../api/AbstractSpringDocActuatorTest.java | 20 + .../api/app148/SpringDocApp148Test.java | 9 +- .../resources/application-test.properties | 1 + .../src/test/resources/logback-test.xml | 3 +- .../src/test/resources/results/app147-1.json | 62 ++ .../src/test/resources/results/app148-2.json | 62 ++ .../src/test/resources/results/app186.json | 64 +- .../api/AbstractSpringDocFunctionTest.java | 6 +- .../src/test/resources/logback-test.xml | 1 - .../src/test/resources/results/app1.json | 628 +++++++------ .../src/test/resources/results/app38.json | 9 +- .../springdoc-openapi-security-tests/pom.xml | 10 - 30 files changed, 1676 insertions(+), 465 deletions(-) diff --git a/pom.xml b/pom.xml index 11339c18a..05ca7eee9 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 3.2.4 + 3.3.0 @@ -60,15 +60,13 @@ 1.6 2.5.3 1.6.8 - 2.2.21 - 5.13.0 + 2.2.22 + 5.17.14 1.13.1 - 2.1 - 1.1 0.9.1 0.15.0 - 4.0.0 - 1.0.1 + 4.1.2 + 1.3.0 diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java index 871ebdbb6..b8cfd52f0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java @@ -55,6 +55,7 @@ import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.security.web.util.matcher.OrRequestMatcher; import org.springframework.security.web.util.matcher.RequestMatcher; +import org.springframework.util.ReflectionUtils; import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; import static org.springframework.http.MediaType.TEXT_HTML_VALUE; @@ -110,7 +111,7 @@ public void customise(OpenAPI openAPI) { * @param securityFilterChain the security filter chain * @param openapi31 the openapi 31 */ - private void getOAuth2TokenRevocationEndpointFilter(OpenAPI openAPI, SecurityFilterChain securityFilterChain, boolean openapi31) { + private void getOAuth2TokenRevocationEndpointFilter(OpenAPI openAPI, SecurityFilterChain securityFilterChain, boolean openapi31) { Object oAuth2EndpointFilter = new SpringDocSecurityOAuth2EndpointUtils(OAuth2TokenRevocationEndpointFilter.class).findEndpoint(securityFilterChain); if (oAuth2EndpointFilter != null) { @@ -168,14 +169,20 @@ private void getOAuth2TokenIntrospectionEndpointFilter(OpenAPI openAPI, Security * @param openapi31 the openapi 31 */ private void getOAuth2AuthorizationServerMetadataEndpoint(OpenAPI openAPI, SecurityFilterChain securityFilterChain, boolean openapi31) { + ClassauthorizationServerMetadataEndpointClass = OAuth2AuthorizationServerMetadataEndpointFilter.class; Object oAuth2EndpointFilter = - new SpringDocSecurityOAuth2EndpointUtils(OAuth2AuthorizationServerMetadataEndpointFilter.class).findEndpoint(securityFilterChain); + new SpringDocSecurityOAuth2EndpointUtils(authorizationServerMetadataEndpointClass).findEndpoint(securityFilterChain); if (oAuth2EndpointFilter != null) { ApiResponses apiResponses = new ApiResponses(); buildApiResponsesOnSuccess(apiResponses, AnnotationsUtils.resolveSchemaFromType(SpringDocOAuth2AuthorizationServerMetadata.class, openAPI.getComponents(), null, openapi31)); buildApiResponsesOnInternalServerError(apiResponses); Operation operation = buildOperation(apiResponses); - buildPath(oAuth2EndpointFilter, REQUEST_MATCHER, openAPI, operation, HttpMethod.GET); + Field field = ReflectionUtils.findField(authorizationServerMetadataEndpointClass, "DEFAULT_OAUTH2_AUTHORIZATION_SERVER_METADATA_ENDPOINT_URI"); + if (field != null) { + ReflectionUtils.makeAccessible(field); + String defaultOauth2MetadataUri = (String) ReflectionUtils.getField(field, null); + openAPI.getPaths().addPathItem(defaultOauth2MetadataUri , new PathItem().get(operation)); + } } } @@ -288,15 +295,22 @@ private void getOAuth2AuthorizationEndpoint(OpenAPI openAPI, SecurityFilterChain * @param openapi31 the openapi 31 */ private void getOidcProviderConfigurationEndpoint(OpenAPI openAPI, SecurityFilterChain securityFilterChain, boolean openapi31) { + Class oidcProviderConfigurationEndpointFilterClass = OidcProviderConfigurationEndpointFilter.class; Object oAuth2EndpointFilter = - new SpringDocSecurityOAuth2EndpointUtils(OidcProviderConfigurationEndpointFilter.class).findEndpoint(securityFilterChain); + new SpringDocSecurityOAuth2EndpointUtils(oidcProviderConfigurationEndpointFilterClass).findEndpoint(securityFilterChain); if (oAuth2EndpointFilter != null) { ApiResponses apiResponses = new ApiResponses(); buildApiResponsesOnSuccess(apiResponses, AnnotationsUtils.resolveSchemaFromType(SpringDocOidcProviderConfiguration.class, openAPI.getComponents(), null, openapi31)); buildApiResponsesOnInternalServerError(apiResponses); Operation operation = buildOperation(apiResponses); - buildPath(oAuth2EndpointFilter, REQUEST_MATCHER, openAPI, operation, HttpMethod.GET); + + Field field = ReflectionUtils.findField(oidcProviderConfigurationEndpointFilterClass, "DEFAULT_OIDC_PROVIDER_CONFIGURATION_ENDPOINT_URI"); + if (field != null) { + ReflectionUtils.makeAccessible(field); + String defaultOidcConfigUri = (String) ReflectionUtils.getField(field, null); + openAPI.getPaths().addPathItem(defaultOidcConfigUri , new PathItem().get(operation)); + } } } diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/logback-test.xml b/springdoc-openapi-starter-webflux-api/src/test/resources/logback-test.xml index 24cd4646e..3fd46cfab 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/logback-test.xml +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/logback-test.xml @@ -1,6 +1,5 @@ - \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app38.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app38.json index e28206a0b..0de67a730 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app38.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app38.json @@ -23,11 +23,8 @@ "content": { "*/*": { "schema": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } + "type": "string", + "format": "byte" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java index 17446b334..14e357531 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java @@ -7,13 +7,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springdoc.core.utils.Constants; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.reactive.server.EntityExchangeResult; import org.springframework.test.web.reactive.server.WebTestClient; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + @AutoConfigureWebTestClient(timeout = "3600000") @ActiveProfiles("test") @TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" }) @@ -34,4 +38,19 @@ protected String getContent(String fileName) { throw new RuntimeException("Failed to read file: " + fileName, e); } } + + protected void testApp(String testId, String groupName) throws Exception{ + String result = null; + try { + EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + groupName).exchange() + .expectStatus().isOk().expectBody().returnResult(); + result = new String(getResult.getResponseBody()); + String expected = getContent("results/app" + testId + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java index b2a483d38..029d5ff0c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java @@ -25,11 +25,15 @@ package test.org.springdoc.api; import jakarta.annotation.PostConstruct; +import org.springdoc.core.utils.Constants; import org.springframework.boot.test.web.server.LocalManagementPort; import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.reactive.server.EntityExchangeResult; import org.springframework.web.reactive.function.client.WebClient; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + @TestPropertySource(properties = { "management.endpoints.enabled-by-default=true" }) public abstract class AbstractSpringDocActuatorTest extends AbstractCommonTest { @@ -43,4 +47,18 @@ void init() { webClient = WebClient.builder().baseUrl("http://localhost:" + this.managementPort) .build(); } + + protected void testWithWebClient(String testId, String uri) throws Exception{ + String result = null; + try { + result = webClient.get().uri(uri).retrieve() + .bodyToMono(String.class).block(); + String expected = getContent("results/app"+testId+".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 4b1df181d..b93e551df 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -18,41 +18,20 @@ package test.org.springdoc.api; +import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; -import org.springframework.test.web.reactive.server.EntityExchangeResult; -import org.springframework.web.reactive.function.server.HandlerFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @WebFluxTest public abstract class AbstractSpringDocTest extends AbstractCommonTest { - public static final HandlerFunction HANDLER_FUNCTION = request -> ServerResponse.ok().build(); - - protected String groupName = ""; - - @Test public void testApp() throws Exception { - String result = null; - try { - EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() - .expectStatus().isOk().expectBody().returnResult(); - - result = new String(getResult.getResponseBody()); - String className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } - catch (AssertionError e) { - LOGGER.error(result); - throw e; - } + String className = getClass().getSimpleName(); + String testId = className.replaceAll("[^0-9]", ""); + testApp(testId, StringUtils.EMPTY); } + } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java index 42a72b1d5..53a87de9f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java @@ -24,10 +24,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.web.reactive.server.EntityExchangeResult; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - +import org.springframework.context.annotation.ComponentScan; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "management.endpoints.web.exposure.include=*", @@ -40,31 +37,16 @@ public class SpringDocApp146Test extends AbstractSpringDocActuatorTest { @Test public void testApp() throws Exception { - EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.ACTUATOR_DEFAULT_GROUP) - .exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.openapi").isEqualTo("3.0.1") - .returnResult(); - String result = new String(getResult.getResponseBody()); - String expected = getContent("results/app146-1.json"); - assertEquals(expected, result, true); + super.testApp("146-1", Constants.ACTUATOR_DEFAULT_GROUP); } @Test public void testApp1() throws Exception { - EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.DEFAULT_GROUP_NAME) - .exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.openapi").isEqualTo("3.0.1") - .returnResult(); - String result = new String(getResult.getResponseBody()); - String expected = getContent("results/app146-2.json"); - assertEquals(expected, result, true); + super.testApp("146-2", Constants.DEFAULT_GROUP_NAME); } @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app146" }) static class SpringDocTestApp {} } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java index 065edeb43..a41644858 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java @@ -40,28 +40,13 @@ public class SpringDocApp147Test extends AbstractSpringDocActuatorTest { @Test public void testApp() throws Exception { - EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.ACTUATOR_DEFAULT_GROUP) - .exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.openapi").isEqualTo("3.0.1") - .returnResult(); - String result = new String(getResult.getResponseBody()); - String expected = getContent("results/app147-1.json"); - assertEquals(expected, result, true); + super.testApp("147-1", Constants.ACTUATOR_DEFAULT_GROUP); } @Test public void testApp1() throws Exception { - EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/users") - .exchange() - .expectStatus().isOk() - .expectBody() - .jsonPath("$.openapi").isEqualTo("3.0.1") - .returnResult(); - String result = new String(getResult.getResponseBody()); - String expected = getContent("results/app147-2.json"); - assertEquals(expected, result, true); + super.testApp("147-2", Constants.ACTUATOR_DEFAULT_GROUP); + } @Test diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java index d761b9d25..851b43460 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java @@ -46,18 +46,12 @@ public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { @Test public void testApp() throws Exception { - String result = webClient.get().uri("/test/application/openapi/users").retrieve() - .bodyToMono(String.class).block(); - String expected = getContent("results/app148-1.json"); - assertEquals(expected, result, true); + super.testWithWebClient("148-1","/test/application/openapi/users"); } @Test public void testApp2() throws Exception { - String result = webClient.get().uri("/test/application/openapi/x-actuator").retrieve() - .bodyToMono(String.class).block(); - String expected = getContent("results/app148-2.json"); - assertEquals(expected, result, true); + super.testWithWebClient("148-2","/test/application/openapi/x-actuator"); } @Test diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java index 989f9be43..85e94408e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java @@ -59,21 +59,21 @@ public void testApp() throws Exception { } @Test - public void testGroupActuatorAsCodeCheckBackwardsCompatibility() throws Exception { + public void testGroupActuatorAsCodeCheckBackwardsCompatibility() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code-check-backwards-compatibility").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app186.json"), true); } @Test - public void testGroupActuatorAsCode() throws Exception { + public void testGroupActuatorAsCode() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app186.json"), true); } @Test - public void testGroupActuatorAsProperties() throws Exception { + public void testGroupActuatorAsProperties() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-properties").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app186.json"), true); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java index b0f4c1508..9f877e497 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java @@ -35,14 +35,9 @@ }) public class SpringDocApp76Test extends AbstractSpringDocTest { - public SpringDocApp76Test() { - this.groupName = "/actuator"; - } - - @Test public void testApp() throws Exception { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange().expectStatus().isOk().expectBody() + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/actuator").exchange().expectStatus().isOk().expectBody() .jsonPath("$.openapi").isEqualTo("3.0.1") .jsonPath("$.paths./actuator/health.get.operationId").exists(); } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/logback-test.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/logback-test.xml index 24cd4646e..3fd46cfab 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/logback-test.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/logback-test.xml @@ -1,6 +1,5 @@ - \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json index 4d21f4405..3b190e590 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json @@ -176,6 +176,68 @@ } } }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom-id", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sbom", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, "/application/metrics/{requiredMetricName}": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json index cbcf7fd50..ebc856a6f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json @@ -176,6 +176,68 @@ } } }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom-id", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sbom", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, "/application/metrics/{requiredMetricName}": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json index e7c346c11..ebc856a6f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json @@ -6,24 +6,833 @@ }, "servers": [ { - "url": "", + "url": "http://localhost:9297/test", "description": "Generated server url" } ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], "paths": { - "/persons": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggers-name", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggers-name_2", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threaddump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledtasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom-id", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sbom", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metrics-requiredMetricName", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "metrics", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapdump", + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { "get": { "tags": [ - "hello-controller" + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "env-toMatch", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } ], - "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "env", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configprops-prefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configprops", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "caches-cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "caches-cache_2", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches_2", "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { - "type": "string" + "type": "object" + } + } + } + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } } } } @@ -32,5 +841,19 @@ } } }, - "components": {} + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json index 837455a90..ea44fd1c0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json @@ -176,6 +176,68 @@ } } }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom-id", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sbom", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, "/application/metrics/{requiredMetricName}": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json index 6f5111c7a..3c91143c4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json @@ -176,6 +176,68 @@ } } }, + "/actuator/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom-id", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sbom", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, "/actuator/metrics/{requiredMetricName}": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java index d76fc9525..4173589c8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java @@ -25,6 +25,8 @@ package test.org.springdoc.api; import jakarta.annotation.PostConstruct; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.web.server.LocalManagementPort; @@ -32,9 +34,13 @@ import org.springframework.test.context.TestPropertySource; import org.springframework.web.client.RestTemplate; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + @TestPropertySource(properties = { "management.endpoints.enabled-by-default=true" }) public abstract class AbstractSpringDocActuatorTest extends AbstractCommonTest { + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); + protected RestTemplate actuatorRestTemplate; @LocalManagementPort @@ -48,4 +54,18 @@ void init() { actuatorRestTemplate = restTemplateBuilder .rootUri("http://localhost:" + this.managementPort).build(); } + + protected void testWithRestTemplate(String testId, String uri) throws Exception { + String result = null; + try { + result = actuatorRestTemplate.getForObject(uri, String.class); + String expected = getContent("results/app" + testId + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } + } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java index 41241a573..3d9c4a593 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java @@ -30,7 +30,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, @@ -48,16 +47,12 @@ public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { @Test public void testApp() throws Exception { - String result = actuatorRestTemplate.getForObject("/test/application/openapi/users", String.class); - String expected = getContent("results/app148-1.json"); - assertEquals(expected, result, true); + super.testWithRestTemplate("148-1","/test/application/openapi/users"); } @Test public void testApp2() throws Exception { - String result = actuatorRestTemplate.getForObject("/test/application/openapi/x-actuator", String.class); - String expected = getContent("results/app148-2.json"); - assertEquals(expected, result, true); + super.testWithRestTemplate("148-2","/test/application/openapi/x-actuator"); } @Test diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/application-test.properties b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/application-test.properties index b88c99251..9d2df2929 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/application-test.properties +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/application-test.properties @@ -1,3 +1,4 @@ spring.main.banner-mode=off logging.level.root=OFF +logging.pattern.console=%m%n spring.main.lazy-initialization=true \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/logback-test.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/logback-test.xml index 608cb302d..3fd46cfab 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/logback-test.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/logback-test.xml @@ -1,4 +1,5 @@ - + + \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json index 601c304ca..4df57e3ca 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json @@ -225,6 +225,68 @@ } } }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sbom", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom-id", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, "/application/metrics": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json index 1d726c0ba..7b6724300 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json @@ -225,6 +225,68 @@ } } }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sbom", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom-id", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, "/application/metrics": { "get": { "tags": [ diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json index c136df41f..b8faa137b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json @@ -225,6 +225,68 @@ } } }, + "/actuator/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sbom", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom-id", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, "/actuator/metrics": { "get": { "tags": [ @@ -825,4 +887,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java index 9b5b08e9e..78e2db9f8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java @@ -24,8 +24,6 @@ import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.cloud.function.context.test.FunctionalSpringBootTest; import org.springframework.test.web.reactive.server.EntityExchangeResult; -import org.springframework.web.reactive.function.server.HandlerFunction; -import org.springframework.web.reactive.function.server.ServerResponse; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -34,13 +32,11 @@ @AutoConfigureWebTestClient(timeout = "3600000") public abstract class AbstractSpringDocFunctionTest extends AbstractCommonTest { - public static final HandlerFunction HANDLER_FUNCTION = request -> ServerResponse.ok().build(); - protected String groupName = ""; @Test - public void testApp() throws Exception { + public void testApp() { String result = null; try { EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/logback-test.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/logback-test.xml index 24cd4646e..3fd46cfab 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/logback-test.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/logback-test.xml @@ -1,6 +1,5 @@ - \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json index 802d051cf..a7376fb6b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json @@ -151,13 +151,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "text": { "type": "string" }, @@ -424,8 +424,9 @@ "void": { "type": "boolean" }, - "typeDescription": { - "type": "string" + "superClassDistance": { + "type": "integer", + "format": "int32" }, "newMetaMethods": { "type": "array", @@ -436,9 +437,8 @@ "callSiteLoader": { "$ref": "#/components/schemas/CallSiteClassLoader" }, - "superClassDistance": { - "type": "integer", - "format": "int32" + "typeDescription": { + "type": "string" } } }, @@ -460,20 +460,6 @@ "items": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "bounds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "typeName": { - "type": "string" - } - } - } - }, "genericDeclaration": { "type": "object", "properties": { @@ -694,20 +680,6 @@ "items": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "bounds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "typeName": { - "type": "string" - } - } - } - }, "genericDeclaration": { "type": "object" }, @@ -739,6 +711,20 @@ } } }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, "typeName": { "type": "string" }, @@ -992,6 +978,20 @@ } } }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, "typeName": { "type": "string" }, @@ -1220,20 +1220,6 @@ "items": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "bounds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "typeName": { - "type": "string" - } - } - } - }, "genericDeclaration": { "type": "object" }, @@ -1265,6 +1251,20 @@ } } }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, "typeName": { "type": "string" }, @@ -1614,20 +1614,6 @@ "items": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "bounds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "typeName": { - "type": "string" - } - } - } - }, "annotatedBounds": { "type": "array", "items": { @@ -1656,6 +1642,20 @@ } } }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, "typeName": { "type": "string" }, @@ -1876,20 +1876,6 @@ "items": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "bounds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "typeName": { - "type": "string" - } - } - } - }, "genericDeclaration": { "type": "object" }, @@ -1921,6 +1907,20 @@ } } }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, "typeName": { "type": "string" }, @@ -3114,21 +3114,34 @@ "text": { "type": "string" }, - "outerClass": { - "$ref": "#/components/schemas/ClassNode" + "allDeclaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } }, - "genericsPlaceHolder": { - "type": "boolean" + "allInterfaces": { + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } }, - "unresolvedSuperClass": { - "$ref": "#/components/schemas/ClassNode" + "abstractMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } }, - "plainNodeReference": { + "outerClass": { "$ref": "#/components/schemas/ClassNode" }, "redirectNode": { "type": "boolean" }, + "genericsPlaceHolder": { + "type": "boolean" + }, "primaryClassNode": { "type": "boolean" }, @@ -3150,6 +3163,9 @@ "derivedFromGroovyObject": { "type": "boolean" }, + "unresolvedSuperClass": { + "$ref": "#/components/schemas/ClassNode" + }, "unresolvedInterfaces": { "type": "array", "items": { @@ -3169,24 +3185,8 @@ "annotationDefinition": { "type": "boolean" }, - "abstractMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodNode" - } - }, - "allInterfaces": { - "uniqueItems": true, - "type": "array", - "items": { - "$ref": "#/components/schemas/ClassNode" - } - }, - "allDeclaredMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodNode" - } + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" }, "objectInitializerStatements": { "type": "array", @@ -3197,13 +3197,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "sourcePosition": { "$ref": "#/components/schemas/ASTNode" }, @@ -3256,21 +3256,15 @@ "type": "string" }, "encoded": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } + "type": "string", + "format": "byte" }, "publicKey": { "type": "object", "properties": { "encoded": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } + "type": "string", + "format": "byte" }, "format": { "type": "string" @@ -3291,6 +3285,12 @@ "signerCertPath": { "type": "object", "properties": { + "type": { + "type": "string" + }, + "encodings": { + "type": "object" + }, "certificates": { "type": "array", "items": { @@ -3300,21 +3300,15 @@ "type": "string" }, "encoded": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } + "type": "string", + "format": "byte" }, "publicKey": { "type": "object", "properties": { "encoded": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } + "type": "string", + "format": "byte" }, "format": { "type": "string" @@ -3327,18 +3321,9 @@ } } }, - "type": { - "type": "string" - }, "encoded": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } - }, - "encodings": { - "type": "object" + "type": "string", + "format": "byte" } } }, @@ -3352,6 +3337,12 @@ "signerCertPath": { "type": "object", "properties": { + "type": { + "type": "string" + }, + "encodings": { + "type": "object" + }, "certificates": { "type": "array", "items": { @@ -3361,21 +3352,15 @@ "type": "string" }, "encoded": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } + "type": "string", + "format": "byte" }, "publicKey": { "type": "object", "properties": { "encoded": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } + "type": "string", + "format": "byte" }, "format": { "type": "string" @@ -3388,18 +3373,9 @@ } } }, - "type": { - "type": "string" - }, "encoded": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } - }, - "encodings": { - "type": "object" + "type": "string", + "format": "byte" } } } @@ -3689,10 +3665,6 @@ "text": { "type": "string" }, - "annotationDefault": { - "type": "boolean", - "writeOnly": true - }, "voidMethod": { "type": "boolean" }, @@ -3708,16 +3680,20 @@ "staticConstructor": { "type": "boolean" }, + "annotationDefault": { + "type": "boolean", + "writeOnly": true + }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "sourcePosition": { "$ref": "#/components/schemas/ASTNode" }, @@ -3747,16 +3723,16 @@ "configuration": { "$ref": "#/components/schemas/CompilerConfiguration" }, + "errorCount": { + "type": "integer", + "format": "int32" + }, "warningCount": { "type": "integer", "format": "int32" }, "lastError": { "$ref": "#/components/schemas/Message" - }, - "errorCount": { - "type": "integer", - "format": "int32" } } }, @@ -3816,6 +3792,9 @@ "type": "integer", "format": "int32" }, + "classInfo": { + "$ref": "#/components/schemas/ClassInfo" + }, "groovyObject": { "type": "boolean" }, @@ -3864,20 +3843,6 @@ "items": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "bounds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "typeName": { - "type": "string" - } - } - } - }, "annotatedBounds": { "type": "array", "items": { @@ -3906,6 +3871,20 @@ } } }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, "typeName": { "type": "string" }, @@ -4126,20 +4105,6 @@ "items": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "bounds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "typeName": { - "type": "string" - } - } - } - }, "genericDeclaration": { "type": "object" }, @@ -4171,6 +4136,20 @@ } } }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, "typeName": { "type": "string" }, @@ -4436,20 +4415,6 @@ "items": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "bounds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "typeName": { - "type": "string" - } - } - } - }, "annotatedBounds": { "type": "array", "items": { @@ -4478,6 +4443,20 @@ } } }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, "typeName": { "type": "string" }, @@ -4698,20 +4677,6 @@ "items": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "bounds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "typeName": { - "type": "string" - } - } - } - }, "genericDeclaration": { "type": "object" }, @@ -4743,6 +4708,20 @@ } } }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, "typeName": { "type": "string" }, @@ -4995,9 +4974,6 @@ } } } - }, - "classInfo": { - "$ref": "#/components/schemas/ClassInfo" } } }, @@ -5038,13 +5014,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "text": { "type": "string" }, @@ -5155,13 +5131,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "text": { "type": "string" }, @@ -5688,13 +5664,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "sourcePosition": { "$ref": "#/components/schemas/ASTNode" }, @@ -5891,18 +5867,31 @@ "text": { "type": "string" }, - "genericsPlaceHolder": { - "type": "boolean" + "allDeclaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } }, - "unresolvedSuperClass": { - "$ref": "#/components/schemas/ClassNode" + "allInterfaces": { + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } }, - "plainNodeReference": { - "$ref": "#/components/schemas/ClassNode" + "abstractMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } }, "redirectNode": { "type": "boolean" }, + "genericsPlaceHolder": { + "type": "boolean" + }, "primaryClassNode": { "type": "boolean" }, @@ -5924,6 +5913,9 @@ "derivedFromGroovyObject": { "type": "boolean" }, + "unresolvedSuperClass": { + "$ref": "#/components/schemas/ClassNode" + }, "unresolvedInterfaces": { "type": "array", "items": { @@ -5943,24 +5935,8 @@ "annotationDefinition": { "type": "boolean" }, - "abstractMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodNode" - } - }, - "allInterfaces": { - "uniqueItems": true, - "type": "array", - "items": { - "$ref": "#/components/schemas/ClassNode" - } - }, - "allDeclaredMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodNode" - } + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" }, "objectInitializerStatements": { "type": "array", @@ -5971,13 +5947,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "sourcePosition": { "$ref": "#/components/schemas/ASTNode" }, @@ -6226,10 +6202,6 @@ "text": { "type": "string" }, - "annotationDefault": { - "type": "boolean", - "writeOnly": true - }, "voidMethod": { "type": "boolean" }, @@ -6245,16 +6217,20 @@ "staticConstructor": { "type": "boolean" }, + "annotationDefault": { + "type": "boolean", + "writeOnly": true + }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "sourcePosition": { "$ref": "#/components/schemas/ASTNode" }, @@ -6439,21 +6415,34 @@ "text": { "type": "string" }, - "outerClass": { - "$ref": "#/components/schemas/ClassNode" + "allDeclaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } }, - "genericsPlaceHolder": { - "type": "boolean" + "allInterfaces": { + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } }, - "unresolvedSuperClass": { - "$ref": "#/components/schemas/ClassNode" + "abstractMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } }, - "plainNodeReference": { + "outerClass": { "$ref": "#/components/schemas/ClassNode" }, "redirectNode": { "type": "boolean" }, + "genericsPlaceHolder": { + "type": "boolean" + }, "primaryClassNode": { "type": "boolean" }, @@ -6475,6 +6464,9 @@ "derivedFromGroovyObject": { "type": "boolean" }, + "unresolvedSuperClass": { + "$ref": "#/components/schemas/ClassNode" + }, "unresolvedInterfaces": { "type": "array", "items": { @@ -6494,24 +6486,8 @@ "annotationDefinition": { "type": "boolean" }, - "abstractMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodNode" - } - }, - "allInterfaces": { - "uniqueItems": true, - "type": "array", - "items": { - "$ref": "#/components/schemas/ClassNode" - } - }, - "allDeclaredMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodNode" - } + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" }, "objectInitializerStatements": { "type": "array", @@ -6522,13 +6498,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "sourcePosition": { "$ref": "#/components/schemas/ASTNode" }, @@ -6617,12 +6593,12 @@ "statementBlock": { "$ref": "#/components/schemas/BlockStatement" }, - "empty": { - "type": "boolean" - }, "packageName": { "type": "string" }, + "empty": { + "type": "boolean" + }, "package": { "$ref": "#/components/schemas/PackageNode" }, @@ -6695,13 +6671,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "sourcePosition": { "$ref": "#/components/schemas/ASTNode" }, @@ -6781,13 +6757,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "text": { "type": "string" }, @@ -6869,6 +6845,9 @@ "type": "integer", "format": "int32" }, + "type": { + "$ref": "#/components/schemas/ClassNode" + }, "name": { "type": "string" }, @@ -6878,15 +6857,9 @@ "public": { "type": "boolean" }, - "type": { - "$ref": "#/components/schemas/ClassNode" - }, "private": { "type": "boolean" }, - "dynamicTyped": { - "type": "boolean" - }, "initialExpression": { "$ref": "#/components/schemas/Expression" }, @@ -6900,6 +6873,9 @@ "originType": { "$ref": "#/components/schemas/ClassNode" }, + "dynamicTyped": { + "type": "boolean" + }, "getterNameOrDefault": { "type": "string" }, @@ -6909,13 +6885,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "text": { "type": "string" }, @@ -6933,12 +6909,12 @@ "ReaderSource": { "type": "object", "properties": { - "reader": { - "type": "object" - }, "uri": { "type": "string", "format": "uri" + }, + "reader": { + "type": "object" } } }, @@ -6988,13 +6964,13 @@ "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, "hasNoRealSourcePosition": { "type": "boolean", "writeOnly": true }, - "groovydoc": { - "$ref": "#/components/schemas/Groovydoc" - }, "text": { "type": "string" }, @@ -7185,9 +7161,6 @@ "type": { "$ref": "#/components/schemas/ClassNode" }, - "dynamicTyped": { - "type": "boolean" - }, "initialExpression": { "$ref": "#/components/schemas/Expression" }, @@ -7199,6 +7172,9 @@ }, "originType": { "$ref": "#/components/schemas/ClassNode" + }, + "dynamicTyped": { + "type": "boolean" } } }, diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app38.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app38.json index b6127e78c..d1e0f9d27 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app38.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app38.json @@ -31,11 +31,8 @@ "content": { "*/*": { "schema": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - } + "type": "string", + "format": "byte" } } } @@ -45,4 +42,4 @@ } }, "components": {} -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 2b8da2454..2779092bd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -31,16 +31,6 @@ ${project.version} test - - javax.xml - jaxb-impl - test - - - javax.jws - javax.jws-api - test - io.jsonwebtoken jjwt From 479fbb716c7c9b843099eab41255cd3d764f51e7 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 15 Jun 2024 18:37:17 +0200 Subject: [PATCH 014/226] "application/json; charset=UTF-8" Skipped in Generated OpenAPI JSON, Fixes #2596 --- .../test/resources/results/3.0.1/app219.json | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app219.json diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app219.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app219.json new file mode 100644 index 000000000..70b2fb8d5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app219.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/testpost": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "testpost", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + }, + "application/json;charset=UTF-8": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + }, + "application/json; charset=UTF-8": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TestObject": { + "type": "object", + "properties": { + "stringValue": { + "type": "string" + }, + "localDateTime": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} From cedee7bd99bec5aa7734dc359471aeb917fb6861 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 15 Jun 2024 19:00:17 +0200 Subject: [PATCH 015/226] Code review. Fixes #2625 --- .../SpringDocPageConfiguration.java | 96 ------------------- .../SpringDocPageableConfiguration.java | 19 ++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 - 3 files changed, 19 insertions(+), 97 deletions(-) delete mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageConfiguration.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageConfiguration.java deleted file mode 100644 index 6df0b467a..000000000 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageConfiguration.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package org.springdoc.core.configuration; - -import org.springdoc.core.converters.PageOpenAPIConverter; -import org.springdoc.core.converters.SortOpenAPIConverter; -import org.springdoc.core.converters.models.SortObject; -import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; -import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer; -import org.springdoc.core.providers.ObjectMapperProvider; -import org.springdoc.core.providers.RepositoryRestConfigurationProvider; -import org.springdoc.core.providers.SpringDataWebPropertiesProvider; -import org.springframework.boot.autoconfigure.condition.*; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Lazy; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Sort; -import org.springframework.data.web.PagedModel; -import org.springframework.data.web.config.EnableSpringDataWebSupport; -import org.springframework.data.web.config.SpringDataWebSettings; - -import java.util.Optional; - -import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLED; -import static org.springdoc.core.utils.Constants.SPRINGDOC_SORT_CONVERTER_ENABLED; -import static org.springdoc.core.utils.SpringDocUtils.getConfig; - -/** - * The type Spring doc page configuration. - * - * @author Claudio Nave - */ -@Lazy(false) -@Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = SPRINGDOC_ENABLED, matchIfMissing = true) -@ConditionalOnClass({ Page.class, PagedModel.class }) -@ConditionalOnWebApplication -@ConditionalOnBean(SpringDocConfiguration.class) -public class SpringDocPageConfiguration { - - /** - * Page open api converter. - * @param objectMapperProvider the object mapper provider - * @return the page open api converter - */ - @Bean - @ConditionalOnMissingBean - @ConditionalOnBean(SpringDataWebSettings.class) - @Lazy(false) - PageOpenAPIConverter pageOpenAPIConverter(SpringDataWebSettings settings, - ObjectMapperProvider objectMapperProvider) { - return new PageOpenAPIConverter( - settings.pageSerializationMode() == EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO, - objectMapperProvider); - } - - /** - * Delegating method parameter customizer delegating method parameter customizer. - * @param optionalSpringDataWebPropertiesProvider the optional spring data web - * properties - * @param optionalRepositoryRestConfiguration the optional repository rest - * configuration - * @return the delegating method parameter customizer - */ - @Bean - @ConditionalOnMissingBean - @Lazy(false) - DelegatingMethodParameterCustomizer delegatingMethodParameterCustomizer( - Optional optionalSpringDataWebPropertiesProvider, - Optional optionalRepositoryRestConfiguration) { - return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, - optionalRepositoryRestConfiguration); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java index 0dd0a9e50..d301d7d53 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java @@ -26,6 +26,7 @@ import java.util.Optional; +import org.springdoc.core.converters.PageOpenAPIConverter; import org.springdoc.core.converters.PageableOpenAPIConverter; import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer; @@ -42,6 +43,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; import org.springframework.data.domain.Pageable; +import org.springframework.data.web.config.EnableSpringDataWebSupport; +import org.springframework.data.web.config.SpringDataWebSettings; import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLED; import static org.springdoc.core.utils.Constants.SPRINGDOC_PAGEABLE_CONVERTER_ENABLED; @@ -75,6 +78,22 @@ PageableOpenAPIConverter pageableOpenAPIConverter(ObjectMapperProvider objectMap return new PageableOpenAPIConverter(objectMapperProvider); } + /** + * Page open api converter. + * @param objectMapperProvider the object mapper provider + * @return the page open api converter + */ + @Bean + @ConditionalOnMissingBean + @ConditionalOnBean(SpringDataWebSettings.class) + @Lazy(false) + PageOpenAPIConverter pageOpenAPIConverter(SpringDataWebSettings settings, + ObjectMapperProvider objectMapperProvider) { + return new PageOpenAPIConverter( + settings.pageSerializationMode() == EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO, + objectMapperProvider); + } + /** * Delegating method parameter customizer delegating method parameter customizer. * diff --git a/springdoc-openapi-starter-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/springdoc-openapi-starter-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index ad61f1fa5..12694c003 100644 --- a/springdoc-openapi-starter-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/springdoc-openapi-starter-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -7,7 +7,6 @@ org.springdoc.core.configuration.SpringDocFunctionCatalogConfiguration org.springdoc.core.configuration.SpringDocHateoasConfiguration org.springdoc.core.configuration.SpringDocPageableConfiguration org.springdoc.core.configuration.SpringDocSortConfiguration -org.springdoc.core.configuration.SpringDocPageConfiguration org.springdoc.core.configuration.SpringDocSpecPropertiesConfiguration org.springdoc.core.configuration.SpringDocDataRestConfiguration org.springdoc.core.configuration.SpringDocKotlinConfiguration From 3b577e499410e0b56853acfe275ad6ee43184cfb Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 15 Jun 2024 20:10:57 +0200 Subject: [PATCH 016/226] Code review. Fixes #2625 --- .../app10/SpringDocApp10NotSpecifiedTest.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java index c6f6856dd..14b6a0452 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java @@ -22,8 +22,23 @@ package test.org.springdoc.api.app10; +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.web.config.EnableSpringDataWebSupport; @@ -35,6 +50,11 @@ public class SpringDocApp10NotSpecifiedTest extends AbstractSpringDocTest { + private final Map> springMixins = new HashMap<>(); + + @Autowired + ObjectMapperProvider objectMapperProvider; + @Override @Test public void testApp() throws Exception { @@ -49,4 +69,29 @@ public static class SpringDocTestApp { } + @BeforeEach + void init() throws IllegalAccessException { + Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); + Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); + Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + Iterator>> it = _localMixIns.entrySet().iterator(); + while (it.hasNext()) { + Entry> entry = it.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + it.remove(); + } + } + + } + + @AfterEach + void clean() throws IllegalAccessException { + Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); + Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); + Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + _localMixIns.putAll(springMixins); + } } From ea45be8a63c6952cf1843a44db9873d45eb3f01b Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 15 Jun 2024 20:21:23 +0200 Subject: [PATCH 017/226] Code review. Fixes #2625 --- .../app10/SpringDocApp10NotSpecifiedTest.java | 62 +++++-------------- 1 file changed, 17 insertions(+), 45 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java index 14b6a0452..933795d85 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java @@ -22,38 +22,35 @@ package test.org.springdoc.api.app10; -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; +import java.util.Optional; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; -import com.fasterxml.jackson.databind.type.ClassKey; -import org.apache.commons.lang3.reflect.FieldUtils; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.springdoc.core.providers.ObjectMapperProvider; +import org.springdoc.core.converters.PageOpenAPIConverter; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.AbstractSpringDocTest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.data.web.config.EnableSpringDataWebSupport; -import test.org.springdoc.api.AbstractSpringDocTest; import static org.hamcrest.Matchers.is; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; public class SpringDocApp10NotSpecifiedTest extends AbstractSpringDocTest { - private final Map> springMixins = new HashMap<>(); - @Autowired - ObjectMapperProvider objectMapperProvider; + @BeforeAll + public static void init() { + Optional pageOpenAPIConverter = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof PageOpenAPIConverter).findAny(); + pageOpenAPIConverter.ifPresent(ModelConverters.getInstance()::removeConverter); + } @Override @Test @@ -69,29 +66,4 @@ public static class SpringDocTestApp { } - @BeforeEach - void init() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); - Iterator>> it = _localMixIns.entrySet().iterator(); - while (it.hasNext()) { - Entry> entry = it.next(); - if (entry.getKey().toString().startsWith("org.springframework")) { - springMixins.put(entry.getKey(), entry.getValue()); - it.remove(); - } - } - - } - - @AfterEach - void clean() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); - _localMixIns.putAll(springMixins); - } } From 36e20538b3e17692f9f0a96d86277f860ce15836 Mon Sep 17 00:00:00 2001 From: Claudio Nave Date: Sat, 15 Jun 2024 20:42:51 +0200 Subject: [PATCH 018/226] Ensure compatibility with previous version of spring data --- .../SpringDocPageableConfiguration.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java index d301d7d53..b12aeb55b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java @@ -43,6 +43,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PagedModel; import org.springframework.data.web.config.EnableSpringDataWebSupport; import org.springframework.data.web.config.SpringDataWebSettings; @@ -85,15 +86,16 @@ PageableOpenAPIConverter pageableOpenAPIConverter(ObjectMapperProvider objectMap */ @Bean @ConditionalOnMissingBean - @ConditionalOnBean(SpringDataWebSettings.class) + @ConditionalOnClass({ PagedModel.class, SpringDataWebSettings.class }) @Lazy(false) - PageOpenAPIConverter pageOpenAPIConverter(SpringDataWebSettings settings, + PageOpenAPIConverter pageOpenAPIConverter(Optional settings, ObjectMapperProvider objectMapperProvider) { - return new PageOpenAPIConverter( - settings.pageSerializationMode() == EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO, - objectMapperProvider); + boolean replacePageWithPagedModel = settings.map(SpringDataWebSettings::pageSerializationMode) + .map(EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO::equals) + .orElse(false); + return new PageOpenAPIConverter(replacePageWithPagedModel, objectMapperProvider); } - + /** * Delegating method parameter customizer delegating method parameter customizer. * From ef74a02c07222a31efed3cf584b33f92a3b8f05a Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 15 Jun 2024 21:51:03 +0200 Subject: [PATCH 019/226] GroupedApi orders by displayName instead of name. Fixes #2576 --- .../core/properties/SwaggerUiConfigParameters.java | 4 ++-- .../test/org/springdoc/ui/app4/SpringDocApp4Test.java | 8 ++++---- .../java/test/org/springdoc/ui/app4/SpringDocTestApp.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java index 8fab65098..c4b5a881f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java @@ -304,9 +304,9 @@ public Map getConfigParameters() { private void put(String urls, Set swaggerUrls, Map params) { Comparator swaggerUrlComparator; if (groupsOrder.isAscending()) - swaggerUrlComparator = Comparator.comparing(SwaggerUrl::getName); + swaggerUrlComparator = Comparator.comparing(SwaggerUrl::getDisplayName); else - swaggerUrlComparator = (h1, h2) -> h2.getName().compareTo(h1.getName()); + swaggerUrlComparator = (h1, h2) -> h2.getDisplayName().compareTo(h1.getDisplayName()); swaggerUrls = swaggerUrls.stream().sorted(swaggerUrlComparator).filter(elt -> StringUtils.isNotEmpty(elt.getUrl())).collect(Collectors.toCollection(LinkedHashSet::new)); if (!CollectionUtils.isEmpty(swaggerUrls)) { diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocApp4Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocApp4Test.java index 1d809ef9f..53e2d8a1d 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocApp4Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocApp4Test.java @@ -37,10 +37,10 @@ public void swagger_config_for_multiple_groups() throws Exception { .andExpect(status().isOk()) .andExpect(jsonPath("configUrl", equalTo("/v3/api-docs/swagger-config"))) .andExpect(jsonPath("url").doesNotExist()) - .andExpect(jsonPath("urls[0].url", equalTo("/v3/api-docs/stores"))) - .andExpect(jsonPath("urls[0].name", equalTo("stores"))) - .andExpect(jsonPath("urls[1].url", equalTo("/v3/api-docs/pets"))) - .andExpect(jsonPath("urls[1].name", equalTo("The pets"))) + .andExpect(jsonPath("urls[1].url", equalTo("/v3/api-docs/stores"))) + .andExpect(jsonPath("urls[1].name", equalTo("stores"))) + .andExpect(jsonPath("urls[0].url", equalTo("/v3/api-docs/pets"))) + .andExpect(jsonPath("urls[0].name", equalTo("zpets"))) .andExpect(jsonPath("$['urls.primaryName']", equalTo("pets"))); } } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocTestApp.java index f8d22037f..13506213c 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocTestApp.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocTestApp.java @@ -47,7 +47,7 @@ public GroupedOpenApi groupOpenApi() { String[] paths = { "/pet/**" }; return GroupedOpenApi.builder() .group("pets") - .displayName("The pets") + .displayName("zpets") .pathsToMatch(paths) .build(); } From eef312d0a7e04a15d28976aac621bdd8bd6ecb48 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 16 Jun 2024 11:55:51 +0200 Subject: [PATCH 020/226] Dynamically define ApiGroups does not work. Fixes #2584 --- .../MultipleOpenApiGroupsCondition.java | 7 +++++++ .../api/v30/app177/AnnotatedController.java | 18 ++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java index 63a1ab686..66df9e4ad 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java @@ -24,6 +24,8 @@ package org.springdoc.core.conditions; +import java.util.Collection; + import org.springdoc.core.models.GroupedOpenApi; import org.springframework.boot.autoconfigure.condition.AnyNestedCondition; @@ -59,4 +61,9 @@ static class OnGroupedOpenApiBean {} @ConditionalOnProperty(name = GROUP_CONFIG_FIRST_PROPERTY) static class OnGroupConfigProperty {} + /** + * The type On list grouped open api bean. + */ + @ConditionalOnBean(value = GroupedOpenApi.class, parameterizedContainer = Collection.class) + static class OnListGroupedOpenApiBean {} } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/AnnotatedController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/AnnotatedController.java index fca639d4a..74cc1c134 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/AnnotatedController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/AnnotatedController.java @@ -26,6 +26,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import java.util.Arrays; +import java.util.List; import org.springdoc.core.filters.OpenApiMethodFilter; import org.springdoc.core.models.GroupedOpenApi; @@ -65,27 +67,23 @@ public String notAnnotatedPost() { } @Bean - public GroupedOpenApi group1OpenApi() { - return GroupedOpenApi.builder() + public List apis() { + GroupedOpenApi group1OpenApi = GroupedOpenApi.builder() .group("annotatedGroup1") .addOpenApiMethodFilter(method -> method.isAnnotationPresent(Group1.class)) .build(); - } - @Bean - public GroupedOpenApi group2OpenApi() { - return GroupedOpenApi.builder() + GroupedOpenApi group2OpenApi = GroupedOpenApi.builder() .group("annotatedGroup2") .addOpenApiMethodFilter(method -> method.isAnnotationPresent(Group2.class)) .build(); - } - @Bean - public GroupedOpenApi group3OpenApi() { - return GroupedOpenApi.builder() + GroupedOpenApi group3OpenApi = GroupedOpenApi.builder() .group("annotatedCombinedGroup") .addOpenApiMethodFilter(method -> method.isAnnotationPresent(Group1.class) || method.isAnnotationPresent(Group2.class)) .build(); + + return Arrays.asList(group1OpenApi, group2OpenApi, group3OpenApi); } @Bean From 14c59da7a63e42f3a4c72f43065855a240ab4994 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 16 Jun 2024 12:57:50 +0200 Subject: [PATCH 021/226] Removed unused imports --- .../core/converters/PageOpenAPIConverter.java | 9 +++++---- .../springdoc/core/models/MethodAttributes.java | 6 +++--- .../api/AbstractOpenApiResourceTest.java | 2 +- .../api/v30/app217/SpringDocApp217Test.java | 2 -- .../api/v30/app218/HelloController.java | 5 +++-- .../api/v30/app218/SpringDocApp218Test.java | 3 ++- .../api/v30/app219/SpringDocApp219Test.java | 3 ++- .../api/AbstractSpringDocActuatorTest.java | 2 -- .../api/app147/SpringDocApp147Test.java | 3 --- .../api/app148/SpringDocApp148Test.java | 1 - .../api/app186/SpringDocApp186Test.java | 1 - .../springdoc/api/app10/HelloController.java | 4 ++-- .../api/app10/SpringDocApp10DirectTest.java | 8 +++++--- .../app10/SpringDocApp10NotSpecifiedTest.java | 1 - .../api/app10/SpringDocApp10ViaDtoTest.java | 9 +++++---- .../springdoc/api/app9/FooConfiguration.java | 6 +++--- .../springdoc/api/app9/SpringDocApp9Test.java | 3 ++- .../api/app9/application/FooController.java | 17 +++++++++++------ .../api/app9/application/dto/FeedResponse.java | 14 +++++++++----- .../api/app9/application/dto/ResponseData.java | 6 +++--- 20 files changed, 56 insertions(+), 49 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java index 3fcada041..63aaca0a8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java @@ -22,6 +22,10 @@ package org.springdoc.core.converters; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.Iterator; + import com.fasterxml.jackson.databind.JavaType; import io.swagger.v3.core.converter.AnnotatedType; import io.swagger.v3.core.converter.ModelConverter; @@ -29,13 +33,10 @@ import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.springdoc.core.providers.ObjectMapperProvider; + import org.springframework.core.ResolvableType; import org.springframework.data.web.PagedModel; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.Iterator; - /** * The Spring Data Page type model converter. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java index dbb545a98..433df153a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java @@ -30,16 +30,16 @@ import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; import com.fasterxml.jackson.annotation.JsonView; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; -import java.util.Set; -import java.util.stream.Collectors; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; - import org.jetbrains.annotations.Nullable; + import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java index f670da701..10ec555b0 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java @@ -60,9 +60,9 @@ import org.springframework.beans.factory.ObjectFactory; import org.springframework.context.ApplicationContext; +import org.springframework.mock.http.client.MockClientHttpRequest; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.mock.http.client.MockClientHttpRequest; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app217/SpringDocApp217Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app217/SpringDocApp217Test.java index fd4bb77ab..820e5ce8e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app217/SpringDocApp217Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app217/SpringDocApp217Test.java @@ -20,13 +20,11 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.customizers.SpecPropertiesCustomizer; -import org.springdoc.core.models.GroupedOpenApi; import org.springdoc.core.utils.Constants; import test.org.springdoc.api.v30.AbstractSpringDocV30Test; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.Bean; import org.springframework.test.context.ActiveProfiles; import static org.hamcrest.Matchers.is; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/HelloController.java index 6749896a4..e753b54f0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/HelloController.java @@ -23,17 +23,18 @@ package test.org.springdoc.api.v30.app218; +import java.net.URI; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.headers.Header; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; + import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.net.URI; - @RestController @RequestMapping("/") diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/SpringDocApp218Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/SpringDocApp218Test.java index 24b9d92b4..65013aff1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/SpringDocApp218Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app218/SpringDocApp218Test.java @@ -19,9 +19,10 @@ package test.org.springdoc.api.v30.app218; import org.springdoc.core.customizers.SpecPropertiesCustomizer; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; -import test.org.springdoc.api.v30.AbstractSpringDocV30Test; /** *

diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java index a6ec97f84..a9afcaf7b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java @@ -24,9 +24,10 @@ package test.org.springdoc.api.v30.app219; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.ActiveProfiles; -import test.org.springdoc.api.v30.AbstractSpringDocV30Test; @ActiveProfiles("219") public class SpringDocApp219Test extends AbstractSpringDocV30Test { diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java index 029d5ff0c..fa81f9c09 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java @@ -25,11 +25,9 @@ package test.org.springdoc.api; import jakarta.annotation.PostConstruct; -import org.springdoc.core.utils.Constants; import org.springframework.boot.test.web.server.LocalManagementPort; import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.reactive.server.EntityExchangeResult; import org.springframework.web.reactive.function.client.WebClient; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java index a41644858..83a884cbf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java @@ -24,9 +24,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.web.reactive.server.EntityExchangeResult; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java index 851b43460..11b004e45 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java @@ -30,7 +30,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java index 85e94408e..8282d1e3a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java @@ -27,7 +27,6 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.customizers.ActuatorOpenApiCustomizer; -import org.springdoc.core.customizers.OpenApiCustomizer; import org.springdoc.core.customizers.OperationCustomizer; import org.springdoc.core.models.GroupedOpenApi; import org.springdoc.core.utils.Constants; diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java index 0597d1fd4..00d143fbf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java @@ -22,14 +22,14 @@ package test.org.springdoc.api.app10; +import java.util.List; + import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.web.PagedModel; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; - @SuppressWarnings("rawtypes") @RestController public class HelloController { diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java index 6ced6708d..4dba111c1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java @@ -24,14 +24,16 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import org.springframework.boot.SpringBootConfiguration; +import test.org.springdoc.api.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.web.config.EnableSpringDataWebSupport; -import test.org.springdoc.api.AbstractSpringDocTest; import static org.hamcrest.Matchers.is; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; public class SpringDocApp10DirectTest extends AbstractSpringDocTest { diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java index 933795d85..91985d75e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java @@ -29,7 +29,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springdoc.core.converters.PageOpenAPIConverter; -import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; import org.springdoc.core.utils.Constants; import test.org.springdoc.api.AbstractSpringDocTest; diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java index 7d37e9f38..22e8cc2ea 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java @@ -24,15 +24,16 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import org.springframework.boot.SpringBootConfiguration; +import test.org.springdoc.api.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.TestConfiguration; import org.springframework.data.web.config.EnableSpringDataWebSupport; -import test.org.springdoc.api.AbstractSpringDocTest; import static org.hamcrest.Matchers.is; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; public class SpringDocApp10ViaDtoTest extends AbstractSpringDocTest { diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/FooConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/FooConfiguration.java index 11065e4b9..c5a21f1c1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/FooConfiguration.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/FooConfiguration.java @@ -1,5 +1,7 @@ package test.org.springdoc.api.app9; +import java.util.List; + import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Contact; @@ -8,12 +10,10 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.tags.Tag; -import org.springdoc.core.models.GroupedOpenApi; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import java.util.List; - @Configuration public class FooConfiguration { @Bean diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java index ba02d6e00..2e4cab1b2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java @@ -18,9 +18,10 @@ package test.org.springdoc.api.app9; -import org.springframework.boot.autoconfigure.SpringBootApplication; import test.org.springdoc.api.AbstractSpringDocTest; +import org.springframework.boot.autoconfigure.SpringBootApplication; + public class SpringDocApp9Test extends AbstractSpringDocTest { @SpringBootApplication diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/FooController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/FooController.java index dd5864ae1..8600ded15 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/FooController.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/FooController.java @@ -1,17 +1,22 @@ package test.org.springdoc.api.app9.application; +import java.util.List; +import java.util.UUID; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; -import test.org.springdoc.api.app9.application.dto.ResponseData; import test.org.springdoc.api.app9.application.dto.FeedResponse; +import test.org.springdoc.api.app9.application.dto.ResponseData; -import java.util.List; -import java.util.UUID; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; @Tag(name = "ResponseDataController") @RestController @RequestMapping(value = "/some-route", produces = MediaType.APPLICATION_JSON_VALUE) diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/FeedResponse.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/FeedResponse.java index 9fc1e3e66..a9819e55d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/FeedResponse.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/FeedResponse.java @@ -1,15 +1,19 @@ package test.org.springdoc.api.app9.application.dto; +import java.util.List; +import java.util.UUID; + import com.fasterxml.jackson.annotation.JsonProperty; import jakarta.validation.constraints.NotNull; -import lombok.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; import lombok.experimental.Accessors; -import org.springframework.hateoas.IanaLinkRelations; -import org.springframework.hateoas.RepresentationModel; import test.org.springdoc.api.app9.application.FooController; -import java.util.List; -import java.util.UUID; +import org.springframework.hateoas.IanaLinkRelations; +import org.springframework.hateoas.RepresentationModel; import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/ResponseData.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/ResponseData.java index 7d0860484..4481194c6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/ResponseData.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/ResponseData.java @@ -1,13 +1,13 @@ package test.org.springdoc.api.app9.application.dto; +import java.time.LocalDate; +import java.util.UUID; + import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Builder; -import java.time.LocalDate; -import java.util.UUID; - @Builder public record ResponseData( @JsonProperty(value = "DATA_ID", required = true) From 4059109bd42cd1e1a8613066682219ca97868121 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 16 Jun 2024 13:10:44 +0200 Subject: [PATCH 022/226] When an entity class contains fields of Class type, an infinite loop. Fixes #2591 --- .../springdoc/core/extractor/MethodParameterPojoExtractor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index ff8e3f0c1..c040264c2 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -88,6 +88,7 @@ public class MethodParameterPojoExtractor { SIMPLE_TYPES.add(Iterable.class); SIMPLE_TYPES.add(Duration.class); SIMPLE_TYPES.add(LocalTime.class); + SIMPLE_TYPES.add(Class.class); SIMPLE_TYPE_PREDICATES.add(Class::isPrimitive); SIMPLE_TYPE_PREDICATES.add(Class::isEnum); From 07e2c926d174e4093efdf91e37f44668091242bc Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 16 Jun 2024 13:34:45 +0200 Subject: [PATCH 023/226] Spring security @RegisteredOAuth2AuthorizedClient is not handled in the right way. Fixes #2595 --- springdoc-openapi-starter-common/pom.xml | 5 ++++ .../SpringDocSecurityConfiguration.java | 19 ++++++++++++ .../springdoc-openapi-security-tests/pom.xml | 5 ++++ .../springdoc/api/app1/HelloController.java | 9 ++++++ .../src/test/resources/results/app1.json | 30 +++++++++++++++++++ 5 files changed, 68 insertions(+) diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index dd6ede53a..94c8ccfce 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -51,6 +51,11 @@ spring-security-oauth2-authorization-server true + + org.springframework.security + spring-security-oauth2-client + true + com.fasterxml.jackson.module diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java index 465a9bc4a..d577f12fd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java @@ -58,6 +58,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.core.Authentication; import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient; import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; import org.springframework.security.web.FilterChainProxy; import org.springframework.security.web.SecurityFilterChain; @@ -169,6 +170,9 @@ OpenApiCustomizer springSecurityLoginEndpointCustomiser(ApplicationContext appli } } + /** + * The type Spring doc security o auth 2 configuration. + */ @Lazy(false) @Configuration(proxyBeanMethods = false) @ConditionalOnClass(OAuth2AuthorizationService.class) @@ -186,4 +190,19 @@ GlobalOpenApiCustomizer springDocSecurityOAuth2Customizer() { return new SpringDocSecurityOAuth2Customizer(); } } + + /** + * The type Spring doc security o auth 2 client configuration. + */ + @Lazy(false) + @Configuration(proxyBeanMethods = false) + @ConditionalOnClass(RegisteredOAuth2AuthorizedClient.class) + class SpringDocSecurityOAuth2ClientConfiguration { + + static { + getConfig() + .addAnnotationsToIgnore(RegisteredOAuth2AuthorizedClient.class); + } + + } } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 2779092bd..9ef3caf3f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -20,6 +20,11 @@ spring-security-config test + + org.springframework.security + spring-security-oauth2-client + test + jakarta.servlet jakarta.servlet-api diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java index 8dbff03ac..063133377 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java @@ -20,6 +20,8 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.core.userdetails.User; +import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; +import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @@ -38,4 +40,11 @@ public String personsWithUser(@RequestBody() Person person, return "OK"; } + @PostMapping(value = "/persons-with-oauth2-user") + public String personsWithUser(@RequestBody() Person person, + @RegisteredOAuth2AuthorizedClient OAuth2AuthorizedClient authorizedClient, + @AuthenticationPrincipal User user) { + return "OK"; + } + } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app1.json index 0b91f6ec3..0260adb6d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app1.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app1.json @@ -74,6 +74,36 @@ } } } + }, + "/persons-with-oauth2-user": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "personsWithUser_1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } } }, "components": { From 497bfae781a2e637037892d333f625595675531c Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 16 Jun 2024 21:38:56 +0200 Subject: [PATCH 024/226] PolymorphicModelConverter only handles direct subtypes and misses indirect. Fixes #2603 --- .../converters/PolymorphicModelConverter.java | 42 ++++-- .../api/v30/app220/HelloController.java | 63 +++++++++ .../api/v30/app220/SpringDocApp220Test.java | 35 +++++ .../test/resources/results/3.0.1/app220.json | 132 ++++++++++++++++++ 4 files changed, 263 insertions(+), 9 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/SpringDocApp220Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app220.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 2f04a52c8..95a93340d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -25,9 +25,11 @@ package org.springdoc.core.converters; import java.lang.reflect.Modifier; +import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; +import java.util.stream.Collectors; import com.fasterxml.jackson.databind.JavaType; import io.swagger.v3.core.converter.AnnotatedType; @@ -61,10 +63,12 @@ public PolymorphicModelConverter(ObjectMapperProvider springDocObjectMapper) { private static Schema getResolvedSchema(JavaType javaType, Schema resolvedSchema) { if (resolvedSchema instanceof ObjectSchema && resolvedSchema.getProperties() != null) { - if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getName())) + if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getName())){ resolvedSchema = resolvedSchema.getProperties().get(javaType.getRawClass().getName()); - else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSimpleName())) + } + else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSimpleName())){ resolvedSchema = resolvedSchema.getProperties().get(javaType.getRawClass().getSimpleName()); + } } return resolvedSchema; } @@ -94,13 +98,8 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato */ private Schema composePolymorphicSchema(AnnotatedType type, Schema schema, Collection schemas) { String ref = schema.get$ref(); - List composedSchemas = schemas.stream() - .filter(ComposedSchema.class::isInstance) - .map(ComposedSchema.class::cast) - .filter(s -> s.getAllOf() != null) - .filter(s -> s.getAllOf().stream().anyMatch(s2 -> ref.equals(s2.get$ref()))) - .map(s -> new Schema().$ref(AnnotationsUtils.COMPONENTS_REF + s.getName())) - .toList(); + List composedSchemas = findComposedSchemas(ref, schemas); + if (composedSchemas.isEmpty()) return schema; ComposedSchema result = new ComposedSchema(); @@ -109,6 +108,31 @@ private Schema composePolymorphicSchema(AnnotatedType type, Schema schema, Colle return result; } + /** + * Find composed schemas recursively. + * + * @param ref the reference of the schema + * @param schemas the collection of schemas to search in + * @return the list of composed schemas + */ + private List findComposedSchemas(String ref, Collection schemas) { + List composedSchemas = schemas.stream() + .filter(ComposedSchema.class::isInstance) + .map(ComposedSchema.class::cast) + .filter(s -> s.getAllOf() != null) + .filter(s -> s.getAllOf().stream().anyMatch(s2 -> ref.equals(s2.get$ref()))) + .map(s -> new Schema().$ref(AnnotationsUtils.COMPONENTS_REF + s.getName())) + .collect(Collectors.toList()); + + List resultSchemas = new ArrayList<>(composedSchemas); + + for (Schema childSchema : composedSchemas) { + String childSchemaRef = childSchema.get$ref(); + resultSchemas.addAll(findComposedSchemas(childSchemaRef, schemas)); + } + + return resultSchemas; + } /** * Is concrete class boolean. * diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/HelloController.java new file mode 100644 index 000000000..f5b17bc2b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/HelloController.java @@ -0,0 +1,63 @@ +package test.org.springdoc.api.v30.app220; + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/parent") + public void parentEndpoint(@RequestBody Superclass parent) { + + } + +} + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @Type(value = IntermediateClass.class, name = IntermediateClass.SCHEMA_NAME), +}) +sealed class Superclass permits IntermediateClass { + + public Superclass() {} +} + +@Schema(name = IntermediateClass.SCHEMA_NAME) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @Type(value = FirstChildClass.class, name = FirstChildClass.SCHEMA_NAME), + @Type(value = SecondChildClass.class, name = SecondChildClass.SCHEMA_NAME) +}) +sealed class IntermediateClass extends Superclass permits FirstChildClass, SecondChildClass { + + public static final String SCHEMA_NAME = "IntermediateClass"; +} + +@Schema(name = FirstChildClass.SCHEMA_NAME) +final class FirstChildClass extends IntermediateClass { + + public static final String SCHEMA_NAME = "Image"; +} + +@Schema(name = SecondChildClass.SCHEMA_NAME) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @Type(value = ThirdChildClass.class, name = ThirdChildClass.SCHEMA_NAME) +}) +sealed class SecondChildClass extends IntermediateClass { + + public static final String SCHEMA_NAME = "Mail"; +} + +@Schema(name = ThirdChildClass.SCHEMA_NAME) +final class ThirdChildClass extends SecondChildClass { + + public static final String SCHEMA_NAME = "Home"; +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/SpringDocApp220Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/SpringDocApp220Test.java new file mode 100644 index 000000000..0e5f57595 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/SpringDocApp220Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app220; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp220Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app220.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app220.json new file mode 100644 index 000000000..de2244501 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app220.json @@ -0,0 +1,132 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/parent": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "parentEndpoint", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Superclass" + }, + { + "$ref": "#/components/schemas/IntermediateClass" + }, + { + "$ref": "#/components/schemas/Image" + }, + { + "$ref": "#/components/schemas/Mail" + }, + { + "$ref": "#/components/schemas/Home" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Home": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Mail" + } + ] + }, + "Image": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/IntermediateClass" + } + ] + }, + "IntermediateClass": { + "required": [ + "@type" + ], + "type": "object", + "discriminator": { + "propertyName": "@type" + }, + "allOf": [ + { + "$ref": "#/components/schemas/Superclass" + }, + { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + } + } + ] + }, + "Mail": { + "required": [ + "@type" + ], + "type": "object", + "discriminator": { + "propertyName": "@type" + }, + "allOf": [ + { + "$ref": "#/components/schemas/IntermediateClass" + }, + { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + } + } + ] + }, + "Superclass": { + "required": [ + "@type" + ], + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "@type" + } + } + } + } +} From 6c24eb632f31b36e04a37de8f99e5885df29efba Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 16 Jun 2024 22:33:14 +0200 Subject: [PATCH 025/226] Spring Authorization Server Metadata Endpoint not compatible. fixes #2606 --- .../SpringDocSecurityOAuth2Customizer.java | 19 +- .../src/test/resources/results/app10.json | 134 +++++---- .../src/test/resources/results/app11.json | 189 +++++++++---- .../src/test/resources/results/app12.json | 266 +++++++++++------- 4 files changed, 400 insertions(+), 208 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java index b8cfd52f0..d155b9459 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java @@ -4,6 +4,8 @@ import io.swagger.v3.core.util.AnnotationsUtils; import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.SecurityRequirements; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; @@ -18,9 +20,14 @@ import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.parameters.HeaderParameter; import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.PathParameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.security.SecurityScheme.In; +import io.swagger.v3.oas.models.security.SecurityScheme.Type; import org.apache.commons.lang3.reflect.FieldUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -182,6 +189,10 @@ private void getOAuth2AuthorizationServerMetadataEndpoint(OpenAPI openAPI, Secur ReflectionUtils.makeAccessible(field); String defaultOauth2MetadataUri = (String) ReflectionUtils.getField(field, null); openAPI.getPaths().addPathItem(defaultOauth2MetadataUri , new PathItem().get(operation)); + operation = buildOperation(apiResponses); + operation.addParametersItem(new PathParameter().name("subpath").schema(new StringSchema())); + operation.summary("Valid when multiple issuers are allowed"); + openAPI.getPaths().addPathItem(defaultOauth2MetadataUri+"/{subpath}" , new PathItem().get(operation)); } } } @@ -252,7 +263,7 @@ private void getOAuth2TokenEndpoint(OpenAPI openAPI, SecurityFilterChain securit String mediaType = org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE; RequestBody requestBody = new RequestBody().content(new Content().addMediaType(mediaType, new MediaType().schema(requestSchema))); operation.setRequestBody(requestBody); - operation.addParametersItem(new HeaderParameter().name("Authorization")); + operation.addParametersItem(new HeaderParameter().name("Authorization").schema(new StringSchema())); buildPath(oAuth2EndpointFilter, "tokenEndpointMatcher", openAPI, operation, HttpMethod.POST); } @@ -310,6 +321,10 @@ private void getOidcProviderConfigurationEndpoint(OpenAPI openAPI, SecurityFilte ReflectionUtils.makeAccessible(field); String defaultOidcConfigUri = (String) ReflectionUtils.getField(field, null); openAPI.getPaths().addPathItem(defaultOidcConfigUri , new PathItem().get(operation)); + operation = buildOperation(apiResponses); + operation.addParametersItem(new PathParameter().name("subpath").schema(new StringSchema())); + operation.summary("Valid when multiple issuers are allowed"); + openAPI.getPaths().addPathItem("/{subpath}"+defaultOidcConfigUri , new PathItem().get(operation)); } } } @@ -360,7 +375,7 @@ private void getOidcClientRegistrationEndpoint(OpenAPI openAPI, SecurityFilterCh String mediaType = APPLICATION_JSON_VALUE; RequestBody requestBody = new RequestBody().content(new Content().addMediaType(mediaType, new MediaType().schema(schema))); operation.setRequestBody(requestBody); - operation.addParametersItem(new HeaderParameter().name("Authorization")); + operation.addParametersItem(new HeaderParameter().name("Authorization").schema(new StringSchema())); buildPath(oAuth2EndpointFilter, "clientRegistrationEndpointMatcher", openAPI, operation, HttpMethod.POST); } diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json index c53212833..9ca244228 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json @@ -56,6 +56,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -65,6 +68,25 @@ } } } + } + } + } + }, + "/.well-known/oauth-authorization-server": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2AuthorizationServerMetadata" + } + } + } }, "500": { "description": "Internal Server Error" @@ -72,11 +94,22 @@ } } }, - "/.well-known/oauth-authorization-server": { + "/.well-known/oauth-authorization-server/{subpath}": { "get": { "tags": [ "authorization-server-endpoints" ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -101,8 +134,11 @@ ], "parameters": [ { + "name": "Authorization", "in": "header", - "name": "Authorization" + "schema": { + "type": "string" + } } ], "requestBody": { @@ -165,6 +201,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -184,9 +223,6 @@ } } } - }, - "500": { - "description": "Internal Server Error" } } } @@ -215,15 +251,8 @@ "text/html": {} } }, - "302": { - "description": "Moved Temporarily", - "headers": { - "Location": { - "schema": { - "type": "string" - } - } - } + "500": { + "description": "Internal Server Error" }, "400": { "description": "Bad Request", @@ -235,8 +264,15 @@ } } }, - "500": { - "description": "Internal Server Error" + "302": { + "description": "Moved Temporarily", + "headers": { + "Location": { + "schema": { + "type": "string" + } + } + } } } } @@ -280,6 +316,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -289,9 +328,6 @@ } } } - }, - "500": { - "description": "Internal Server Error" } } } @@ -322,6 +358,9 @@ "200": { "description": "OK" }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -331,9 +370,6 @@ } } } - }, - "500": { - "description": "Internal Server Error" } } } @@ -358,9 +394,6 @@ "OAuth2AuthorizationServerMetadata": { "type": "object", "properties": { - "issuer": { - "type": "string" - }, "token_endpoint_auth_methods_supported": { "type": "array", "items": { @@ -397,16 +430,19 @@ "type": "string" } }, + "introspection_endpoint": { + "type": "string" + }, + "revocation_endpoint": { + "type": "string" + }, "grant_types_supported": { "type": "array", "items": { "type": "string" } }, - "revocation_endpoint": { - "type": "string" - }, - "introspection_endpoint": { + "issuer": { "type": "string" }, "jwks_uri": { @@ -424,13 +460,13 @@ "type": "integer", "format": "int64" }, - "access_token": { + "token_type": { "type": "string" }, - "refresh_token": { + "access_token": { "type": "string" }, - "token_type": { + "refresh_token": { "type": "string" } } @@ -438,26 +474,21 @@ "OAuth2TokenIntrospection": { "type": "object", "properties": { - "nbf": { - "type": "integer", - "format": "int64" - }, "scope": { "type": "string" }, "jti": { "type": "string" }, - "client_id": { - "type": "string" - }, - "username": { - "type": "string" + "exp": { + "type": "integer", + "format": "int64" }, - "active": { - "type": "boolean" + "nbf": { + "type": "integer", + "format": "int64" }, - "iss": { + "token_type": { "type": "string" }, "aud": { @@ -466,19 +497,24 @@ "type": "string" } }, - "token_type": { + "client_id": { "type": "string" }, - "exp": { - "type": "integer", - "format": "int64" + "username": { + "type": "string" }, - "sub": { + "iss": { "type": "string" }, + "active": { + "type": "boolean" + }, "iat": { "type": "integer", "format": "int64" + }, + "sub": { + "type": "string" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json index 1f8119986..8d7a90106 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json @@ -56,6 +56,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -65,6 +68,25 @@ } } } + } + } + } + }, + "/.well-known/oauth-authorization-server": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2AuthorizationServerMetadata" + } + } + } }, "500": { "description": "Internal Server Error" @@ -72,11 +94,22 @@ } } }, - "/.well-known/oauth-authorization-server": { + "/.well-known/oauth-authorization-server/{subpath}": { "get": { "tags": [ "authorization-server-endpoints" ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -101,8 +134,11 @@ ], "parameters": [ { + "name": "Authorization", "in": "header", - "name": "Authorization" + "schema": { + "type": "string" + } } ], "requestBody": { @@ -165,6 +201,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -184,9 +223,6 @@ } } } - }, - "500": { - "description": "Internal Server Error" } } } @@ -215,15 +251,8 @@ "text/html": {} } }, - "302": { - "description": "Moved Temporarily", - "headers": { - "Location": { - "schema": { - "type": "string" - } - } - } + "500": { + "description": "Internal Server Error" }, "400": { "description": "Bad Request", @@ -235,8 +264,15 @@ } } }, - "500": { - "description": "Internal Server Error" + "302": { + "description": "Moved Temporarily", + "headers": { + "Location": { + "schema": { + "type": "string" + } + } + } } } } @@ -280,6 +316,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -289,9 +328,6 @@ } } } - }, - "500": { - "description": "Internal Server Error" } } } @@ -322,6 +358,9 @@ "200": { "description": "OK" }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -331,6 +370,25 @@ } } } + } + } + } + }, + "/.well-known/openid-configuration": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OidcProviderConfiguration" + } + } + } }, "500": { "description": "Internal Server Error" @@ -338,11 +396,22 @@ } } }, - "/.well-known/openid-configuration": { + "/{subpath}/.well-known/openid-configuration": { "get": { "tags": [ "authorization-server-endpoints" ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -405,9 +474,6 @@ "OAuth2AuthorizationServerMetadata": { "type": "object", "properties": { - "issuer": { - "type": "string" - }, "token_endpoint_auth_methods_supported": { "type": "array", "items": { @@ -444,16 +510,19 @@ "type": "string" } }, + "introspection_endpoint": { + "type": "string" + }, + "revocation_endpoint": { + "type": "string" + }, "grant_types_supported": { "type": "array", "items": { "type": "string" } }, - "revocation_endpoint": { - "type": "string" - }, - "introspection_endpoint": { + "issuer": { "type": "string" }, "jwks_uri": { @@ -471,13 +540,13 @@ "type": "integer", "format": "int64" }, - "access_token": { + "token_type": { "type": "string" }, - "refresh_token": { + "access_token": { "type": "string" }, - "token_type": { + "refresh_token": { "type": "string" } } @@ -485,26 +554,21 @@ "OAuth2TokenIntrospection": { "type": "object", "properties": { - "nbf": { - "type": "integer", - "format": "int64" - }, "scope": { "type": "string" }, "jti": { "type": "string" }, - "client_id": { - "type": "string" - }, - "username": { - "type": "string" + "exp": { + "type": "integer", + "format": "int64" }, - "active": { - "type": "boolean" + "nbf": { + "type": "integer", + "format": "int64" }, - "iss": { + "token_type": { "type": "string" }, "aud": { @@ -513,25 +577,33 @@ "type": "string" } }, - "token_type": { + "client_id": { "type": "string" }, - "exp": { - "type": "integer", - "format": "int64" + "username": { + "type": "string" }, - "sub": { + "iss": { "type": "string" }, + "active": { + "type": "boolean" + }, "iat": { "type": "integer", "format": "int64" + }, + "sub": { + "type": "string" } } }, "OidcProviderConfiguration": { "type": "object", "properties": { + "id_token_signing_alg_values_supported": { + "type": "string" + }, "token_endpoint_auth_methods_supported": { "type": "array", "items": { @@ -556,22 +628,19 @@ "type": "string" } }, - "id_token_signing_alg_values_supported": { - "type": "string" - }, - "authorization_endpoint": { + "subject_types_supported": { "type": "string" }, - "token_endpoint": { + "scopes_supported": { "type": "string" }, "userinfo_endpoint": { "type": "string" }, - "subject_types_supported": { + "authorization_endpoint": { "type": "string" }, - "scopes_supported": { + "token_endpoint": { "type": "string" }, "response_types_supported": { @@ -580,18 +649,18 @@ "type": "string" } }, + "introspection_endpoint": { + "type": "string" + }, + "revocation_endpoint": { + "type": "string" + }, "grant_types_supported": { "type": "array", "items": { "type": "string" } }, - "revocation_endpoint": { - "type": "string" - }, - "introspection_endpoint": { - "type": "string" - }, "issuer": { "type": "string" }, diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json index 8925e7038..a45d84f60 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json @@ -56,6 +56,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -65,6 +68,25 @@ } } } + } + } + } + }, + "/.well-known/oauth-authorization-server": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2AuthorizationServerMetadata" + } + } + } }, "500": { "description": "Internal Server Error" @@ -72,11 +94,22 @@ } } }, - "/.well-known/oauth-authorization-server": { + "/.well-known/oauth-authorization-server/{subpath}": { "get": { "tags": [ "authorization-server-endpoints" ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -101,8 +134,11 @@ ], "parameters": [ { + "name": "Authorization", "in": "header", - "name": "Authorization" + "schema": { + "type": "string" + } } ], "requestBody": { @@ -165,6 +201,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -184,9 +223,6 @@ } } } - }, - "500": { - "description": "Internal Server Error" } } } @@ -215,15 +251,8 @@ "text/html": {} } }, - "302": { - "description": "Moved Temporarily", - "headers": { - "Location": { - "schema": { - "type": "string" - } - } - } + "500": { + "description": "Internal Server Error" }, "400": { "description": "Bad Request", @@ -235,8 +264,15 @@ } } }, - "500": { - "description": "Internal Server Error" + "302": { + "description": "Moved Temporarily", + "headers": { + "Location": { + "schema": { + "type": "string" + } + } + } } } } @@ -280,6 +316,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -289,9 +328,6 @@ } } } - }, - "500": { - "description": "Internal Server Error" } } } @@ -322,6 +358,9 @@ "200": { "description": "OK" }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -331,6 +370,25 @@ } } } + } + } + } + }, + "/.well-known/openid-configuration": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OidcProviderConfiguration" + } + } + } }, "500": { "description": "Internal Server Error" @@ -338,11 +396,22 @@ } } }, - "/.well-known/openid-configuration": { + "/{subpath}/.well-known/openid-configuration": { "get": { "tags": [ "authorization-server-endpoints" ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -393,7 +462,10 @@ "parameters": [ { "name": "Authorization", - "in": "header" + "in": "header", + "schema": { + "type": "string" + } } ], "requestBody": { @@ -416,6 +488,9 @@ } } }, + "500": { + "description": "Internal Server Error" + }, "400": { "description": "Bad Request", "content": { @@ -445,9 +520,6 @@ } } } - }, - "500": { - "description": "Internal Server Error" } } } @@ -472,9 +544,6 @@ "OAuth2AuthorizationServerMetadata": { "type": "object", "properties": { - "issuer": { - "type": "string" - }, "token_endpoint_auth_methods_supported": { "type": "array", "items": { @@ -511,16 +580,19 @@ "type": "string" } }, + "introspection_endpoint": { + "type": "string" + }, + "revocation_endpoint": { + "type": "string" + }, "grant_types_supported": { "type": "array", "items": { "type": "string" } }, - "revocation_endpoint": { - "type": "string" - }, - "introspection_endpoint": { + "issuer": { "type": "string" }, "jwks_uri": { @@ -538,13 +610,13 @@ "type": "integer", "format": "int64" }, - "access_token": { + "token_type": { "type": "string" }, - "refresh_token": { + "access_token": { "type": "string" }, - "token_type": { + "refresh_token": { "type": "string" } } @@ -552,26 +624,21 @@ "OAuth2TokenIntrospection": { "type": "object", "properties": { - "nbf": { - "type": "integer", - "format": "int64" - }, "scope": { "type": "string" }, "jti": { "type": "string" }, - "client_id": { - "type": "string" - }, - "username": { - "type": "string" + "exp": { + "type": "integer", + "format": "int64" }, - "active": { - "type": "boolean" + "nbf": { + "type": "integer", + "format": "int64" }, - "iss": { + "token_type": { "type": "string" }, "aud": { @@ -580,25 +647,33 @@ "type": "string" } }, - "token_type": { + "client_id": { "type": "string" }, - "exp": { - "type": "integer", - "format": "int64" + "username": { + "type": "string" }, - "sub": { + "iss": { "type": "string" }, + "active": { + "type": "boolean" + }, "iat": { "type": "integer", "format": "int64" + }, + "sub": { + "type": "string" } } }, "OidcProviderConfiguration": { "type": "object", "properties": { + "id_token_signing_alg_values_supported": { + "type": "string" + }, "token_endpoint_auth_methods_supported": { "type": "array", "items": { @@ -623,22 +698,19 @@ "type": "string" } }, - "id_token_signing_alg_values_supported": { - "type": "string" - }, - "authorization_endpoint": { + "subject_types_supported": { "type": "string" }, - "token_endpoint": { + "scopes_supported": { "type": "string" }, "userinfo_endpoint": { "type": "string" }, - "subject_types_supported": { + "authorization_endpoint": { "type": "string" }, - "scopes_supported": { + "token_endpoint": { "type": "string" }, "response_types_supported": { @@ -647,18 +719,18 @@ "type": "string" } }, + "introspection_endpoint": { + "type": "string" + }, + "revocation_endpoint": { + "type": "string" + }, "grant_types_supported": { "type": "array", "items": { "type": "string" } }, - "revocation_endpoint": { - "type": "string" - }, - "introspection_endpoint": { - "type": "string" - }, "issuer": { "type": "string" }, @@ -676,22 +748,13 @@ "id_token_signed_response_alg": { "type": "string" }, - "response_types": { - "type": "array", - "items": { - "type": "string" - } - }, - "client_secret": { + "registration_access_token": { "type": "string" }, "client_secret_expires_at": { "type": "integer", "format": "int64" }, - "registration_access_token": { - "type": "string" - }, "registration_client_uri": { "type": "string" }, @@ -705,12 +768,27 @@ "type": "string" } }, - "scope": { + "client_secret": { "type": "string" }, + "response_types": { + "type": "array", + "items": { + "type": "string" + } + }, "client_id": { "type": "string" }, + "client_name": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "scope": { + "type": "string" + }, "token_endpoint_auth_signing_alg": { "type": "string" }, @@ -719,12 +797,6 @@ "items": { "type": "string" } - }, - "jwks_uri": { - "type": "string" - }, - "client_name": { - "type": "string" } } }, @@ -737,15 +809,6 @@ "id_token_signed_response_alg": { "type": "string" }, - "response_types": { - "type": "array", - "items": { - "type": "string" - } - }, - "client_secret": { - "type": "string" - }, "client_secret_expires_at": { "type": "string", "format": "date-time" @@ -760,12 +823,27 @@ "type": "string" } }, - "scope": { + "client_secret": { "type": "string" }, + "response_types": { + "type": "array", + "items": { + "type": "string" + } + }, "client_id": { "type": "string" }, + "client_name": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "scope": { + "type": "string" + }, "token_endpoint_auth_signing_alg": { "type": "string" }, @@ -774,12 +852,6 @@ "items": { "type": "string" } - }, - "jwks_uri": { - "type": "string" - }, - "client_name": { - "type": "string" } } } From cf125474883829c11fd7389e86d2aed811785207 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Wed, 19 Jun 2024 03:04:11 +0200 Subject: [PATCH 026/226] Content-type for POST endpoints with multipart/form-data does not work since v2.4.0. Fixes #2621 --- .../core/data/DataRestRequestService.java | 2 +- .../core/service/AbstractRequestService.java | 41 ++++----- .../org/springdoc/api/v30/app221/HomeApi.java | 23 +++++ .../api/v30/app221/HomeController.java | 24 ++++++ .../api/v30/app221/SpringDocApp221Test.java | 35 ++++++++ .../test/resources/results/3.0.1/app221.json | 83 +++++++++++++++++++ 6 files changed, 188 insertions(+), 20 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/HomeApi.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/HomeController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/SpringDocApp221Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app221.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java index b756e7a87..fd67c75c0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java @@ -175,7 +175,7 @@ else if (methodParameter.getParameterAnnotation(BackendId.class) != null) { parameterInfo.setParameterModel(parameter); } if (!ArrayUtils.isEmpty(methodParameter.getParameterAnnotations())) - parameter = requestBuilder.buildParams(parameterInfo, openAPI.getComponents(), requestMethod, null, + parameter = requestBuilder.buildParams(parameterInfo, openAPI.getComponents(), requestMethod, methodAttributes, openAPI.getOpenapi()); addParameters(openAPI, requestMethod, methodAttributes, operation, methodParameter, parameterInfo, parameter); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 7fe94dad5..6a53cc4e3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -25,6 +25,7 @@ package org.springdoc.core.service; import java.lang.annotation.Annotation; +import java.lang.reflect.Field; import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.ArrayList; @@ -88,12 +89,14 @@ import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.context.request.WebRequest; import org.springframework.web.method.HandlerMethod; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.util.UriComponentsBuilder; import static org.springdoc.core.converters.SchemaPropertyDeprecatingConverter.containsDeprecatedAnnotation; import static org.springdoc.core.service.GenericParameterService.isFile; import static org.springdoc.core.utils.Constants.OPENAPI_ARRAY_TYPE; import static org.springdoc.core.utils.Constants.OPENAPI_STRING_TYPE; +import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE; /** * The type Abstract request builder. @@ -323,7 +326,7 @@ public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, } if (!isParamToIgnore(methodParameter)) { - parameter = buildParams(parameterInfo, components, requestMethod, methodAttributes.getJsonViewAnnotation(), openAPI.getOpenapi()); + parameter = buildParams(parameterInfo, components, requestMethod, methodAttributes, openAPI.getOpenapi()); // Merge with the operation parameters parameter = GenericParameterService.mergeParameter(operationParameters, parameter); List parameterAnnotations = Arrays.asList(methodParameter.getParameterAnnotations()); @@ -353,7 +356,7 @@ else if (!RequestMethod.GET.equals(requestMethod) || OpenApiVersion.OPENAPI_3_1. // support form-data if (defaultSupportFormData && requestBody != null && requestBody.getContent() != null - && requestBody.getContent().containsKey(org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE)) { + && requestBody.getContent().containsKey(MULTIPART_FORM_DATA_VALUE)) { Iterator> it = map.entrySet().iterator(); while (it.hasNext()) { Entry entry = it.next(); @@ -496,28 +499,28 @@ public boolean isValidParameter(Parameter parameter) { /** * Build params parameter. * - * @param parameterInfo the parameter info - * @param components the components - * @param requestMethod the request method - * @param jsonView the json view - * @param openApiVersion the open api version + * @param parameterInfo the parameter info + * @param components the components + * @param requestMethod the request method + * @param methodAttributes the method attributes + * @param openApiVersion the open api version * @return the parameter */ public Parameter buildParams(ParameterInfo parameterInfo, Components components, - RequestMethod requestMethod, JsonView jsonView, String openApiVersion) { + RequestMethod requestMethod, MethodAttributes methodAttributes, String openApiVersion) { MethodParameter methodParameter = parameterInfo.getMethodParameter(); if (parameterInfo.getParamType() != null) { if (!ValueConstants.DEFAULT_NONE.equals(parameterInfo.getDefaultValue())) parameterInfo.setRequired(false); else parameterInfo.setDefaultValue(null); - return this.buildParam(parameterInfo, components, jsonView); + return this.buildParam(parameterInfo, components, methodAttributes.getJsonViewAnnotation()); } // By default - if (!isRequestBodyParam(requestMethod, parameterInfo, openApiVersion)) { + if (!isRequestBodyParam(requestMethod, parameterInfo, openApiVersion, methodAttributes)) { parameterInfo.setRequired(!((DelegatingMethodParameter) methodParameter).isNotRequired() && !methodParameter.isOptional()); parameterInfo.setDefaultValue(null); - return this.buildParam(parameterInfo, components, jsonView); + return this.buildParam(parameterInfo, components, methodAttributes.getJsonViewAnnotation()); } return null; } @@ -631,7 +634,7 @@ public RequestBodyService getRequestBodyBuilder() { public boolean isDefaultFlatParamObject() { return defaultFlatParamObject; } - + /** * Calculate size. * @@ -722,12 +725,13 @@ private void applyValidationsToSchema(Map annos, Schema s /** * Is RequestBody param boolean. * - * @param requestMethod the request method - * @param parameterInfo the parameter info - * @param openApiVersion the open api version + * @param requestMethod the request method + * @param parameterInfo the parameter info + * @param openApiVersion the open api version + * @param methodAttributes the method attributes * @return the boolean */ - private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo parameterInfo, String openApiVersion) { + private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo parameterInfo, String openApiVersion, MethodAttributes methodAttributes) { MethodParameter methodParameter = parameterInfo.getMethodParameter(); DelegatingMethodParameter delegatingMethodParameter = (DelegatingMethodParameter) methodParameter; boolean isBodyAllowed = !RequestMethod.GET.equals(requestMethod) || OpenApiVersion.OPENAPI_3_1.getVersion().equals(openApiVersion); @@ -739,8 +743,7 @@ private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo pa || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null) || checkOperationRequestBody(methodParameter) || checkFile(methodParameter) - - ); + || Arrays.asList(methodAttributes.getMethodConsumes()).contains(MULTIPART_FORM_DATA_VALUE)); } /** @@ -767,7 +770,7 @@ else if (methodParameter.getParameterAnnotation(org.springframework.web.bind.ann private boolean checkOperationRequestBody(MethodParameter methodParameter) { if (AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.Operation.class) != null) { io.swagger.v3.oas.annotations.Operation operation = AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.Operation.class); - if(operation!=null){ + if (operation != null) { io.swagger.v3.oas.annotations.parameters.RequestBody requestBody = operation.requestBody(); if (StringUtils.isNotBlank(requestBody.description())) return true; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/HomeApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/HomeApi.java new file mode 100644 index 000000000..40506c3da --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/HomeApi.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v30.app221; + +import java.io.IOException; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import test.org.springdoc.api.v30.app221.HomeController.HelloDto; +import test.org.springdoc.api.v30.app221.HomeController.HelloUploadDto; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; +import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE; + +@Tag(name = "Hello World Api", description = "This is a test api") +@RequestMapping("api/hello") +public interface HomeApi { + + @Operation(summary = "Upload new content", description = "Upload test content") + @PostMapping(produces = APPLICATION_JSON_VALUE, consumes = MULTIPART_FORM_DATA_VALUE) + HelloDto uploadContent(HelloUploadDto contentUploadDto) throws IOException; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/HomeController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/HomeController.java new file mode 100644 index 000000000..3c4115e94 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/HomeController.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v30.app221; + +import java.io.IOException; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class HomeController implements HomeApi { + + @Override + public HelloDto uploadContent(@Valid HelloUploadDto uploadDto) + throws IOException { + var fileBytes = uploadDto.file.getBytes(); + return new HelloDto(uploadDto.title, fileBytes); + } + + public record HelloDto(String title, byte[] file) {} + + public record HelloUploadDto(@NotNull String title, MultipartFile file) {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/SpringDocApp221Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/SpringDocApp221Test.java new file mode 100644 index 000000000..d53ee8dbf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/SpringDocApp221Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app221; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp221Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app221.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app221.json new file mode 100644 index 000000000..2554fd2f9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app221.json @@ -0,0 +1,83 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello World Api", + "description": "This is a test api" + } + ], + "paths": { + "/api/hello": { + "post": { + "tags": [ + "Hello World Api" + ], + "summary": "Upload new content", + "description": "Upload test content", + "operationId": "uploadContent", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/HelloUploadDto" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloUploadDto": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "file": { + "type": "string", + "format": "binary" + } + } + }, + "HelloDto": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "file": { + "type": "string", + "format": "byte" + } + } + } + } + } +} From 524c5fa24593150854ea7ee0fee17cef08caafe1 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 23 Jun 2024 10:11:08 +0200 Subject: [PATCH 027/226] Kotlin enums are always marked as required if used in Java controllers. Fixes #2622 --- .../SpringDocKotlinConfiguration.kt | 8 ++- .../springdoc/api/app12/EnumController.java | 18 +++++++ .../springdoc/api/app12/SpringDocApp12Test.kt | 35 +++++++++++++ .../src/test/resources/results/app12.json | 50 +++++++++++++++++++ 4 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/EnumController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app12.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt index 7c7dd6070..fc09e6465 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt @@ -92,9 +92,13 @@ class SpringDocKotlinConfiguration() { // parameter is not required if a default value is provided in @RequestParam else if (requestParam != null && requestParam.defaultValue != ValueConstants.DEFAULT_NONE) parameterModel.required = false - else + else{ + val isJavaNullableAnnotationPresent = methodParameter.parameterAnnotations.any { + it.annotationClass.qualifiedName == "jakarta.annotation.Nullable" + } parameterModel.required = - kParameter.type.isMarkedNullable == false + kParameter.type.isMarkedNullable == false && !isJavaNullableAnnotationPresent + } } } return@ParameterCustomizer parameterModel diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/EnumController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/EnumController.java new file mode 100644 index 000000000..7bdd2ffe2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/EnumController.java @@ -0,0 +1,18 @@ +package test.org.springdoc.api.app12; + +import jakarta.annotation.Nullable; +import test.org.springdoc.api.app12.SpringDocApp12Test.MyEnum; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +public class EnumController { + @GetMapping("/test-enum-2") + String testEnum2(@Nullable MyEnum e) { + return ""; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt new file mode 100644 index 000000000..f522f7de3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt @@ -0,0 +1,35 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.app12 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest + +class SpringDocApp12Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app12"]) + class DemoApplication + + enum class MyEnum { + A, B; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app12.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app12.json new file mode 100644 index 000000000..407e5620a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app12.json @@ -0,0 +1,50 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test-enum-2": { + "get": { + "tags": [ + "enum-controller" + ], + "operationId": "testEnum2", + "parameters": [ + { + "name": "e", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "A", + "B" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} From 42de831b5adbe50fd7d4bc8c29ac43512a7d0b77 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 23 Jun 2024 10:59:47 +0200 Subject: [PATCH 028/226] Kotlin enums are always marked as required if used in Java controllers. Fixes #2622 --- .../test/org/springdoc/api/app12/EnumController.java | 0 .../test/org/springdoc/api/app12/SpringDocApp12Test.kt | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/{kotlin => java}/test/org/springdoc/api/app12/EnumController.java (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/{kotlin => java}/test/org/springdoc/api/app12/SpringDocApp12Test.kt (100%) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/EnumController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/EnumController.java similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/EnumController.java rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/EnumController.java diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.kt similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.kt From cd9778fae6d7ccdcaffc4f7fd26e786be7614ae0 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 23 Jun 2024 12:48:40 +0200 Subject: [PATCH 029/226] Kotlin enums are always marked as required if used in Java controllers. Fixes #2622 --- .../pom.xml | 30 +++++++++++++++++++ .../springdoc/api/app12/SpringDocApp12Test.kt | 0 2 files changed, 30 insertions(+) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/{java => kotlin}/test/org/springdoc/api/app12/SpringDocApp12Test.kt (100%) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 745ee023f..14818297f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -78,6 +78,36 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + + default-compile + none + + + + default-testCompile + none + + + java-compile + compile + + compile + + + + java-test-compile + test-compile + + testCompile + + + + \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.kt rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt From fa35308fa19f522e4217ae723895bc3df5e32b68 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 23 Jun 2024 18:10:32 +0200 Subject: [PATCH 030/226] @Schema and description not picked up for polymorphic attributes. Fixes #2620 --- .../src/test/java/test/org/springdoc/api/v30/app185/Pet.java | 2 ++ .../src/test/resources/results/3.0.1/app185.json | 1 + 2 files changed, 3 insertions(+) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Pet.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Pet.java index f02de23cc..93dc30461 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Pet.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Pet.java @@ -26,12 +26,14 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.Schema; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(Dog.class), @JsonSubTypes.Type(Cat.class) }) +@Schema(description = "This is a Pet") public class Pet { public final String name; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app185.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app185.json index 699f9026b..78b116b1d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app185.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app185.json @@ -109,6 +109,7 @@ "type": "string" } }, + "description": "This is a Pet", "discriminator": { "propertyName": "type" } From 8a1e0ad2bc71f7c3befd368c59b0d8119bb078b9 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 30 Jun 2024 00:23:25 +0200 Subject: [PATCH 031/226] Multiple Superclasses Are Not Mapped To Multiple allOf If Used In Different Services. Fixes #2601. --- .../converters/PolymorphicModelConverter.java | 2 +- .../core/utils/SpringDocAnnotationsUtils.java | 24 +++- .../api/v30/app222/HelloController.java | 28 ++++ .../api/v30/app222/SpringDocApp222Test.java | 55 ++++++++ .../test/resources/results/3.0.1/app222.json | 122 ++++++++++++++++++ 5 files changed, 225 insertions(+), 6 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/SpringDocApp222Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app222.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 95a93340d..eb9e04adb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -122,7 +122,7 @@ private List findComposedSchemas(String ref, Collection schemas) .filter(s -> s.getAllOf() != null) .filter(s -> s.getAllOf().stream().anyMatch(s2 -> ref.equals(s2.get$ref()))) .map(s -> new Schema().$ref(AnnotationsUtils.COMPONENTS_REF + s.getName())) - .collect(Collectors.toList()); + .toList(); List resultSchemas = new ArrayList<>(composedSchemas); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java index c532a679a..0c3750eea 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java @@ -31,9 +31,11 @@ import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; @@ -65,6 +67,7 @@ /** * The type Spring doc annotations utils. + * * @author bnasslahsen */ @SuppressWarnings({ "rawtypes" }) @@ -142,10 +145,21 @@ public static Schema extractSchema(Components components, Type returnType, JsonV for (Map.Entry entry : schemaMap.entrySet()) { // If we've seen this schema before but find later it should be polymorphic, // replace the existing schema with this richer version. + Schema existingSchema = componentSchemas.get(entry.getKey()); if (!componentSchemas.containsKey(entry.getKey()) || - (!entry.getValue().getClass().equals(componentSchemas.get(entry.getKey()).getClass()) && entry.getValue().getAllOf() != null)) { + (!entry.getValue().getClass().equals(existingSchema.getClass()) && entry.getValue().getAllOf() != null)) { componentSchemas.put(entry.getKey(), entry.getValue()); } + else if (componentSchemas.containsKey(entry.getKey()) && schemaMap.containsKey(entry.getKey())) { + // Check to merge polymorphic types + Set existingAllOf = new LinkedHashSet<>(); + if(existingSchema.getAllOf() != null) + existingAllOf.addAll(existingSchema.getAllOf()); + if (schemaMap.get(entry.getKey()).getAllOf() != null){ + existingAllOf.addAll(schemaMap.get(entry.getKey()).getAllOf()); + existingSchema.setAllOf(new ArrayList<>(existingAllOf)); + } + } } components.setSchemas(componentSchemas); } @@ -207,8 +221,8 @@ public static Optional getContent(io.swagger.v3.oas.annotations.media.C * Merge schema. * * @param existingContent the existing content - * @param schemaN the schema n - * @param mediaTypeStr the media type str + * @param schemaN the schema n + * @param mediaTypeStr the media type str */ public static void mergeSchema(Content existingContent, Schema schemaN, String mediaTypeStr) { if (existingContent.containsKey(mediaTypeStr)) { @@ -322,7 +336,7 @@ private static void addExtension(io.swagger.v3.oas.annotations.media.Content ann * Sets examples. * * @param mediaType the media type - * @param examples the examples + * @param examples the examples */ private static void setExamples(MediaType mediaType, ExampleObject[] examples) { if (examples.length == 1 && StringUtils.isBlank(examples[0].name())) { @@ -436,7 +450,7 @@ private static boolean isArray(io.swagger.v3.oas.annotations.media.Content annot * Resolve default value object. * * @param defaultValueStr the default value str - * @param objectMapper the object mapper + * @param objectMapper the object mapper * @return the object */ public static Object resolveDefaultValue(String defaultValueStr, ObjectMapper objectMapper) { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/HelloController.java new file mode 100644 index 000000000..0415f7911 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/HelloController.java @@ -0,0 +1,28 @@ +package test.org.springdoc.api.v30.app222; + + + +import test.org.springdoc.api.v30.app222.SpringDocApp222Test.FirstHierarchyUser; +import test.org.springdoc.api.v30.app222.SpringDocApp222Test.SecondHierarchyUser; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ + +@RestController +class HelloController { + + @GetMapping("/hello1") + public FirstHierarchyUser getItems1() { + return null; + } + + @GetMapping("/hello2") + public SecondHierarchyUser getItems2() { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/SpringDocApp222Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/SpringDocApp222Test.java new file mode 100644 index 000000000..d25dc5598 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/SpringDocApp222Test.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app222; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp222Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} + + @JsonTypeInfo(use = Id.NAME, property = "@type") + @JsonSubTypes(@Type(CommonImplementor.class)) + interface FirstHierarchy {} + + @JsonTypeInfo(use = Id.NAME, property = "@type") + @JsonSubTypes(@Type(CommonImplementor.class)) + interface SecondHierarchy {} + + class CommonImplementor implements FirstHierarchy, SecondHierarchy {} + + record CommonImplementorUser(FirstHierarchy firstHierarchy, SecondHierarchy secondHierarchy) {} + + record FirstHierarchyUser(FirstHierarchy firstHierarchy) {} + + record SecondHierarchyUser(SecondHierarchy secondHierarchy) {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app222.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app222.json new file mode 100644 index 000000000..cd4de9975 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app222.json @@ -0,0 +1,122 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getItems2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SecondHierarchyUser" + } + } + } + } + } + } + }, + "/hello1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getItems1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/FirstHierarchyUser" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CommonImplementor": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/SecondHierarchy" + }, + { + "$ref": "#/components/schemas/FirstHierarchy" + } + ] + }, + "SecondHierarchy": { + "required": [ + "@type" + ], + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "@type" + } + }, + "SecondHierarchyUser": { + "type": "object", + "properties": { + "secondHierarchy": { + "oneOf": [ + { + "$ref": "#/components/schemas/CommonImplementor" + } + ] + } + } + }, + "FirstHierarchy": { + "required": [ + "@type" + ], + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "@type" + } + }, + "FirstHierarchyUser": { + "type": "object", + "properties": { + "firstHierarchy": { + "oneOf": [ + { + "$ref": "#/components/schemas/CommonImplementor" + } + ] + } + } + } + } + } +} From 935b984673cbfd7aa6633644304497760b0f4ffb Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 30 Jun 2024 19:12:19 +0200 Subject: [PATCH 032/226] Polymorphic fields on polymorphic parents don't get correct oneOf docs generated. Fixes #2597 --- .../converters/PolymorphicModelConverter.java | 39 +- .../springdoc/core/utils/SpringDocUtils.java | 12 + .../api/v30/app223/ARestController.java | 23 ++ .../api/v30/app223/SpringDocApp223Test.java | 35 ++ .../v30/app223/apiobjects/AbstractChild.java | 61 +++ .../v30/app223/apiobjects/AbstractParent.java | 72 ++++ .../api/v30/app223/apiobjects/Response.java | 4 + .../test/resources/results/3.0.1/app223.json | 228 +++++++++++ .../src/test/resources/results/app105-3.json | 380 +++++++++--------- .../src/test/resources/results/app2.json | 14 +- 10 files changed, 666 insertions(+), 202 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/ARestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/SpringDocApp223Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/AbstractChild.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/AbstractParent.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/Response.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app223.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index eb9e04adb..e243f7e1a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -27,9 +27,9 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Iterator; import java.util.List; -import java.util.stream.Collectors; import com.fasterxml.jackson.databind.JavaType; import io.swagger.v3.core.converter.AnnotatedType; @@ -43,6 +43,7 @@ /** * The type Polymorphic model converter. + * * @author bnasslahsen */ public class PolymorphicModelConverter implements ModelConverter { @@ -52,6 +53,17 @@ public class PolymorphicModelConverter implements ModelConverter { */ private final ObjectMapperProvider springDocObjectMapper; + /** + * The constant PARENT_TYPES_TO_IGNORE. + */ + private static final List PARENT_TYPES_TO_IGNORE = Collections.synchronizedList(new ArrayList<>()); + + static { + PARENT_TYPES_TO_IGNORE.add("JsonSchema"); + PARENT_TYPES_TO_IGNORE.add("Pageable"); + PARENT_TYPES_TO_IGNORE.add("EntityModel"); + } + /** * Instantiates a new Polymorphic model converter. * @@ -61,12 +73,21 @@ public PolymorphicModelConverter(ObjectMapperProvider springDocObjectMapper) { this.springDocObjectMapper = springDocObjectMapper; } - private static Schema getResolvedSchema(JavaType javaType, Schema resolvedSchema) { + /** + * Add parent type. + * + * @param parentTypes the parent types + */ + public static void addParentType(String... parentTypes) { + PARENT_TYPES_TO_IGNORE.addAll(List.of(parentTypes)); + } + + private Schema getResolvedSchema(JavaType javaType, Schema resolvedSchema) { if (resolvedSchema instanceof ObjectSchema && resolvedSchema.getProperties() != null) { - if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getName())){ + if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getName())) { resolvedSchema = resolvedSchema.getProperties().get(javaType.getRawClass().getName()); } - else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSimpleName())){ + else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSimpleName())) { resolvedSchema = resolvedSchema.getProperties().get(javaType.getRawClass().getSimpleName()); } } @@ -78,6 +99,9 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); if (javaType != null) { if (chain.hasNext()) { + if (!type.isResolveAsRef() && type.getParent() != null + && PARENT_TYPES_TO_IGNORE.stream().noneMatch(ignore -> type.getParent().getName().startsWith(ignore))) + type.resolveAsRef(true); Schema resolvedSchema = chain.next().resolve(type, context, chain); resolvedSchema = getResolvedSchema(javaType, resolvedSchema); if (resolvedSchema == null || resolvedSchema.get$ref() == null) @@ -91,8 +115,8 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato /** * Compose polymorphic schema. * - * @param type the type - * @param schema the schema + * @param type the type + * @param schema the schema * @param schemas the schemas * @return the schema */ @@ -111,7 +135,7 @@ private Schema composePolymorphicSchema(AnnotatedType type, Schema schema, Colle /** * Find composed schemas recursively. * - * @param ref the reference of the schema + * @param ref the reference of the schema * @param schemas the collection of schemas to search in * @return the list of composed schemas */ @@ -133,6 +157,7 @@ private List findComposedSchemas(String ref, Collection schemas) return resultSchemas; } + /** * Is concrete class boolean. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java index 09175e6e4..f1023e3c6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java @@ -32,6 +32,7 @@ import org.springdoc.api.AbstractOpenApiResource; import org.springdoc.core.converters.AdditionalModelsConverter; import org.springdoc.core.converters.ConverterUtils; +import org.springdoc.core.converters.PolymorphicModelConverter; import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; import org.springdoc.core.extractor.MethodParameterPojoExtractor; import org.springdoc.core.service.AbstractRequestService; @@ -388,5 +389,16 @@ public static boolean isValidPath(String path) { return true; return false; } + + /** + * Add parent type spring doc utils. + * + * @param parentTypes the parent types + * @return the spring doc utils + */ + public SpringDocUtils addParentType(String ...parentTypes) { + PolymorphicModelConverter.addParentType(parentTypes); + return this; + } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/ARestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/ARestController.java new file mode 100644 index 000000000..8c672eb38 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/ARestController.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v30.app223; + + +import test.org.springdoc.api.v30.app223.apiobjects.AbstractChild; +import test.org.springdoc.api.v30.app223.apiobjects.AbstractParent; +import test.org.springdoc.api.v30.app223.apiobjects.Response; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ARestController { + @PostMapping("/parent") + public Response parentEndpoint(@RequestBody AbstractParent parent) { + return null; + } + + @PostMapping("/child") + public Response childEndpoint(@RequestBody AbstractChild child) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/SpringDocApp223Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/SpringDocApp223Test.java new file mode 100644 index 000000000..ce55a35c6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/SpringDocApp223Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app223; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp223Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/AbstractChild.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/AbstractChild.java new file mode 100644 index 000000000..de53786c3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/AbstractChild.java @@ -0,0 +1,61 @@ +package test.org.springdoc.api.v30.app223.apiobjects; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildType1.class), + @Type(ChildType2.class) +}) +public abstract class AbstractChild { + private int id; + + public AbstractChild(int id) { + this.id = id; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + + class ChildType1 extends AbstractChild { + private String childType1Param; + + public ChildType1(int id, String childType1Param) { + super(id); + this.childType1Param = childType1Param; + } + + public String getChildType1Param() { + return childType1Param; + } + + public void setChildType1Param(String childType1Param) { + this.childType1Param = childType1Param; + } +} + +class ChildType2 extends AbstractChild { + private String childType2Param; + + public ChildType2(int id, String childType2Param) { + super(id); + this.childType2Param = childType2Param; + } + + public String getChildType2Param() { + return childType2Param; + } + + public void setChildType2Param(String childType2Param) { + this.childType2Param = childType2Param; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/AbstractParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/AbstractParent.java new file mode 100644 index 000000000..73795f768 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/AbstractParent.java @@ -0,0 +1,72 @@ +package test.org.springdoc.api.v30.app223.apiobjects; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + + +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ParentType1.class), + @Type(ParentType2.class) +}) +public abstract class AbstractParent { + private int id; + + public AbstractParent(int id) { + this.id = id; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + +class ParentType1 extends AbstractParent { + private String parentType1Param; + private AbstractChild abstractChild; + + public ParentType1(int id, String parentType1Param, AbstractChild abstractChild) { + super(id); + this.parentType1Param = parentType1Param; + this.abstractChild = abstractChild; + } + + public String getParentType1Param() { + return parentType1Param; + } + + public void setParentType1Param(String parentType1Param) { + this.parentType1Param = parentType1Param; + } + + public AbstractChild getAbstractChild() { + return abstractChild; + } + + public void setAbstractChild(AbstractChild abstractChild) { + this.abstractChild = abstractChild; + } +} + +class ParentType2 extends AbstractParent { + private String parentType2Param; + + public ParentType2(int id, String parentType2Param) { + super(id); + this.parentType2Param = parentType2Param; + } + + public String getParentType2Param() { + return parentType2Param; + } + + public void setParentType2Param(String parentType2Param) { + this.parentType2Param = parentType2Param; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/Response.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/Response.java new file mode 100644 index 000000000..71dfdf576 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/apiobjects/Response.java @@ -0,0 +1,4 @@ +package test.org.springdoc.api.v30.app223.apiobjects; + +public record Response(AbstractParent abstractParent, AbstractChild abstractChild) { +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app223.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app223.json new file mode 100644 index 000000000..31ab9d5f6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app223.json @@ -0,0 +1,228 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/parent": { + "post": { + "tags": [ + "a-rest-controller" + ], + "operationId": "parentEndpoint", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ParentType1" + }, + { + "$ref": "#/components/schemas/ParentType2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + }, + "/child": { + "post": { + "tags": [ + "a-rest-controller" + ], + "operationId": "childEndpoint", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildType1" + }, + { + "$ref": "#/components/schemas/ChildType2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractChild": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "type" + } + }, + "AbstractParent": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "type" + } + }, + "ChildType1": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/AbstractChild" + }, + { + "type": "object", + "properties": { + "childType1Param": { + "type": "string" + } + } + } + ] + }, + "ChildType2": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/AbstractChild" + }, + { + "type": "object", + "properties": { + "childType2Param": { + "type": "string" + } + } + } + ] + }, + "ParentType1": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "parentType1Param": { + "type": "string" + }, + "abstractChild": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildType1" + }, + { + "$ref": "#/components/schemas/ChildType2" + } + ] + } + } + } + ] + }, + "ParentType2": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "parentType2Param": { + "type": "string" + } + } + } + ] + }, + "Response": { + "type": "object", + "properties": { + "abstractParent": { + "oneOf": [ + { + "$ref": "#/components/schemas/ParentType1" + }, + { + "$ref": "#/components/schemas/ParentType2" + } + ] + }, + "abstractChild": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildType1" + }, + { + "$ref": "#/components/schemas/ChildType2" + } + ] + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json index bccc4af1b..ff9c8392e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json @@ -34,12 +34,12 @@ "requestBody": { "description": "Pet object that needs to be added to the store", "content": { - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } }, - "application/xml": { + "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } @@ -87,12 +87,12 @@ "requestBody": { "description": "Pet object that needs to be added to the store", "content": { - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } }, - "application/xml": { + "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } @@ -128,142 +128,6 @@ ] } }, - "/pet/findByStatus": { - "get": { - "tags": [ - "pet" - ], - "summary": "Finds Pets by status", - "description": "Multiple status values can be provided with comma separated strings", - "operationId": "findPetsByStatus", - "parameters": [ - { - "name": "status", - "in": "query", - "description": "Status values that need to be considered for filter", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "application/xml": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - } - }, - "400": { - "description": "Invalid status value", - "content": { - "*/*": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] - } - }, - "/pet/findByTags": { - "get": { - "tags": [ - "pet" - ], - "summary": "Finds Pets by tags", - "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - "operationId": "findPetsByTags", - "parameters": [ - { - "name": "tags", - "in": "query", - "description": "Tags to filter by", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "application/xml": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - } - }, - "400": { - "description": "Invalid tag value", - "content": { - "*/*": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] - } - }, "/pet/{petId}": { "get": { "tags": [ @@ -285,21 +149,6 @@ } ], "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - } - } - }, "400": { "description": "Invalid ID supplied", "content": { @@ -316,15 +165,30 @@ "404": { "description": "Pet not found", "content": { - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } } } } @@ -504,6 +368,19 @@ } }, "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, "200": { "description": "successful operation", "content": { @@ -513,9 +390,111 @@ } } } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByTags": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by tags", + "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId": "findPetsByTags", + "parameters": [ + { + "name": "tags", + "in": "query", + "description": "Tags to filter by", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "400": { + "description": "Invalid tag value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByStatus": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by status", + "description": "Multiple status values can be provided with comma separated strings", + "operationId": "findPetsByStatus", + "parameters": [ + { + "name": "status", + "in": "query", + "description": "Status values that need to be considered for filter", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { "400": { - "description": "the map", + "description": "Invalid status value", "content": { "*/*": { "schema": { @@ -526,6 +505,27 @@ } } } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } } }, "security": [ @@ -553,26 +553,8 @@ "type": "string", "description": "The Name." } - } - }, - "ModelApiResponse": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "description": "The Code.", - "format": "int32" - }, - "message": { - "type": "string", - "description": "The Message." - }, - "type": { - "type": "string", - "description": "The Type." - } }, - "description": "The type Model api response." + "description": "The type Category." }, "Pet": { "required": [ @@ -581,14 +563,14 @@ ], "type": "object", "properties": { - "category": { - "$ref": "#/components/schemas/Category" - }, "id": { "type": "integer", "description": "The Id.", "format": "int64" }, + "category": { + "$ref": "#/components/schemas/Category" + }, "name": { "type": "string", "description": "The Name.", @@ -601,6 +583,13 @@ "type": "string" } }, + "tags": { + "type": "array", + "description": "The Tags.", + "items": { + "$ref": "#/components/schemas/Tag" + } + }, "status": { "type": "string", "description": "pet status in the store", @@ -609,13 +598,6 @@ "pending", "sold" ] - }, - "tags": { - "type": "array", - "description": "The Tags.", - "items": { - "$ref": "#/components/schemas/Tag" - } } }, "description": "The type Pet." @@ -632,7 +614,27 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Tag." + }, + "ModelApiResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "The Code.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "The Type." + }, + "message": { + "type": "string", + "description": "The Message." + } + }, + "description": "The type Model api response." } }, "securitySchemes": { @@ -646,8 +648,8 @@ "implicit": { "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", "scopes": { - "read:pets": "read your pets", - "write:pets": "modify pets in your account" + "write:pets": "modify pets in your account", + "read:pets": "read your pets" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json index a0c5620f9..3a0de8a56 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json @@ -193,12 +193,12 @@ "requestBody": { "description": "Pet object that needs to be added to the store", "content": { - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } }, - "application/xml": { + "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } @@ -246,12 +246,12 @@ "requestBody": { "description": "Pet object that needs to be added to the store", "content": { - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } }, - "application/xml": { + "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } @@ -1163,7 +1163,8 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Category." }, "Pet": { "required": [ @@ -1223,7 +1224,8 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Tag." }, "Order": { "type": "object", From c1523b5265acc40cfd6af8f9493bd5eb28268d5a Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 30 Jun 2024 18:08:46 +0000 Subject: [PATCH 033/226] [maven-release-plugin] prepare release v2.6.0 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 05ca7eee9..0f2d9d8ba 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.5.1-SNAPSHOT + 2.6.0 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.6.0 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 94c8ccfce..bdd9a305d 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.1-SNAPSHOT + 2.6.0 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index d83221c8c..550254788 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.1-SNAPSHOT + 2.6.0 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 26ddadf7a..0f5a75883 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.1-SNAPSHOT + 2.6.0 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 8ffe7c7db..0fafe6f0b 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.1-SNAPSHOT + 2.6.0 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 1f1c56b89..3d5f5fd3d 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.5.1-SNAPSHOT + 2.6.0 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index f62280958..7db59be14 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.5.1-SNAPSHOT + 2.6.0 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 933aadce0..e4773b39b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.1-SNAPSHOT + 2.6.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index e719c73cf..62fe7665c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.1-SNAPSHOT + 2.6.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index c937bd6fe..6d65af1dc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.1-SNAPSHOT + 2.6.0 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 24f81f82c..059a207db 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.1-SNAPSHOT + 2.6.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index 34d734fdb..e3b01e3ba 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.1-SNAPSHOT + 2.6.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index 4435adfad..f37fe303c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.5.1-SNAPSHOT + 2.6.0 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index ca833c0ec..75a2200e1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.1-SNAPSHOT + 2.6.0 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index a657bd3df..5499ce7d1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.5.1-SNAPSHOT + 2.6.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 214de16ee..c16a98152 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.1-SNAPSHOT + 2.6.0 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 14818297f..d1fc090ec 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.5.1-SNAPSHOT + 2.6.0 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 9ef3caf3f..ee932d0be 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.5.1-SNAPSHOT + 2.6.0 springdoc-openapi-security-tests From e3dbc6456f3a504bef1ba8e3c904ed07f89516e1 Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 30 Jun 2024 18:08:49 +0000 Subject: [PATCH 034/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 0f2d9d8ba..1f9ec36f6 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.6.0 + 2.6.1-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.6.0 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index bdd9a305d..57c44e272 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.0 + 2.6.1-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 550254788..562ec249e 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.0 + 2.6.1-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 0f5a75883..36e6ace7b 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.0 + 2.6.1-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 0fafe6f0b..f5de73f8d 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.0 + 2.6.1-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 3d5f5fd3d..92eddc837 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.0 + 2.6.1-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 7db59be14..440bc47ea 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.6.0 + 2.6.1-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index e4773b39b..74161a620 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.0 + 2.6.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 62fe7665c..918854210 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.0 + 2.6.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 6d65af1dc..e301b3a62 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.0 + 2.6.1-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 059a207db..0e568d48e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.0 + 2.6.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index e3b01e3ba..958f81f36 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.0 + 2.6.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index f37fe303c..0f449016a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.6.0 + 2.6.1-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 75a2200e1..502e88fd4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.0 + 2.6.1-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 5499ce7d1..7fc945b12 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.6.0 + 2.6.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index c16a98152..e683450e5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.0 + 2.6.1-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index d1fc090ec..17ec9557c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.0 + 2.6.1-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index ee932d0be..06b551c15 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.6.0 + 2.6.1-SNAPSHOT springdoc-openapi-security-tests From 71a0684dc0eea2504f570aad90f5069319dfa061 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 30 Jun 2024 20:25:04 +0200 Subject: [PATCH 035/226] CHANGELOG.md prepare for 2.6.0 --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47b5a8111..1e00dfa30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.6.0] - 2024-06-30 + +### Added + +- #2561 - NPE occurs when outputting an OpenAPI document since 2.5.0 +- #2579 - Add support for leading tab characters with trim-kotlin-indent. +- #2589 - Pass HttpRequest to ServerBaseUrlCustomizer +- #2596, #2600 - consumes and produces calculation. Fixes +- #2625, #2626 - Replace Page schema with PagedModel when pageSerializationMode is set to VIA_DTO +- #2627 - Ensure compatibility with previous version of spring data +- #2576 - GroupedApi orders by displayName instead of name. +- #2584 - Dynamically define ApiGroups does not work. +- #2595 - Spring security support of @RegisteredOAuth2AuthorizedClient + +### Changed +- Upgrade spring-boot to 3.3.0 +- Upgrade swagger-core to 2.2.22 +- Upgrade swagger-ui to 5.17.14 +- Upgrade spring-cloud-function to 4.1.2 +- Upgrade spring-security-oauth2-authorization-server to 1.3.0 + +### Fixed +- #2577 - Fix missing exception response types in OpenAPI spec +- #2591 - When an entity class contains fields of Class type, an infinite loop. +- #2603 - PolymorphicModelConverter only handles direct subtypes and misses indirect. +- #2606 - Spring Authorization Server Metadata Endpoint not compatible. +- #2621 - Content-type for POST endpoints with multipart/form-data does not work since v2.4.0. +- #2622 - Kotlin enums are always marked as required if used in Java controllers. +- #2601 - Multiple Superclasses Are Not Mapped To Multiple allOf If Used In Different Services. +- #2597 - Polymorphic fields on polymorphic parents don't get correct oneOf docs generated. + ## [2.5.0] - 2024-04-01 ### Added From 4f62ea57f9d5399d44e9cfe3ff0b147c7f09111d Mon Sep 17 00:00:00 2001 From: Tao Sun Date: Wed, 17 Jul 2024 14:02:25 +0800 Subject: [PATCH 036/226] Add Encoding to multiple files and JSON payloads request test case. Fixes #2649 --- .../test/org/springdoc/api/v30/app119/HelloController.java | 5 ++++- .../src/test/resources/results/3.0.1/app119.json | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java index f403d4fce..22d058493 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java @@ -27,6 +27,8 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Encoding; +import io.swagger.v3.oas.annotations.parameters.RequestBody; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; @@ -44,7 +46,8 @@ public class HelloController { produces = MediaType.TEXT_PLAIN_VALUE) public String multiFilesInMultiPart( @RequestPart("params") - @Parameter( + @RequestBody(content = @Content(encoding = @Encoding(name="params", contentType=MediaType.APPLICATION_JSON_VALUE))) + @Parameter( description = "This is the configuration", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)) final JsonRequest jsonRequest, @RequestPart(value = "file1", required = false) @Parameter(description = "This is file1") final MultipartFile file1, diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app119.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app119.json index a377e00fb..5f03c5312 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app119.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app119.json @@ -41,6 +41,11 @@ "$ref": "#/components/schemas/JsonRequest" } } + }, + "encoding": { + "params": { + "contentType": "application/json" + } } } } From 08e6ad4646815772a7daf0c067289c64dc06c06b Mon Sep 17 00:00:00 2001 From: Tao Sun Date: Thu, 18 Jul 2024 14:52:44 +0800 Subject: [PATCH 037/226] Replace space with tab --- .../java/test/org/springdoc/api/v30/app119/HelloController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java index 22d058493..6a0385656 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java @@ -47,7 +47,7 @@ public class HelloController { public String multiFilesInMultiPart( @RequestPart("params") @RequestBody(content = @Content(encoding = @Encoding(name="params", contentType=MediaType.APPLICATION_JSON_VALUE))) - @Parameter( + @Parameter( description = "This is the configuration", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)) final JsonRequest jsonRequest, @RequestPart(value = "file1", required = false) @Parameter(description = "This is file1") final MultipartFile file1, From 4fd4344764f278a22df15ba7ec8593c176301b24 Mon Sep 17 00:00:00 2001 From: e-build Date: Tue, 23 Jul 2024 17:40:21 +0900 Subject: [PATCH 038/226] modify test for springdoc.trim-kotlin-indent --- .../springdoc/api/app11/ExampleController.kt | 72 +++++++++++++++- .../src/test/resources/results/app11.json | 82 ++++++++++++++++++- 2 files changed, 148 insertions(+), 6 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/ExampleController.kt index c6cc0a45d..79116e0b4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/ExampleController.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/ExampleController.kt @@ -1,7 +1,9 @@ package test.org.springdoc.api.app11 import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Schema import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RestController @@ -20,11 +22,75 @@ class ExampleController { | 400 | STORE_NOT_FOUND |Store not found. | | | """ ) - @GetMapping("/foo/remove-kotlin-indent") + @GetMapping("/foo/trim-kotlin-indent") fun readFoo(@RequestParam name: String?) = FooResponse("Hello ${name ?: "world"}") } data class FooResponse( - private val name: String, -) \ No newline at end of file + val name: String, +) + +@RestController +class ExampleController2 { + + @GetMapping("/foo/trim-kotlin-indent/schema") + fun readFoo( + @RequestBody request: FooRequestWithSchema, + ) = FooResponseWithSchema( + name = "Hello ${request.age ?: "world"}", + subFoo = SubFooResponseWithSchema(subName = "sub foo name"), + ) +} + +@Schema( + name = "foo request", + description = """ + foo request class description + with kotlin indent + """ +) +data class FooRequestWithSchema( + @Schema( + name = "age", + description = """ + foo request field with kotlin indent + """ + ) + val age: Int, +) + +@Schema( + name = "foo response", + description = """ + foo response class description + with kotlin indent + """ +) +data class FooResponseWithSchema( + @Schema( + name = "name", + description = """ + foo response fields with kotlin indent + """ + ) + val name: String, + val subFoo: SubFooResponseWithSchema +) + +@Schema( + name = "sub foo response", + description = """ + sub foo response class description + with kotlin indent + """ +) +data class SubFooResponseWithSchema( + @Schema( + name = "subName", + description = """ + sub foo response fields with kotlin indent + """ + ) + val subName: String, +) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app11.json index 13425c05a..a19d2fca6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app11.json +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app11.json @@ -11,7 +11,7 @@ } ], "paths": { - "/foo/remove-kotlin-indent": { + "/foo/trim-kotlin-indent": { "get": { "tags": [ "example-controller" @@ -42,18 +42,94 @@ } } } + }, + "/foo/trim-kotlin-indent/schema": { + "get": { + "tags": [ + "example-controller-2" + ], + "operationId": "readFoo_1", + "parameters": [ + { + "name": "request", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/foo request" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/foo response" + } + } + } + } + } + } } }, "components": { "schemas": { "FooResponse": { + "required": [ + "name" + ], "type": "object", "properties": { "name": { - "type": "string", - "writeOnly": true + "type": "string" } } + }, + "foo request": { + "required": [ + "age" + ], + "type": "object", + "properties": { + "age": { + "type": "integer", + "description": "\nfoo request field with kotlin indent\n", + "format": "int32" + } + }, + "description": "\nfoo request class description\nwith kotlin indent\n" + }, + "foo response": { + "required": [ + "name", + "subFoo" + ], + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "\nfoo response fields with kotlin indent\n" + }, + "subFoo": { + "$ref": "#/components/schemas/sub foo response" + } + }, + "description": "\nfoo response class description\nwith kotlin indent\n" + }, + "sub foo response": { + "required": [ + "subName" + ], + "type": "object", + "properties": { + "subName": { + "type": "string", + "description": "\nsub foo response fields with kotlin indent\n" + } + }, + "description": "\nsub foo response class description\nwith kotlin indent\n" } } } From c80f191895b0d0af29705b002c70d60e282c9312 Mon Sep 17 00:00:00 2001 From: e-build Date: Tue, 23 Jul 2024 17:40:31 +0900 Subject: [PATCH 039/226] apply 'springdoc.trim-kotlin-indent' to schema annotation properties --- .../api/AbstractOpenApiResource.java | 60 ++++++++++++++++++- .../core/service/OperationService.java | 8 +++ .../core/utils/PropertyResolverUtils.java | 32 +++++----- 3 files changed, 82 insertions(+), 18 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 2dda6e1c2..90e3a20c2 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -69,6 +69,7 @@ import io.swagger.v3.oas.models.PathItem.HttpMethod; import io.swagger.v3.oas.models.Paths; import io.swagger.v3.oas.models.SpecVersion; +import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.responses.ApiResponses; @@ -100,6 +101,7 @@ import org.springdoc.core.service.GenericResponseService; import org.springdoc.core.service.OpenAPIService; import org.springdoc.core.service.OperationService; +import org.springdoc.core.utils.PropertyResolverUtils; import org.springdoc.core.utils.SpringDocUtils; import org.springframework.aop.support.AopUtils; @@ -352,6 +354,9 @@ protected OpenAPI getOpenApi(Locale locale) { } getPaths(mappingsMap, finalLocale, openAPI); + if (springDocConfigProperties.isTrimKotlinIndent()) + this.trimIndent(openAPI); + Optional cloudFunctionProviderOptional = springDocProviders.getSpringCloudFunctionProvider(); cloudFunctionProviderOptional.ifPresent(cloudFunctionProvider -> { List routerOperationList = cloudFunctionProvider.getRouterOperations(openAPI); @@ -384,7 +389,6 @@ protected OpenAPI getOpenApi(Locale locale) { if (!CollectionUtils.isEmpty(openAPI.getServers()) && !openAPI.getServers().equals(serversCopy)) openAPIService.setServersPresent(true); - openAPIService.setCachedOpenAPI(openAPI, finalLocale); LOGGER.info("Init duration for springdoc-openapi is: {} ms", @@ -396,12 +400,62 @@ protected OpenAPI getOpenApi(Locale locale) { openAPIService.updateServers(openAPI); } openAPIService.updateServers(openAPI); - return openAPI; } - finally { + return openAPI; + } finally { this.reentrantLock.unlock(); } } + private void trimIndent(OpenAPI openAPI) { + trimComponents(openAPI); + trimPaths(openAPI); + } + + private void trimComponents(OpenAPI openAPI) { + final PropertyResolverUtils propertyResolverUtils = operationParser.getPropertyResolverUtils(); + if (openAPI.getComponents() == null || openAPI.getComponents().getSchemas() == null) { + return; + } + for (Schema schema : openAPI.getComponents().getSchemas().values()) { + schema.description(propertyResolverUtils.trimIndent(schema.getDescription())); + if (schema.getProperties() == null) { + continue; + } + for (Object prop : schema.getProperties().values()) { + if (prop instanceof Schema schemaProp) { + schemaProp.setDescription(propertyResolverUtils.trimIndent(schemaProp.getDescription())); + } + } + } + } + + private void trimPaths(OpenAPI openAPI) { + final PropertyResolverUtils propertyResolverUtils = operationParser.getPropertyResolverUtils(); + if (openAPI.getPaths() == null) { + return; + } + for (PathItem value : openAPI.getPaths().values()) { + value.setDescription(propertyResolverUtils.trimIndent(value.getDescription())); + trimIndentOperation(value.getGet()); + trimIndentOperation(value.getPut()); + trimIndentOperation(value.getPost()); + trimIndentOperation(value.getDelete()); + trimIndentOperation(value.getOptions()); + trimIndentOperation(value.getHead()); + trimIndentOperation(value.getPatch()); + trimIndentOperation(value.getTrace()); + } + } + + private void trimIndentOperation(Operation operation) { + final PropertyResolverUtils propertyResolverUtils = operationParser.getPropertyResolverUtils(); + if (operation == null) { + return; + } + operation.setSummary(propertyResolverUtils.trimIndent(operation.getSummary())); + operation.setDescription(propertyResolverUtils.trimIndent(operation.getDescription())); + } + /** * Gets paths. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java index 5a539b6b8..9f91dd18c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java @@ -646,4 +646,12 @@ public Operation mergeOperation(Operation operation, Operation operationModel) { public JavadocProvider getJavadocProvider() { return parameterBuilder.getJavadocProvider(); } + + /** + * Gets propertyResolverUtils + * @return propertyResolverUtils + */ + public PropertyResolverUtils getPropertyResolverUtils(){ + return parameterBuilder.getPropertyResolverUtils(); + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java index dfa282e82..88993014c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java @@ -99,9 +99,6 @@ public String resolve(String parameterProperty, Locale locale) { } if (parameterProperty.equals(result)) try { - if (springDocConfigProperties.isTrimKotlinIndent()) { - parameterProperty = trimIndent(parameterProperty); - } result = factory.resolveEmbeddedValue(parameterProperty); } catch (IllegalArgumentException ex) { @@ -119,18 +116,23 @@ public String resolve(String parameterProperty, Locale locale) { * @param text The original string with possible leading indentation. * @return The string with leading indentation removed from each line. */ - private String trimIndent(String text) { - if (text == null) { - return null; + public String trimIndent(String text) { + try { + if (text == null) { + return null; + } + final String newLine = "\n"; + String[] lines = text.split(newLine); + int minIndent = resolveMinIndent(lines); + return Arrays.stream(lines) + .map(line -> line.substring(Math.min(line.length(), minIndent))) + .reduce((a, b) -> a + newLine + b) + .orElse(StringUtils.EMPTY); + } catch (Exception ex){ + LOGGER.warn(ex.getMessage()); + return text; } - final String newLine = "\n"; - String[] lines = text.split(newLine); - int minIndent = resolveMinIndent(lines); - return Arrays.stream(lines) - .map(line -> line.substring(Math.min(line.length(), minIndent))) - .reduce((a, b) -> a + newLine + b) - .orElse(StringUtils.EMPTY); - } + } private int resolveMinIndent(String[] lines) { return Arrays.stream(lines) @@ -222,4 +224,4 @@ public Map resolveExtensions(Locale locale, Map else return extensions; } -} +} \ No newline at end of file From 73a1904b7bce91cfcbe760084a5a2dcbc237a362 Mon Sep 17 00:00:00 2001 From: e-build Date: Tue, 23 Jul 2024 18:01:07 +0900 Subject: [PATCH 040/226] add comment implementation 'springdoc.trim-kotlin-indent' --- .../springdoc/api/AbstractOpenApiResource.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 90e3a20c2..353f86cf5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -406,11 +406,19 @@ protected OpenAPI getOpenApi(Locale locale) { } } + /** + * Indents are removed for properties that are mainly used as “explanations” using Open API. + * @param openAPI the open api + */ private void trimIndent(OpenAPI openAPI) { trimComponents(openAPI); trimPaths(openAPI); } + /** + * Trim the indent for descriptions in the 'components' of open api. + * @param openAPI the open api + */ private void trimComponents(OpenAPI openAPI) { final PropertyResolverUtils propertyResolverUtils = operationParser.getPropertyResolverUtils(); if (openAPI.getComponents() == null || openAPI.getComponents().getSchemas() == null) { @@ -429,6 +437,10 @@ private void trimComponents(OpenAPI openAPI) { } } + /** + * Trim the indent for descriptions in the 'paths' of open api. + * @param openAPI the open api + */ private void trimPaths(OpenAPI openAPI) { final PropertyResolverUtils propertyResolverUtils = operationParser.getPropertyResolverUtils(); if (openAPI.getPaths() == null) { @@ -447,6 +459,10 @@ private void trimPaths(OpenAPI openAPI) { } } + /** + * Trim the indent for 'operation' + * @param operation the operation + */ private void trimIndentOperation(Operation operation) { final PropertyResolverUtils propertyResolverUtils = operationParser.getPropertyResolverUtils(); if (operation == null) { From 51ced5408f454b446407d9e221932912b6a1738b Mon Sep 17 00:00:00 2001 From: YunByungil Date: Fri, 26 Jul 2024 17:14:49 +0900 Subject: [PATCH 041/226] fix: typo in SpringSecurityLoginEndpointCustomizer method name --- .../core/configuration/SpringDocSecurityConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java index d577f12fd..a678298cb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java @@ -110,7 +110,7 @@ class SpringSecurityLoginEndpointConfiguration { @Bean @ConditionalOnProperty(SPRINGDOC_SHOW_LOGIN_ENDPOINT) @Lazy(false) - OpenApiCustomizer springSecurityLoginEndpointCustomiser(ApplicationContext applicationContext) { + OpenApiCustomizer springSecurityLoginEndpointCustomizer(ApplicationContext applicationContext) { FilterChainProxy filterChainProxy = applicationContext.getBean(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME, FilterChainProxy.class); return openAPI -> { for (SecurityFilterChain filterChain : filterChainProxy.getFilterChains()) { @@ -203,6 +203,6 @@ class SpringDocSecurityOAuth2ClientConfiguration { getConfig() .addAnnotationsToIgnore(RegisteredOAuth2AuthorizedClient.class); } - + } } \ No newline at end of file From dc5d1d1e78b93e065cbf1314f9ba9ddc22e8415f Mon Sep 17 00:00:00 2001 From: YunByungil Date: Fri, 26 Jul 2024 17:56:02 +0900 Subject: [PATCH 042/226] fix: update response code Updated the response code for login failures from 403 Frobidden to 401 UnAuthorized to more accurately reflect the correct HTTP status code for authentication failures. --- .../core/configuration/SpringDocSecurityConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java index d577f12fd..cec8604ed 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java @@ -147,7 +147,7 @@ OpenApiCustomizer springSecurityLoginEndpointCustomiser(ApplicationContext appli operation.requestBody(requestBody); ApiResponses apiResponses = new ApiResponses(); apiResponses.addApiResponse(String.valueOf(HttpStatus.OK.value()), new ApiResponse().description(HttpStatus.OK.getReasonPhrase())); - apiResponses.addApiResponse(String.valueOf(HttpStatus.FORBIDDEN.value()), new ApiResponse().description(HttpStatus.FORBIDDEN.getReasonPhrase())); + apiResponses.addApiResponse(String.valueOf(HttpStatus.UNAUTHORIZED.value()), new ApiResponse().description(HttpStatus.FORBIDDEN.getReasonPhrase())); operation.responses(apiResponses); operation.addTagsItem("login-endpoint"); PathItem pathItem = new PathItem().post(operation); From 451edeb29eb0d25fa13149274d591b86f1dc7c4b Mon Sep 17 00:00:00 2001 From: YunByungil Date: Fri, 26 Jul 2024 20:49:20 +0900 Subject: [PATCH 043/226] fix: update response code Updated the response code for login failures from 403 Frobidden to 401 UnAuthorized to more accurately reflect the correct HTTP status code for authentication failures. --- .../core/configuration/SpringDocSecurityConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java index cec8604ed..c12638356 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java @@ -147,7 +147,7 @@ OpenApiCustomizer springSecurityLoginEndpointCustomiser(ApplicationContext appli operation.requestBody(requestBody); ApiResponses apiResponses = new ApiResponses(); apiResponses.addApiResponse(String.valueOf(HttpStatus.OK.value()), new ApiResponse().description(HttpStatus.OK.getReasonPhrase())); - apiResponses.addApiResponse(String.valueOf(HttpStatus.UNAUTHORIZED.value()), new ApiResponse().description(HttpStatus.FORBIDDEN.getReasonPhrase())); + apiResponses.addApiResponse(String.valueOf(HttpStatus.UNAUTHORIZED.value()), new ApiResponse().description(HttpStatus.UNAUTHORIZED.getReasonPhrase())); operation.responses(apiResponses); operation.addTagsItem("login-endpoint"); PathItem pathItem = new PathItem().post(operation); From e470c211f1d031d15666dfa0492811ae55270231 Mon Sep 17 00:00:00 2001 From: zinzo Date: Wed, 31 Jul 2024 12:56:56 +0900 Subject: [PATCH 044/226] Refactor Replace hardcoded schema prefix length --- .../core/customizers/JavadocPropertyCustomizer.java | 3 ++- .../springdoc/core/service/GenericParameterService.java | 2 +- .../org/springdoc/core/utils/SpringDocDataRestUtils.java | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java index e81ea2225..3b219f199 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java @@ -24,6 +24,7 @@ package org.springdoc.core.customizers; +import io.swagger.v3.oas.models.Components; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; @@ -95,7 +96,7 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato setJavadocDescription(cls, fields, clsProperties, existingSchema, false); } else if (resolvedSchema != null && resolvedSchema.get$ref() != null && resolvedSchema.get$ref().contains(AnnotationsUtils.COMPONENTS_REF)) { - String schemaName = resolvedSchema.get$ref().substring(21); + String schemaName = resolvedSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); Schema existingSchema = context.getDefinedModels().get(schemaName); setJavadocDescription(cls, fields, clsProperties, existingSchema, false); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index f9bfad87a..458a9331c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -407,7 +407,7 @@ private Schema calculateRequestBodySchema(Components components, ParameterInfo p if (schemaN != null && StringUtils.isEmpty(schemaN.getDescription()) && parameterInfo.getParameterModel() != null) { String description = parameterInfo.getParameterModel().getDescription(); if (schemaN.get$ref() != null && schemaN.get$ref().contains(AnnotationsUtils.COMPONENTS_REF)) { - String key = schemaN.get$ref().substring(21); + String key = schemaN.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); Schema existingSchema = components.getSchemas().get(key); if (!StringUtils.isEmpty(description)) existingSchema.setDescription(description); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java index 79ce8f660..79b9047e5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java @@ -161,7 +161,7 @@ private void updateApiResponse(OpenAPI openAPI, Components components, ApiRespon apiResponse.getContent().values().forEach(mediaType -> { Schema schema = mediaType.getSchema(); if (schema.get$ref() != null && !schema.get$ref().endsWith(RESPONSE)) { - String key = schema.get$ref().substring(21); + String key = schema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); Set entitiesNames = entityInoMap.keySet(); entitiesNames.forEach(entityName -> { if (key.endsWith(entityName)) @@ -184,7 +184,7 @@ private void updateRequestBody(OpenAPI openAPI, RequestBody requestBody, boolean requestBody.getContent().values().forEach(mediaType -> { Schema schema = mediaType.getSchema(); if (schema.get$ref() != null && !schema.get$ref().endsWith(REQUEST_BODY)) { - String key = schema.get$ref().substring(21); + String key = schema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); if (entityInoMap.containsKey(key)) updateRequestBodySchema(key, schema, openAPI.getComponents(), openapi31); } @@ -285,7 +285,7 @@ private void updateResponseSchemaEmbedded(Components components, EntityInfo enti Schema itemsSchema = arraySchema.getItems(); Set entitiesNames = entityInoMap.keySet(); if (itemsSchema.get$ref() != null && !itemsSchema.get$ref().endsWith(RESPONSE)) { - String key = itemsSchema.get$ref().substring(21); + String key = itemsSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); if (entitiesNames.contains(key)) { String newKey = itemsSchema.get$ref() + RESPONSE; createNewResponseSchema(key, components, openapi31); @@ -380,7 +380,7 @@ private void updateKey(List allSchemas, String suffix, Components compon if (!CollectionUtils.isEmpty(allSchemas)) for (Schema allSchema : allSchemas) { if (allSchema.get$ref() != null) { - String allKey = allSchema.get$ref().substring(21); + String allKey = allSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); updateSingleKey(suffix, components, allSchema, allKey, openapi31); } } From 2af86262019481dfe08d5e8ea7660ebbc5a2f773 Mon Sep 17 00:00:00 2001 From: Dmitry Lebedko Date: Sun, 4 Aug 2024 14:54:18 +0200 Subject: [PATCH 045/226] Replace swagger urls in `org.springdoc.core.properties.AbstractSwaggerUiConfigProperties.urls` only if url is changed. Test to check if the issue is fixed. Fixes #2509. --- .../springdoc/ui/AbstractSwaggerWelcome.java | 19 ++-- ...ltipleUrlsSeveralParallelRequestsTest.java | 89 +++++++++++++++++++ 2 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java index 888e80a62..b8aaaede7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java @@ -33,6 +33,8 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.util.UriComponentsBuilder; +import java.util.Objects; + import static org.springdoc.core.utils.Constants.SWAGGER_UI_OAUTH_REDIRECT_URL; import static org.springdoc.core.utils.Constants.SWAGGER_UI_URL; import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; @@ -134,12 +136,17 @@ else if (swaggerUiConfigParameters.isValidUrl(swaggerUiUrl)) else swaggerUiConfigParameters.addUrl(apiDocsUrl); if (!CollectionUtils.isEmpty(swaggerUiConfig.getUrls())) { - swaggerUiConfig.cloneUrls().forEach(swaggerUrl -> { - swaggerUiConfigParameters.getUrls().remove(swaggerUrl); - if (!swaggerUiConfigParameters.isValidUrl(swaggerUrl.getUrl())) - swaggerUrl.setUrl(buildUrlWithContextPath(swaggerUrl.getUrl())); - swaggerUiConfigParameters.getUrls().add(swaggerUrl); - }); + swaggerUiConfig.cloneUrls() + .stream() + .filter(swaggerUrl -> !swaggerUiConfigParameters.isValidUrl(swaggerUrl.getUrl())) + .forEach(swaggerUrl -> { + final var url = buildUrlWithContextPath(swaggerUrl.getUrl()); + if (!Objects.equals(url, swaggerUrl.getUrl())) { + swaggerUiConfigParameters.getUrls().remove(swaggerUrl); + swaggerUrl.setUrl(url); + swaggerUiConfigParameters.getUrls().add(swaggerUrl); + } + }); } } calculateOauth2RedirectUrl(uriComponentsBuilder); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java new file mode 100644 index 000000000..2b08b7038 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java @@ -0,0 +1,89 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.ui.app8; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.ui.AbstractSpringDocTest; + +import java.util.concurrent.CompletableFuture; +import java.util.stream.Stream; + +import static java.util.concurrent.CompletableFuture.allOf; +import static java.util.concurrent.CompletableFuture.runAsync; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The test to make sure no race condition issues are present when several parallel requests + * are sent to get Swagger config. + * + * @author Dmitry Lebedko (lebedko.dmitrii@gmail.com) + */ +@TestPropertySource(properties = { + "springdoc.swagger-ui.urls[0].name=first-user-list", + "springdoc.swagger-ui.urls[0].url=/api-docs.yaml", + "springdoc.swagger-ui.urls[1].name=second-user-list", + "springdoc.swagger-ui.urls[1].url=/api-docs.yaml", + "springdoc.swagger-ui.urls[2].name=third-user-list", + "springdoc.swagger-ui.urls[2].url=/api-docs.yaml" +}) +public class SpringDocApp8MultipleUrlsSeveralParallelRequestsTest extends AbstractSpringDocTest { + + private static final int PARALLEL_REQUEST_NUMBER = 100; + + /** + * Sends {@link SpringDocApp8MultipleUrlsSeveralParallelRequestsTest#PARALLEL_REQUEST_NUMBER} requests + * simultaneously to make sure no race condition issues are present. + */ + @Test + public void swagger_config_for_multiple_groups_and_many_parallel_requests() { + assertDoesNotThrow(() -> { + allOf(Stream.generate(() -> runAsync(() -> { + try { + mockMvc.perform(get("/v3/api-docs/swagger-config")) + .andExpect(status().isOk()) + .andExpect(jsonPath("configUrl", equalTo("/v3/api-docs/swagger-config"))) + .andExpect(jsonPath("url").doesNotExist()) + .andExpect(jsonPath("urls.length()", equalTo(3))) + .andExpect(jsonPath("urls[0].url", equalTo("/api-docs.yaml"))) + .andExpect(jsonPath("urls[0].name", equalTo("first-user-list"))) + .andExpect(jsonPath("urls[1].url", equalTo("/api-docs.yaml"))) + .andExpect(jsonPath("urls[1].name", equalTo("second-user-list"))) + .andExpect(jsonPath("urls[2].url", equalTo("/api-docs.yaml"))) + .andExpect(jsonPath("urls[2].name", equalTo("third-user-list"))); + } catch (Exception e) { + throw new RuntimeException(e); + } + })) + .limit(PARALLEL_REQUEST_NUMBER) + .toArray(CompletableFuture[]::new)) + .join(); + }, "Swagger config is supposed to be delivered successfully " + + "no matter how many parallel requests are sent"); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file From da0eb3e689b2754c65b0ac08e6a373f051977fc4 Mon Sep 17 00:00:00 2001 From: Dmitry Lebedko Date: Sun, 4 Aug 2024 16:09:42 +0200 Subject: [PATCH 046/226] Javadocs updated. --- .../SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java index 2b08b7038..76ffa29a8 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java @@ -35,7 +35,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** - * The test to make sure no race condition issues are present when several parallel requests + * The test to make sure no exceptions are thrown when several parallel requests * are sent to get Swagger config. * * @author Dmitry Lebedko (lebedko.dmitrii@gmail.com) @@ -54,7 +54,7 @@ public class SpringDocApp8MultipleUrlsSeveralParallelRequestsTest extends Abstra /** * Sends {@link SpringDocApp8MultipleUrlsSeveralParallelRequestsTest#PARALLEL_REQUEST_NUMBER} requests - * simultaneously to make sure no race condition issues are present. + * simultaneously to make sure no exceptions are thrown when getting Swagger config. */ @Test public void swagger_config_for_multiple_groups_and_many_parallel_requests() { From 21005700762927e8af89fbd84e67e0718f6e4318 Mon Sep 17 00:00:00 2001 From: Dmitry Lebedko Date: Mon, 5 Aug 2024 16:55:42 +0200 Subject: [PATCH 047/226] Fix `SpringDocApp193Test` for Java 21 and above. In Java 21 the `getFirst()` and `getLast()`` methods were added to the `java.util.List` interface. Those are the POJO getters, therefore Jackson will add them during serialization. So there are two different expected results for Java prior 21 and starting from Java 21. Fixes #2442. --- .../api/v30/app193/SpringDocApp193Test.java | 31 +++- .../resources/results/3.0.1/app193-1.json | 158 ++++++++++++++++++ 2 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app193-1.json diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java index c0b0c0f38..812d346c7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java @@ -23,12 +23,37 @@ package test.org.springdoc.api.v30.app193; -import test.org.springdoc.api.v30.AbstractSpringDocV30Test; +import org.apache.commons.lang3.JavaVersion; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.web.servlet.MvcResult; +import test.org.springdoc.api.AbstractCommonTest; import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp193Test extends AbstractSpringDocV30Test { +import static org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast; +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest +public class SpringDocApp193Test extends AbstractCommonTest { + + @Test + public void testApp() throws Exception { + final MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + final String result = mockMvcResult.getResponse().getContentAsString(); + // In Java 21 the getFirst() and getLast() methods were added to the List interface. + // Those are the POJO getters, therefore Jackson will add them during serialization. + // So there are two different expected results for Java prior 21 and starting from Java 21. + final var expectedResponseFile = isJavaVersionAtLeast(JavaVersion.JAVA_21) ? "app193-1.json" : "app193.json"; + final String expected = getContent("results/3.0.1/" + expectedResponseFile); + assertEquals(expected, result, true); + } @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app193-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app193-1.json new file mode 100644 index 000000000..e3a0dfd38 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app193-1.json @@ -0,0 +1,158 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "basic-controller" + ], + "summary": "get", + "description": "Provides a list of books.", + "operationId": "get", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Books" + } + ] + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "basic-controller" + ], + "summary": "get1", + "description": "Provides an animal.", + "operationId": "get1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Cat" + }, + { + "$ref": "#/components/schemas/Dog" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": + { + "type": "object", + "properties": + { + "title": + { + "type": "string" + } + }, + "description": "Represents a Book." + }, + "Books": { + "type": "array", + "description": "Represents a list of Books.", + "allOf": [ + { + "$ref": "#/components/schemas/Knowledge" + }, + { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "first": + { + "$ref": "#/components/schemas/Book" + }, + "last": + { + "$ref": "#/components/schemas/Book" + } + } + } + ] + }, + "Knowledge": { + "type": "object", + "description": "Represents the knowledge." + }, + "Animal": { + "type": "object", + "description": "Represents an Animal class." + }, + "Cat": { + "type": "object", + "description": "Represents a Cat class.", + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "speed": { + "type": "integer", + "format": "int32" + } + } + } + ] + }, + "Dog": { + "type": "object", + "description": "Represents a Dog class.", + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + } + } + ] + } + } + } +} From 2ad1ce0cc60c14950eb33bfaab7d6e3b499499c2 Mon Sep 17 00:00:00 2001 From: limehee Date: Thu, 8 Aug 2024 12:00:02 +0900 Subject: [PATCH 048/226] Ensure default media type is prioritized in SpringDoc configuration (Fixes #2671) --- .../core/models/MethodAttributes.java | 12 ++-- .../core/model/MethodAttributesTest.java | 64 +++++++++++++++++++ 2 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java index 433df153a..8a90530f3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java @@ -26,8 +26,8 @@ import java.lang.reflect.Method; import java.util.Arrays; -import java.util.HashSet; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.Locale; import java.util.Map; import java.util.Set; @@ -305,11 +305,11 @@ private void fillMethods(String[] produces, String[] consumes, String[] headers) * @param array2 the array2 * @return the string [ ] */ - private String[] mergeArrays(@Nullable String[] array1, String[] array2) { - Set uniqueValues = array1 == null ? new HashSet<>() : Arrays.stream(array1).collect(Collectors.toSet()); - uniqueValues.addAll(Arrays.asList(array2)); - return uniqueValues.toArray(new String[0]); - } + public String[] mergeArrays(@Nullable String[] array1, String[] array2) { + Set uniqueValues = array1 == null ? new LinkedHashSet<>() : Arrays.stream(array1).collect(Collectors.toCollection(LinkedHashSet::new)); + uniqueValues.addAll(Arrays.asList(array2)); + return uniqueValues.toArray(new String[0]); + } /** * Is method overloaded boolean. diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java new file mode 100644 index 000000000..d002270e7 --- /dev/null +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java @@ -0,0 +1,64 @@ +package org.springdoc.core.model; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.MethodAttributes; + +import java.lang.reflect.Method; +import java.util.Locale; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; + +public class MethodAttributesTest { + + @Test + public void testMergeArrays() { + MethodAttributes methodAttributes = new MethodAttributes("application/json", "application/xml", Locale.ENGLISH); + + String[] array1 = {"application/json", "application/xml"}; + String[] array2 = {"application/xml", "application/yaml"}; + + String[] expected = {"application/json", "application/xml", "application/yaml"}; + String[] result = methodAttributes.mergeArrays(array1, array2); + + assertArrayEquals(expected, result); + } + + @Test + public void testMergeArraysWithNullArray1() { + MethodAttributes methodAttributes = new MethodAttributes("application/json", "application/xml", Locale.ENGLISH); + + String[] array1 = null; + String[] array2 = {"application/xml", "application/yaml"}; + + String[] expected = {"application/xml", "application/yaml"}; + String[] result = methodAttributes.mergeArrays(array1, array2); + + assertArrayEquals(expected, result); + } + + @Test + public void testDefaultProducesMediaType() { + MethodAttributes methodAttributes = new MethodAttributes("application/json", "application/xml", Locale.ENGLISH); + + Method method = this.getClass().getDeclaredMethods()[0]; + methodAttributes.calculateConsumesProduces(method); + + String[] expectedProduces = {"application/xml"}; + String[] resultProduces = methodAttributes.getMethodProduces(); + + assertArrayEquals(expectedProduces, resultProduces); + } + + @Test + public void testDefaultConsumesMediaType() { + MethodAttributes methodAttributes = new MethodAttributes("application/json", "application/xml", Locale.ENGLISH); + + Method method = this.getClass().getDeclaredMethods()[0]; + methodAttributes.calculateConsumesProduces(method); + + String[] expectedConsumes = {"application/json"}; + String[] resultConsumes = methodAttributes.getMethodConsumes(); + + assertArrayEquals(expectedConsumes, resultConsumes); + } +} From ca438abb912eceee23645f7a5fe683e528c5458a Mon Sep 17 00:00:00 2001 From: limehee Date: Thu, 8 Aug 2024 12:56:22 +0900 Subject: [PATCH 049/226] test: Use Reflection to test private mergeArrays method in MethodAttributes --- .../springdoc/core/models/MethodAttributes.java | 2 +- .../core/model/MethodAttributesTest.java | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java index 8a90530f3..ce26b40a0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java @@ -305,7 +305,7 @@ private void fillMethods(String[] produces, String[] consumes, String[] headers) * @param array2 the array2 * @return the string [ ] */ - public String[] mergeArrays(@Nullable String[] array1, String[] array2) { + private String[] mergeArrays(@Nullable String[] array1, String[] array2) { Set uniqueValues = array1 == null ? new LinkedHashSet<>() : Arrays.stream(array1).collect(Collectors.toCollection(LinkedHashSet::new)); uniqueValues.addAll(Arrays.asList(array2)); return uniqueValues.toArray(new String[0]); diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java index d002270e7..bec69db22 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java @@ -11,27 +11,33 @@ public class MethodAttributesTest { @Test - public void testMergeArrays() { + public void testMergeArrays() throws Exception { MethodAttributes methodAttributes = new MethodAttributes("application/json", "application/xml", Locale.ENGLISH); String[] array1 = {"application/json", "application/xml"}; String[] array2 = {"application/xml", "application/yaml"}; String[] expected = {"application/json", "application/xml", "application/yaml"}; - String[] result = methodAttributes.mergeArrays(array1, array2); + + Method mergeArraysMethod = MethodAttributes.class.getDeclaredMethod("mergeArrays", String[].class, String[].class); + mergeArraysMethod.setAccessible(true); + String[] result = (String[]) mergeArraysMethod.invoke(methodAttributes, (Object) array1, (Object) array2); assertArrayEquals(expected, result); } @Test - public void testMergeArraysWithNullArray1() { + public void testMergeArraysWithNullArray1() throws Exception { MethodAttributes methodAttributes = new MethodAttributes("application/json", "application/xml", Locale.ENGLISH); String[] array1 = null; String[] array2 = {"application/xml", "application/yaml"}; String[] expected = {"application/xml", "application/yaml"}; - String[] result = methodAttributes.mergeArrays(array1, array2); + + Method mergeArraysMethod = MethodAttributes.class.getDeclaredMethod("mergeArrays", String[].class, String[].class); + mergeArraysMethod.setAccessible(true); + String[] result = (String[]) mergeArraysMethod.invoke(methodAttributes, (Object) array1, (Object) array2); assertArrayEquals(expected, result); } @@ -61,4 +67,4 @@ public void testDefaultConsumesMediaType() { assertArrayEquals(expectedConsumes, resultConsumes); } -} +} \ No newline at end of file From 570e367b4ad4b51cb2efc80815b3a97aad8cba74 Mon Sep 17 00:00:00 2001 From: Dmitry Lebedko Date: Sun, 18 Aug 2024 15:20:12 +0200 Subject: [PATCH 050/226] Avoid mutation of `org.springdoc.core.properties.AbstractSwaggerUiConfigProperties.urls` and replace it with mutation of `org.springdoc.core.properties.AbstractSwaggerUiConfigProperties.SwaggerUrl.url` when necessary. Enhance `SpringDocApp8MultipleUrlsSeveralParallelRequestsTest` by specifying custom servlet path to check no exception is thrown. --- .../java/org/springdoc/ui/AbstractSwaggerWelcome.java | 7 ++++--- ...ngDocApp8MultipleUrlsSeveralParallelRequestsTest.java | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java index b8aaaede7..40b3e24d6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java @@ -142,9 +142,10 @@ else if (swaggerUiConfigParameters.isValidUrl(swaggerUiUrl)) .forEach(swaggerUrl -> { final var url = buildUrlWithContextPath(swaggerUrl.getUrl()); if (!Objects.equals(url, swaggerUrl.getUrl())) { - swaggerUiConfigParameters.getUrls().remove(swaggerUrl); - swaggerUrl.setUrl(url); - swaggerUiConfigParameters.getUrls().add(swaggerUrl); + swaggerUiConfigParameters.getUrls() + .stream() + .filter(swaggerUrl::equals) + .forEach(subUrl -> subUrl.setUrl(url)); } }); } diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java index 76ffa29a8..b2360c1b4 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java @@ -41,6 +41,7 @@ * @author Dmitry Lebedko (lebedko.dmitrii@gmail.com) */ @TestPropertySource(properties = { + "spring.mvc.servlet.path=/servlet-path", "springdoc.swagger-ui.urls[0].name=first-user-list", "springdoc.swagger-ui.urls[0].url=/api-docs.yaml", "springdoc.swagger-ui.urls[1].name=second-user-list", @@ -63,14 +64,14 @@ public void swagger_config_for_multiple_groups_and_many_parallel_requests() { try { mockMvc.perform(get("/v3/api-docs/swagger-config")) .andExpect(status().isOk()) - .andExpect(jsonPath("configUrl", equalTo("/v3/api-docs/swagger-config"))) + .andExpect(jsonPath("configUrl", equalTo("/servlet-path/v3/api-docs/swagger-config"))) .andExpect(jsonPath("url").doesNotExist()) .andExpect(jsonPath("urls.length()", equalTo(3))) - .andExpect(jsonPath("urls[0].url", equalTo("/api-docs.yaml"))) + .andExpect(jsonPath("urls[0].url", equalTo("/servlet-path/api-docs.yaml"))) .andExpect(jsonPath("urls[0].name", equalTo("first-user-list"))) - .andExpect(jsonPath("urls[1].url", equalTo("/api-docs.yaml"))) + .andExpect(jsonPath("urls[1].url", equalTo("/servlet-path/api-docs.yaml"))) .andExpect(jsonPath("urls[1].name", equalTo("second-user-list"))) - .andExpect(jsonPath("urls[2].url", equalTo("/api-docs.yaml"))) + .andExpect(jsonPath("urls[2].url", equalTo("/servlet-path/api-docs.yaml"))) .andExpect(jsonPath("urls[2].name", equalTo("third-user-list"))); } catch (Exception e) { throw new RuntimeException(e); From 4ae9d7759e957832c200f893e2b48d1832bcba73 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 16 Sep 2024 12:00:34 +0200 Subject: [PATCH 051/226] Update Response Code Fixes #2660 --- .../src/test/resources/results/app6.json | 4 ++-- .../src/test/resources/results/app8.json | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app6.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app6.json index cc5cb4e77..458b70331 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app6.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app6.json @@ -84,8 +84,8 @@ "200": { "description": "OK" }, - "403": { - "description": "Forbidden" + "401": { + "description": "Unauthorized" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app8.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app8.json index fa75f84cf..aac20cc7f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app8.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app8.json @@ -41,13 +41,12 @@ "200": { "description": "OK" }, - "403": { - "description": "Forbidden" + "401": { + "description": "Unauthorized" } } } } }, - "components": { - } -} + "components": {} +} \ No newline at end of file From 47039bcd58357dec0e8ba525e1a4b332482411a1 Mon Sep 17 00:00:00 2001 From: Georg Echterling Date: Mon, 16 Sep 2024 18:31:55 +0200 Subject: [PATCH 052/226] fix: Missing descriptions on Kotlin ByteArray fields Fixes #2275 --- .../core/configuration/SpringDocKotlinConfiguration.kt | 1 - .../test/org/springdoc/api/app6/ByteArrayController.kt | 6 +++++- .../src/test/resources/results/app6.json | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt index fc09e6465..ab1504574 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt @@ -44,7 +44,6 @@ class SpringDocKotlinConfiguration() { init { SpringDocUtils.getConfig() .addRequestWrapperToIgnore(Continuation::class.java) - .replaceWithSchema(ByteArray::class.java, ByteArraySchema()) .addDeprecatedType(Deprecated::class.java) } diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt index f3de98487..9f201c3d7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt @@ -18,11 +18,15 @@ package test.org.springdoc.api.app6 +import io.swagger.v3.oas.annotations.media.Schema import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController -data class Foo(val data: ByteArray) +data class Foo( + @Schema(description = "Some description about a byte array.") + val data: ByteArray +) @RestController @RequestMapping("/bytearray") diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app6.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app6.json index 907da4426..dd4d0a41c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app6.json +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app6.json @@ -42,6 +42,7 @@ "properties": { "data": { "type": "string", + "description":"Some description about a byte array.", "format": "byte" } } From 4c002e56f1a6a1f7f5d44d0e6c0f2073700ac637 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 17 Sep 2024 20:07:40 +0200 Subject: [PATCH 053/226] fix groovy tests --- .../src/test/resources/results/app1.json | 349 ++++++++++-------- 1 file changed, 188 insertions(+), 161 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json index a7376fb6b..b22603430 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json @@ -317,9 +317,6 @@ "type": "integer", "format": "int32" }, - "description": { - "type": "string" - }, "startLine": { "type": "integer", "format": "int32" @@ -328,15 +325,18 @@ "type": "integer", "format": "int32" }, + "meaning": { + "type": "integer", + "format": "int32" + }, "rootText": { "type": "string" }, "anExpression": { "type": "boolean" }, - "meaning": { - "type": "integer", - "format": "int32" + "description": { + "type": "string" } } }, @@ -428,6 +428,9 @@ "type": "integer", "format": "int32" }, + "typeDescription": { + "type": "string" + }, "newMetaMethods": { "type": "array", "items": { @@ -436,9 +439,6 @@ }, "callSiteLoader": { "$ref": "#/components/schemas/CallSiteClassLoader" - }, - "typeDescription": { - "type": "string" } } }, @@ -2348,6 +2348,9 @@ "type": "string" } }, + "nativeAccessEnabled": { + "type": "boolean" + }, "layer": { "type": "object" } @@ -2501,6 +2504,9 @@ "type": "string" } }, + "nativeAccessEnabled": { + "type": "boolean" + }, "layer": { "type": "object" } @@ -2591,14 +2597,14 @@ "weakMetaClass": { "$ref": "#/components/schemas/MetaClass" }, + "cachedClass": { + "$ref": "#/components/schemas/CachedClass" + }, "modifiedExpando": { "$ref": "#/components/schemas/ExpandoMetaClass" }, "metaClassForClass": { "$ref": "#/components/schemas/MetaClass" - }, - "cachedClass": { - "$ref": "#/components/schemas/CachedClass" } } }, @@ -2727,6 +2733,9 @@ "type": "string" } }, + "nativeAccessEnabled": { + "type": "boolean" + }, "layer": { "type": "object" } @@ -2880,6 +2889,9 @@ "type": "string" } }, + "nativeAccessEnabled": { + "type": "boolean" + }, "layer": { "type": "object" } @@ -3114,11 +3126,11 @@ "text": { "type": "string" }, - "allDeclaredMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodNode" - } + "redirectNode": { + "type": "boolean" + }, + "outerClass": { + "$ref": "#/components/schemas/ClassNode" }, "allInterfaces": { "uniqueItems": true, @@ -3133,15 +3145,18 @@ "$ref": "#/components/schemas/MethodNode" } }, - "outerClass": { - "$ref": "#/components/schemas/ClassNode" - }, - "redirectNode": { - "type": "boolean" + "allDeclaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } }, "genericsPlaceHolder": { "type": "boolean" }, + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" + }, "primaryClassNode": { "type": "boolean" }, @@ -3160,6 +3175,18 @@ "$ref": "#/components/schemas/ClassNode" } }, + "nameWithoutPackage": { + "type": "string" + }, + "annotationDefinition": { + "type": "boolean" + }, + "objectInitializerStatements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, "derivedFromGroovyObject": { "type": "boolean" }, @@ -3172,9 +3199,6 @@ "$ref": "#/components/schemas/ClassNode" } }, - "nameWithoutPackage": { - "type": "string" - }, "recordComponentNodes": { "type": "array", "deprecated": true, @@ -3182,18 +3206,6 @@ "$ref": "#/components/schemas/RecordComponentNode" } }, - "annotationDefinition": { - "type": "boolean" - }, - "plainNodeReference": { - "$ref": "#/components/schemas/ClassNode" - }, - "objectInitializerStatements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Statement" - } - }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, @@ -3262,6 +3274,9 @@ "publicKey": { "type": "object", "properties": { + "params": { + "type": "object" + }, "encoded": { "type": "string", "format": "byte" @@ -3285,9 +3300,6 @@ "signerCertPath": { "type": "object", "properties": { - "type": { - "type": "string" - }, "encodings": { "type": "object" }, @@ -3306,6 +3318,9 @@ "publicKey": { "type": "object", "properties": { + "params": { + "type": "object" + }, "encoded": { "type": "string", "format": "byte" @@ -3321,6 +3336,9 @@ } } }, + "type": { + "type": "string" + }, "encoded": { "type": "string", "format": "byte" @@ -3337,9 +3355,6 @@ "signerCertPath": { "type": "object", "properties": { - "type": { - "type": "string" - }, "encodings": { "type": "object" }, @@ -3358,6 +3373,9 @@ "publicKey": { "type": "object", "properties": { + "params": { + "type": "object" + }, "encoded": { "type": "string", "format": "byte" @@ -3373,6 +3391,9 @@ } } }, + "type": { + "type": "string" + }, "encoded": { "type": "string", "format": "byte" @@ -3528,11 +3549,10 @@ "bytecodePostprocessor": { "$ref": "#/components/schemas/BytecodeProcessor" }, - "targetDirectorySafe": { - "type": "string", - "writeOnly": true + "indyEnabled": { + "type": "boolean" }, - "targetBytecodeIfValid": { + "targetDirectorySafe": { "type": "string", "writeOnly": true }, @@ -3547,12 +3567,13 @@ "type": "integer", "format": "int32" }, - "indyEnabled": { - "type": "boolean" - }, "groovydocEnabled": { "type": "boolean" }, + "targetBytecodeIfValid": { + "type": "string", + "writeOnly": true + }, "runtimeGroovydocEnabled": { "type": "boolean" } @@ -3653,15 +3674,15 @@ "default": { "type": "boolean" }, - "final": { - "type": "boolean" - }, "abstract": { "type": "boolean" }, "private": { "type": "boolean" }, + "final": { + "type": "boolean" + }, "text": { "type": "string" }, @@ -3671,19 +3692,19 @@ "packageScope": { "type": "boolean" }, - "firstStatement": { - "$ref": "#/components/schemas/Statement" - }, "scriptBody": { "type": "boolean" }, - "staticConstructor": { - "type": "boolean" - }, "annotationDefault": { "type": "boolean", "writeOnly": true }, + "firstStatement": { + "$ref": "#/components/schemas/Statement" + }, + "staticConstructor": { + "type": "boolean" + }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, @@ -3727,12 +3748,12 @@ "type": "integer", "format": "int32" }, + "lastError": { + "$ref": "#/components/schemas/Message" + }, "warningCount": { "type": "integer", "format": "int32" - }, - "lastError": { - "$ref": "#/components/schemas/Message" } } }, @@ -3792,12 +3813,12 @@ "type": "integer", "format": "int32" }, - "classInfo": { - "$ref": "#/components/schemas/ClassInfo" - }, "groovyObject": { "type": "boolean" }, + "classInfo": { + "$ref": "#/components/schemas/ClassInfo" + }, "upProperties": { "type": "array", "writeOnly": true, @@ -5109,15 +5130,15 @@ "protected": { "type": "boolean" }, - "final": { - "type": "boolean" - }, "volatile": { "type": "boolean" }, "private": { "type": "boolean" }, + "final": { + "type": "boolean" + }, "initialExpression": { "$ref": "#/components/schemas/Expression" }, @@ -5344,6 +5365,9 @@ "type": "string" } }, + "nativeAccessEnabled": { + "type": "boolean" + }, "layer": { "type": "object" } @@ -5497,6 +5521,9 @@ "type": "string" } }, + "nativeAccessEnabled": { + "type": "boolean" + }, "layer": { "type": "object" } @@ -5822,12 +5849,12 @@ "anonymous": { "type": "boolean" }, - "variableScope": { - "$ref": "#/components/schemas/VariableScope" - }, "outerMostClass": { "$ref": "#/components/schemas/ClassNode" }, + "variableScope": { + "$ref": "#/components/schemas/VariableScope" + }, "interface": { "type": "boolean" }, @@ -5867,11 +5894,8 @@ "text": { "type": "string" }, - "allDeclaredMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodNode" - } + "redirectNode": { + "type": "boolean" }, "allInterfaces": { "uniqueItems": true, @@ -5886,12 +5910,18 @@ "$ref": "#/components/schemas/MethodNode" } }, - "redirectNode": { - "type": "boolean" + "allDeclaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } }, "genericsPlaceHolder": { "type": "boolean" }, + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" + }, "primaryClassNode": { "type": "boolean" }, @@ -5910,6 +5940,18 @@ "$ref": "#/components/schemas/ClassNode" } }, + "nameWithoutPackage": { + "type": "string" + }, + "annotationDefinition": { + "type": "boolean" + }, + "objectInitializerStatements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, "derivedFromGroovyObject": { "type": "boolean" }, @@ -5922,9 +5964,6 @@ "$ref": "#/components/schemas/ClassNode" } }, - "nameWithoutPackage": { - "type": "string" - }, "recordComponentNodes": { "type": "array", "deprecated": true, @@ -5932,18 +5971,6 @@ "$ref": "#/components/schemas/RecordComponentNode" } }, - "annotationDefinition": { - "type": "boolean" - }, - "plainNodeReference": { - "$ref": "#/components/schemas/ClassNode" - }, - "objectInitializerStatements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Statement" - } - }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, @@ -6005,10 +6032,10 @@ "MetaClassRegistry": { "type": "object", "properties": { - "metaClassCreationHandle": { + "metaClassCreationHandler": { "$ref": "#/components/schemas/MetaClassCreationHandle" }, - "metaClassCreationHandler": { + "metaClassCreationHandle": { "$ref": "#/components/schemas/MetaClassCreationHandle" }, "metaClassRegistryChangeEventListeners": { @@ -6190,15 +6217,15 @@ "default": { "type": "boolean" }, - "final": { - "type": "boolean" - }, "abstract": { "type": "boolean" }, "private": { "type": "boolean" }, + "final": { + "type": "boolean" + }, "text": { "type": "string" }, @@ -6208,19 +6235,19 @@ "packageScope": { "type": "boolean" }, - "firstStatement": { - "$ref": "#/components/schemas/Statement" - }, "scriptBody": { "type": "boolean" }, - "staticConstructor": { - "type": "boolean" - }, "annotationDefault": { "type": "boolean", "writeOnly": true }, + "firstStatement": { + "$ref": "#/components/schemas/Statement" + }, + "staticConstructor": { + "type": "boolean" + }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, @@ -6415,11 +6442,11 @@ "text": { "type": "string" }, - "allDeclaredMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodNode" - } + "redirectNode": { + "type": "boolean" + }, + "outerClass": { + "$ref": "#/components/schemas/ClassNode" }, "allInterfaces": { "uniqueItems": true, @@ -6434,15 +6461,18 @@ "$ref": "#/components/schemas/MethodNode" } }, - "outerClass": { - "$ref": "#/components/schemas/ClassNode" - }, - "redirectNode": { - "type": "boolean" + "allDeclaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } }, "genericsPlaceHolder": { "type": "boolean" }, + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" + }, "primaryClassNode": { "type": "boolean" }, @@ -6461,6 +6491,18 @@ "$ref": "#/components/schemas/ClassNode" } }, + "nameWithoutPackage": { + "type": "string" + }, + "annotationDefinition": { + "type": "boolean" + }, + "objectInitializerStatements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, "derivedFromGroovyObject": { "type": "boolean" }, @@ -6473,9 +6515,6 @@ "$ref": "#/components/schemas/ClassNode" } }, - "nameWithoutPackage": { - "type": "string" - }, "recordComponentNodes": { "type": "array", "deprecated": true, @@ -6483,18 +6522,6 @@ "$ref": "#/components/schemas/RecordComponentNode" } }, - "annotationDefinition": { - "type": "boolean" - }, - "plainNodeReference": { - "$ref": "#/components/schemas/ClassNode" - }, - "objectInitializerStatements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Statement" - } - }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, @@ -6860,28 +6887,28 @@ "private": { "type": "boolean" }, - "initialExpression": { - "$ref": "#/components/schemas/Expression" - }, - "inStaticContext": { + "dynamicTyped": { "type": "boolean" }, - "closureSharedVariable": { - "type": "boolean", - "deprecated": true - }, "originType": { "$ref": "#/components/schemas/ClassNode" }, - "dynamicTyped": { - "type": "boolean" - }, "getterNameOrDefault": { "type": "string" }, "setterNameOrDefault": { "type": "string" }, + "initialExpression": { + "$ref": "#/components/schemas/Expression" + }, + "inStaticContext": { + "type": "boolean" + }, + "closureSharedVariable": { + "type": "boolean", + "deprecated": true + }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, @@ -7001,9 +7028,6 @@ "type": "integer", "format": "int32" }, - "description": { - "type": "string" - }, "startLine": { "type": "integer", "format": "int32" @@ -7012,12 +7036,15 @@ "type": "integer", "format": "int32" }, - "rootText": { - "type": "string" - }, "meaning": { "type": "integer", "format": "int32" + }, + "rootText": { + "type": "string" + }, + "description": { + "type": "string" } } }, @@ -7140,11 +7167,11 @@ "empty": { "type": "boolean" }, - "description": { - "type": "string" - }, "anExpression": { "type": "boolean" + }, + "description": { + "type": "string" } } }, @@ -7161,6 +7188,12 @@ "type": { "$ref": "#/components/schemas/ClassNode" }, + "dynamicTyped": { + "type": "boolean" + }, + "originType": { + "$ref": "#/components/schemas/ClassNode" + }, "initialExpression": { "$ref": "#/components/schemas/Expression" }, @@ -7169,12 +7202,6 @@ }, "closureSharedVariable": { "type": "boolean" - }, - "originType": { - "$ref": "#/components/schemas/ClassNode" - }, - "dynamicTyped": { - "type": "boolean" } } }, @@ -7205,17 +7232,17 @@ "root": { "type": "boolean" }, - "referencedLocalVariablesCount": { - "type": "integer", - "format": "int32" - }, - "declaredVariablesIterator": { + "referencedClassVariablesIterator": { "type": "object" }, "referencedLocalVariablesIterator": { "type": "object" }, - "referencedClassVariablesIterator": { + "referencedLocalVariablesCount": { + "type": "integer", + "format": "int32" + }, + "declaredVariablesIterator": { "type": "object" } } From feb7f6c629e53aa0f3e00acc12f7b522adddf1cc Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 17 Sep 2024 20:35:34 +0200 Subject: [PATCH 054/226] Fix tests for 21.0.4 --- .../src/test/resources/results/app1.json | 97 +++++++++---------- 1 file changed, 44 insertions(+), 53 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json index b22603430..542bdaf73 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json @@ -1512,10 +1512,10 @@ "type": "integer", "format": "int32" }, - "static": { + "final": { "type": "boolean" }, - "final": { + "static": { "type": "boolean" }, "cachedField": { @@ -2184,10 +2184,10 @@ "descriptor": { "type": "string" }, - "static": { + "synthetic": { "type": "boolean" }, - "synthetic": { + "static": { "type": "boolean" }, "declaringClass": { @@ -3139,13 +3139,13 @@ "$ref": "#/components/schemas/ClassNode" } }, - "abstractMethods": { + "allDeclaredMethods": { "type": "array", "items": { "$ref": "#/components/schemas/MethodNode" } }, - "allDeclaredMethods": { + "abstractMethods": { "type": "array", "items": { "$ref": "#/components/schemas/MethodNode" @@ -3154,9 +3154,6 @@ "genericsPlaceHolder": { "type": "boolean" }, - "plainNodeReference": { - "$ref": "#/components/schemas/ClassNode" - }, "primaryClassNode": { "type": "boolean" }, @@ -3181,6 +3178,9 @@ "annotationDefinition": { "type": "boolean" }, + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" + }, "objectInitializerStatements": { "type": "array", "items": { @@ -3274,9 +3274,6 @@ "publicKey": { "type": "object", "properties": { - "params": { - "type": "object" - }, "encoded": { "type": "string", "format": "byte" @@ -3318,9 +3315,6 @@ "publicKey": { "type": "object", "properties": { - "params": { - "type": "object" - }, "encoded": { "type": "string", "format": "byte" @@ -3373,9 +3367,6 @@ "publicKey": { "type": "object", "properties": { - "params": { - "type": "object" - }, "encoded": { "type": "string", "format": "byte" @@ -3662,6 +3653,9 @@ "constructor": { "type": "boolean" }, + "final": { + "type": "boolean" + }, "static": { "type": "boolean" }, @@ -3680,9 +3674,6 @@ "private": { "type": "boolean" }, - "final": { - "type": "boolean" - }, "text": { "type": "string" }, @@ -3695,16 +3686,16 @@ "scriptBody": { "type": "boolean" }, - "annotationDefault": { - "type": "boolean", - "writeOnly": true - }, "firstStatement": { "$ref": "#/components/schemas/Statement" }, "staticConstructor": { "type": "boolean" }, + "annotationDefault": { + "type": "boolean", + "writeOnly": true + }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, @@ -3744,13 +3735,13 @@ "configuration": { "$ref": "#/components/schemas/CompilerConfiguration" }, + "lastError": { + "$ref": "#/components/schemas/Message" + }, "errorCount": { "type": "integer", "format": "int32" }, - "lastError": { - "$ref": "#/components/schemas/Message" - }, "warningCount": { "type": "integer", "format": "int32" @@ -5121,6 +5112,9 @@ "enum": { "type": "boolean" }, + "final": { + "type": "boolean" + }, "static": { "type": "boolean" }, @@ -5136,9 +5130,6 @@ "private": { "type": "boolean" }, - "final": { - "type": "boolean" - }, "initialExpression": { "$ref": "#/components/schemas/Expression" }, @@ -5904,13 +5895,13 @@ "$ref": "#/components/schemas/ClassNode" } }, - "abstractMethods": { + "allDeclaredMethods": { "type": "array", "items": { "$ref": "#/components/schemas/MethodNode" } }, - "allDeclaredMethods": { + "abstractMethods": { "type": "array", "items": { "$ref": "#/components/schemas/MethodNode" @@ -5919,9 +5910,6 @@ "genericsPlaceHolder": { "type": "boolean" }, - "plainNodeReference": { - "$ref": "#/components/schemas/ClassNode" - }, "primaryClassNode": { "type": "boolean" }, @@ -5946,6 +5934,9 @@ "annotationDefinition": { "type": "boolean" }, + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" + }, "objectInitializerStatements": { "type": "array", "items": { @@ -6205,6 +6196,9 @@ "constructor": { "type": "boolean" }, + "final": { + "type": "boolean" + }, "static": { "type": "boolean" }, @@ -6223,9 +6217,6 @@ "private": { "type": "boolean" }, - "final": { - "type": "boolean" - }, "text": { "type": "string" }, @@ -6238,16 +6229,16 @@ "scriptBody": { "type": "boolean" }, - "annotationDefault": { - "type": "boolean", - "writeOnly": true - }, "firstStatement": { "$ref": "#/components/schemas/Statement" }, "staticConstructor": { "type": "boolean" }, + "annotationDefault": { + "type": "boolean", + "writeOnly": true + }, "instance": { "$ref": "#/components/schemas/AnnotatedNode" }, @@ -6455,13 +6446,13 @@ "$ref": "#/components/schemas/ClassNode" } }, - "abstractMethods": { + "allDeclaredMethods": { "type": "array", "items": { "$ref": "#/components/schemas/MethodNode" } }, - "allDeclaredMethods": { + "abstractMethods": { "type": "array", "items": { "$ref": "#/components/schemas/MethodNode" @@ -6470,9 +6461,6 @@ "genericsPlaceHolder": { "type": "boolean" }, - "plainNodeReference": { - "$ref": "#/components/schemas/ClassNode" - }, "primaryClassNode": { "type": "boolean" }, @@ -6497,6 +6485,9 @@ "annotationDefinition": { "type": "boolean" }, + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" + }, "objectInitializerStatements": { "type": "array", "items": { @@ -7232,17 +7223,17 @@ "root": { "type": "boolean" }, - "referencedClassVariablesIterator": { - "type": "object" - }, - "referencedLocalVariablesIterator": { + "declaredVariablesIterator": { "type": "object" }, "referencedLocalVariablesCount": { "type": "integer", "format": "int32" }, - "declaredVariablesIterator": { + "referencedLocalVariablesIterator": { + "type": "object" + }, + "referencedClassVariablesIterator": { "type": "object" } } From 1fc8f9db2fdf94a6e83f93aa893f2adea2c8ef59 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 21 Sep 2024 19:01:18 +0200 Subject: [PATCH 055/226] Boolean Parameter with @Schema Annotation Changes Type to string in OpenAPI Documentation Fixes #2638 --- .../org/springdoc/core/service/GenericParameterService.java | 4 +++- .../src/test/resources/results/3.0.1/app206.json | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index 458a9331c..b07fb550c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -321,7 +321,9 @@ private void setSchema(io.swagger.v3.oas.annotations.Parameter parameterDoc, Com else { Schema schema = null; try { - schema = AnnotationsUtils.getSchema(parameterDoc.schema(), null, false, parameterDoc.schema().implementation(), components, jsonView, propertyResolverUtils.isOpenapi31()).orElse(null); + if(StringUtils.isNotEmpty(parameterDoc.schema().type()) || !Void.class.equals(parameterDoc.schema().implementation())){ + schema = AnnotationsUtils.getSchema(parameterDoc.schema(), null, false, parameterDoc.schema().implementation(), components, jsonView, propertyResolverUtils.isOpenapi31()).orElse(null); + } // Cast default value if (schema != null && schema.getDefault() != null) { PrimitiveType primitiveType = PrimitiveType.fromTypeAndFormat(schema.getType(), schema.getFormat()); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json index 165ccf314..3b515a38a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json @@ -23,7 +23,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int64" } }, { @@ -57,7 +58,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } } ], From 7bb5fc282f856500238bac81a9292a349fa4f873 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 21 Sep 2024 23:24:25 +0200 Subject: [PATCH 056/226] @JsonUnwrapped is ignored when PolymorphicConverter is enabled. Fixes #2640 --- .../converters/PolymorphicModelConverter.java | 8 +++ .../springdoc/api/v30/app224/RootModel.java | 27 ++++++++++ .../api/v30/app224/SpringDocApp224Test.java | 35 +++++++++++++ .../api/v30/app224/TestController.java | 15 ++++++ .../api/v30/app224/UnwrappedModel.java | 14 +++++ .../test/resources/results/3.0.1/app224.json | 52 +++++++++++++++++++ 6 files changed, 151 insertions(+) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/RootModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/SpringDocApp224Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/UnwrappedModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app224.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index e243f7e1a..9a4b4ecb8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -24,6 +24,7 @@ package org.springdoc.core.converters; +import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; @@ -31,6 +32,7 @@ import java.util.Iterator; import java.util.List; +import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.databind.JavaType; import io.swagger.v3.core.converter.AnnotatedType; import io.swagger.v3.core.converter.ModelConverter; @@ -39,6 +41,7 @@ import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.ObjectSchema; import io.swagger.v3.oas.models.media.Schema; +import org.apache.commons.lang3.reflect.FieldUtils; import org.springdoc.core.providers.ObjectMapperProvider; /** @@ -98,6 +101,11 @@ else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSi public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator chain) { JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); if (javaType != null) { + for (Field field : FieldUtils.getAllFields(javaType.getRawClass())) { + if (field.isAnnotationPresent(JsonUnwrapped.class)) { + PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); + } + } if (chain.hasNext()) { if (!type.isResolveAsRef() && type.getParent() != null && PARENT_TYPES_TO_IGNORE.stream().noneMatch(ignore -> type.getParent().getName().startsWith(ignore))) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/RootModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/RootModel.java new file mode 100644 index 000000000..5a18b69f4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/RootModel.java @@ -0,0 +1,27 @@ +package test.org.springdoc.api.v30.app224; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; + +public class RootModel { + + private Integer rootProperty; + + @JsonUnwrapped + private UnwrappedModel unwrappedModel; + + public Integer getRootProperty() { + return rootProperty; + } + + public void setRootProperty(Integer rootProperty) { + this.rootProperty = rootProperty; + } + + public UnwrappedModel getUnwrappedModel() { + return unwrappedModel; + } + + public void setUnwrappedModel(UnwrappedModel unwrappedModel) { + this.unwrappedModel = unwrappedModel; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/SpringDocApp224Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/SpringDocApp224Test.java new file mode 100644 index 000000000..0d97db4aa --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/SpringDocApp224Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app224; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp224Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/TestController.java new file mode 100644 index 000000000..e69c8e01d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/TestController.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v30.app224; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class TestController { + + @GetMapping + public RootModel getRootModel() { + return new RootModel(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/UnwrappedModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/UnwrappedModel.java new file mode 100644 index 000000000..3de72ae51 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/UnwrappedModel.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v30.app224; + +public class UnwrappedModel { + + private Integer unwrappedProperty; + + public Integer getUnwrappedProperty() { + return unwrappedProperty; + } + + public void setUnwrappedProperty(Integer unwrappedProperty) { + this.unwrappedProperty = unwrappedProperty; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app224.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app224.json new file mode 100644 index 000000000..d83020e50 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app224.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api": { + "get": { + "tags": [ + "test-controller" + ], + "operationId": "getRootModel", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/RootModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "RootModel": { + "type": "object", + "properties": { + "rootProperty": { + "type": "integer", + "format": "int32" + }, + "unwrappedProperty": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} From 2b45ea413f2f5814ae80b648c78c54fb62acd6b4 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 22 Sep 2024 00:57:53 +0200 Subject: [PATCH 057/226] UpperSnakeCaseStrategy is not working with spring boot and ParameterObject. Fixes #2643 --- .../configuration/SpringDocConfiguration.java | 19 +++++- .../SpringDocPageableConfiguration.java | 2 +- .../SpringDocSortConfiguration.java | 2 +- ...rameterObjectNamingStrategyCustomizer.java | 66 +++++++++++++++++++ .../core/data/DataRestRequestService.java | 2 +- .../extractor/DelegatingMethodParameter.java | 6 +- .../core/service/AbstractRequestService.java | 2 +- .../core/service/GenericParameterService.java | 16 ++--- .../api/v30/app225/HelloController.java | 35 ++++++++++ .../api/v30/app225/SpringDocApp225Test.java | 35 ++++++++++ .../test/resources/results/3.0.1/app225.json | 39 +++++++++++ .../api/app14/SpringDocApp14Test.java | 2 +- .../api/app32/SpringDocApp32Test.java | 2 +- 13 files changed, 208 insertions(+), 20 deletions(-) create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/SpringDocApp225Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app225.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 3a51f92e2..4bab8f1c3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -63,6 +63,7 @@ import org.springdoc.core.customizers.OpenApiBuilderCustomizer; import org.springdoc.core.customizers.OpenApiCustomizer; import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.customizers.ParameterObjectNamingStrategyCustomizer; import org.springdoc.core.customizers.PropertyCustomizer; import org.springdoc.core.customizers.QuerydslPredicateOperationCustomizer; import org.springdoc.core.customizers.RouterOperationCustomizer; @@ -375,7 +376,7 @@ ReturnTypeParser genericReturnTypeParser() { * Parameter builder generic parameter builder. * * @param propertyResolverUtils the property resolver utils - * @param optionalDelegatingMethodParameterCustomizer the optional delegating method parameter customizer + * @param optionalDelegatingMethodParameterCustomizers the optional list delegating method parameter customizer * @param optionalWebConversionServiceProvider the optional web conversion service provider * @param objectMapperProvider the object mapper provider * @param javadocProvider the javadoc provider @@ -385,9 +386,9 @@ ReturnTypeParser genericReturnTypeParser() { @ConditionalOnMissingBean @Lazy(false) GenericParameterService parameterBuilder(PropertyResolverUtils propertyResolverUtils, - Optional optionalDelegatingMethodParameterCustomizer, + Optional> optionalDelegatingMethodParameterCustomizers, Optional optionalWebConversionServiceProvider, ObjectMapperProvider objectMapperProvider, Optional javadocProvider) { - return new GenericParameterService(propertyResolverUtils, optionalDelegatingMethodParameterCustomizer, + return new GenericParameterService(propertyResolverUtils, optionalDelegatingMethodParameterCustomizers, optionalWebConversionServiceProvider, objectMapperProvider, javadocProvider); } @@ -649,4 +650,16 @@ QuerydslPredicateOperationCustomizer queryDslQuerydslPredicateOperationCustomize return null; } } + + /** + * Parameter object naming strategy customizer delegating method parameter customizer. + * + * @return the delegating method parameter customizer + */ + @Bean + @ConditionalOnMissingBean + @Lazy(false) + ParameterObjectNamingStrategyCustomizer parameterObjectNamingStrategyCustomizer() { + return new ParameterObjectNamingStrategyCustomizer(); + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java index b12aeb55b..823e19f72 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java @@ -106,7 +106,7 @@ PageOpenAPIConverter pageOpenAPIConverter(Optional settin @Bean @ConditionalOnMissingBean @Lazy(false) - DelegatingMethodParameterCustomizer delegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { + DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); } } \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java index 5e512d170..56fa8912a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java @@ -86,7 +86,7 @@ SortOpenAPIConverter sortOpenAPIConverter(ObjectMapperProvider objectMapperProvi @Bean @ConditionalOnMissingBean @Lazy(false) - DelegatingMethodParameterCustomizer delegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { + DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); } } \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java new file mode 100644 index 000000000..f73f33e93 --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package org.springdoc.core.customizers; + +import java.lang.reflect.Field; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.core.MethodParameter; +import org.springframework.core.annotation.AnnotatedElementUtils; + +/** + * The type Parameter object naming strategy customizer. + * + * @author bnasslahsen + */ +public class ParameterObjectNamingStrategyCustomizer implements DelegatingMethodParameterCustomizer { + + /** + * The constant LOGGER. + */ + private static final Logger LOGGER = LoggerFactory.getLogger(ParameterObjectNamingStrategyCustomizer.class); + + @Override + public void customize(MethodParameter originalParameter, MethodParameter methodParameter) { + if (AnnotatedElementUtils.isAnnotated(methodParameter.getContainingClass(), JsonNaming.class)) { + JsonNaming jsonNaming = methodParameter.getContainingClass().getAnnotation(JsonNaming.class); + if (jsonNaming.value().equals(PropertyNamingStrategies.UpperSnakeCaseStrategy.class)) { + try { + Field parameterNameField = FieldUtils.getDeclaredField(methodParameter.getClass(), "parameterName", + true); + parameterNameField.set(methodParameter, + PropertyNamingStrategies.UpperSnakeCaseStrategy.INSTANCE.translate( + methodParameter.getParameterName())); + } + catch (IllegalAccessException e) { + LOGGER.warn(e.getMessage()); + } + } + } + } +} diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java index fd67c75c0..60a5f02fd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java @@ -151,7 +151,7 @@ public void buildParameters(OpenAPI openAPI, HandlerMethod handlerMethod, Reques */ public void buildCommonParameters(OpenAPI openAPI, RequestMethod requestMethod, MethodAttributes methodAttributes, Operation operation, String[] pNames, MethodParameter[] parameters, DataRestRepository dataRestRepository) { - parameters = DelegatingMethodParameter.customize(pNames, parameters, parameterBuilder.getDelegatingMethodParameterCustomizer(), requestBuilder.isDefaultFlatParamObject()); + parameters = DelegatingMethodParameter.customize(pNames, parameters, parameterBuilder.getOptionalDelegatingMethodParameterCustomizers(), requestBuilder.isDefaultFlatParamObject()); Class domainType = dataRestRepository.getDomainType(); for (MethodParameter methodParameter : parameters) { final String pName = methodParameter.getParameterName(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java index d3320398e..2029e617e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java @@ -113,12 +113,12 @@ public class DelegatingMethodParameter extends MethodParameter { * * @param pNames the p names * @param parameters the parameters - * @param optionalDelegatingMethodParameterCustomizer the optional delegating method parameter customizer + * @param optionalDelegatingMethodParameterCustomizers the optional list delegating method parameter customizer * @param defaultFlatParamObject the default flat param object * @return the method parameter [ ] */ public static MethodParameter[] customize(String[] pNames, MethodParameter[] parameters, - Optional optionalDelegatingMethodParameterCustomizer, boolean defaultFlatParamObject) { + Optional> optionalDelegatingMethodParameterCustomizers, boolean defaultFlatParamObject) { List explodedParameters = new ArrayList<>(); for (int i = 0; i < parameters.length; ++i) { MethodParameter p = parameters[i]; @@ -130,7 +130,7 @@ public static MethodParameter[] customize(String[] pNames, MethodParameter[] par if (!MethodParameterPojoExtractor.isSimpleType(paramClass) && (hasFlatAnnotation || (defaultFlatParamObject && !hasNotFlatAnnotation && !AbstractRequestService.isRequestTypeToIgnore(paramClass)))) { MethodParameterPojoExtractor.extractFrom(paramClass).forEach(methodParameter -> { - optionalDelegatingMethodParameterCustomizer.ifPresent(customizer -> customizer.customize(p, methodParameter)); + optionalDelegatingMethodParameterCustomizers.ifPresent(delegatingMethodParameterCustomizers -> delegatingMethodParameterCustomizers.forEach(customizer -> customizer.customize(p, methodParameter))); explodedParameters.add(methodParameter); }); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 6a53cc4e3..47d2baa77 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -287,7 +287,7 @@ public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, String[] reflectionParametersNames = Arrays.stream(handlerMethod.getMethod().getParameters()).map(java.lang.reflect.Parameter::getName).toArray(String[]::new); if (pNames == null || Arrays.stream(pNames).anyMatch(Objects::isNull)) pNames = reflectionParametersNames; - parameters = DelegatingMethodParameter.customize(pNames, parameters, parameterBuilder.getDelegatingMethodParameterCustomizer(), this.defaultFlatParamObject); + parameters = DelegatingMethodParameter.customize(pNames, parameters, parameterBuilder.getOptionalDelegatingMethodParameterCustomizers(), this.defaultFlatParamObject); RequestBodyInfo requestBodyInfo = new RequestBodyInfo(); List operationParameters = (operation.getParameters() != null) ? operation.getParameters() : new ArrayList<>(); Map parametersDocMap = getApiParameters(handlerMethod.getMethod()); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index b07fb550c..3d6d42426 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -113,7 +113,7 @@ public class GenericParameterService { /** * The Optional delegating method parameter customizer. */ - private final Optional optionalDelegatingMethodParameterCustomizer; + private final Optional> optionalDelegatingMethodParameterCustomizers; /** * The Web conversion service. @@ -148,15 +148,15 @@ public class GenericParameterService { /** * Instantiates a new Generic parameter builder. * @param propertyResolverUtils the property resolver utils - * @param optionalDelegatingMethodParameterCustomizer the optional delegating method parameter customizer + * @param optionalDelegatingMethodParameterCustomizers the optional list delegating method parameter customizer * @param optionalWebConversionServiceProvider the optional web conversion service provider * @param objectMapperProvider the object mapper provider * @param javadocProviderOptional the javadoc provider */ - public GenericParameterService(PropertyResolverUtils propertyResolverUtils, Optional optionalDelegatingMethodParameterCustomizer, + public GenericParameterService(PropertyResolverUtils propertyResolverUtils, Optional> optionalDelegatingMethodParameterCustomizers, Optional optionalWebConversionServiceProvider, ObjectMapperProvider objectMapperProvider, Optional javadocProviderOptional) { this.propertyResolverUtils = propertyResolverUtils; - this.optionalDelegatingMethodParameterCustomizer = optionalDelegatingMethodParameterCustomizer; + this.optionalDelegatingMethodParameterCustomizers = optionalDelegatingMethodParameterCustomizers; this.optionalWebConversionServiceProvider = optionalWebConversionServiceProvider; this.configurableBeanFactory = propertyResolverUtils.getFactory(); this.expressionContext = (configurableBeanFactory != null ? new BeanExpressionContext(configurableBeanFactory, new RequestScope()) : null); @@ -543,12 +543,12 @@ public boolean isFile(MethodParameter methodParameter) { } /** - * Gets delegating method parameter customizer. + * Gets optional delegating method parameter customizers. * - * @return the delegating method parameter customizer + * @return the optional delegating method parameter customizers */ - public Optional getDelegatingMethodParameterCustomizer() { - return optionalDelegatingMethodParameterCustomizer; + public Optional> getOptionalDelegatingMethodParameterCustomizers() { + return optionalDelegatingMethodParameterCustomizers; } /** diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/HelloController.java new file mode 100644 index 000000000..ac2b7b0af --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/HelloController.java @@ -0,0 +1,35 @@ +package test.org.springdoc.api.v30.app225; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping +public class HelloController { + + @PostMapping("/testBoolean") + public void HelloController(@ParameterObject RequestDto requestDto) { + } +} + +@JsonNaming(PropertyNamingStrategies.UpperSnakeCaseStrategy.class) + class RequestDto { + private String personalNumber; + + public String getPersonalNumber() { + return personalNumber; + } + + public void setPersonalNumber(String personalNumber) { + this.personalNumber = personalNumber; + } +} + diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/SpringDocApp225Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/SpringDocApp225Test.java new file mode 100644 index 000000000..af8907232 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/SpringDocApp225Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app225; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp225Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app225.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app225.json new file mode 100644 index 000000000..096ec64b7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app225.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/testBoolean": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "HelloController", + "parameters": [ + { + "name": "PERSONAL_NUMBER", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java index fce659ee2..f3b617ee0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java @@ -57,7 +57,7 @@ static class SpringDocTestApp { @Bean @ConditionalOnMissingBean @Lazy(false) - DelegatingMethodParameterCustomizer delegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { + DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); } } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java index 0a6e2d882..c50c69a0e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java @@ -52,7 +52,7 @@ static class SpringDocTestApp { @Bean @ConditionalOnMissingBean @Lazy(false) - DelegatingMethodParameterCustomizer delegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { + DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); } } From 68be64e9bcd351aa76380dc5ba0baac3b2bdc78e Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 22 Sep 2024 01:19:22 +0200 Subject: [PATCH 058/226] swagger-core upgrade to 2.2.23 --- pom.xml | 2 +- .../src/test/resources/results/3.1.0/app1.json | 2 ++ .../src/test/resources/results/3.1.0/app2.json | 13 +++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 1f9ec36f6..aec07ce46 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.6 2.5.3 1.6.8 - 2.2.22 + 2.2.23 5.17.14 1.13.1 0.9.1 diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json index 67f595272..e6bd12a39 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json @@ -236,6 +236,7 @@ "required": false, "explode": false, "schema": { + "type": "array", "items": {} } } @@ -453,6 +454,7 @@ "content": { "application/json": { "schema": { + "type": "array", "items": { "$ref": "#/components/schemas/PersonDTO" } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json index 5bae75d1d..2456d512c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json @@ -809,8 +809,8 @@ } } }, - "404": { - "description": "Order not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -824,8 +824,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "Order not found", "content": { "application/xml": { "schema": { @@ -901,6 +901,7 @@ "content": { "application/json": { "schema": { + "type": "array", "items": {} } } @@ -953,6 +954,7 @@ "content": { "application/xml": { "schema": { + "type": "array", "items": { "$ref": "#/components/schemas/Pet" } @@ -960,6 +962,7 @@ }, "application/json": { "schema": { + "type": "array", "items": { "$ref": "#/components/schemas/Pet" } @@ -1017,6 +1020,7 @@ "content": { "application/xml": { "schema": { + "type": "array", "items": { "$ref": "#/components/schemas/Pet" } @@ -1024,6 +1028,7 @@ }, "application/json": { "schema": { + "type": "array", "items": { "$ref": "#/components/schemas/Pet" } From cdbd7f6dac35d6926723d1ff28fae27ff0bdbbc4 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 22 Sep 2024 11:18:14 +0200 Subject: [PATCH 059/226] The operationId is unnecessarily deduplicated for a requestBody with multiple content types. Fixes #2646. --- .../api/AbstractOpenApiResource.java | 2 +- .../configuration/SpringDocConfiguration.java | 13 + .../customizers/OperationIdCustomizer.java | 82 +++++ .../core/service/AbstractRequestService.java | 3 +- .../core/service/OperationService.java | 93 +----- .../SpringDocHateoasConfigurationTest.java | 4 +- .../api/app65/SpringDocApp65Test.java | 2 + .../src/test/resources/results/app73.json | 24 +- .../src/test/resources/results/app74.json | 2 +- .../src/test/resources/results/app80.json | 14 +- .../src/test/resources/results/app86.json | 24 +- .../src/test/resources/results/app87.json | 2 +- .../src/test/resources/results/app89.json | 18 +- .../src/test/resources/results/app90.json | 26 +- .../test/resources/results/3.0.1/app106.json | 2 +- .../test/resources/results/3.0.1/app108.json | 2 +- .../test/resources/results/3.0.1/app122.json | 2 +- .../test/resources/results/3.0.1/app126.json | 10 +- .../test/resources/results/3.0.1/app135.json | 12 +- .../test/resources/results/3.0.1/app141.json | 16 +- .../test/resources/results/3.0.1/app161.json | 2 +- .../test/resources/results/3.0.1/app198.json | 2 +- .../test/resources/results/3.0.1/app206.json | 2 +- .../test/resources/results/3.0.1/app211.json | 2 +- .../test/resources/results/3.0.1/app216.json | 2 +- .../test/resources/results/3.0.1/app37.json | 44 +-- .../test/resources/results/3.0.1/app47.json | 3 +- .../test/resources/results/3.0.1/app51.json | 4 +- .../test/resources/results/3.0.1/app91.json | 2 +- .../test/resources/results/3.0.1/app93.json | 2 +- .../src/test/resources/results/app146-1.json | 68 +--- .../src/test/resources/results/app147-1.json | 68 +--- .../src/test/resources/results/app147-2.json | 6 +- .../src/test/resources/results/app148-2.json | 68 +--- .../src/test/resources/results/app147-1.json | 68 +--- .../src/test/resources/results/app148-2.json | 68 +--- .../src/test/resources/results/app10.json | 12 +- .../src/test/resources/results/app11.json | 4 +- .../src/test/resources/results/app16.json | 108 +++--- .../src/test/resources/results/app17.json | 32 +- .../src/test/resources/results/app20.json | 6 +- .../src/test/resources/results/app21.json | 20 +- .../src/test/resources/results/app22.json | 4 +- .../src/test/resources/results/app23.json | 60 ++-- .../src/test/resources/results/app25.json | 316 +++++++++--------- .../src/test/resources/results/app26.json | 4 +- .../src/test/resources/results/app29.json | 4 +- .../src/test/resources/results/app34.json | 18 +- .../src/test/resources/results/app37.json | 8 +- .../src/test/resources/results/app2.json | 2 +- .../src/test/resources/results/app5.json | 2 +- .../RecordObject__Javadoc.json | 1 - .../src/test/resources/results/app106.json | 2 +- .../src/test/resources/results/app108.json | 2 +- .../src/test/resources/results/app122.json | 2 +- .../src/test/resources/results/app126.json | 16 +- .../src/test/resources/results/app135.json | 10 +- .../src/test/resources/results/app141.json | 34 +- .../src/test/resources/results/app161.json | 2 +- .../src/test/resources/results/app167.json | 10 +- .../src/test/resources/results/app3.json | 2 +- .../src/test/resources/results/app37.json | 4 +- .../src/test/resources/results/app51.json | 2 +- .../src/test/resources/results/app91.json | 2 +- .../src/test/resources/results/app93.json | 2 +- .../src/test/resources/results/app5.json | 5 +- 66 files changed, 576 insertions(+), 884 deletions(-) create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/RecordObject__Javadoc.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 353f86cf5..be2bb941b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -693,7 +693,7 @@ protected void calculatePath(RouterOperation routerOperation, Locale locale, Ope if (apiOperation != null) openAPI = operationParser.parse(apiOperation, operation, openAPI, methodAttributes); - String operationId = operationParser.getOperationId(operation.getOperationId(), openAPI); + String operationId = operation.getOperationId(); operation.setOperationId(operationId); fillParametersList(operation, queryParams, methodAttributes); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 4bab8f1c3..06e1e7fd1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -63,6 +63,7 @@ import org.springdoc.core.customizers.OpenApiBuilderCustomizer; import org.springdoc.core.customizers.OpenApiCustomizer; import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.customizers.OperationIdCustomizer; import org.springdoc.core.customizers.ParameterObjectNamingStrategyCustomizer; import org.springdoc.core.customizers.PropertyCustomizer; import org.springdoc.core.customizers.QuerydslPredicateOperationCustomizer; @@ -662,4 +663,16 @@ QuerydslPredicateOperationCustomizer queryDslQuerydslPredicateOperationCustomize ParameterObjectNamingStrategyCustomizer parameterObjectNamingStrategyCustomizer() { return new ParameterObjectNamingStrategyCustomizer(); } + + /** + * Global open api customizer global open api customizer. + * + * @return the global open api customizer + */ + @Bean + @ConditionalOnMissingBean + @Lazy(false) + GlobalOpenApiCustomizer globalOpenApiCustomizer() { + return new OperationIdCustomizer(); + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java new file mode 100644 index 000000000..25d3e11cc --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java @@ -0,0 +1,82 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package org.springdoc.core.customizers; + +import java.util.HashMap; +import java.util.Map; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; + +/** + * @author bnasslahsen + */ +public class OperationIdCustomizer implements GlobalOpenApiCustomizer { + + @Override + public void customise(OpenAPI openApi) { + // Map to store operationId counts + Map operationIdCount = new HashMap<>(); + + // Iterate through all the paths + for (Map.Entry pathEntry : openApi.getPaths().entrySet()) { + PathItem pathItem = pathEntry.getValue(); + + // Process all HTTP methods for the path (GET, POST, PUT, DELETE, etc.) + processOperation(pathItem.getGet(), operationIdCount); + processOperation(pathItem.getPost(), operationIdCount); + processOperation(pathItem.getPut(), operationIdCount); + processOperation(pathItem.getDelete(), operationIdCount); + processOperation(pathItem.getPatch(), operationIdCount); + processOperation(pathItem.getHead(), operationIdCount); + processOperation(pathItem.getOptions(), operationIdCount); + processOperation(pathItem.getTrace(), operationIdCount); + } + } + + // Helper method to process each operation and handle duplicate operationId + private void processOperation(Operation operation, Map operationIdCount) { + if (operation != null) { + String originalOperationId = operation.getOperationId(); + + // Check if operationId already exists + if (operationIdCount.containsKey(originalOperationId)) { + // Get the count for the current operationId and increment + int count = operationIdCount.get(originalOperationId); + count++; + operationIdCount.put(originalOperationId, count); + + // Create new unique operationId by appending _x + String newOperationId = originalOperationId + "_" + count; + operation.setOperationId(newOperationId); + } + else { + // First time this operationId is seen, initialize the count + operationIdCount.put(originalOperationId, 0); + } + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 47d2baa77..77b125edb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -278,8 +278,7 @@ public static Collection getHeaders(MethodAttributes methodAttributes public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, Operation operation, MethodAttributes methodAttributes, OpenAPI openAPI) { // Documentation - String operationId = operationService.getOperationId(handlerMethod.getMethod().getName(), - operation.getOperationId(), openAPI); + String operationId = operation.getOperationId()!=null ? operation.getOperationId() : handlerMethod.getMethod().getName(); operation.setOperationId(operationId); // requests String[] pNames = this.localSpringDocParameterNameDiscoverer.getParameterNames(handlerMethod.getMethod()); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java index 9f91dd18c..7973465fe 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java @@ -132,7 +132,7 @@ public OpenAPI parse(io.swagger.v3.oas.annotations.Operation apiOperation, operation.setDescription(propertyResolverUtils.resolve(apiOperation.description(), locale)); if (StringUtils.isNotBlank(apiOperation.operationId())) - operation.setOperationId(getOperationId(apiOperation.operationId(), openAPI)); + operation.setOperationId(apiOperation.operationId()); if (apiOperation.deprecated()) operation.setDeprecated(apiOperation.deprecated()); @@ -306,82 +306,6 @@ private void buildTags(io.swagger.v3.oas.annotations.Operation apiOperation, Ope } } - /** - * Gets operation id. - * - * @param operationId the operation id - * @param openAPI the open api - * @return the operation id - */ - public String getOperationId(String operationId, OpenAPI openAPI) { - boolean operationIdUsed = existOperationId(operationId, openAPI); - String operationIdToFind = null; - int counter = 0; - while (operationIdUsed) { - operationIdToFind = String.format("%s_%d", operationId, ++counter); - operationIdUsed = existOperationId(operationIdToFind, openAPI); - } - if (operationIdToFind != null) { - operationId = operationIdToFind; - } - return operationId; - } - - /** - * Exist operation id boolean. - * - * @param operationId the operation id - * @param openAPI the open api - * @return the boolean - */ - private boolean existOperationId(String operationId, OpenAPI openAPI) { - if (openAPI == null) { - return false; - } - if (openAPI.getPaths() == null || openAPI.getPaths().isEmpty()) { - return false; - } - for (PathItem path : openAPI.getPaths().values()) { - Set pathOperationIds = extractOperationIdFromPathItem(path); - if (pathOperationIds.contains(operationId)) { - return true; - } - } - return false; - } - - /** - * Extract operation id from path item set. - * - * @param path the path - * @return the set - */ - private Set extractOperationIdFromPathItem(PathItem path) { - Set ids = new HashSet<>(); - if (path.getGet() != null && StringUtils.isNotBlank(path.getGet().getOperationId())) { - ids.add(path.getGet().getOperationId()); - } - if (path.getPost() != null && StringUtils.isNotBlank(path.getPost().getOperationId())) { - ids.add(path.getPost().getOperationId()); - } - if (path.getPut() != null && StringUtils.isNotBlank(path.getPut().getOperationId())) { - ids.add(path.getPut().getOperationId()); - } - if (path.getDelete() != null && StringUtils.isNotBlank(path.getDelete().getOperationId())) { - ids.add(path.getDelete().getOperationId()); - } - if (path.getOptions() != null && StringUtils.isNotBlank(path.getOptions().getOperationId())) { - ids.add(path.getOptions().getOperationId()); - } - if (path.getHead() != null && StringUtils.isNotBlank(path.getHead().getOperationId())) { - ids.add(path.getHead().getOperationId()); - } - if (path.getPatch() != null && StringUtils.isNotBlank(path.getPatch().getOperationId())) { - ids.add(path.getPatch().getOperationId()); - } - return ids; - } - /** * Gets api responses. * @@ -597,21 +521,6 @@ private Optional> getStringListFromStringArray(String[] array) { return Optional.of(list); } - /** - * Gets operation id. - * - * @param operationId the operation id - * @param oldOperationId the old operation id - * @param openAPI the open api - * @return the operation id - */ - public String getOperationId(String operationId, String oldOperationId, OpenAPI openAPI) { - if (StringUtils.isNotBlank(oldOperationId)) - return this.getOperationId(oldOperationId, openAPI); - else - return this.getOperationId(operationId, openAPI); - } - /** * Merge operation. * diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/configuration/SpringDocHateoasConfigurationTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/configuration/SpringDocHateoasConfigurationTest.java index c99de580c..91e3029bb 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/configuration/SpringDocHateoasConfigurationTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/configuration/SpringDocHateoasConfigurationTest.java @@ -32,8 +32,8 @@ void linksSchemaCustomizerShouldBeRegistered() { )) .run(context -> { assertThat(context).getBeanNames(GlobalOpenApiCustomizer.class) - .hasSize(1) - .containsExactly(LINKS_SCHEMA_CUSTOMISER); + .hasSize(2) + .contains(LINKS_SCHEMA_CUSTOMISER); assertThat(context.getBean(LINKS_SCHEMA_CUSTOMISER)).isExactlyInstanceOf(OpenApiHateoasLinksCustomizer.class); }); } diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java index 67e2721fc..244850375 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java @@ -21,8 +21,10 @@ import test.org.springdoc.api.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.context.annotation.ComponentScan; +@AutoConfigureWebTestClient(timeout = "3600000") public class SpringDocApp65Test extends AbstractSpringDocTest { @SpringBootApplication diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app73.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app73.json index 1ce2dc7fb..0e297ed56 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app73.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app73.json @@ -11,19 +11,9 @@ } ], "paths": { - "/hello": { - "get": { - "operationId": "hello", - "responses": { - "200": { - "description": "OK" - } - } - } - }, "/echo": { "post": { - "operationId": "echo_1_1", + "operationId": "echo", "requestBody": { "content": { "text/plain": { @@ -57,9 +47,19 @@ } } }, + "/hello": { + "get": { + "operationId": "hello", + "responses": { + "200": { + "description": "OK" + } + } + } + }, "/quotes": { "get": { - "operationId": "fetchQuotes_1_1", + "operationId": "fetchQuotes", "parameters": [ { "name": "size", diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app74.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app74.json index 0a54dbfad..8f0a26a58 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app74.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app74.json @@ -16,7 +16,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1", + "operationId": "findAll", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app80.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app80.json index 22dadf6ea..89c51b6d1 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app80.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app80.json @@ -16,7 +16,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1", + "operationId": "findAll", "responses": { "200": { "description": "OK", @@ -88,7 +88,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll", + "operationId": "findAll_1", "responses": { "200": { "description": "OK", @@ -134,7 +134,7 @@ "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -142,7 +142,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -160,7 +160,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_2_1", + "operationId": "findAll_2", "responses": { "200": { "description": "OK", @@ -232,7 +232,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_2_2", + "operationId": "findAll_3", "responses": { "200": { "description": "OK", @@ -304,7 +304,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_2_3", + "operationId": "findAll_4", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app86.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app86.json index 1ce2dc7fb..0e297ed56 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app86.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app86.json @@ -11,19 +11,9 @@ } ], "paths": { - "/hello": { - "get": { - "operationId": "hello", - "responses": { - "200": { - "description": "OK" - } - } - } - }, "/echo": { "post": { - "operationId": "echo_1_1", + "operationId": "echo", "requestBody": { "content": { "text/plain": { @@ -57,9 +47,19 @@ } } }, + "/hello": { + "get": { + "operationId": "hello", + "responses": { + "200": { + "description": "OK" + } + } + } + }, "/quotes": { "get": { - "operationId": "fetchQuotes_1_1", + "operationId": "fetchQuotes", "parameters": [ { "name": "size", diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app87.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app87.json index 0a54dbfad..8f0a26a58 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app87.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app87.json @@ -16,7 +16,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1", + "operationId": "findAll", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app89.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app89.json index 22dadf6ea..ea04eecda 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app89.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app89.json @@ -16,7 +16,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1", + "operationId": "findAll", "responses": { "200": { "description": "OK", @@ -88,12 +88,12 @@ "tags": [ "book-repository" ], - "operationId": "findAll", + "operationId": "findAll_1", "responses": { "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -101,7 +101,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -134,7 +134,7 @@ "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -142,7 +142,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -160,7 +160,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_2_1", + "operationId": "findAll_2", "responses": { "200": { "description": "OK", @@ -232,7 +232,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_2_2", + "operationId": "findAll_3", "responses": { "200": { "description": "OK", @@ -304,7 +304,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_2_3", + "operationId": "findAll_4", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app90.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app90.json index c5979e6fa..ec997c6c6 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app90.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app90.json @@ -47,12 +47,12 @@ "tags": [ "book" ], - "operationId": "findAll_1_1", + "operationId": "findAll", "responses": { "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -60,7 +60,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -120,7 +120,7 @@ "tags": [ "book" ], - "operationId": "findAll", + "operationId": "findAll_1", "responses": { "200": { "description": "OK", @@ -184,12 +184,12 @@ "tags": [ "book" ], - "operationId": "findAll_1", + "operationId": "findAll_2", "responses": { "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -197,7 +197,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -215,12 +215,12 @@ "tags": [ "book" ], - "operationId": "findAll_3_1", + "operationId": "findAll_3", "responses": { "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -228,7 +228,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -381,7 +381,7 @@ "positions" ], "description": "Get all positions", - "operationId": "findAll_2", + "operationId": "findAll_4", "responses": { "200": { "description": "OK", @@ -435,7 +435,7 @@ "tags": [ "quotes" ], - "operationId": "echo_1_1", + "operationId": "echo", "requestBody": { "content": { "text/plain": { @@ -487,7 +487,7 @@ "tags": [ "quotes" ], - "operationId": "fetchQuotes_1_1", + "operationId": "fetchQuotes", "parameters": [ { "name": "size", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app106.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app106.json index 57677aa0f..37b143029 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app106.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app106.json @@ -17,7 +17,7 @@ "hello-controller" ], "summary": "find-articles", - "operationId": "findArticles_1", + "operationId": "findArticles", "parameters": [ { "name": "If-Modified-Since", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app108.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app108.json index 8375715aa..e4e98e576 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app108.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app108.json @@ -16,7 +16,7 @@ "tags": [ "hello-controller" ], - "operationId": "update_1", + "operationId": "update", "parameters": [ { "name": "toto", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app122.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app122.json index d7a836d13..ed18e58c0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app122.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app122.json @@ -17,7 +17,7 @@ "example" ], "summary": "create", - "operationId": "create_1", + "operationId": "create", "requestBody": { "content": { "application/json": { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app126.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app126.json index 442057409..3bea48404 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app126.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app126.json @@ -18,7 +18,7 @@ ], "summary": "getAllCurrencies", "description": "Get all currencies", - "operationId": "getAllCurrencies_1", + "operationId": "getAllCurrencies", "responses": { "401": { "$ref": "#/components/responses/http401NoToken" @@ -62,15 +62,15 @@ "type": "object" } }, + "status": { + "type": "integer", + "format": "int32" + }, "title": { "type": "string" }, "detail": { "type": "string" - }, - "status": { - "type": "integer", - "format": "int32" } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app135.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app135.json index 42418d7cf..80f9ab7d8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app135.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app135.json @@ -62,7 +62,7 @@ "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -70,7 +70,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -88,7 +88,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1_1", + "operationId": "findAll_1", "responses": { "200": { "description": "OK", @@ -160,7 +160,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1_2", + "operationId": "findAll_2", "responses": { "200": { "description": "OK", @@ -232,7 +232,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1_3", + "operationId": "findAll_3", "responses": { "200": { "description": "OK", @@ -304,7 +304,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1_4", + "operationId": "findAll_4", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app141.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app141.json index 42418d7cf..c75a3a94d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app141.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app141.json @@ -21,7 +21,7 @@ "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -29,7 +29,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -62,7 +62,7 @@ "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -70,7 +70,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -88,7 +88,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1_1", + "operationId": "findAll_1", "responses": { "200": { "description": "OK", @@ -160,7 +160,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1_2", + "operationId": "findAll_2", "responses": { "200": { "description": "OK", @@ -232,7 +232,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1_3", + "operationId": "findAll_3", "responses": { "200": { "description": "OK", @@ -304,7 +304,7 @@ "tags": [ "book-repository" ], - "operationId": "findAll_1_4", + "operationId": "findAll_4", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app161.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app161.json index e425730c0..fb1b822c0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app161.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app161.json @@ -85,7 +85,7 @@ "hello-controller" ], "summary": "This is a test message", - "operationId": "test_1", + "operationId": "test", "requestBody": { "content": { "multipart/form-data": { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app198.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app198.json index d7fb08a57..251cb0d2d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app198.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app198.json @@ -16,7 +16,7 @@ "tags": [ "hello-controller" ], - "operationId": "test_1", + "operationId": "test", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json index 3b515a38a..15af3c649 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json @@ -16,7 +16,7 @@ "tags": [ "required-mode-controller" ], - "operationId": "index_1", + "operationId": "index", "parameters": [ { "name": "id", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app211.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app211.json index f2b9b4346..0bb57161b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app211.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app211.json @@ -16,7 +16,7 @@ "tags": [ "hello-controller" ], - "operationId": "index_1", + "operationId": "index", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app216.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app216.json index 27d4c5e0c..0641bc89d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app216.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app216.json @@ -17,7 +17,7 @@ "hello-controller" ], "description": "a", - "operationId": "b_1", + "operationId": "b", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app37.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app37.json index 627fc2abc..fc1963ba1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app37.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app37.json @@ -16,17 +16,17 @@ "tags": [ "hello-controller" ], - "operationId": "petsPost_1", + "operationId": "petsPost", "requestBody": { "content": { - "application/json": { + "text/plain": { "schema": { - "$ref": "#/components/schemas/Pet" + "type": "string" } }, - "text/plain": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Pet" } } } @@ -43,9 +43,14 @@ "tags": [ "hello-controller" ], - "operationId": "process_1_1", + "operationId": "process", "requestBody": { "content": { + "application/x.c+json": { + "schema": { + "$ref": "#/components/schemas/Car" + } + }, "application/x.b+json": { "schema": { "$ref": "#/components/schemas/Bar" @@ -55,11 +60,6 @@ "schema": { "$ref": "#/components/schemas/Foo" } - }, - "application/x.c+json": { - "schema": { - "$ref": "#/components/schemas/Car" - } } } }, @@ -67,6 +67,11 @@ "200": { "description": "OK", "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Car" + } + }, "text/plain": { "schema": { "oneOf": [ @@ -78,11 +83,6 @@ } ] } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/Car" - } } } } @@ -100,26 +100,26 @@ } } }, - "Bar": { + "Car": { "type": "object", "properties": { - "bar": { + "car": { "type": "string" } } }, - "Foo": { + "Bar": { "type": "object", "properties": { - "foo": { + "bar": { "type": "string" } } }, - "Car": { + "Foo": { "type": "object", "properties": { - "car": { + "foo": { "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app47.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app47.json index b683fac32..6ddd43110 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app47.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app47.json @@ -46,7 +46,7 @@ "tags": [ "basic-controller" ], - "operationId": "get1_1_1", + "operationId": "get1", "parameters": [ { "name": "foo", @@ -96,4 +96,3 @@ }, "components": {} } - \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app51.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app51.json index 55e35e2b6..b4b326ba9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app51.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app51.json @@ -16,7 +16,7 @@ "tags": [ "hello-controller" ], - "operationId": "hello_1", + "operationId": "hello", "requestBody": { "content": { "application/json": { @@ -190,4 +190,4 @@ } }, "components": {} -} \ No newline at end of file +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app91.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app91.json index 32d710f08..2c4246f73 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app91.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app91.json @@ -63,7 +63,7 @@ "Demo" ], "summary": "This API will return a random greeting.", - "operationId": "sayHello_1", + "operationId": "sayHello", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app93.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app93.json index 62cade080..462cfe210 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app93.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app93.json @@ -16,7 +16,7 @@ "tags": [ "specific-controller" ], - "operationId": "get_1", + "operationId": "get", "parameters": [ { "name": "param", diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json index bcfb2e81e..889f11afa 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json @@ -66,7 +66,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_2", + "operationId": "loggers-name_1", "parameters": [ { "name": "name", @@ -279,68 +279,6 @@ } } }, - "/application/sbom": { - "get": { - "operationId": "sbom", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom'", - "tags": [ - "Actuator" - ] - } - }, - "/application/sbom/{id}": { - "get": { - "operationId": "sbom-id", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom-id'", - "tags": [ - "Actuator" - ] - } - }, "/application/metrics": { "get": { "tags": [ @@ -737,7 +675,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_2", + "operationId": "caches-cache_1", "parameters": [ { "name": "cache", @@ -807,7 +745,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_2", + "operationId": "caches_1", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json index 33d159196..7e30137d2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json @@ -66,7 +66,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_2", + "operationId": "loggers-name_1", "parameters": [ { "name": "name", @@ -279,68 +279,6 @@ } } }, - "/application/sbom": { - "get": { - "operationId": "sbom", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom'", - "tags": [ - "Actuator" - ] - } - }, - "/application/sbom/{id}": { - "get": { - "operationId": "sbom-id", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom-id'", - "tags": [ - "Actuator" - ] - } - }, "/application/metrics": { "get": { "tags": [ @@ -737,7 +675,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_2", + "operationId": "caches-cache_1", "parameters": [ { "name": "cache", @@ -807,7 +745,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_2", + "operationId": "caches_1", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json index ebc856a6f..7e30137d2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json @@ -66,7 +66,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_2", + "operationId": "loggers-name_1", "parameters": [ { "name": "name", @@ -675,7 +675,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_2", + "operationId": "caches-cache_1", "parameters": [ { "name": "cache", @@ -745,7 +745,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_2", + "operationId": "caches_1", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json index 4b706fa5c..eec8f3533 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json @@ -66,7 +66,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_2", + "operationId": "loggers-name_1", "parameters": [ { "name": "name", @@ -279,68 +279,6 @@ } } }, - "/application/sbom": { - "get": { - "operationId": "sbom", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom'", - "tags": [ - "Actuator" - ] - } - }, - "/application/sbom/{id}": { - "get": { - "operationId": "sbom-id", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom-id'", - "tags": [ - "Actuator" - ] - } - }, "/application/metrics": { "get": { "tags": [ @@ -737,7 +675,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_2", + "operationId": "caches-cache_1", "parameters": [ { "name": "cache", @@ -807,7 +745,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_2", + "operationId": "caches_1", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json index 4483a9f2c..801e02898 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json @@ -66,7 +66,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_2", + "operationId": "loggers-name_1", "parameters": [ { "name": "name", @@ -359,68 +359,6 @@ } } }, - "/application/sbom": { - "get": { - "operationId": "sbom", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom'", - "tags": [ - "Actuator" - ] - } - }, - "/application/sbom/{id}": { - "get": { - "operationId": "sbom-id", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom-id'", - "tags": [ - "Actuator" - ] - } - }, "/application/mappings": { "get": { "tags": [ @@ -776,7 +714,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_2", + "operationId": "caches_1", "responses": { "200": { "description": "OK", @@ -836,7 +774,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_2", + "operationId": "caches-cache_1", "parameters": [ { "name": "cache", diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json index 69726213f..f4bc5ee44 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json @@ -66,7 +66,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_2", + "operationId": "loggers-name_1", "parameters": [ { "name": "name", @@ -359,68 +359,6 @@ } } }, - "/application/sbom": { - "get": { - "operationId": "sbom", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom'", - "tags": [ - "Actuator" - ] - } - }, - "/application/sbom/{id}": { - "get": { - "operationId": "sbom-id", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom-id'", - "tags": [ - "Actuator" - ] - } - }, "/application/mappings": { "get": { "tags": [ @@ -776,7 +714,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_2", + "operationId": "caches_1", "responses": { "200": { "description": "OK", @@ -836,7 +774,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_2", + "operationId": "caches-cache_1", "parameters": [ { "name": "cache", diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app10.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app10.json index 96d007c9a..d7ea17c5e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app10.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app10.json @@ -17,7 +17,7 @@ "account-entity-controller" ], "description": "get-account", - "operationId": "getCollectionResource-account-get_1", + "operationId": "getCollectionResource-account-get", "responses": { "200": { "description": "OK", @@ -262,7 +262,7 @@ "account-property-reference-controller" ], "description": "get-customer-by-account-Id", - "operationId": "followPropertyReference-account-get_1", + "operationId": "followPropertyReference-account-get", "parameters": [ { "name": "id", @@ -440,7 +440,7 @@ "account-property-reference-controller" ], "description": "get-customer-by-account-Id", - "operationId": "followPropertyReference-account-get", + "operationId": "followPropertyReference-account-get_1", "parameters": [ { "name": "id", @@ -515,7 +515,7 @@ "customer-entity-controller" ], "description": "get-customer", - "operationId": "getCollectionResource-customer-get_1", + "operationId": "getCollectionResource-customer-get", "responses": { "200": { "description": "OK", @@ -611,7 +611,7 @@ "tags": [ "profile-controller" ], - "operationId": "listAllFormsOfMetadata_1", + "operationId": "listAllFormsOfMetadata", "responses": { "200": { "description": "OK", @@ -631,7 +631,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app11.json index 4c7b2aa89..f840c5afd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app11.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app11.json @@ -17,7 +17,7 @@ "person-entity-controller" ], "description": "get-person", - "operationId": "getCollectionResource-person-get_1", + "operationId": "getCollectionResource-person-get", "parameters": [ { "name": "page", @@ -135,7 +135,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app16.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app16.json index 697c129cf..e95e0eaf6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app16.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app16.json @@ -23,7 +23,7 @@ ], "summary": "getCollectionResource-account-get", "description": "get-account", - "operationId": "getCollectionResource-account-get_1", + "operationId": "getCollectionResource-account-get", "responses": { "200": { "description": "OK", @@ -310,7 +310,7 @@ ], "summary": "followPropertyReference-account-get", "description": "get-customer-by-account-Id", - "operationId": "followPropertyReference-account-get_1", + "operationId": "followPropertyReference-account-get", "parameters": [ { "name": "id", @@ -512,7 +512,7 @@ ], "summary": "followPropertyReference-account-get", "description": "get-customer-by-account-Id", - "operationId": "followPropertyReference-account-get", + "operationId": "followPropertyReference-account-get_1", "parameters": [ { "name": "id", @@ -599,7 +599,7 @@ ], "summary": "getCollectionResource-customer-get", "description": "get-customer", - "operationId": "getCollectionResource-customer-get_1", + "operationId": "getCollectionResource-customer-get", "responses": { "200": { "description": "OK", @@ -863,7 +863,7 @@ "profile-controller" ], "summary": "listAllFormsOfMetadata", - "operationId": "listAllFormsOfMetadata_1", + "operationId": "listAllFormsOfMetadata", "responses": { "200": { "description": "OK", @@ -884,7 +884,7 @@ "profile-controller" ], "summary": "descriptor", - "operationId": "descriptor_1_1_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", @@ -915,7 +915,7 @@ "profile-controller" ], "summary": "descriptor", - "operationId": "descriptor_1_1_2", + "operationId": "descriptor_1", "responses": { "200": { "description": "OK", @@ -1038,30 +1038,28 @@ } } }, - "EntityModelCustomer": { + "EntityModelAccount": { "type": "object", "properties": { - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" + "expiryDate": { + "type": "string", + "format": "date-time" }, "_links": { "$ref": "#/components/schemas/Links" } } }, - "CollectionModelEntityModelCustomer": { + "CollectionModelEntityModelAccount": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "customers": { + "accounts": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityModelCustomer" + "$ref": "#/components/schemas/EntityModelAccount" } } } @@ -1071,71 +1069,49 @@ } } }, - "PageMetadata": { + "EntityModelCustomer": { "type": "object", "properties": { - "size": { - "type": "integer", - "format": "int64" - }, - "totalElements": { - "type": "integer", - "format": "int64" + "firstname": { + "type": "string" }, - "totalPages": { - "type": "integer", - "format": "int64" + "lastname": { + "type": "string" }, - "number": { - "type": "integer", - "format": "int64" + "_links": { + "$ref": "#/components/schemas/Links" } } }, - "PagedModelEntityModelCustomer": { + "CollectionModelObject": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "customers": { + "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityModelCustomer" + "type": "object" } } } }, - "_links": { - "$ref": "#/components/schemas/Links" - }, - "page": { - "$ref": "#/components/schemas/PageMetadata" - } - } - }, - "EntityModelAccount": { - "type": "object", - "properties": { - "expiryDate": { - "type": "string", - "format": "date-time" - }, "_links": { "$ref": "#/components/schemas/Links" } } }, - "CollectionModelEntityModelAccount": { + "CollectionModelEntityModelCustomer": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "accounts": { + "customers": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityModelAccount" + "$ref": "#/components/schemas/EntityModelCustomer" } } } @@ -1145,22 +1121,46 @@ } } }, - "CollectionModelObject": { + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelCustomer": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "objects": { + "customers": { "type": "array", "items": { - "type": "object" + "$ref": "#/components/schemas/EntityModelCustomer" } } } }, "_links": { "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" } } }, diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app17.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app17.json index 96b0394ee..e1085bae2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app17.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app17.json @@ -17,7 +17,7 @@ "child-property-entity-controller" ], "description": "get-childproperty", - "operationId": "getCollectionResource-childproperty-get_1", + "operationId": "getCollectionResource-childproperty-get", "parameters": [ { "name": "page", @@ -83,7 +83,7 @@ "tags": [ "profile-controller" ], - "operationId": "listAllFormsOfMetadata_1", + "operationId": "listAllFormsOfMetadata", "responses": { "200": { "description": "OK", @@ -103,7 +103,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", @@ -133,7 +133,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_2", + "operationId": "descriptor_1", "responses": { "200": { "description": "OK", @@ -164,7 +164,7 @@ "property-entity-controller" ], "description": "get-property", - "operationId": "getCollectionResource-property-get_1", + "operationId": "getCollectionResource-property-get", "parameters": [ { "name": "page", @@ -320,7 +320,7 @@ } } }, - "EntityModelProperty": { + "EntityModelChildProperty": { "type": "object", "properties": { "id": { @@ -330,9 +330,6 @@ "name": { "type": "string" }, - "myChildPropertyName": { - "$ref": "#/components/schemas/ChildProperty" - }, "_links": { "$ref": "#/components/schemas/Links" } @@ -359,16 +356,16 @@ } } }, - "PagedModelEntityModelProperty": { + "PagedModelEntityModelChildProperty": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "properties": { + "childProperties": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityModelProperty" + "$ref": "#/components/schemas/EntityModelChildProperty" } } } @@ -381,7 +378,7 @@ } } }, - "EntityModelChildProperty": { + "EntityModelProperty": { "type": "object", "properties": { "id": { @@ -391,21 +388,24 @@ "name": { "type": "string" }, + "myChildPropertyName": { + "$ref": "#/components/schemas/ChildProperty" + }, "_links": { "$ref": "#/components/schemas/Links" } } }, - "PagedModelEntityModelChildProperty": { + "PagedModelEntityModelProperty": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "childProperties": { + "properties": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityModelChildProperty" + "$ref": "#/components/schemas/EntityModelProperty" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app20.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app20.json index 3ebaa3cd8..8a208bfb0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app20.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app20.json @@ -16,7 +16,7 @@ "bank-entity-controller" ], "description": "get-bank", - "operationId": "getCollectionResource-bank-get_1", + "operationId": "getCollectionResource-bank-get", "parameters": [ { "name": "page", @@ -329,7 +329,7 @@ "tags": [ "profile-controller" ], - "operationId": "listAllFormsOfMetadata_1", + "operationId": "listAllFormsOfMetadata", "responses": { "200": { "description": "OK", @@ -349,7 +349,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app21.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app21.json index 1b2b1cbce..f61470407 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app21.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app21.json @@ -17,7 +17,7 @@ "person-entity-controller" ], "description": "get-person", - "operationId": "getCollectionResource-person-get_1", + "operationId": "getCollectionResource-person-get", "parameters": [ { "name": "page", @@ -142,8 +142,8 @@ } ], "responses": { - "404": { - "description": "Contact not found", + "400": { + "description": "Invalid ID supplied", "content": { "application/hal+json": { "schema": { @@ -155,8 +155,8 @@ } } }, - "405": { - "description": "Validation exception", + "200": { + "description": "successful operation", "content": { "application/hal+json": { "schema": { @@ -168,8 +168,8 @@ } } }, - "400": { - "description": "Invalid ID supplied", + "404": { + "description": "Contact not found", "content": { "application/hal+json": { "schema": { @@ -181,8 +181,8 @@ } } }, - "200": { - "description": "successful operation", + "405": { + "description": "Validation exception", "content": { "application/hal+json": { "schema": { @@ -222,7 +222,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app22.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app22.json index 6db5d37e4..7b0342647 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app22.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app22.json @@ -17,7 +17,7 @@ "person-entity-controller" ], "description": "get-person", - "operationId": "getCollectionResource-person-get_1", + "operationId": "getCollectionResource-person-get", "parameters": [ { "name": "page", @@ -103,7 +103,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app23.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app23.json index c1c73d94d..3b2dd10aa 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app23.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app23.json @@ -17,7 +17,7 @@ "clinic-entity-controller" ], "description": "get-clinic", - "operationId": "getCollectionResource-clinic-get_1", + "operationId": "getCollectionResource-clinic-get", "responses": { "200": { "description": "OK", @@ -230,7 +230,7 @@ "doctor-entity-controller" ], "description": "get-doctor", - "operationId": "getCollectionResource-doctor-get_1", + "operationId": "getCollectionResource-doctor-get", "responses": { "200": { "description": "OK", @@ -443,7 +443,7 @@ "doctor-property-reference-controller" ], "description": "get-clinic-by-doctor-Id", - "operationId": "followPropertyReference-doctor-get_1", + "operationId": "followPropertyReference-doctor-get", "parameters": [ { "name": "id", @@ -621,7 +621,7 @@ "doctor-property-reference-controller" ], "description": "get-clinic-by-doctor-Id", - "operationId": "followPropertyReference-doctor-get", + "operationId": "followPropertyReference-doctor-get_1", "parameters": [ { "name": "id", @@ -695,7 +695,7 @@ "tags": [ "profile-controller" ], - "operationId": "listAllFormsOfMetadata_1", + "operationId": "listAllFormsOfMetadata", "responses": { "200": { "description": "OK", @@ -715,7 +715,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", @@ -745,7 +745,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_2", + "operationId": "descriptor_1", "responses": { "200": { "description": "OK", @@ -853,30 +853,24 @@ } } }, - "EntityModelClinic": { - "required": [ - "name" - ], + "EntityModelDoctor": { "type": "object", "properties": { - "name": { - "type": "string" - }, "_links": { "$ref": "#/components/schemas/Links" } } }, - "CollectionModelEntityModelClinic": { + "CollectionModelEntityModelDoctor": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "clinics": { + "doctors": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityModelClinic" + "$ref": "#/components/schemas/EntityModelDoctor" } } } @@ -886,24 +880,16 @@ } } }, - "EntityModelDoctor": { - "type": "object", - "properties": { - "_links": { - "$ref": "#/components/schemas/Links" - } - } - }, - "CollectionModelEntityModelDoctor": { + "CollectionModelClinic": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "doctors": { + "clinics": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityModelDoctor" + "$ref": "#/components/schemas/ClinicResponse" } } } @@ -932,7 +918,21 @@ } } }, - "CollectionModelClinic": { + "EntityModelClinic": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelClinic": { "type": "object", "properties": { "_embedded": { @@ -941,7 +941,7 @@ "clinics": { "type": "array", "items": { - "$ref": "#/components/schemas/ClinicResponse" + "$ref": "#/components/schemas/EntityModelClinic" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app25.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app25.json index 37d589101..bc4d6ea8b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app25.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app25.json @@ -17,7 +17,7 @@ "clinic-entity-controller" ], "description": "get-clinic", - "operationId": "getCollectionResource-clinic-get_1", + "operationId": "getCollectionResource-clinic-get", "responses": { "200": { "description": "OK", @@ -230,7 +230,7 @@ "doctor-entity-controller" ], "description": "get-doctor", - "operationId": "getCollectionResource-doctor-get_1", + "operationId": "getCollectionResource-doctor-get", "responses": { "200": { "description": "OK", @@ -475,7 +475,7 @@ "doctor-property-reference-controller" ], "description": "get-clinic-by-doctor-Id", - "operationId": "followPropertyReference-doctor-get_1", + "operationId": "followPropertyReference-doctor-get", "parameters": [ { "name": "id", @@ -653,7 +653,7 @@ "doctor-property-reference-controller" ], "description": "get-clinic-by-doctor-Id", - "operationId": "followPropertyReference-doctor-get", + "operationId": "followPropertyReference-doctor-get_1", "parameters": [ { "name": "id", @@ -728,7 +728,7 @@ "owner-entity-controller" ], "description": "get-owner", - "operationId": "getCollectionResource-owner-get_1", + "operationId": "getCollectionResource-owner-get", "parameters": [ { "name": "page", @@ -977,7 +977,7 @@ "owner-property-reference-controller" ], "description": "get-pet-by-owner-Id", - "operationId": "followPropertyReference-owner-get_1", + "operationId": "followPropertyReference-owner-get", "parameters": [ { "name": "id", @@ -1155,7 +1155,7 @@ "owner-property-reference-controller" ], "description": "get-pet-by-owner-Id", - "operationId": "followPropertyReference-owner-get", + "operationId": "followPropertyReference-owner-get_1", "parameters": [ { "name": "id", @@ -1230,7 +1230,7 @@ "pet-entity-controller" ], "description": "get-pet", - "operationId": "getCollectionResource-pet-get_1", + "operationId": "getCollectionResource-pet-get", "parameters": [ { "name": "page", @@ -1509,7 +1509,7 @@ "pet-property-reference-controller" ], "description": "get-owner-by-pet-Id", - "operationId": "followPropertyReference-pet-get_1", + "operationId": "followPropertyReference-pet-get", "parameters": [ { "name": "id", @@ -1687,7 +1687,7 @@ "pet-property-reference-controller" ], "description": "get-owner-by-pet-Id", - "operationId": "followPropertyReference-pet-get", + "operationId": "followPropertyReference-pet-get_1", "parameters": [ { "name": "id", @@ -1761,7 +1761,7 @@ "tags": [ "profile-controller" ], - "operationId": "listAllFormsOfMetadata_1", + "operationId": "listAllFormsOfMetadata", "responses": { "200": { "description": "OK", @@ -1781,7 +1781,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", @@ -1811,7 +1811,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_2", + "operationId": "descriptor_1", "responses": { "200": { "description": "OK", @@ -1841,7 +1841,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_3", + "operationId": "descriptor_2", "responses": { "200": { "description": "OK", @@ -1871,7 +1871,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_4", + "operationId": "descriptor_3", "responses": { "200": { "description": "OK", @@ -2026,149 +2026,6 @@ } } }, - "EntityModelClinic": { - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "addresses": { - "maxItems": 2147483647, - "minItems": 1, - "uniqueItems": true, - "type": "array", - "items": { - "$ref": "#/components/schemas/Address" - } - }, - "_links": { - "$ref": "#/components/schemas/Links" - } - } - }, - "CollectionModelEntityModelClinic": { - "type": "object", - "properties": { - "_embedded": { - "type": "object", - "properties": { - "clinics": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityModelClinic" - } - } - } - }, - "_links": { - "$ref": "#/components/schemas/Links" - } - } - }, - "EntityModelPet": { - "required": [ - "_type", - "name" - ], - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "_type": { - "type": "string" - }, - "_links": { - "$ref": "#/components/schemas/Links" - } - } - }, - "PageMetadata": { - "type": "object", - "properties": { - "size": { - "type": "integer", - "format": "int64" - }, - "totalElements": { - "type": "integer", - "format": "int64" - }, - "totalPages": { - "type": "integer", - "format": "int64" - }, - "number": { - "type": "integer", - "format": "int64" - } - } - }, - "PagedModelEntityModelPet": { - "type": "object", - "properties": { - "_embedded": { - "type": "object", - "properties": { - "pets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityModelPet" - } - } - } - }, - "_links": { - "$ref": "#/components/schemas/Links" - }, - "page": { - "$ref": "#/components/schemas/PageMetadata" - } - } - }, - "CollectionModelObject": { - "type": "object", - "properties": { - "_embedded": { - "type": "object", - "properties": { - "objects": { - "type": "array", - "items": { - "type": "object" - } - } - } - }, - "_links": { - "$ref": "#/components/schemas/Links" - } - } - }, - "EntityModelOwner": { - "required": [ - "addresses", - "lastname" - ], - "type": "object", - "properties": { - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" - }, - "addresses": { - "$ref": "#/components/schemas/Address" - }, - "_links": { - "$ref": "#/components/schemas/Links" - } - } - }, "EntityModelDoctor": { "required": [ "firstname", @@ -2303,6 +2160,107 @@ } } }, + "CollectionModelObject": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelPet": { + "required": [ + "_type", + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "_type": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelPet": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPet" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "EntityModelOwner": { + "required": [ + "addresses", + "lastname" + ], + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "addresses": { + "$ref": "#/components/schemas/Address" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, "PagedModelEntityModelOwner": { "type": "object", "properties": { @@ -2354,6 +2312,48 @@ } } }, + "EntityModelClinic": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "addresses": { + "maxItems": 2147483647, + "minItems": 1, + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelClinic": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "clinics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, "ClinicRequestBody": { "required": [ "name" diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app26.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app26.json index ba90577f5..562819ee2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app26.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app26.json @@ -17,7 +17,7 @@ "person-entity-controller" ], "description": "get-person", - "operationId": "getCollectionResource-person-get_1", + "operationId": "getCollectionResource-person-get", "parameters": [ { "name": "page", @@ -151,7 +151,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app29.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app29.json index 948afb7ef..8eb0185ab 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app29.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app29.json @@ -17,7 +17,7 @@ "person-entity-controller" ], "description": "get-person", - "operationId": "getCollectionResource-person-get_1", + "operationId": "getCollectionResource-person-get", "parameters": [ { "name": "page", @@ -103,7 +103,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app34.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app34.json index fd2dcf8f8..57c436e53 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app34.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app34.json @@ -22,7 +22,7 @@ "The account Repository" ], "description": "get-account", - "operationId": "getCollectionResource-account-get_1", + "operationId": "getCollectionResource-account-get", "responses": { "200": { "description": "OK", @@ -302,7 +302,7 @@ "The account Repository" ], "description": "get-customer-by-account-Id", - "operationId": "followPropertyReference-account-get_1", + "operationId": "followPropertyReference-account-get", "parameters": [ { "name": "id", @@ -500,7 +500,7 @@ "The account Repository" ], "description": "get-customer-by-account-Id", - "operationId": "followPropertyReference-account-get", + "operationId": "followPropertyReference-account-get_1", "parameters": [ { "name": "id", @@ -585,7 +585,7 @@ "The customer Repository" ], "description": "get-customer", - "operationId": "getCollectionResource-customer-get_1", + "operationId": "getCollectionResource-customer-get", "responses": { "200": { "description": "OK", @@ -844,7 +844,7 @@ "The customer Repository" ], "description": "get-account-by-customer-Id", - "operationId": "followPropertyReference-customer-get_1", + "operationId": "followPropertyReference-customer-get", "parameters": [ { "name": "id", @@ -997,7 +997,7 @@ "The customer Repository" ], "description": "get-account-by-customer-Id", - "operationId": "followPropertyReference-customer-get", + "operationId": "followPropertyReference-customer-get_1", "parameters": [ { "name": "id", @@ -1038,7 +1038,7 @@ "tags": [ "profile-controller" ], - "operationId": "listAllFormsOfMetadata_1", + "operationId": "listAllFormsOfMetadata", "responses": { "200": { "description": "OK", @@ -1058,7 +1058,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", @@ -1088,7 +1088,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_2", + "operationId": "descriptor_1", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app37.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app37.json index 12c142085..6b95b0716 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app37.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app37.json @@ -17,7 +17,7 @@ "product-entity-entity-controller" ], "description": "get-productentity", - "operationId": "getCollectionResource-productentity-get_1", + "operationId": "getCollectionResource-productentity-get", "parameters": [ { "name": "page", @@ -558,7 +558,7 @@ "tags": [ "profile-controller" ], - "operationId": "listAllFormsOfMetadata_1", + "operationId": "listAllFormsOfMetadata", "responses": { "200": { "description": "OK", @@ -578,7 +578,7 @@ "tags": [ "profile-controller" ], - "operationId": "descriptor_1_1_1", + "operationId": "descriptor", "responses": { "200": { "description": "OK", @@ -832,4 +832,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app2.json index d5a37d2c6..79166c2c6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app2.json +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app2.json @@ -16,7 +16,7 @@ "tags": [ "post-controller" ], - "operationId": "getAll_1", + "operationId": "getAll", "parameters": [ { "name": "pageable", diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app5.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app5.json index c06ac725a..5bf9f83e8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app5.json +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app5.json @@ -16,7 +16,7 @@ "tags": [ "company-controller" ], - "operationId": "create_1", + "operationId": "create", "requestBody": { "description": "Details of the Item to be created", "content": { diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/RecordObject__Javadoc.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/RecordObject__Javadoc.json deleted file mode 100644 index f0d5b3b7e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/RecordObject__Javadoc.json +++ /dev/null @@ -1 +0,0 @@ -{"doc":" Record Object\n\n @param id the id\n @param name the name\n","fields":[],"enumConstants":[],"methods":[],"constructors":[]} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app106.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app106.json index 2b4c457c9..f3c9e7ee7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app106.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app106.json @@ -24,7 +24,7 @@ ], "summary": "find-articles", "description": "Find articles response entity.", - "operationId": "findArticles_1", + "operationId": "findArticles", "parameters": [ { "name": "If-Modified-Since", diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app108.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app108.json index f6ae41597..ea930f5db 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app108.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app108.json @@ -24,7 +24,7 @@ ], "summary": "Update action result.", "description": "Update action result.", - "operationId": "update_1", + "operationId": "update", "parameters": [ { "name": "toto", diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app122.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app122.json index 809a45a51..a8e654275 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app122.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app122.json @@ -18,7 +18,7 @@ ], "summary": "create", "description": "Create response entity.", - "operationId": "create_1", + "operationId": "create", "requestBody": { "description": "the payload", "content": { diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app126.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app126.json index 60da48d1f..47ce6c5a7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app126.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app126.json @@ -24,7 +24,7 @@ ], "summary": "getAllCurrencies", "description": "Get all currencies", - "operationId": "getAllCurrencies_1", + "operationId": "getAllCurrencies", "responses": { "401": { "$ref": "#/components/responses/http401NoToken" @@ -56,8 +56,8 @@ "properties": { "instance": { "type": "string", - "format": "uri", - "description": "An absolute URI that identifies the specific occurrence of the problem.\n It may or may not yield further information if dereferenced." + "description": "An absolute URI that identifies the specific occurrence of the problem.\n It may or may not yield further information if dereferenced.", + "format": "uri" }, "type": { "type": "string", @@ -75,14 +75,14 @@ "type": "string", "description": "A short, human-readable summary of the problem type. It SHOULD NOT\n change from occurrence to occurrence of the problem, except for\n purposes of localisation." }, + "detail": { + "type": "string", + "description": "A human readable explanation specific to this occurrence of the problem." + }, "status": { "type": "integer", "description": "The HTTP status code generated by the origin server for this\n occurrence of the problem.", "format": "int32" - }, - "detail": { - "type": "string", - "description": "A human readable explanation specific to this occurrence of the problem." } }, "description": "The interface Problem." @@ -121,4 +121,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app135.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app135.json index 64630fa3d..18ae19ca2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app135.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app135.json @@ -101,7 +101,7 @@ ], "summary": "Find all list.", "description": "Find all list.", - "operationId": "findAll_1_3", + "operationId": "findAll_3", "responses": { "200": { "description": "the list", @@ -178,7 +178,7 @@ ], "summary": "Find all list.", "description": "Find all list.", - "operationId": "findAll_1_1", + "operationId": "findAll_1", "responses": { "200": { "description": "the list", @@ -255,7 +255,7 @@ ], "summary": "Find all list.", "description": "Find all list.", - "operationId": "findAll_1_4", + "operationId": "findAll_4", "responses": { "200": { "description": "the list", @@ -332,7 +332,7 @@ ], "summary": "Find all list.", "description": "Find all list.", - "operationId": "findAll_1_2", + "operationId": "findAll_2", "responses": { "200": { "description": "the list", @@ -425,4 +425,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app141.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app141.json index 0e3a6746a..8bacc7c24 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app141.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app141.json @@ -29,7 +29,7 @@ "200": { "description": "the list", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -37,7 +37,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -73,7 +73,7 @@ "200": { "description": "the list", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -81,7 +81,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -101,12 +101,12 @@ ], "summary": "Find all list.", "description": "Find all list.", - "operationId": "findAll_1_1", + "operationId": "findAll_1", "responses": { "200": { "description": "the list", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -114,7 +114,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -178,12 +178,12 @@ ], "summary": "Find all list.", "description": "Find all list.", - "operationId": "findAll_1_2", + "operationId": "findAll_2", "responses": { "200": { "description": "the list", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -191,7 +191,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -255,12 +255,12 @@ ], "summary": "Find all list.", "description": "Find all list.", - "operationId": "findAll_1_3", + "operationId": "findAll_3", "responses": { "200": { "description": "the list", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -268,7 +268,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -332,12 +332,12 @@ ], "summary": "Find all list.", "description": "Find all list.", - "operationId": "findAll_1_4", + "operationId": "findAll_4", "responses": { "200": { "description": "the list", "content": { - "application/xml": { + "application/json": { "schema": { "type": "array", "items": { @@ -345,7 +345,7 @@ } } }, - "application/json": { + "application/xml": { "schema": { "type": "array", "items": { @@ -425,4 +425,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app161.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app161.json index 9c53f3193..9fcfff1a5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app161.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app161.json @@ -95,7 +95,7 @@ ], "summary": "test", "description": "Test.", - "operationId": "test_1", + "operationId": "test", "requestBody": { "content": { "multipart/form-data": { diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app167.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app167.json index eeb1c3815..801fc0e3e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app167.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app167.json @@ -33,7 +33,7 @@ "tags": [ "hello-controller" ], - "operationId": "process_3", + "operationId": "process_2", "responses": { "200": { "description": "OK" @@ -44,7 +44,7 @@ "tags": [ "hello-controller" ], - "operationId": "process_2", + "operationId": "process_1", "responses": { "200": { "description": "OK" @@ -55,7 +55,7 @@ "tags": [ "hello-controller" ], - "operationId": "process_5", + "operationId": "process_3", "responses": { "200": { "description": "OK" @@ -77,7 +77,7 @@ "tags": [ "hello-controller" ], - "operationId": "process_1", + "operationId": "process_5", "responses": { "200": { "description": "OK" @@ -98,4 +98,4 @@ } }, "components": {} -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app3.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app3.json index 4f219bdc2..1eaccb8db 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app3.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app3.json @@ -24,7 +24,7 @@ ], "summary": "Echo playing card.", "description": "Echo playing card.", - "operationId": "echo_1", + "operationId": "echo", "parameters": [ { "name": "toto", diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app37.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app37.json index 29db92173..81aaff378 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app37.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app37.json @@ -24,7 +24,7 @@ ], "summary": "Process car.", "description": "Process car.", - "operationId": "process_1_1", + "operationId": "process", "requestBody": { "description": "the c", "content": { @@ -166,4 +166,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app51.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app51.json index 038c2a74b..a48152f4d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app51.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app51.json @@ -24,7 +24,7 @@ ], "summary": "Hello response entity.", "description": "Hello response entity.", - "operationId": "hello_1", + "operationId": "hello", "requestBody": { "description": "the map", "content": { diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app91.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app91.json index f3d2f44a4..107be9680 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app91.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app91.json @@ -24,7 +24,7 @@ ], "summary": "This API will return a random greeting.", "description": "Say hello response entity.", - "operationId": "sayHello_1", + "operationId": "sayHello", "responses": { "200": { "description": "the response entity", diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app93.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app93.json index 5509594a8..2634085eb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app93.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app93.json @@ -24,7 +24,7 @@ ], "summary": "Get t client model.", "description": "Get t client model.", - "operationId": "get_1", + "operationId": "get", "parameters": [ { "name": "param", diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app5.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app5.json index 50d96838a..13d4b5812 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app5.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app5.json @@ -16,7 +16,7 @@ "tags": [ "hello-controller" ], - "operationId": "doGet_1", + "operationId": "doGet", "responses": { "200": { "description": "OK" @@ -27,7 +27,7 @@ "tags": [ "hello-controller" ], - "operationId": "doPost_1", + "operationId": "doPost", "responses": { "200": { "description": "OK", @@ -56,4 +56,3 @@ } } } - \ No newline at end of file From 42f2c84eebd7509f983b6a6fe3461b7dce1e8c34 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 22 Sep 2024 14:45:28 +0200 Subject: [PATCH 060/226] Add support for OAS v3.1 webhooks. Fixes #2657 --- .../api/AbstractOpenApiResource.java | 138 +++++++++++------- .../core/service/OpenAPIService.java | 62 +++++++- .../api/v31/app9/SpringDocApp9Test.java | 37 +++++ .../api/v31/app9/WebHookResource.java | 52 +++++++ .../test/resources/results/3.1.0/app9.json | 47 ++++++ 5 files changed, 280 insertions(+), 56 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/WebHookResource.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app9.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index be2bb941b..25fd6538e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -60,6 +60,8 @@ import io.swagger.v3.core.filter.SpecFilter; import io.swagger.v3.core.util.ReflectionUtils; import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Webhook; +import io.swagger.v3.oas.annotations.Webhooks; import io.swagger.v3.oas.annotations.callbacks.Callback; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.models.Components; @@ -213,14 +215,14 @@ public abstract class AbstractOpenApiResource extends SpecFilter { /** * Instantiates a new Abstract open api resource. * - * @param groupName the group name + * @param groupName the group name * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ protected AbstractOpenApiResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, @@ -239,7 +241,8 @@ protected AbstractOpenApiResource(String groupName, ObjectFactory this.getOpenApi(Locale.forLanguageTag(locale))); } @@ -343,9 +346,10 @@ protected OpenAPI getOpenApi(Locale locale) { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a1, a2) -> a1)); Map findControllerAdvice = openAPIService.getControllerAdviceMap(); - if (OpenApiVersion.OPENAPI_3_1 == springDocConfigProperties.getApiDocs().getVersion()){ + if (OpenApiVersion.OPENAPI_3_1 == springDocConfigProperties.getApiDocs().getVersion()) { openAPI.openapi(OpenApiVersion.OPENAPI_3_1.getVersion()); openAPI.specVersion(SpecVersion.V31); + calculateWebhooks(openAPI, locale); } if (springDocConfigProperties.isDefaultOverrideWithGenericResponse()) { if (!CollectionUtils.isEmpty(mappingsMap)) @@ -373,7 +377,7 @@ protected OpenAPI getOpenApi(Locale locale) { if (springDocConfigProperties.isRemoveBrokenReferenceDefinitions()) this.removeBrokenReferenceDefinitions(openAPI); - // run the optional customisers + // run the optional customizers List servers = openAPI.getServers(); List serversCopy = null; try { @@ -401,13 +405,15 @@ protected OpenAPI getOpenApi(Locale locale) { } openAPIService.updateServers(openAPI); return openAPI; - } finally { + } + finally { this.reentrantLock.unlock(); } } /** * Indents are removed for properties that are mainly used as “explanations” using Open API. + * * @param openAPI the open api */ private void trimIndent(OpenAPI openAPI) { @@ -417,6 +423,7 @@ private void trimIndent(OpenAPI openAPI) { /** * Trim the indent for descriptions in the 'components' of open api. + * * @param openAPI the open api */ private void trimComponents(OpenAPI openAPI) { @@ -439,6 +446,7 @@ private void trimComponents(OpenAPI openAPI) { /** * Trim the indent for descriptions in the 'paths' of open api. + * * @param openAPI the open api */ private void trimPaths(OpenAPI openAPI) { @@ -461,6 +469,7 @@ private void trimPaths(OpenAPI openAPI) { /** * Trim the indent for 'operation' + * * @param operation the operation */ private void trimIndentOperation(Operation operation) { @@ -476,18 +485,39 @@ private void trimIndentOperation(Operation operation) { * Gets paths. * * @param findRestControllers the find rest controllers - * @param locale the locale - * @param openAPI the open api + * @param locale the locale + * @param openAPI the open api */ protected abstract void getPaths(Map findRestControllers, Locale locale, OpenAPI openAPI); + + /** + * Calculate webhooks. + * + * @param calculatedOpenAPI the calculated open api + * @param locale the locale + */ + protected void calculateWebhooks(OpenAPI calculatedOpenAPI, Locale locale) { + Webhooks[] webhooksAttr = openAPIService.getWebhooks(); + var webhooks = Arrays.stream(webhooksAttr).map(Webhooks::value).flatMap(Arrays::stream).toArray(Webhook[]::new); + Arrays.stream(webhooks).forEach(webhook -> { + io.swagger.v3.oas.annotations.Operation apiOperation = webhook.operation(); + Operation operation = new Operation(); + MethodAttributes methodAttributes = new MethodAttributes(springDocConfigProperties.getDefaultConsumesMediaType(), + springDocConfigProperties.getDefaultProducesMediaType(), locale); + operationParser.parse(apiOperation, operation, calculatedOpenAPI, methodAttributes); + PathItem pathItem = new PathItem().post(operation); + calculatedOpenAPI.addWebhooks(webhook.name(), pathItem); + }); + } + /** * Calculate path. * - * @param handlerMethod the handler method + * @param handlerMethod the handler method * @param routerOperation the router operation - * @param locale the locale - * @param openAPI the open api + * @param locale the locale + * @param openAPI the open api */ protected void calculatePath(HandlerMethod handlerMethod, RouterOperation routerOperation, Locale locale, OpenAPI openAPI) { routerOperation = customizeRouterOperation(routerOperation, handlerMethod); @@ -602,10 +632,10 @@ protected void calculatePath(HandlerMethod handlerMethod, RouterOperation router /** * Build callbacks. * - * @param openAPI the open api + * @param openAPI the open api * @param methodAttributes the method attributes - * @param operation the operation - * @param apiCallbacks the api callbacks + * @param operation the operation + * @param apiCallbacks the api callbacks */ private void buildCallbacks(OpenAPI openAPI, MethodAttributes methodAttributes, Operation operation, Set apiCallbacks) { if (!CollectionUtils.isEmpty(apiCallbacks)) @@ -617,8 +647,8 @@ private void buildCallbacks(OpenAPI openAPI, MethodAttributes methodAttributes, * Calculate path. * * @param routerOperationList the router operation list - * @param locale the locale - * @param openAPI the open api + * @param locale the locale + * @param openAPI the open api */ protected void calculatePath(List routerOperationList, Locale locale, OpenAPI openAPI) { ApplicationContext applicationContext = openAPIService.getContext(); @@ -667,7 +697,7 @@ else if (routerOperation.getOperationModel() != null && StringUtils.isNotBlank(r * Calculate path. * * @param routerOperation the router operation - * @param locale the locale + * @param locale the locale */ protected void calculatePath(RouterOperation routerOperation, Locale locale, OpenAPI openAPI) { routerOperation = customizeDataRestRouterOperation(routerOperation); @@ -733,13 +763,13 @@ private RouterOperation customizeDataRestRouterOperation(RouterOperation routerO /** * Calculate path. * - * @param handlerMethod the handler method - * @param operationPath the operation path + * @param handlerMethod the handler method + * @param operationPath the operation path * @param requestMethods the request methods - * @param consumes the consumes - * @param produces the produces - * @param headers the headers - * @param locale the locale + * @param consumes the consumes + * @param produces the produces + * @param headers the headers + * @param locale the locale */ protected void calculatePath(HandlerMethod handlerMethod, String operationPath, Set requestMethods, String[] consumes, String[] produces, String[] headers, String[] params, Locale locale, OpenAPI openAPI) { @@ -749,10 +779,10 @@ protected void calculatePath(HandlerMethod handlerMethod, String operationPath, /** * Gets router function paths. * - * @param beanName the bean name + * @param beanName the bean name * @param routerFunctionVisitor the router function visitor - * @param locale the locale - * @param openAPI the open api + * @param locale the locale + * @param openAPI the open api */ protected void getRouterFunctionPaths(String beanName, AbstractRouterFunctionVisitor routerFunctionVisitor, Locale locale, OpenAPI openAPI) { @@ -788,9 +818,9 @@ protected void getRouterFunctionPaths(String beanName, AbstractRouterFunctionVis * * @param handlerMethod the handler method * @param operationPath the operation path - * @param produces the produces - * @param consumes the consumes - * @param headers the headers + * @param produces the produces + * @param consumes the consumes + * @param headers the headers * @return the boolean */ protected boolean isFilterCondition(HandlerMethod handlerMethod, String operationPath, String[] produces, String[] consumes, String[] headers) { @@ -816,7 +846,7 @@ protected boolean isMethodToFilter(HandlerMethod handlerMethod) { * Is condition to match boolean. * * @param existingConditions the existing conditions - * @param conditionType the condition type + * @param conditionType the condition type * @return the boolean */ protected boolean isConditionToMatch(String[] existingConditions, ConditionType conditionType) { @@ -915,8 +945,8 @@ protected boolean isAdditionalRestController(Class rawClass) { * Is rest controller boolean. * * @param restControllers the rest controllers - * @param handlerMethod the handler method - * @param operationPath the operation path + * @param handlerMethod the handler method + * @param operationPath the operation path * @return the boolean */ protected boolean isRestController(Map restControllers, HandlerMethod handlerMethod, @@ -941,7 +971,7 @@ protected Set getDefaultAllowedHttpMethods() { /** * Customise operation. * - * @param operation the operation + * @param operation the operation * @param handlerMethod the handler method * @return the operation */ @@ -959,7 +989,7 @@ protected Operation customizeOperation(Operation operation, HandlerMethod handle * Customise router operation * * @param routerOperation the router operation - * @param handlerMethod the handler method + * @param handlerMethod the handler method * @return the router operation */ protected RouterOperation customizeRouterOperation(RouterOperation routerOperation, HandlerMethod handlerMethod) { @@ -1064,9 +1094,9 @@ && isEqualArrays(routerFunctionData1.getConsumes(), routerOperation.getConsumes( /** * Calculate json view. * - * @param apiOperation the api operation + * @param apiOperation the api operation * @param methodAttributes the method attributes - * @param method the method + * @param method the method */ private void calculateJsonView(io.swagger.v3.oas.annotations.Operation apiOperation, MethodAttributes methodAttributes, Method method) { @@ -1123,8 +1153,8 @@ private boolean isEqualMethods(RequestMethod[] requestMethods1, RequestMethod[] /** * Fill parameters list. * - * @param operation the operation - * @param queryParams the query params + * @param operation the operation + * @param queryParams the query params * @param methodAttributes the method attributes */ private void fillParametersList(Operation operation, Map queryParams, MethodAttributes methodAttributes) { @@ -1157,7 +1187,7 @@ private void fillParametersList(Operation operation, Map queryPa * Fill router operation. * * @param routerFunctionData the router function data - * @param routerOperation the router operation + * @param routerOperation the router operation */ private void fillRouterOperation(RouterFunctionData routerFunctionData, RouterOperation routerOperation) { if (ArrayUtils.isEmpty(routerOperation.getConsumes())) @@ -1176,9 +1206,9 @@ private void fillRouterOperation(RouterFunctionData routerFunctionData, RouterOp * Build path item. * * @param requestMethod the request method - * @param operation the operation + * @param operation the operation * @param operationPath the operation path - * @param paths the paths + * @param paths the paths * @return the path item */ private PathItem buildPathItem(RequestMethod requestMethod, Operation operation, String operationPath, @@ -1191,7 +1221,7 @@ private PathItem buildPathItem(RequestMethod requestMethod, Operation operation, if (ParameterIn.PATH.toString().equals(parameter.getIn())) { // check it's present in the path String name = parameter.getName(); - if(!StringUtils.containsAny(operationPath, "{" + name + "}", "{*" + name + "}")) + if (!StringUtils.containsAny(operationPath, "{" + name + "}", "{*" + name + "}")) paramIt.remove(); } } @@ -1236,7 +1266,7 @@ private PathItem buildPathItem(RequestMethod requestMethod, Operation operation, /** * Gets existing operation. * - * @param operationMap the operation map + * @param operationMap the operation map * @param requestMethod the request method * @return the existing operation */ @@ -1277,7 +1307,7 @@ private Operation getExistingOperation(Map operationMap, /** * Gets operation. * - * @param routerOperation the router operation + * @param routerOperation the router operation * @param existingOperation the existing operation * @return the operation */ @@ -1336,7 +1366,7 @@ protected byte[] writeYamlValue(OpenAPI openAPI) throws JsonProcessingException * Gets actuator uri. * * @param scheme the scheme - * @param host the host + * @param host the host * @return the actuator uri */ protected URI getActuatorURI(String scheme, String host) { @@ -1405,7 +1435,7 @@ protected byte[] writeJsonValue(OpenAPI openAPI) throws JsonProcessingException * Gets conditions to match. * * @param conditionType the condition type - * @param groupConfigs the group configs + * @param groupConfigs the group configs * @return the conditions to match */ private List getConditionsToMatch(ConditionType conditionType, GroupConfig... groupConfigs) { @@ -1433,9 +1463,9 @@ private List getConditionsToMatch(ConditionType conditionType, GroupConf * Is filter condition boolean. * * @param operationPath the operation path - * @param produces the produces - * @param consumes the consumes - * @param headers the headers + * @param produces the produces + * @param consumes the consumes + * @param headers the headers * @return the boolean */ private boolean isFilterCondition(String operationPath, String[] produces, String[] consumes, String[] headers) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java index bb69b1a6c..d5c471e94 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java @@ -48,6 +48,7 @@ import io.swagger.v3.core.util.AnnotationsUtils; import io.swagger.v3.oas.annotations.Hidden; import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Webhooks; import io.swagger.v3.oas.annotations.security.SecuritySchemes; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tags; @@ -536,6 +537,64 @@ private Optional getOpenAPIDefinition() { return Optional.ofNullable(apiDef); } + /** + * Get webhooks webhooks [ ]. + * + * @return the webhooks [ ] + */ + public Webhooks[] getWebhooks() { + // List to collect all Webhooks annotations + List allWebhooks = new ArrayList<>(); + + // Get beans with @Webhooks annotation managed by Spring + Map beansWithWebhooksAnnotation = context.getBeansWithAnnotation(Webhooks.class); + + // Process Spring-managed beans + if (!beansWithWebhooksAnnotation.isEmpty()) { + beansWithWebhooksAnnotation.values().forEach(controller -> { + // Get the @Webhooks annotation(s) from each bean + Webhooks[] webhooksAnnotations = controller.getClass().getAnnotationsByType(Webhooks.class); + allWebhooks.addAll(Arrays.asList(webhooksAnnotations)); + }); + } + + // If no beans with @Webhooks annotation found, perform classpath scanning + if (allWebhooks.isEmpty()) { + ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false); + scanner.addIncludeFilter(new AnnotationTypeFilter(Webhooks.class)); + + // Scan base packages if available + if (AutoConfigurationPackages.has(context)) { + List packagesToScan = AutoConfigurationPackages.get(context); + + for (String basePackage : packagesToScan) { + // Perform the scan and get candidate components + Set components = scanner.findCandidateComponents(basePackage); + + // Loop through the components + for (BeanDefinition beanDefinition : components) { + try { + // Get the class name and load the class + String className = beanDefinition.getBeanClassName(); + Class clazz = Class.forName(className); + + // Get @Webhooks annotation from the class + Webhooks[] webhooksAnnotations = clazz.getAnnotationsByType(Webhooks.class); + allWebhooks.addAll(Arrays.asList(webhooksAnnotations)); + + } catch (ClassNotFoundException e) { + // Log the error if the class is not found + LOGGER.error("Class not found in classpath: {}", e.getMessage()); + } + } + } + } + } + + // Convert the list of Webhooks annotations to an array and return + return allWebhooks.toArray(new Webhooks[0]); + } + /** * Build open api with open api definition. * @@ -608,7 +667,7 @@ private Info resolveProperties(Info info, Locale locale) { resolveProperty(contact::getUrl, contact::url, propertyResolverUtils, locale); } - if(propertyResolverUtils.isResolveExtensionsProperties()){ + if (propertyResolverUtils.isResolveExtensionsProperties()) { Map extensionsResolved = propertyResolverUtils.resolveExtensions(locale, info.getExtensions()); info.setExtensions(extensionsResolved); } @@ -617,7 +676,6 @@ private Info resolveProperties(Info info, Locale locale) { } - /** * Resolve property. * diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..737b8aa3a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2023 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.remove-broken-reference-definitions=false") +public class SpringDocApp9Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/WebHookResource.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/WebHookResource.java new file mode 100644 index 000000000..1d28b96a0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/WebHookResource.java @@ -0,0 +1,52 @@ +package test.org.springdoc.api.v31.app9; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Webhook; +import io.swagger.v3.oas.annotations.Webhooks; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.stereotype.Component; + +@Webhooks({ + @Webhook( + name = "newPet", + operation = @Operation( + requestBody = @RequestBody( + description = "Information about a new pet in the system", + content = { + @Content( + mediaType = "application/json", + schema = @Schema( + description = "Webhook Pet", + implementation = RequestDto.class + ) + ) + } + ), + method = "post", + responses = @ApiResponse( + responseCode = "200", + description = "Return a 200 status to indicate that the data was received successfully" + ) + ) + ) +}) +@Component +public class WebHookResource {} + + +class RequestDto { + + private String personalNumber; + + public String getPersonalNumber() { + return personalNumber; + } + + public void setPersonalNumber(String personalNumber) { + this.personalNumber = personalNumber; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app9.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app9.json new file mode 100644 index 000000000..457bfce93 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app9.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": {}, + "components": { + "schemas": { + "RequestDto": { + "properties": { + "personalNumber": { + "type": "string" + } + } + } + } + }, + "webhooks": { + "newPet": { + "post": { + "requestBody": { + "description": "Information about a new pet in the system", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestDto", + "description": "Webhook Pet" + } + } + } + }, + "responses": { + "200": { + "description": "Return a 200 status to indicate that the data was received successfully" + } + } + } + } + } +} From 5e42cf5398f7b6d6a9c6ab8e6fcd119e8213762a Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 22 Sep 2024 16:19:14 +0200 Subject: [PATCH 061/226] Content definition in @ApiResponse remove schema generated based on the returned value. Fixes #2663 --- .../core/models/MethodAttributes.java | 23 ++++++++++ .../core/service/GenericResponseService.java | 5 ++- .../core/utils/SpringDocAnnotationsUtils.java | 17 ++++--- .../api/v30/app226/HelloController.java | 37 +++++++++++++++ .../api/v30/app226/SpringDocApp226Test.java | 35 +++++++++++++++ .../test/resources/results/3.0.1/app226.json | 45 +++++++++++++++++++ 6 files changed, 154 insertions(+), 8 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/SpringDocApp226Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app226.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java index ce26b40a0..8ab202d24 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java @@ -128,6 +128,11 @@ public class MethodAttributes { */ private String javadocReturn; + /** + * The Use return type schema. + */ + private boolean useReturnTypeSchema; + /** * Instantiates a new Method attributes. * @param methodProducesNew the method produces new @@ -493,4 +498,22 @@ public void setJavadocReturn(String javadocReturn) { public Locale getLocale() { return locale; } + + /** + * Is use return type schema boolean. + * + * @return the boolean + */ + public boolean isUseReturnTypeSchema() { + return useReturnTypeSchema; + } + + /** + * Sets use return type schema. + * + * @param useReturnTypeSchema the use return type schema + */ + public void setUseReturnTypeSchema(boolean useReturnTypeSchema) { + this.useReturnTypeSchema = useReturnTypeSchema; + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index dbe542e00..b657a5fc0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -181,6 +181,7 @@ public static void buildContentFromDoc(Components components, ApiResponses apiRe io.swagger.v3.oas.annotations.responses.ApiResponse apiResponseAnnotations, ApiResponse apiResponse, boolean openapi31) { + methodAttributes.setUseReturnTypeSchema(apiResponseAnnotations.useReturnTypeSchema()); io.swagger.v3.oas.annotations.media.Content[] contentdoc = apiResponseAnnotations.content(); Optional optionalContent = getContent(contentdoc, new String[0], methodAttributes.getMethodProduces(), null, components, methodAttributes.getJsonViewAnnotation(), openapi31); @@ -620,8 +621,8 @@ else if (CollectionUtils.isEmpty(apiResponse.getContent())) setDescription(httpCode, apiResponse); } } - if (apiResponse.getContent() != null - && ((isGeneric || methodAttributes.isMethodOverloaded()) && methodAttributes.isNoApiResponseDoc())) { + if (apiResponse.getContent() != null && (methodAttributes.isUseReturnTypeSchema() || + ((isGeneric || methodAttributes.isMethodOverloaded()) && methodAttributes.isNoApiResponseDoc()))) { // Merge with existing schema Content existingContent = apiResponse.getContent(); Type type = ReturnTypeParser.getType(methodParameter); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java index 0c3750eea..905a27f96 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java @@ -34,6 +34,7 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Optional; import java.util.Set; @@ -45,6 +46,7 @@ import io.swagger.v3.core.converter.ResolvedSchema; import io.swagger.v3.core.util.AnnotationsUtils; import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Encoding; import io.swagger.v3.oas.annotations.media.ExampleObject; import io.swagger.v3.oas.annotations.media.SchemaProperty; import io.swagger.v3.oas.models.Components; @@ -142,7 +144,7 @@ public static Schema extractSchema(Components components, Type returnType, JsonV componentSchemas.putAll(schemaMap); } else - for (Map.Entry entry : schemaMap.entrySet()) { + for (Entry entry : schemaMap.entrySet()) { // If we've seen this schema before but find later it should be polymorphic, // replace the existing schema with this richer version. Schema existingSchema = componentSchemas.get(entry.getKey()); @@ -200,7 +202,7 @@ public static Optional getContent(io.swagger.v3.oas.annotations.media.C ExampleObject[] examples = annotationContent.examples(); setExamples(mediaType, examples); addExtension(annotationContent, mediaType, openapi31); - io.swagger.v3.oas.annotations.media.Encoding[] encodings = annotationContent.encoding(); + Encoding[] encodings = annotationContent.encoding(); addEncodingToMediaType(jsonViewAnnotation, mediaType, encodings, openapi31); if (StringUtils.isNotBlank(annotationContent.mediaType())) { content.addMediaType(annotationContent.mediaType(), mediaType); @@ -230,8 +232,11 @@ public static void mergeSchema(Content existingContent, Schema schemaN, Strin if (!schemaN.equals(mediaType.getSchema())) { // Merge the two schemas for the same mediaType Schema firstSchema = mediaType.getSchema(); - ComposedSchema schemaObject; - if (firstSchema instanceof ComposedSchema) { + Schema schemaObject = null; + if (firstSchema == null) { + schemaObject = schemaN; + } + else if (firstSchema instanceof ComposedSchema) { schemaObject = (ComposedSchema) firstSchema; List listOneOf = schemaObject.getOneOf(); if (!CollectionUtils.isEmpty(listOneOf) && !listOneOf.contains(schemaN)) @@ -311,8 +316,8 @@ public static void removeAnnotationsToIgnore(Class... classes) { * @param openapi31 the openapi 31 */ private static void addEncodingToMediaType(JsonView jsonViewAnnotation, MediaType mediaType, - io.swagger.v3.oas.annotations.media.Encoding[] encodings, boolean openapi31) { - for (io.swagger.v3.oas.annotations.media.Encoding encoding : encodings) { + Encoding[] encodings, boolean openapi31) { + for (Encoding encoding : encodings) { addEncodingToMediaType(mediaType, encoding, jsonViewAnnotation, openapi31); } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/HelloController.java new file mode 100644 index 000000000..2d71cbb37 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/HelloController.java @@ -0,0 +1,37 @@ +package test.org.springdoc.api.v30.app226; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping +public class HelloController { + + @PostMapping("/testBoolean") + @ApiResponse( + useReturnTypeSchema = true, + responseCode = "200", + description = "OK", + content = { + @Content( + mediaType = "*/*", + examples = + @ExampleObject( + name = "success", + value ="...")) + } + ) + public Map HelloController() { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/SpringDocApp226Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/SpringDocApp226Test.java new file mode 100644 index 000000000..5c4d44f06 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/SpringDocApp226Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app226; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp226Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app226.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app226.json new file mode 100644 index 000000000..55698a84d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app226.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/testBoolean": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "HelloController", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "examples": { + "success": { + "description": "success", + "value": "..." + } + } + } + } + } + } + } + } + }, + "components": {} +} From 0d7dc373773531f0a4e6f5080d64b6f394390c69 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 22 Sep 2024 21:03:36 +0200 Subject: [PATCH 062/226] Calling Swagger UI via different context paths fails. Fixes #2642 --- .../webflux/ui/SwaggerIndexPageTransformer.java | 3 +-- .../webmvc/ui/SwaggerIndexPageTransformer.java | 3 +-- .../org/springdoc/ui/AbstractSpringDocTest.java | 17 ++++++++++++----- .../SpringDocAppRedirectWithPrefixTest.java | 3 ++- .../springdoc/ui/app5/SpringDocApp5Test.java | 9 ++++++--- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java index 62733a2c2..379adb006 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java @@ -69,8 +69,7 @@ public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, Sw @Override public Mono transform(ServerWebExchange serverWebExchange, Resource resource, ResourceTransformerChain resourceTransformerChain) { - if (swaggerUiConfigParameters.getConfigUrl() == null) - swaggerWelcomeCommon.buildFromCurrentContextPath(serverWebExchange.getRequest()); + swaggerWelcomeCommon.buildFromCurrentContextPath(serverWebExchange.getRequest()); final AntPathMatcher antPathMatcher = new AntPathMatcher(); try { diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java index 53191b919..a9593c3bb 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java @@ -69,8 +69,7 @@ public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, Sw @Override public Resource transform(HttpServletRequest request, Resource resource, ResourceTransformerChain transformerChain) throws IOException { - if (swaggerUiConfigParameters.getConfigUrl() == null) - swaggerWelcomeCommon.buildFromCurrentContextPath(request); + swaggerWelcomeCommon.buildFromCurrentContextPath(request); final AntPathMatcher antPathMatcher = new AntPathMatcher(); boolean isIndexFound = antPathMatcher.match("**/swagger-ui/**/" + SWAGGER_INITIALIZER_JS, resource.getURL().toString()); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java index 11fb19a40..36a25dd7c 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java @@ -18,6 +18,7 @@ package test.org.springdoc.ui; +import org.apache.commons.lang3.StringUtils; import org.springdoc.core.utils.Constants; import org.springframework.boot.test.context.SpringBootTest; @@ -33,22 +34,28 @@ public abstract class AbstractSpringDocTest extends AbstractCommonTest { public static String className; - protected void checkJS(String fileName, String uri) throws Exception { - MvcResult mvcResult = mockMvc.perform(get(uri)).andExpect(status().isOk()).andReturn(); + protected void checkJS(String fileName, String uri, String contextPath) throws Exception { + MvcResult mvcResult = mockMvc.perform(get(contextPath+uri).contextPath(contextPath)).andExpect(status().isOk()).andReturn(); String transformedIndex = mvcResult.getResponse().getContentAsString(); assertTrue(transformedIndex.contains("window.ui")); assertEquals("no-store", mvcResult.getResponse().getHeader("Cache-Control")); assertEquals(this.getContent(fileName), transformedIndex.replace("\r", "")); } - protected void chekJS(String fileName) throws Exception { - checkJS(fileName, Constants.SWAGGER_INITIALIZER_URL); + protected void chekJS(String fileName,String contextPath) throws Exception { + checkJS(fileName, Constants.SWAGGER_INITIALIZER_URL,contextPath); + } + + protected void chekJS(String contextPath) throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + checkJS("results/app" + testNumber, Constants.SWAGGER_INITIALIZER_URL,contextPath); } protected void chekJS() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); - checkJS("results/app" + testNumber, Constants.SWAGGER_INITIALIZER_URL); + checkJS("results/app" + testNumber, Constants.SWAGGER_INITIALIZER_URL, StringUtils.EMPTY); } protected void checkJSResult(String fileName, String htmlResult) throws Exception { diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java index fdf58ea94..af156580f 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java @@ -18,6 +18,7 @@ package test.org.springdoc.ui.app1; +import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; import test.org.springdoc.ui.AbstractSpringDocTest; @@ -45,7 +46,7 @@ public void shouldRedirectWithPrefix() throws Exception { .andExpect(jsonPath("validatorUrl", equalTo(""))) .andExpect(jsonPath("oauth2RedirectUrl", equalTo("http://localhost/documentation/swagger-ui/oauth2-redirect.html"))); - super.checkJS("results/app1-prefix", "/documentation" + Constants.SWAGGER_INITIALIZER_URL); + super.checkJS("results/app1-prefix", "/documentation" + Constants.SWAGGER_INITIALIZER_URL, StringUtils.EMPTY); } @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java index b974e0d60..02b25dc7e 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java @@ -28,16 +28,19 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import static test.org.springdoc.ui.app5.SpringDocApp5Test.CONTEXT_PATH; -@TestPropertySource(properties = "server.servlet.context-path=/context-path") +@TestPropertySource(properties = "server.servlet.context-path="+CONTEXT_PATH) public class SpringDocApp5Test extends AbstractSpringDocTest { + public static final String CONTEXT_PATH = "/context-path"; + @Test public void oauth2_redirect_url_calculated_with_context_path() throws Exception { - mockMvc.perform(get("/context-path/v3/api-docs/swagger-config").contextPath("/context-path")) + mockMvc.perform(get(CONTEXT_PATH+"/v3/api-docs/swagger-config").contextPath("/context-path")) .andExpect(status().isOk()) .andExpect(jsonPath("oauth2RedirectUrl", equalTo("http://localhost/context-path/swagger-ui/oauth2-redirect.html"))); - super.chekJS(); + super.chekJS(CONTEXT_PATH); } @SpringBootApplication From 829e4b6015d23c3e5f6e79835cfd91b2b6e81b57 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 23 Sep 2024 16:06:02 +0200 Subject: [PATCH 063/226] swagger-core upgrade to version: 2.2.24 --- pom.xml | 2 +- .../test/resources/results/3.1.0/app1.json | 6 ++++ .../test/resources/results/3.1.0/app2.json | 30 +++++++++++-------- .../test/resources/results/3.1.0/app4.json | 1 + .../test/resources/results/3.1.0/app6.json | 1 + .../test/resources/results/3.1.0/app7.json | 3 +- .../test/resources/results/3.1.0/app8.json | 3 ++ .../test/resources/results/3.1.0/app9.json | 1 + 8 files changed, 33 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index aec07ce46..ce5af62d1 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.6 2.5.3 1.6.8 - 2.2.23 + 2.2.24 5.17.14 1.13.1 0.9.1 diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json index e6bd12a39..b7829258b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json @@ -517,6 +517,7 @@ "components": { "schemas": { "ErrorMessage": { + "type": "object", "properties": { "id": { "type": "string" @@ -527,6 +528,7 @@ } }, "PersonDTO": { + "type": "object", "properties": { "email": { "type": "string" @@ -540,6 +542,7 @@ } }, "ItemLightDTO": { + "type": "object", "properties": { "description": { "type": "string" @@ -556,6 +559,7 @@ } }, "InventoryItem": { + "type": "object", "properties": { "id": { "type": "string", @@ -582,6 +586,7 @@ ] }, "Manufacturer": { + "type": "object", "properties": { "name": { "type": "string", @@ -601,6 +606,7 @@ ] }, "ItemDTO": { + "type": "object", "properties": { "itemID": { "type": "string" diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json index 2456d512c..c431409f8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json @@ -61,8 +61,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "User not found", "content": { "application/xml": { "schema": { @@ -76,8 +76,8 @@ } } }, - "404": { - "description": "User not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -464,8 +464,8 @@ } } }, - "404": { - "description": "Pet not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -479,8 +479,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "Pet not found", "content": { "application/xml": { "schema": { @@ -809,8 +809,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "Order not found", "content": { "application/xml": { "schema": { @@ -824,8 +824,8 @@ } } }, - "404": { - "description": "Order not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -1051,6 +1051,7 @@ "components": { "schemas": { "User": { + "type": "object", "properties": { "id": { "type": "integer", @@ -1082,6 +1083,7 @@ } }, "Category": { + "type": "object", "properties": { "id": { "type": "integer", @@ -1093,6 +1095,7 @@ } }, "Pet": { + "type": "object", "properties": { "id": { "type": "integer", @@ -1133,6 +1136,7 @@ ] }, "Tag": { + "type": "object", "properties": { "id": { "type": "integer", @@ -1144,6 +1148,7 @@ } }, "Order": { + "type": "object", "properties": { "complete": { "type": "boolean" @@ -1171,6 +1176,7 @@ } }, "ModelApiResponse": { + "type": "object", "properties": { "code": { "type": "integer", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app4.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app4.json index bdd288eaa..584edad37 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app4.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app4.json @@ -45,6 +45,7 @@ "components": { "schemas": { "test.org.springdoc.api.v31.app4.TrackerData": { + "type": "object", "properties": { "trackerId": { "type": "string", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app6.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app6.json index 6c8b64925..b944be7e5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app6.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app6.json @@ -45,6 +45,7 @@ "components": { "schemas": { "DummyData": { + "type": "object", "properties": { "trackerId": { "type": "string" diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app7.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app7.json index 60bf98686..f5635e871 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app7.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app7.json @@ -35,6 +35,7 @@ "components": { "schemas": { "ExamplesResponse": { + "type": "object", "properties": { "name": { "type": "string", @@ -46,7 +47,7 @@ "subject": { "type": "string", "description": "subject", - "example":"Hello", + "example": "Hello", "examples": [ "Hello", "World" diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app8.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app8.json index 8bc72ac52..1a26bde25 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app8.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app8.json @@ -35,6 +35,7 @@ "components": { "schemas": { "ExamplesResponse": { + "type": "object", "properties": { "self": { "$ref": "#/components/schemas/UserInfo", @@ -58,6 +59,7 @@ ] }, "FooBar": { + "type": "object", "deprecated": true, "description": "the foo bar", "properties": { @@ -76,6 +78,7 @@ ] }, "UserInfo": { + "type": "object", "description": "user info", "properties": { "name": { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app9.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app9.json index 457bfce93..1ee84bb45 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app9.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app9.json @@ -14,6 +14,7 @@ "components": { "schemas": { "RequestDto": { + "type": "object", "properties": { "personalNumber": { "type": "string" From 7a4d09e3ec309d91c0dfa2e2ef905a8464d7201b Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 24 Sep 2024 19:42:18 +0200 Subject: [PATCH 064/226] Annotation @Hidden on rest controller class level doesn't work due to spring default proxying mechanism CGLIB. Fxies #2709 --- .../main/java/org/springdoc/api/AbstractOpenApiResource.java | 5 +++-- .../SpringDocJacksonKotlinModuleConfiguration.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 25fd6538e..19b4a37bc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -113,6 +113,7 @@ import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.env.Environment; import org.springframework.util.AntPathMatcher; +import org.springframework.util.ClassUtils; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -306,7 +307,7 @@ public static boolean containsResponseBody(HandlerMethod handlerMethod) { * @return the boolean */ public static boolean isHiddenRestControllers(Class rawClass) { - return HIDDEN_REST_CONTROLLERS.stream().anyMatch(clazz -> clazz.isAssignableFrom(rawClass)); + return HIDDEN_REST_CONTROLLERS.stream().anyMatch(clazz -> ClassUtils.getUserClass(clazz).isAssignableFrom(rawClass)); } /** @@ -938,7 +939,7 @@ protected String decode(String requestURI) { * @return the boolean */ protected boolean isAdditionalRestController(Class rawClass) { - return ADDITIONAL_REST_CONTROLLERS.stream().anyMatch(clazz -> clazz.isAssignableFrom(rawClass)); + return ADDITIONAL_REST_CONTROLLERS.stream().anyMatch(clazz -> ClassUtils.getUserClass(clazz).isAssignableFrom(rawClass)); } /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java index a8fb5b41a..f325a73ba 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java @@ -24,7 +24,7 @@ @ConditionalOnExpression("${springdoc.api-docs.enabled:true} and ${springdoc.enable-kotlin:true}") @ConditionalOnWebApplication @ConditionalOnBean(SpringDocConfiguration.class) -class SpringDocJacksonKotlinModuleConfiguration { +public class SpringDocJacksonKotlinModuleConfiguration { /** * Instantiates a new objectMapperProvider with a kotlin module. From 03349cff6a2480555c746cf560f7d14272c93331 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 26 Sep 2024 11:23:13 +0200 Subject: [PATCH 065/226] Calling Swagger UI via different context paths fails. Fixes #2642 --- .../AbstractSwaggerUiConfigProperties.java | 6 +- .../properties/SwaggerUiConfigParameters.java | 76 +++++++++++++++-- .../ui/AbstractSwaggerIndexTransformer.java | 18 ++-- .../springdoc/ui/AbstractSwaggerWelcome.java | 83 ++++++++----------- .../AbstractSwaggerIndexTransformerTest.java | 12 +-- .../springdoc/webflux/ui/SwaggerConfig.java | 34 ++------ .../ui/SwaggerIndexPageTransformer.java | 14 ++-- .../springdoc/webflux/ui/SwaggerUiHome.java | 11 ++- .../webflux/ui/SwaggerWebFluxConfigurer.java | 33 ++++---- .../webflux/ui/SwaggerWelcomeActuator.java | 24 +++--- .../webflux/ui/SwaggerWelcomeCommon.java | 23 ++--- .../webflux/ui/SwaggerWelcomeWebFlux.java | 58 ++++--------- ...ot.autoconfigure.AutoConfiguration.imports | 1 - .../ui/app32/SpringDocBehindProxyTest.java | 43 ++++++++++ .../springdoc/webmvc/ui/SwaggerConfig.java | 38 +++------ .../ui/SwaggerIndexPageTransformer.java | 12 +-- .../webmvc/ui/SwaggerWebMvcConfigurer.java | 18 ++-- .../webmvc/ui/SwaggerWelcomeActuator.java | 25 +++--- .../webmvc/ui/SwaggerWelcomeCommon.java | 27 +++--- .../webmvc/ui/SwaggerWelcomeWebMvc.java | 68 ++++----------- ...ot.autoconfigure.AutoConfiguration.imports | 1 - .../ui/app32/SpringDocBehindProxyTest.java | 42 ++++++++++ 22 files changed, 351 insertions(+), 316 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java index b60117ba0..d8b1eb349 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java @@ -31,8 +31,10 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.commons.lang3.StringUtils; +import org.springdoc.core.utils.Constants; import static org.springdoc.core.utils.Constants.GROUP_NAME_NOT_NULL_OR_EMPTY; +import static org.springdoc.core.utils.Constants.SWAGGER_UI_OAUTH_REDIRECT_URL; /** * Please refer to the swagger @@ -45,7 +47,7 @@ public abstract class AbstractSwaggerUiConfigProperties { /** * The path for the Swagger UI pages to load. Will redirect to the springdoc.webjars.prefix property. */ - protected String path; + protected String path = Constants.DEFAULT_SWAGGER_UI_PATH; /** * The name of a component available via the plugin system to use as the top-level layout for Swagger UI. @@ -138,7 +140,7 @@ public abstract class AbstractSwaggerUiConfigProperties { /** * OAuth redirect URL. */ - protected String oauth2RedirectUrl; + protected String oauth2RedirectUrl = SWAGGER_UI_OAUTH_REDIRECT_URL; /** * The Url. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java index c4b5a881f..c9159f21e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java @@ -53,10 +53,6 @@ * The type Swagger ui config parameters. * @author bnasslahsen */ -@Lazy(false) -@Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = SPRINGDOC_SWAGGER_UI_ENABLED, matchIfMissing = true) -@ConditionalOnBean(SpringDocConfiguration.class) public class SwaggerUiConfigParameters extends AbstractSwaggerUiConfigProperties { /** @@ -149,6 +145,20 @@ public class SwaggerUiConfigParameters extends AbstractSwaggerUiConfigProperties */ private String uiRootPath; + /** + * The Context path. + */ + private String contextPath; + + /** + * The Context path. + */ + private String apiDocsUrl; + + /** + * The Path prefix. + */ + private String pathPrefix; /** * Instantiates a new Swagger ui config parameters. @@ -157,8 +167,8 @@ public class SwaggerUiConfigParameters extends AbstractSwaggerUiConfigProperties */ public SwaggerUiConfigParameters(SwaggerUiConfigProperties swaggerUiConfig) { this.swaggerUiConfig = swaggerUiConfig; - this.path = StringUtils.defaultIfBlank(swaggerUiConfig.getPath(), Constants.DEFAULT_SWAGGER_UI_PATH); - this.oauth2RedirectUrl = StringUtils.defaultIfBlank(swaggerUiConfig.getOauth2RedirectUrl(), SWAGGER_UI_OAUTH_REDIRECT_URL); + this.path = swaggerUiConfig.getPath(); + this.oauth2RedirectUrl = swaggerUiConfig.getOauth2RedirectUrl(); this.layout = swaggerUiConfig.getLayout(); this.configUrl = swaggerUiConfig.getConfigUrl(); this.validatorUrl = swaggerUiConfig.getValidatorUrl(); @@ -325,4 +335,58 @@ private boolean isSwaggerUrlDefined(String name) { return swaggerUiConfig.getUrls().stream().anyMatch(swaggerUrl -> name.equals(swaggerUrl.getName()) && StringUtils.isNotBlank(swaggerUrl.getUrl())); return false; } + + /** + * Gets context path. + * + * @return the context path + */ + public String getContextPath() { + return contextPath; + } + + /** + * Sets context path. + * + * @param contextPath the context path + */ + public void setContextPath(String contextPath) { + this.contextPath = contextPath; + } + + /** + * Gets api docs url. + * + * @return the api docs url + */ + public String getApiDocsUrl() { + return apiDocsUrl; + } + + /** + * Sets api docs url. + * + * @param apiDocsUrl the api docs url + */ + public void setApiDocsUrl(String apiDocsUrl) { + this.apiDocsUrl = apiDocsUrl; + } + + /** + * Gets path prefix. + * + * @return the path prefix + */ + public String getPathPrefix() { + return pathPrefix; + } + + /** + * Sets path prefix. + * + * @param pathPrefix the path prefix + */ + public void setPathPrefix(String pathPrefix) { + this.pathPrefix = pathPrefix; + } } \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java index 9877b1ae0..1192af327 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java @@ -61,11 +61,6 @@ public class AbstractSwaggerIndexTransformer { */ protected SwaggerUiOAuthProperties swaggerUiOAuthProperties; - /** - * The Swagger ui config parameters. - */ - protected SwaggerUiConfigParameters swaggerUiConfigParameters; - /** * The Object mapper. */ @@ -81,13 +76,11 @@ public class AbstractSwaggerIndexTransformer { * * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param objectMapperProvider the object mapper provider */ - public AbstractSwaggerIndexTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, ObjectMapperProvider objectMapperProvider) { + public AbstractSwaggerIndexTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, ObjectMapperProvider objectMapperProvider) { this.swaggerUiConfig = swaggerUiConfig; this.swaggerUiOAuthProperties = swaggerUiOAuthProperties; - this.swaggerUiConfigParameters = swaggerUiConfigParameters; this.objectMapper = objectMapperProvider.jsonMapper(); } @@ -148,11 +141,12 @@ protected String setConfiguredApiDocsUrl(String html){ /** * Default transformations string. * - * @param inputStream the input stream + * @param swaggerUiConfigParameters the swagger ui config parameters + * @param inputStream the input stream * @return the string * @throws IOException the io exception */ - protected String defaultTransformations(InputStream inputStream) throws IOException { + protected String defaultTransformations(SwaggerUiConfigParameters swaggerUiConfigParameters, InputStream inputStream) throws IOException { String html = readFullyAsString(inputStream); if (!CollectionUtils.isEmpty(swaggerUiOAuthProperties.getConfigParameters())) html = addInitOauth(html); @@ -170,7 +164,7 @@ else if (swaggerUiConfig.getCsrf().isUseSessionStorage()) html = addSyntaxHighlight(html); if (swaggerUiConfig.getQueryConfigEnabled() == null || !swaggerUiConfig.getQueryConfigEnabled()) - html = addParameters(html); + html = addParameters(html, swaggerUiConfigParameters); else html = addParameter(html, QUERY_CONFIG_ENABLED_PROPERTY, swaggerUiConfig.getQueryConfigEnabled().toString()); @@ -191,7 +185,7 @@ else if (swaggerUiConfig.getCsrf().isUseSessionStorage()) * @return the string * @throws JsonProcessingException the json processing exception */ - protected String addParameters(String html) throws JsonProcessingException { + protected String addParameters(String html, SwaggerUiConfigParameters swaggerUiConfigParameters) throws JsonProcessingException { String layout = swaggerUiConfigParameters.getLayout() != null ? swaggerUiConfigParameters.getLayout() : "StandaloneLayout"; StringBuilder stringBuilder = new StringBuilder("layout: \"" + layout + "\" ,\n"); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java index 40b3e24d6..6e17af03e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java @@ -57,45 +57,23 @@ public abstract class AbstractSwaggerWelcome { */ protected final SpringDocConfigProperties springDocConfigProperties; - /** - * The Swagger ui calculated config. - */ - protected final SwaggerUiConfigParameters swaggerUiConfigParameters; - - /** - * The Swagger config url. - */ - protected String swaggerConfigUrl; - - /** - * The Api docs url. - */ - protected String apiDocsUrl; - - /** - * The Context path. - */ - protected String contextPath; - /** * Instantiates a new Abstract swagger welcome. * * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters */ - public AbstractSwaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters) { + public AbstractSwaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { this.swaggerUiConfig = swaggerUiConfig; this.springDocConfigProperties = springDocConfigProperties; - this.swaggerUiConfigParameters = swaggerUiConfigParameters; } /** * Init. */ - protected void init() { + protected void init(SwaggerUiConfigParameters swaggerUiConfigParameters) { springDocConfigProperties.getGroupConfigs().forEach(groupConfig -> swaggerUiConfigParameters.addGroup(groupConfig.getGroup(), groupConfig.getDisplayName())); - calculateUiRootPath(); + calculateUiRootPath(swaggerUiConfigParameters); } /** @@ -117,30 +95,30 @@ protected String buildUrl(String contextPath, String docsUrl) { /** * Build config url. * - * @param uriComponentsBuilder the uri components builder + * @param swaggerUiConfigParameters the swagger ui config parameters + * @param uriComponentsBuilder the uri components builder */ - protected void buildConfigUrl(UriComponentsBuilder uriComponentsBuilder) { + protected void buildConfigUrl(SwaggerUiConfigParameters swaggerUiConfigParameters, UriComponentsBuilder uriComponentsBuilder) { if (StringUtils.isEmpty(swaggerUiConfig.getConfigUrl())) { - apiDocsUrl = buildApiDocUrl(); - swaggerConfigUrl = buildSwaggerConfigUrl(); - swaggerUiConfigParameters.setConfigUrl(swaggerConfigUrl); + buildApiDocUrl(swaggerUiConfigParameters); + buildSwaggerConfigUrl(swaggerUiConfigParameters); if (CollectionUtils.isEmpty(swaggerUiConfigParameters.getUrls())) { String swaggerUiUrl = swaggerUiConfig.getUrl(); if (StringUtils.isEmpty(swaggerUiUrl)) - swaggerUiConfigParameters.setUrl(apiDocsUrl); + swaggerUiConfigParameters.setUrl(swaggerUiConfigParameters.getApiDocsUrl()); else if (swaggerUiConfigParameters.isValidUrl(swaggerUiUrl)) swaggerUiConfigParameters.setUrl(swaggerUiUrl); else - swaggerUiConfigParameters.setUrl(buildUrlWithContextPath(swaggerUiUrl)); + swaggerUiConfigParameters.setUrl(buildUrlWithContextPath(swaggerUiConfigParameters, swaggerUiUrl)); } else - swaggerUiConfigParameters.addUrl(apiDocsUrl); + swaggerUiConfigParameters.addUrl(swaggerUiConfigParameters.getApiDocsUrl()); if (!CollectionUtils.isEmpty(swaggerUiConfig.getUrls())) { swaggerUiConfig.cloneUrls() .stream() .filter(swaggerUrl -> !swaggerUiConfigParameters.isValidUrl(swaggerUrl.getUrl())) .forEach(swaggerUrl -> { - final var url = buildUrlWithContextPath(swaggerUrl.getUrl()); + final var url = buildUrlWithContextPath(swaggerUiConfigParameters, swaggerUrl.getUrl()); if (!Objects.equals(url, swaggerUrl.getUrl())) { swaggerUiConfigParameters.getUrls() .stream() @@ -150,24 +128,26 @@ else if (swaggerUiConfigParameters.isValidUrl(swaggerUiUrl)) }); } } - calculateOauth2RedirectUrl(uriComponentsBuilder); + calculateOauth2RedirectUrl(swaggerUiConfigParameters, uriComponentsBuilder); } /** * Build swagger ui url string. * - * @param swaggerUiUrl the swagger ui url + * @param swaggerUiConfigParameters the swagger ui config parameters + * @param swaggerUiUrl the swagger ui url * @return the string */ - protected abstract String buildUrlWithContextPath(String swaggerUiUrl); + protected abstract String buildUrlWithContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, String swaggerUiUrl); /** * Gets uri components builder. * - * @param sbUrl the sb url + * @param swaggerUiConfigParameters the swagger ui config parameters + * @param sbUrl the sb url * @return the uri components builder */ - protected UriComponentsBuilder getUriComponentsBuilder(String sbUrl) { + protected UriComponentsBuilder getUriComponentsBuilder(SwaggerUiConfigParameters swaggerUiConfigParameters, String sbUrl) { UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(sbUrl); if ((swaggerUiConfig.getQueryConfigEnabled() != null && swaggerUiConfig.getQueryConfigEnabled())) { swaggerUiConfigParameters.getConfigParameters().entrySet().stream() @@ -185,24 +165,27 @@ protected UriComponentsBuilder getUriComponentsBuilder(String sbUrl) { /** * Calculate oauth 2 redirect url. * - * @param uriComponentsBuilder the uri components builder + * @param swaggerUiConfigParameters the swagger ui config parameters + * @param uriComponentsBuilder the uri components builder */ - protected abstract void calculateOauth2RedirectUrl(UriComponentsBuilder uriComponentsBuilder); + protected abstract void calculateOauth2RedirectUrl(SwaggerUiConfigParameters swaggerUiConfigParameters, UriComponentsBuilder uriComponentsBuilder); /** * Calculate ui root path. * - * @param sbUrls the sb urls + * @param swaggerUiConfigParameters the swagger ui config parameters + * @param sbUrls the sb urls */ - protected abstract void calculateUiRootPath(StringBuilder... sbUrls); + protected abstract void calculateUiRootPath(SwaggerUiConfigParameters swaggerUiConfigParameters,StringBuilder... sbUrls); /** * Calculate ui root common. * - * @param sbUrl the sb url - * @param sbUrls the sb urls + * @param swaggerUiConfigParameters the swagger ui config parameters + * @param sbUrl the sb url + * @param sbUrls the sb urls */ - protected void calculateUiRootCommon(StringBuilder sbUrl, StringBuilder[] sbUrls) { + protected void calculateUiRootCommon(SwaggerUiConfigParameters swaggerUiConfigParameters, StringBuilder sbUrl, StringBuilder[] sbUrls) { if (ArrayUtils.isNotEmpty(sbUrls)) sbUrl = sbUrls[0]; String swaggerPath = swaggerUiConfigParameters.getPath(); @@ -214,16 +197,16 @@ protected void calculateUiRootCommon(StringBuilder sbUrl, StringBuilder[] sbUrls /** * Build api doc url string. * - * @return the string + * @param swaggerUiConfigParameters the swagger ui config parameters */ - protected abstract String buildApiDocUrl(); + protected abstract void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameters); /** * Build swagger config url string. * - * @return the string + * @param swaggerUiConfigParameters the swagger ui config parameters */ - protected abstract String buildSwaggerConfigUrl(); + protected abstract void buildSwaggerConfigUrl(SwaggerUiConfigParameters swaggerUiConfigParameters); /** * Gets oauth2 redirect url. diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java index 84e3f156d..4af7febfb 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java @@ -5,11 +5,13 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.properties.SwaggerUiOAuthProperties; @@ -24,9 +26,7 @@ public class AbstractSwaggerIndexTransformerTest { private SwaggerUiConfigProperties swaggerUiConfig; @Mock private SwaggerUiOAuthProperties swaggerUiOAuthProperties; - @Mock - private SwaggerUiConfigParameters swaggerUiConfigParameters; - @Mock + private ObjectMapperProvider objectMapperProvider; private AbstractSwaggerIndexTransformer underTest; @@ -57,13 +57,13 @@ public class AbstractSwaggerIndexTransformerTest { public void setup(){ swaggerUiConfig = new SwaggerUiConfigProperties(); swaggerUiConfig.setUrl(apiDocUrl); - underTest = new AbstractSwaggerIndexTransformer(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters, objectMapperProvider); - + objectMapperProvider = new ObjectMapperProvider(new SpringDocConfigProperties()); + underTest = new AbstractSwaggerIndexTransformer(swaggerUiConfig, swaggerUiOAuthProperties, objectMapperProvider); } @Test void setApiDocUrlCorrectly() throws IOException { - var html = underTest.defaultTransformations(is); + var html = underTest.defaultTransformations(new SwaggerUiConfigParameters(swaggerUiConfig), is); assertThat(html, containsString(apiDocUrl)); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java index 61e65f6db..0c1f9938f 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java @@ -74,7 +74,6 @@ public class SwaggerConfig implements WebFluxConfigurer { * * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param springWebProvider the spring web provider * @return the swagger welcome web flux */ @@ -82,8 +81,8 @@ public class SwaggerConfig implements WebFluxConfigurer { @ConditionalOnMissingBean @ConditionalOnProperty(name = SPRINGDOC_USE_MANAGEMENT_PORT, havingValue = "false", matchIfMissing = true) @Lazy(false) - SwaggerWelcomeWebFlux swaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, SpringWebProvider springWebProvider) { - return new SwaggerWelcomeWebFlux(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters, springWebProvider); + SwaggerWelcomeWebFlux swaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SpringWebProvider springWebProvider) { + return new SwaggerWelcomeWebFlux(swaggerUiConfig, springDocConfigProperties,springWebProvider); } /** @@ -117,7 +116,7 @@ SwaggerUiHome swaggerUiHome(Optional optionalWebFluxPropertie /** * Swagger web flux configurer swagger web flux configurer. * - * @param swaggerUiConfigParameters the swagger ui calculated config + * @param swaggerUiConfigProperties the swagger ui calculated config * @param springDocConfigProperties the spring doc config properties * @param swaggerIndexTransformer the swagger index transformer * @param actuatorProvider the actuator provider @@ -127,10 +126,10 @@ SwaggerUiHome swaggerUiHome(Optional optionalWebFluxPropertie @Bean @ConditionalOnMissingBean @Lazy(false) - SwaggerWebFluxConfigurer swaggerWebFluxConfigurer(SwaggerUiConfigParameters swaggerUiConfigParameters, + SwaggerWebFluxConfigurer swaggerWebFluxConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { - return new SwaggerWebFluxConfigurer(swaggerUiConfigParameters, springDocConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); + return new SwaggerWebFluxConfigurer(swaggerUiConfigProperties,springDocConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); } /** @@ -138,7 +137,6 @@ SwaggerWebFluxConfigurer swaggerWebFluxConfigurer(SwaggerUiConfigParameters swag * * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param swaggerWelcomeCommon the swagger welcome common * @param objectMapperProvider the object mapper provider * @return the swagger index transformer @@ -147,21 +145,8 @@ SwaggerWebFluxConfigurer swaggerWebFluxConfigurer(SwaggerUiConfigParameters swag @ConditionalOnMissingBean @Lazy(false) SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, - SwaggerUiConfigParameters swaggerUiConfigParameters, SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { - return new SwaggerIndexPageTransformer(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters, swaggerWelcomeCommon, objectMapperProvider); - } - - /** - * Swagger ui config parameters swagger ui config parameters. - * - * @param swaggerUiConfig the swagger ui config - * @return the swagger ui config parameters - */ - @Bean - @ConditionalOnMissingBean - @Lazy(false) - SwaggerUiConfigParameters swaggerUiConfigParameters(SwaggerUiConfigProperties swaggerUiConfig) { - return new SwaggerUiConfigParameters(swaggerUiConfig); + SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { + return new SwaggerIndexPageTransformer(swaggerUiConfig, swaggerUiOAuthProperties, swaggerWelcomeCommon, objectMapperProvider); } /** @@ -210,7 +195,6 @@ static class SwaggerActuatorWelcomeConfiguration { * * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param webEndpointProperties the web endpoint properties * @param managementServerProperties the management server properties * @return the swagger welcome actuator @@ -219,8 +203,8 @@ static class SwaggerActuatorWelcomeConfiguration { @ConditionalOnMissingBean @Lazy(false) SwaggerWelcomeActuator swaggerActuatorWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, - SwaggerUiConfigParameters swaggerUiConfigParameters, WebEndpointProperties webEndpointProperties, ManagementServerProperties managementServerProperties) { - return new SwaggerWelcomeActuator(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters, webEndpointProperties, managementServerProperties); + WebEndpointProperties webEndpointProperties, ManagementServerProperties managementServerProperties) { + return new SwaggerWelcomeActuator(swaggerUiConfig, springDocConfigProperties, webEndpointProperties, managementServerProperties); } } } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java index 379adb006..0cd8d4357 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java @@ -57,25 +57,25 @@ public class SwaggerIndexPageTransformer extends AbstractSwaggerIndexTransformer * Instantiates a new Swagger index transformer. * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param swaggerWelcomeCommon the swagger welcome common * @param objectMapperProvider the object mapper provider */ - public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, - SwaggerUiConfigParameters swaggerUiConfigParameters, SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { - super(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters, objectMapperProvider); + public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, + SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { + super(swaggerUiConfig, swaggerUiOAuthProperties, objectMapperProvider); this.swaggerWelcomeCommon = swaggerWelcomeCommon; } @Override public Mono transform(ServerWebExchange serverWebExchange, Resource resource, ResourceTransformerChain resourceTransformerChain) { - swaggerWelcomeCommon.buildFromCurrentContextPath(serverWebExchange.getRequest()); - + SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); + swaggerWelcomeCommon.buildFromCurrentContextPath(swaggerUiConfigParameters, serverWebExchange.getRequest()); + final AntPathMatcher antPathMatcher = new AntPathMatcher(); try { boolean isIndexFound = antPathMatcher.match("**/swagger-ui/**/" + SWAGGER_INITIALIZER_JS, resource.getURL().toString()); if (isIndexFound) { - String html = defaultTransformations(resource.getInputStream()); + String html = defaultTransformations(swaggerUiConfigParameters, resource.getInputStream()); return Mono.just(new TransformedResource(resource, html.getBytes(StandardCharsets.UTF_8))); } else { diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java index 7e69ddcab..5a2a80b73 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java @@ -56,9 +56,9 @@ public class SwaggerUiHome { private String swaggerUiPath; /** - * The Base path. + * The Optional web flux properties. */ - private String basePath = StringUtils.EMPTY; + private final Optional optionalWebFluxProperties; /** * Instantiates a new Swagger ui home. @@ -66,7 +66,7 @@ public class SwaggerUiHome { * @param optionalWebFluxProperties the optional web flux properties */ public SwaggerUiHome(Optional optionalWebFluxProperties) { - optionalWebFluxProperties.ifPresent(webFluxProperties -> this.basePath = StringUtils.defaultIfEmpty(webFluxProperties.getBasePath(), StringUtils.EMPTY)); + this.optionalWebFluxProperties = optionalWebFluxProperties; } /** @@ -78,7 +78,10 @@ public SwaggerUiHome(Optional optionalWebFluxProperties) { @GetMapping(DEFAULT_PATH_SEPARATOR) @Operation(hidden = true) public Mono index(ServerHttpResponse response) { - UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(this.basePath + swaggerUiPath); + String basePath = optionalWebFluxProperties + .map(props -> StringUtils.defaultIfEmpty(props.getBasePath(), StringUtils.EMPTY)) + .orElse(StringUtils.EMPTY); + UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(basePath + swaggerUiPath); response.setStatusCode(HttpStatus.FOUND); response.getHeaders().setLocation(URI.create(uriBuilder.build().encode().toString())); return response.setComplete(); diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java index 786f2f8be..ee07fb74a 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java @@ -27,7 +27,7 @@ import java.util.Optional; import org.springdoc.core.properties.SpringDocConfigProperties; -import org.springdoc.core.properties.SwaggerUiConfigParameters; +import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.ActuatorProvider; import org.springframework.web.reactive.config.ResourceHandlerRegistry; @@ -44,16 +44,6 @@ */ public class SwaggerWebFluxConfigurer implements WebFluxConfigurer { - /** - * The Swagger path. - */ - private final String swaggerPath; - - /** - * The Web jars prefix url. - */ - private final String webJarsPrefixUrl; - /** * The Swagger index transformer. */ @@ -69,34 +59,45 @@ public class SwaggerWebFluxConfigurer implements WebFluxConfigurer { */ private final SwaggerResourceResolver swaggerResourceResolver; + /** + * The Swagger ui config properties. + */ + private final SwaggerUiConfigProperties swaggerUiConfigProperties; + + /** + * The Spring doc config properties. + */ + private final SpringDocConfigProperties springDocConfigProperties; + /** * Instantiates a new Swagger web flux configurer. * - * @param swaggerUiConfigParameters the swagger ui calculated config + * @param swaggerUiConfigProperties the swagger ui calculated config * @param springDocConfigProperties the spring doc config properties * @param swaggerIndexTransformer the swagger index transformer * @param actuatorProvider the actuator provider * @param swaggerResourceResolver the swagger resource resolver */ - public SwaggerWebFluxConfigurer(SwaggerUiConfigParameters swaggerUiConfigParameters, + public SwaggerWebFluxConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { - this.swaggerPath = swaggerUiConfigParameters.getPath(); - this.webJarsPrefixUrl = springDocConfigProperties.getWebjars().getPrefix(); this.swaggerIndexTransformer = swaggerIndexTransformer; this.actuatorProvider = actuatorProvider; this.swaggerResourceResolver = swaggerResourceResolver; + this.swaggerUiConfigProperties = swaggerUiConfigProperties; + this.springDocConfigProperties = springDocConfigProperties; } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { StringBuilder uiRootPath = new StringBuilder(); + String swaggerPath = swaggerUiConfigProperties.getPath(); if (swaggerPath.contains(DEFAULT_PATH_SEPARATOR)) uiRootPath.append(swaggerPath, 0, swaggerPath.lastIndexOf(DEFAULT_PATH_SEPARATOR)); if (actuatorProvider.isPresent() && actuatorProvider.get().isUseManagementPort()) uiRootPath.append(actuatorProvider.get().getBasePath()); - registry.addResourceHandler(uiRootPath + webJarsPrefixUrl + ALL_PATTERN) + registry.addResourceHandler(uiRootPath + springDocConfigProperties.getWebjars().getPrefix() + ALL_PATTERN) .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + DEFAULT_WEB_JARS_PREFIX_URL + DEFAULT_PATH_SEPARATOR) .resourceChain(false) .addResolver(swaggerResourceResolver) diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java index 1442d93fd..435eba0e3 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java @@ -75,16 +75,14 @@ public class SwaggerWelcomeActuator extends SwaggerWelcomeCommon { * * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param webEndpointProperties the web endpoint properties * @param managementServerProperties the management server properties */ public SwaggerWelcomeActuator(SwaggerUiConfigProperties swaggerUiConfig , SpringDocConfigProperties springDocConfigProperties, - SwaggerUiConfigParameters swaggerUiConfigParameters, WebEndpointProperties webEndpointProperties, ManagementServerProperties managementServerProperties) { - super(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters); + super(swaggerUiConfig, springDocConfigProperties); this.webEndpointProperties = webEndpointProperties; this.managementServerProperties = managementServerProperties; } @@ -119,14 +117,14 @@ public Map getSwaggerUiConfig(ServerHttpRequest request) { } @Override - protected void calculateUiRootPath(StringBuilder... sbUrls) { + protected void calculateUiRootPath(SwaggerUiConfigParameters swaggerUiConfigParameters,StringBuilder... sbUrls) { StringBuilder sbUrl = new StringBuilder(); sbUrl.append(webEndpointProperties.getBasePath()); - calculateUiRootCommon(sbUrl, sbUrls); + calculateUiRootCommon(swaggerUiConfigParameters,sbUrl, sbUrls); } @Override - protected void calculateOauth2RedirectUrl(UriComponentsBuilder uriComponentsBuilder) { + protected void calculateOauth2RedirectUrl(SwaggerUiConfigParameters swaggerUiConfigParameters, UriComponentsBuilder uriComponentsBuilder) { if (StringUtils.isBlank(swaggerUiConfig.getOauth2RedirectUrl()) || !swaggerUiConfigParameters.isValidUrl(swaggerUiConfig.getOauth2RedirectUrl())) { UriComponentsBuilder oauthPrefix = uriComponentsBuilder.path(managementServerProperties.getBasePath() + swaggerUiConfigParameters.getUiRootPath()).path(webJarsPrefixUrl); swaggerUiConfigParameters.setOauth2RedirectUrl(oauthPrefix.path(getOauth2RedirectUrl()).build().toString()); @@ -134,20 +132,20 @@ protected void calculateOauth2RedirectUrl(UriComponentsBuilder uriComponentsBuil } @Override - protected String buildApiDocUrl() { - return buildUrl(contextPath + webEndpointProperties.getBasePath(), DEFAULT_API_DOCS_ACTUATOR_URL); + protected void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { + swaggerUiConfigParameters.setApiDocsUrl( buildUrl(swaggerUiConfigParameters.getContextPath() + webEndpointProperties.getBasePath(), DEFAULT_API_DOCS_ACTUATOR_URL)); } @Override - protected String buildUrlWithContextPath(String swaggerUiUrl) { - return buildUrl(contextPath + webEndpointProperties.getBasePath(), swaggerUiUrl); + protected String buildUrlWithContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, String swaggerUiUrl) { + return buildUrl(swaggerUiConfigParameters.getContextPath() + webEndpointProperties.getBasePath(), swaggerUiUrl); } @Override - protected String buildSwaggerConfigUrl() { - return contextPath + webEndpointProperties.getBasePath() + protected void buildSwaggerConfigUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { + swaggerUiConfigParameters.setConfigUrl(swaggerUiConfigParameters.getContextPath() + webEndpointProperties.getBasePath() + DEFAULT_PATH_SEPARATOR + DEFAULT_SWAGGER_UI_ACTUATOR_PATH - + DEFAULT_PATH_SEPARATOR + SWAGGER_CONFIG_FILE; + + DEFAULT_PATH_SEPARATOR + SWAGGER_CONFIG_FILE); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java index bef2fd87b..b79397a8c 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java @@ -55,10 +55,9 @@ public abstract class SwaggerWelcomeCommon extends AbstractSwaggerWelcome { * Instantiates a new Abstract swagger welcome. * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters */ - public SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters) { - super(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters); + public SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { + super(swaggerUiConfig, springDocConfigProperties); this.webJarsPrefixUrl = springDocConfigProperties.getWebjars().getPrefix(); } @@ -70,9 +69,10 @@ public SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDoc * @return the mono */ protected Mono redirectToUi(ServerHttpRequest request, ServerHttpResponse response) { - this.buildFromCurrentContextPath(request); - String sbUrl = this.buildUrl(contextPath, swaggerUiConfigParameters.getUiRootPath() + springDocConfigProperties.getWebjars().getPrefix() + getSwaggerUiUrl()); - UriComponentsBuilder uriBuilder = getUriComponentsBuilder(sbUrl); + SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); + this.buildFromCurrentContextPath(swaggerUiConfigParameters, request); + String sbUrl = this.buildUrl(swaggerUiConfigParameters.getContextPath(), swaggerUiConfigParameters.getUiRootPath() + springDocConfigProperties.getWebjars().getPrefix() + getSwaggerUiUrl()); + UriComponentsBuilder uriBuilder = getUriComponentsBuilder(swaggerUiConfigParameters, sbUrl); response.setStatusCode(HttpStatus.FOUND); response.getHeaders().setLocation(URI.create(uriBuilder.build().encode().toString())); return response.setComplete(); @@ -85,7 +85,8 @@ protected Mono redirectToUi(ServerHttpRequest request, ServerHttpResponse * @return the swagger ui config */ protected Map getSwaggerUiConfig(ServerHttpRequest request) { - this.buildFromCurrentContextPath(request); + SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); + this.buildFromCurrentContextPath(swaggerUiConfigParameters, request); return swaggerUiConfigParameters.getConfigParameters(); } @@ -95,13 +96,13 @@ protected Map getSwaggerUiConfig(ServerHttpRequest request) { * @param request the request * @return the string */ - void buildFromCurrentContextPath(ServerHttpRequest request) { - super.init(); - contextPath = request.getPath().contextPath().value(); + void buildFromCurrentContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, ServerHttpRequest request) { + super.init(swaggerUiConfigParameters); + swaggerUiConfigParameters.setContextPath(request.getPath().contextPath().value()); String url = UriComponentsBuilder.fromHttpRequest(request).toUriString(); if (!AntPathMatcher.DEFAULT_PATH_SEPARATOR.equals(request.getPath().toString())) url = url.replace(request.getPath().toString(), ""); - buildConfigUrl(UriComponentsBuilder.fromUriString(url)); + buildConfigUrl(swaggerUiConfigParameters, UriComponentsBuilder.fromUriString(url)); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java index 34efc6f65..268e24049 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java @@ -49,28 +49,20 @@ @Controller public class SwaggerWelcomeWebFlux extends SwaggerWelcomeCommon { - /** * The Spring web provider. */ private final SpringWebProvider springWebProvider; - - /** - * The Path prefix. - */ - private String pathPrefix; - + /** * Instantiates a new Swagger welcome web flux. * * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param springWebProvider the spring web provider */ - public SwaggerWelcomeWebFlux(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, - SwaggerUiConfigParameters swaggerUiConfigParameters, SpringWebProvider springWebProvider) { - super(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters); + public SwaggerWelcomeWebFlux(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SpringWebProvider springWebProvider) { + super(swaggerUiConfig, springDocConfigProperties); this.springWebProvider = springWebProvider; } @@ -89,55 +81,35 @@ public Mono redirectToUi(ServerHttpRequest request, ServerHttpResponse res return super.redirectToUi(request, response); } - /** - * Calculate ui root path. - * - * @param sbUrls the sb urls - */ @Override - protected void calculateUiRootPath(StringBuilder... sbUrls) { + protected void calculateUiRootPath(SwaggerUiConfigParameters swaggerUiConfigParameters, StringBuilder... sbUrls) { StringBuilder sbUrl = new StringBuilder(); - calculateUiRootCommon(sbUrl, sbUrls); + calculateUiRootCommon(swaggerUiConfigParameters,sbUrl, sbUrls); } - /** - * Calculate oauth 2 redirect url. - * - * @param uriComponentsBuilder the uri components builder - */ @Override - protected void calculateOauth2RedirectUrl(UriComponentsBuilder uriComponentsBuilder) { + protected void calculateOauth2RedirectUrl(SwaggerUiConfigParameters swaggerUiConfigParameters, UriComponentsBuilder uriComponentsBuilder) { if (StringUtils.isBlank(swaggerUiConfig.getOauth2RedirectUrl()) || !swaggerUiConfigParameters.isValidUrl(swaggerUiConfig.getOauth2RedirectUrl())) { - UriComponentsBuilder oauthPrefix = uriComponentsBuilder.path(contextPath).path(swaggerUiConfigParameters.getUiRootPath()).path(webJarsPrefixUrl); + UriComponentsBuilder oauthPrefix = uriComponentsBuilder.path(swaggerUiConfigParameters.getContextPath()).path(swaggerUiConfigParameters.getUiRootPath()).path(webJarsPrefixUrl); swaggerUiConfigParameters.setOauth2RedirectUrl(oauthPrefix.path(getOauth2RedirectUrl()).build().toString()); } } - /** - * Build api doc url string. - * - * @return the string - */ @Override - protected String buildApiDocUrl() { - return buildUrlWithContextPath(springDocConfigProperties.getApiDocs().getPath()); + protected void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { + swaggerUiConfigParameters.setApiDocsUrl(buildUrlWithContextPath(swaggerUiConfigParameters, springDocConfigProperties.getApiDocs().getPath())); } @Override - protected String buildUrlWithContextPath(String swaggerUiUrl) { - if (this.pathPrefix == null) - this.pathPrefix = springWebProvider.findPathPrefix(springDocConfigProperties); - return buildUrl(this.contextPath + this.pathPrefix, swaggerUiUrl); + protected String buildUrlWithContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, String swaggerUiUrl) { + if (swaggerUiConfigParameters.getPathPrefix() == null) + swaggerUiConfigParameters.setPathPrefix(springWebProvider.findPathPrefix(springDocConfigProperties)); + return buildUrl(swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getPathPrefix(), swaggerUiUrl); } - /** - * Build swagger config url string. - * - * @return the string - */ @Override - protected String buildSwaggerConfigUrl() { - return this.apiDocsUrl + DEFAULT_PATH_SEPARATOR + SWAGGER_CONFIG_FILE; + protected void buildSwaggerConfigUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { + swaggerUiConfigParameters.setConfigUrl(swaggerUiConfigParameters.getApiDocsUrl()+ DEFAULT_PATH_SEPARATOR + SWAGGER_CONFIG_FILE); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/springdoc-openapi-starter-webflux-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 6a15d9b8b..f946e27b2 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/springdoc-openapi-starter-webflux-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,5 +1,4 @@ org.springdoc.webflux.ui.SwaggerConfig org.springdoc.core.properties.SwaggerUiConfigProperties -org.springdoc.core.properties.SwaggerUiConfigParameters org.springdoc.core.properties.SwaggerUiOAuthProperties org.springdoc.core.configuration.SpringDocUIConfiguration \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java index bc4647420..37c7c9b03 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java @@ -18,6 +18,9 @@ package test.org.springdoc.ui.app32; +import java.util.concurrent.CompletableFuture; +import java.util.stream.IntStream; + import org.junit.jupiter.api.Test; import test.org.springdoc.ui.AbstractSpringDocTest; @@ -80,6 +83,46 @@ public void shouldCalculateUrlsBehindProxy() throws Exception { .isEqualTo("/path/prefix/v3/api-docs/swagger-config"); } + @Test + public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() throws Exception { + var tasks = IntStream.range(0, 100).mapToObj(i -> CompletableFuture.runAsync(() -> { + try { + webTestClient.get().uri("/webjars/swagger-ui/swagger-initializer.js") + .header("X-Forwarded-Prefix", "/path/prefix" + i) + .exchange() + .expectStatus().isOk() + .expectBody(String.class) + .consumeWith(response -> + assertThat(response.getResponseBody()) + .contains("\"configUrl\" : \"/path/prefix" + i + "/v3/api-docs/swagger-config\",") + ); + } catch (Exception e) { + throw new RuntimeException(e); + } + })).toArray(CompletableFuture[]::new); + + CompletableFuture.allOf(tasks).join(); + } + + @Test + public void shouldCalculateUrlsBehindProxyWhenChangingForwardedPrefixHeader() { + var tasks = IntStream.range(0, 100).mapToObj(i -> CompletableFuture.runAsync(() -> { + try { + webTestClient.get().uri("/v3/api-docs/swagger-config") + .header("X-Forwarded-Prefix", "/path/prefix" + i) + .exchange() + .expectStatus().isOk().expectBody() + .jsonPath("$.url").isEqualTo("/path/prefix" + i + "/v3/api-docs") + .jsonPath("$.configUrl").isEqualTo("/path/prefix" + i + "/v3/api-docs/swagger-config"); + } catch (Exception e) { + throw new RuntimeException(e); + } + })).toArray(CompletableFuture[]::new); + + CompletableFuture.allOf(tasks).join(); + } + + @SpringBootApplication static class SpringDocTestApp {} } diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java index 5fcc32f69..2b7c83b25 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java @@ -71,7 +71,6 @@ public class SwaggerConfig { * * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param springWebProvider the spring web provider * @return the swagger welcome web mvc */ @@ -79,8 +78,8 @@ public class SwaggerConfig { @ConditionalOnMissingBean @ConditionalOnProperty(name = SPRINGDOC_USE_MANAGEMENT_PORT, havingValue = "false", matchIfMissing = true) @Lazy(false) - SwaggerWelcomeWebMvc swaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, SpringWebProvider springWebProvider) { - return new SwaggerWelcomeWebMvc(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters, springWebProvider); + SwaggerWelcomeWebMvc swaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SpringWebProvider springWebProvider) { + return new SwaggerWelcomeWebMvc(swaggerUiConfig, springDocConfigProperties, springWebProvider); } /** @@ -127,7 +126,6 @@ SwaggerUiHome swaggerUiHome() { * * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param swaggerWelcomeCommon the swagger welcome common * @param objectMapperProvider the object mapper provider * @return the swagger index transformer @@ -135,15 +133,15 @@ SwaggerUiHome swaggerUiHome() { @Bean @ConditionalOnMissingBean @Lazy(false) - SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, - SwaggerUiConfigParameters swaggerUiConfigParameters, SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { - return new SwaggerIndexPageTransformer(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters, swaggerWelcomeCommon, objectMapperProvider); + SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, + SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { + return new SwaggerIndexPageTransformer(swaggerUiConfig, swaggerUiOAuthProperties, swaggerWelcomeCommon, objectMapperProvider); } /** * Swagger web mvc configurer swagger web mvc configurer. * - * @param swaggerUiConfigParameters the swagger ui calculated config + * @param swaggerUiConfigProperties the swagger ui calculated config * @param swaggerIndexTransformer the swagger index transformer * @param actuatorProvider the actuator provider * @param swaggerResourceResolver the swagger resource resolver @@ -152,24 +150,11 @@ SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUi @Bean @ConditionalOnMissingBean @Lazy(false) - SwaggerWebMvcConfigurer swaggerWebMvcConfigurer(SwaggerUiConfigParameters swaggerUiConfigParameters, + SwaggerWebMvcConfigurer swaggerWebMvcConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { - return new SwaggerWebMvcConfigurer(swaggerUiConfigParameters, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); + return new SwaggerWebMvcConfigurer(swaggerUiConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); } - - /** - * Swagger ui config parameters swagger ui config parameters. - * - * @param swaggerUiConfig the swagger ui config - * @return the swagger ui config parameters - */ - @Bean - @ConditionalOnMissingBean - @Lazy(false) - SwaggerUiConfigParameters swaggerUiConfigParameters(SwaggerUiConfigProperties swaggerUiConfig) { - return new SwaggerUiConfigParameters(swaggerUiConfig); - } - + /** * Swagger resource resolver swagger resource resolver. * @@ -196,15 +181,14 @@ static class SwaggerActuatorWelcomeConfiguration { * * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param webEndpointProperties the web endpoint properties * @return the swagger welcome actuator */ @Bean @ConditionalOnMissingBean @Lazy(false) - SwaggerWelcomeActuator swaggerActuatorWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, WebEndpointProperties webEndpointProperties) { - return new SwaggerWelcomeActuator(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters, webEndpointProperties); + SwaggerWelcomeActuator swaggerActuatorWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, WebEndpointProperties webEndpointProperties) { + return new SwaggerWelcomeActuator(swaggerUiConfig, springDocConfigProperties, webEndpointProperties); } } } diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java index a9593c3bb..dd267bd02 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java @@ -56,26 +56,26 @@ public class SwaggerIndexPageTransformer extends AbstractSwaggerIndexTransformer * Instantiates a new Swagger index transformer. * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param swaggerWelcomeCommon the swagger welcome common * @param objectMapperProvider the object mapper provider */ public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, - SwaggerUiConfigParameters swaggerUiConfigParameters, SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { - super(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters, objectMapperProvider); + SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { + super(swaggerUiConfig, swaggerUiOAuthProperties, objectMapperProvider); this.swaggerWelcomeCommon = swaggerWelcomeCommon; } @Override public Resource transform(HttpServletRequest request, Resource resource, ResourceTransformerChain transformerChain) throws IOException { - swaggerWelcomeCommon.buildFromCurrentContextPath(request); - + SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); + swaggerWelcomeCommon.buildFromCurrentContextPath(swaggerUiConfigParameters, request); + final AntPathMatcher antPathMatcher = new AntPathMatcher(); boolean isIndexFound = antPathMatcher.match("**/swagger-ui/**/" + SWAGGER_INITIALIZER_JS, resource.getURL().toString()); if (isIndexFound) { - String html = defaultTransformations(resource.getInputStream()); + String html = defaultTransformations(swaggerUiConfigParameters, resource.getInputStream()); return new TransformedResource(resource, html.getBytes(StandardCharsets.UTF_8)); } else diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java index 8a11ea445..d9af5c7c1 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Optional; -import org.springdoc.core.properties.SwaggerUiConfigParameters; +import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.ActuatorProvider; import org.springframework.format.FormatterRegistry; @@ -61,11 +61,6 @@ */ public class SwaggerWebMvcConfigurer implements WebMvcConfigurer { - /** - * The Swagger path. - */ - private final String swaggerPath; - /** * The Swagger index transformer. */ @@ -76,6 +71,10 @@ public class SwaggerWebMvcConfigurer implements WebMvcConfigurer { */ private final Optional actuatorProvider; + /** + * The Swagger ui config properties. + */ + private final SwaggerUiConfigProperties swaggerUiConfigProperties; /** * The Swagger resource resolver. @@ -85,23 +84,24 @@ public class SwaggerWebMvcConfigurer implements WebMvcConfigurer { /** * Instantiates a new Swagger web mvc configurer. * - * @param swaggerUiConfigParameters the swagger ui calculated config + * @param swaggerUiConfigProperties the swagger ui calculated config * @param swaggerIndexTransformer the swagger index transformer * @param actuatorProvider the actuator provider * @param swaggerResourceResolver the swagger resource resolver */ - public SwaggerWebMvcConfigurer(SwaggerUiConfigParameters swaggerUiConfigParameters, + public SwaggerWebMvcConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { - this.swaggerPath = swaggerUiConfigParameters.getPath(); this.swaggerIndexTransformer = swaggerIndexTransformer; this.actuatorProvider = actuatorProvider; this.swaggerResourceResolver = swaggerResourceResolver; + this.swaggerUiConfigProperties = swaggerUiConfigProperties; } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { StringBuilder uiRootPath = new StringBuilder(); + String swaggerPath = swaggerUiConfigProperties.getPath(); if (swaggerPath.contains(DEFAULT_PATH_SEPARATOR)) uiRootPath.append(swaggerPath, 0, swaggerPath.lastIndexOf(DEFAULT_PATH_SEPARATOR)); if (actuatorProvider.isPresent() && actuatorProvider.get().isUseManagementPort()) diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java index 521769c26..6a3e49361 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java @@ -60,12 +60,11 @@ public class SwaggerWelcomeActuator extends SwaggerWelcomeCommon { /** * Instantiates a new Swagger welcome. * @param swaggerUiConfig the swagger ui config - * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters + * @param springDocConfigProperties the swagger ui config parameters * @param webEndpointProperties the web endpoint properties */ - public SwaggerWelcomeActuator(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, WebEndpointProperties webEndpointProperties) { - super(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters); + public SwaggerWelcomeActuator(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties,WebEndpointProperties webEndpointProperties) { + super(swaggerUiConfig, springDocConfigProperties); this.webEndpointProperties = webEndpointProperties; } @@ -97,27 +96,27 @@ public Map openapiJson(HttpServletRequest request) { } @Override - protected void calculateUiRootPath(StringBuilder... sbUrls) { + protected void calculateUiRootPath(SwaggerUiConfigParameters swaggerUiConfigParameters, StringBuilder... sbUrls) { StringBuilder sbUrl = new StringBuilder(); sbUrl.append(webEndpointProperties.getBasePath()); - calculateUiRootCommon(sbUrl, sbUrls); + calculateUiRootCommon(swaggerUiConfigParameters, sbUrl, sbUrls); } @Override - protected String buildApiDocUrl() { - return buildUrl(contextPath + webEndpointProperties.getBasePath(), DEFAULT_API_DOCS_ACTUATOR_URL); + protected void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { + swaggerUiConfigParameters.setApiDocsUrl(buildUrl(swaggerUiConfigParameters.getContextPath() + webEndpointProperties.getBasePath(), DEFAULT_API_DOCS_ACTUATOR_URL)); } @Override - protected String buildUrlWithContextPath(String swaggerUiUrl) { - return buildUrl(contextPath + webEndpointProperties.getBasePath(), swaggerUiUrl); + protected String buildUrlWithContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, String swaggerUiUrl) { + return buildUrl(swaggerUiConfigParameters.getContextPath() + webEndpointProperties.getBasePath(), swaggerUiUrl); } @Override - protected String buildSwaggerConfigUrl() { - return contextPath + webEndpointProperties.getBasePath() + protected void buildSwaggerConfigUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { + swaggerUiConfigParameters.setConfigUrl(swaggerUiConfigParameters.getContextPath() + webEndpointProperties.getBasePath() + DEFAULT_PATH_SEPARATOR + DEFAULT_SWAGGER_UI_ACTUATOR_PATH - + DEFAULT_PATH_SEPARATOR + SWAGGER_CONFIG_FILE; + + DEFAULT_PATH_SEPARATOR + SWAGGER_CONFIG_FILE); } } diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java index bd236c693..965525fec 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java @@ -47,11 +47,9 @@ public abstract class SwaggerWelcomeCommon extends AbstractSwaggerWelcome { * Instantiates a new Abstract swagger welcome. * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters */ - public SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, - SwaggerUiConfigParameters swaggerUiConfigParameters) { - super(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters); + public SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { + super(swaggerUiConfig, springDocConfigProperties); } /** @@ -61,9 +59,10 @@ public SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDoc * @return the response entity */ protected ResponseEntity redirectToUi(HttpServletRequest request) { - buildFromCurrentContextPath(request); - String sbUrl = contextPath + swaggerUiConfigParameters.getUiRootPath() + getSwaggerUiUrl(); - UriComponentsBuilder uriBuilder = getUriComponentsBuilder(sbUrl); + SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); + buildFromCurrentContextPath(swaggerUiConfigParameters, request); + String sbUrl = swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getUiRootPath() + getSwaggerUiUrl(); + UriComponentsBuilder uriBuilder = getUriComponentsBuilder(swaggerUiConfigParameters, sbUrl); // forward all queryParams from original request request.getParameterMap().forEach(uriBuilder::queryParam); @@ -80,12 +79,13 @@ protected ResponseEntity redirectToUi(HttpServletRequest request) { * @return the map */ protected Map openapiJson(HttpServletRequest request) { - buildFromCurrentContextPath(request); + SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); + buildFromCurrentContextPath(swaggerUiConfigParameters, request); return swaggerUiConfigParameters.getConfigParameters(); } @Override - protected void calculateOauth2RedirectUrl(UriComponentsBuilder uriComponentsBuilder) { + protected void calculateOauth2RedirectUrl(SwaggerUiConfigParameters swaggerUiConfigParameters, UriComponentsBuilder uriComponentsBuilder) { if (StringUtils.isBlank(swaggerUiConfig.getOauth2RedirectUrl()) || !swaggerUiConfigParameters.isValidUrl(swaggerUiConfig.getOauth2RedirectUrl())) swaggerUiConfigParameters.setOauth2RedirectUrl(uriComponentsBuilder .path(swaggerUiConfigParameters.getUiRootPath()) @@ -97,9 +97,10 @@ protected void calculateOauth2RedirectUrl(UriComponentsBuilder uriComponentsBuil * * @param request the request */ - void buildFromCurrentContextPath(HttpServletRequest request) { - super.init(); - contextPath = request.getContextPath(); - buildConfigUrl(ServletUriComponentsBuilder.fromCurrentContextPath()); + void buildFromCurrentContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, HttpServletRequest request) { + super.init(swaggerUiConfigParameters); + swaggerUiConfigParameters.setContextPath(request.getContextPath()); + buildConfigUrl(swaggerUiConfigParameters, ServletUriComponentsBuilder.fromCurrentContextPath()); } + } diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java index 84220d656..65f48986b 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java @@ -61,88 +61,54 @@ public class SwaggerWelcomeWebMvc extends SwaggerWelcomeCommon { @Value(MVC_SERVLET_PATH) private String mvcServletPath; - /** - * The Path prefix. - */ - private String pathPrefix; - /** * Instantiates a new Swagger welcome web mvc. * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param swaggerUiConfigParameters the swagger ui config parameters * @param springWebProvider the spring web provider */ - public SwaggerWelcomeWebMvc(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, SpringWebProvider springWebProvider) { - super(swaggerUiConfig, springDocConfigProperties, swaggerUiConfigParameters); + public SwaggerWelcomeWebMvc(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SpringWebProvider springWebProvider) { + super(swaggerUiConfig, springDocConfigProperties); this.springWebProvider = springWebProvider; } - - /** - * Redirect to ui string. - * - * @param request the request - * @return the string - */ + @Operation(hidden = true) @GetMapping(SWAGGER_UI_PATH) @Override public ResponseEntity redirectToUi(HttpServletRequest request) { return super.redirectToUi(request); } - - /** - * Calculate ui root path. - * - * @param sbUrls the sb urls - */ + @Override - protected void calculateUiRootPath(StringBuilder... sbUrls) { + protected void calculateUiRootPath(SwaggerUiConfigParameters swaggerUiConfigParameters, StringBuilder... sbUrls) { StringBuilder sbUrl = new StringBuilder(); if (SpringDocUtils.isValidPath(mvcServletPath)) sbUrl.append(mvcServletPath); - calculateUiRootCommon(sbUrl, sbUrls); + calculateUiRootCommon(swaggerUiConfigParameters, sbUrl, sbUrls); } - - /** - * Build url string. - * - * @param contextPath the context path - * @param docsUrl the docs url - * @return the string - */ + @Override protected String buildUrl(String contextPath, final String docsUrl) { if (SpringDocUtils.isValidPath(mvcServletPath)) contextPath += mvcServletPath; return super.buildUrl(contextPath, docsUrl); } - - /** - * Build api doc url string. - * - * @return the string - */ + @Override - protected String buildApiDocUrl() { - return buildUrlWithContextPath(springDocConfigProperties.getApiDocs().getPath()); + protected void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { + swaggerUiConfigParameters.setApiDocsUrl(buildUrlWithContextPath(swaggerUiConfigParameters, springDocConfigProperties.getApiDocs().getPath())); } @Override - protected String buildUrlWithContextPath(String swaggerUiUrl) { - if (this.pathPrefix == null) - this.pathPrefix = springWebProvider.findPathPrefix(springDocConfigProperties); - return buildUrl(contextPath + pathPrefix, swaggerUiUrl); + protected String buildUrlWithContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, String swaggerUiUrl) { + if (swaggerUiConfigParameters.getPathPrefix() == null) + swaggerUiConfigParameters.setPathPrefix(springWebProvider.findPathPrefix(springDocConfigProperties)); + return buildUrl(swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getPathPrefix(), swaggerUiUrl); } - - /** - * Build swagger config url string. - * - * @return the string - */ + @Override - protected String buildSwaggerConfigUrl() { - return apiDocsUrl + DEFAULT_PATH_SEPARATOR + SWAGGER_CONFIG_FILE; + protected void buildSwaggerConfigUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { + swaggerUiConfigParameters.setConfigUrl(swaggerUiConfigParameters.getApiDocsUrl() + DEFAULT_PATH_SEPARATOR + SWAGGER_CONFIG_FILE); } } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/springdoc-openapi-starter-webmvc-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 74e2072b9..6ee14cfc1 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/springdoc-openapi-starter-webmvc-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,5 +1,4 @@ org.springdoc.webmvc.ui.SwaggerConfig org.springdoc.core.properties.SwaggerUiConfigProperties -org.springdoc.core.properties.SwaggerUiConfigParameters org.springdoc.core.properties.SwaggerUiOAuthProperties org.springdoc.core.configuration.SpringDocUIConfiguration \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java index 2cdd36480..7ac2ed5fa 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java @@ -18,6 +18,9 @@ package test.org.springdoc.ui.app32; +import java.util.concurrent.CompletableFuture; +import java.util.stream.IntStream; + import org.junit.jupiter.api.Test; import test.org.springdoc.ui.AbstractSpringDocTest; @@ -79,6 +82,45 @@ public void shouldCalculateUrlsBehindProxy() throws Exception { )); } + @Test + public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() throws Exception { + var tasks = IntStream.range(0, 100).mapToObj(i -> CompletableFuture.runAsync(() -> { + try { + mockMvc.perform(get("/swagger-ui/swagger-initializer.js") + .header("X-Forwarded-Prefix", "/path/prefix" + i)) + .andExpect(status().isOk()) + .andExpect(content().string( + containsString("\"configUrl\" : \"/path/prefix" + i + "/v3/api-docs/swagger-config\",") + )); + } catch (Exception e) { + throw new RuntimeException(e); + } + })).toArray(CompletableFuture[]::new); + + CompletableFuture.allOf(tasks).join(); + } + + @Test + public void shouldCalculateUrlsBehindProxyWhenChangingForwardedPrefixHeader() { + var tasks = IntStream.range(0, 100).mapToObj(i -> CompletableFuture.runAsync(() -> { + try { + mockMvc.perform(get("/v3/api-docs/swagger-config") + .header("X-Forwarded-Prefix", X_FORWARD_PREFIX + i)) + .andExpect(status().isOk()) + .andExpect(jsonPath("url", + equalTo("/path/prefix" + i + "/v3/api-docs") + )) + .andExpect(jsonPath("configUrl", + equalTo("/path/prefix" + i + "/v3/api-docs/swagger-config") + )); + } catch (Exception e) { + throw new RuntimeException(e); + } + })).toArray(CompletableFuture[]::new); + + CompletableFuture.allOf(tasks).join(); + } + @SpringBootApplication static class SpringDocTestApp {} } From ad86c0ac7ec22473f74ee69cadd729704bb57a8d Mon Sep 17 00:00:00 2001 From: granddaifuku Date: Fri, 27 Sep 2024 16:21:38 +0900 Subject: [PATCH 066/226] Display nullable request body with map type. Fixes #2703 --- .../core/service/AbstractRequestService.java | 21 ++++++-- .../api/v31/app10/GreetController.java | 37 +++++++++++++ .../api/v31/app10/SpringDocApp10Test.java | 30 +++++++++++ .../test/resources/results/3.1.0/app10.json | 52 +++++++++++++++++++ 4 files changed, 137 insertions(+), 3 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/GreetController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app10.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 77b125edb..53aa8a480 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ package org.springdoc.core.service; import java.lang.annotation.Annotation; -import java.lang.reflect.Field; import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.ArrayList; @@ -89,7 +88,6 @@ import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.context.request.WebRequest; import org.springframework.web.method.HandlerMethod; -import org.springframework.web.multipart.MultipartFile; import org.springframework.web.util.UriComponentsBuilder; import static org.springdoc.core.converters.SchemaPropertyDeprecatingConverter.containsDeprecatedAnnotation; @@ -453,6 +451,8 @@ public boolean isParamToIgnore(MethodParameter parameter) { return true; if (isRequiredAnnotation(parameter)) return false; + if (isRequestBodyWithMapType(parameter)) + return false; return isRequestTypeToIgnore(parameter.getParameterType()); } @@ -471,6 +471,21 @@ private boolean isRequiredAnnotation(MethodParameter parameter) { || (requestBody != null && requestBody.required()); } + /** + * Is request body with map type + * + * @param parameter the parameter + * @return the boolean + */ + private boolean isRequestBodyWithMapType(MethodParameter parameter) { + org.springframework.web.bind.annotation.RequestBody requestBody = parameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class); + if (requestBody == null) { + return false; + } + Class parameterType = parameter.getParameterType(); + return parameterType == java.util.Map.class; + } + /** * Sets params. * diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/GreetController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/GreetController.java new file mode 100644 index 000000000..c3b62b1b7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/GreetController.java @@ -0,0 +1,37 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app10; + +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +@RestController +public class GreetController { + @PostMapping("/greet") + @Operation(summary = "Greet") + public String greet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Some description", required = false) + @RequestBody(required = false) Map body) { + return body.getOrDefault("greet", "Hello"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java new file mode 100644 index 000000000..6f416b859 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java @@ -0,0 +1,30 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app10; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +public class SpringDocApp10Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app10.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app10.json new file mode 100644 index 000000000..c20537fa9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app10.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/greet": { + "post": { + "tags": [ + "greet-controller" + ], + "summary": "Greet", + "operationId": "greet", + "requestBody": { + "description": "Some description", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + + } +} \ No newline at end of file From 32377870cead1b091cd13c179b99090bb4761801 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 28 Sep 2024 11:41:43 +0200 Subject: [PATCH 067/226] code review --- .../core/service/AbstractRequestService.java | 2 +- .../SpringDocBehindProxyBasePathTest.java | 89 +++++++++++++++++++ .../src/test/resources/results/app32-1.json | 6 ++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java create mode 100644 springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 53aa8a480..3085f66c9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -483,7 +483,7 @@ private boolean isRequestBodyWithMapType(MethodParameter parameter) { return false; } Class parameterType = parameter.getParameterType(); - return parameterType == java.util.Map.class; + return Map.class.isAssignableFrom(parameterType); } /** diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java new file mode 100644 index 000000000..296d78af6 --- /dev/null +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java @@ -0,0 +1,89 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.ui.app32; + +import jakarta.annotation.PostConstruct; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractCommonTest; +import test.org.springdoc.ui.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.test.web.server.LocalServerPort; +import org.springframework.context.annotation.Import; +import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.reactive.function.client.WebClient; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "spring.webflux.base-path=/test", + "server.forward-headers-strategy=framework", + "server.port=9318", + "springdoc.swagger-ui.path=/documentation/swagger-ui.html", + "springdoc.api-docs.path=/documentation/v3/api-docs", + "springdoc.webjars.prefix= /webjars-pref" }) + +@Import(SpringDocConfig.class) +public class SpringDocBehindProxyBasePathTest extends AbstractCommonTest { + + private static final String X_FORWARD_PREFIX = "/path/prefix"; + + @LocalServerPort + private int port; + + private WebClient webClient; + + @PostConstruct + void init() { + webClient = WebClient.builder().baseUrl("http://localhost:" + port) + .build(); + } + + @Test + public void testIndex() throws Exception { + HttpStatusCode httpStatusMono = webClient.get().uri("/test/documentation/swagger-ui.html") + .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) + .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); + assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); + + httpStatusMono = webClient.get().uri("/test/documentation/webjars-pref/swagger-ui/index.html") + .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) + .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); + assertThat(httpStatusMono).isEqualTo(HttpStatus.OK); + + String contentAsString = webClient.get().uri("/test/documentation/v3/api-docs/swagger-config") + .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) + .retrieve() + .bodyToMono(String.class).block(); + String expected = getContent("results/app32-1.json"); + assertEquals(expected, contentAsString, true); + } + + + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json new file mode 100644 index 000000000..c6f06f1f6 --- /dev/null +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json @@ -0,0 +1,6 @@ +{ + "configUrl": "/path/prefix/documentation/v3/api-docs/swagger-config", + "oauth2RedirectUrl": "http://localhost:9318/path/prefix/documentation/webjars-pref/swagger-ui/oauth2-redirect.html", + "url": "/path/prefix/documentation/v3/api-docs", + "validatorUrl": "" +} From 1f128e892796799f0f91c6652081d5f6d8007a65 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 28 Sep 2024 13:02:08 +0200 Subject: [PATCH 068/226] fix test --- .../ui/app32/SpringDocBehindProxyBasePathTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java index 296d78af6..1248d24e1 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java @@ -39,8 +39,8 @@ @SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { "spring.webflux.base-path=/test", - "server.forward-headers-strategy=framework", + properties = { //"spring.webflux.base-path=/test", + "server.forward-headers-strategy=native", "server.port=9318", "springdoc.swagger-ui.path=/documentation/swagger-ui.html", "springdoc.api-docs.path=/documentation/v3/api-docs", @@ -64,17 +64,17 @@ void init() { @Test public void testIndex() throws Exception { - HttpStatusCode httpStatusMono = webClient.get().uri("/test/documentation/swagger-ui.html") + HttpStatusCode httpStatusMono = webClient.get().uri("/documentation/swagger-ui.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); - httpStatusMono = webClient.get().uri("/test/documentation/webjars-pref/swagger-ui/index.html") + httpStatusMono = webClient.get().uri("/documentation/webjars-pref/swagger-ui/index.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.OK); - String contentAsString = webClient.get().uri("/test/documentation/v3/api-docs/swagger-config") + String contentAsString = webClient.get().uri("/documentation/v3/api-docs/swagger-config") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .retrieve() .bodyToMono(String.class).block(); From 1a9a1d44f3be364dbde925fa2c6d5725c7dd1f4d Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Sep 2024 04:27:40 +0200 Subject: [PATCH 069/226] improving actuator docs --- .../api/AbstractOpenApiResource.java | 33 ++- .../configuration/SpringDocConfiguration.java | 28 +-- .../SpringDocKotlinConfiguration.kt | 1 - .../SpringDocPageableConfiguration.java | 1 - .../SpringDocSecurityOAuth2Customizer.java | 6 - .../SpringDocSortConfiguration.java | 1 - ...pringdocActuatorBeanFactoryConfigurer.java | 5 +- .../ActuatorOpenApiCustomizer.java | 124 ---------- .../ActuatorOperationCustomizer.java | 230 ++++++++++++++---- .../JavadocPropertyCustomizer.java | 2 +- .../customizers/SpringDocCustomizers.java | 52 ++-- .../springdoc/core/models/GroupedOpenApi.java | 33 +-- .../properties/SwaggerUiConfigParameters.java | 8 - .../core/service/AbstractRequestService.java | 6 + .../core/service/OperationService.java | 1 - .../springdoc/ui/AbstractSwaggerWelcome.java | 4 +- .../api/AbstractOpenApiResourceTest.java | 3 +- .../core/model/MethodAttributesTest.java | 6 +- .../AbstractSwaggerIndexTransformerTest.java | 1 - .../org/springdoc/api/app188/OrderDemo.java | 6 +- .../api/app188/SpringDocApp188Test.java | 4 +- .../springdoc/webflux/ui/SwaggerConfig.java | 1 - .../SpringDocBehindProxyBasePathTest.java | 2 - .../api/v30/app193/SpringDocApp193Test.java | 4 +- .../springdoc/api/v30/app203/OrderDemo.java | 4 - .../api/v30/app203/SpringDocApp203Test.java | 4 +- .../api/v31/app10/GreetController.java | 5 +- .../api/v31/app10/SpringDocApp10Test.java | 3 +- .../test/resources/results/3.0.1/app143.json | 31 --- .../test/resources/results/3.0.1/app196.json | 31 --- .../test/resources/results/3.0.1/app205.json | 88 +++---- .../springdoc/webmvc/ui/SwaggerConfig.java | 1 - ...ltipleUrlsSeveralParallelRequestsTest.java | 9 +- .../api/app186/SpringDocApp186Test.java | 5 +- .../src/test/resources/results/app146-1.json | 138 +++++++---- .../src/test/resources/results/app147-1.json | 138 +++++++---- .../src/test/resources/results/app147-2.json | 138 +++++++---- .../src/test/resources/results/app148-2.json | 138 +++++++---- .../src/test/resources/results/app186.json | 218 ++++++++--------- .../api/app186/SpringDocApp186Test.java | 5 +- .../src/test/resources/results/app147-1.json | 138 +++++++---- .../src/test/resources/results/app148-2.json | 138 +++++++---- .../src/test/resources/results/app186.json | 229 +++++++---------- .../src/test/resources/results/app36.json | 94 ------- .../api/app14/SpringDocApp14Test.java | 1 - .../api/app32/SpringDocApp32Test.java | 1 - 46 files changed, 1033 insertions(+), 1086 deletions(-) delete mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app36.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 19b4a37bc..8d208a136 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -49,6 +49,8 @@ import java.util.concurrent.Executors; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import com.fasterxml.jackson.annotation.JsonView; @@ -213,6 +215,12 @@ public abstract class AbstractOpenApiResource extends SpecFilter { */ private final Lock reentrantLock = new ReentrantLock(); + /** + * The Path pattern. + */ + private final Pattern pathPattern = Pattern.compile("\\{(.*?)}"); + + /** * Instantiates a new Abstract open api resource. * @@ -626,7 +634,18 @@ protected void calculatePath(HandlerMethod handlerMethod, RouterOperation router operation = customizeOperation(operation, handlerMethod); PathItem pathItemObject = buildPathItem(requestMethod, operation, operationPath, paths); - paths.addPathItem(operationPath, pathItemObject); + + if (!StringUtils.contains(operationPath, "**")) { + if(StringUtils.contains(operationPath,"*")){ + Matcher matcher = pathPattern.matcher(operationPath); + while (matcher.find()) { + String pathParam = matcher.group(1); + String newPathParam = pathParam.replace("*", ""); + operationPath = operationPath.replace("{" + pathParam + "}", "{" + newPathParam + "}"); + } + } + paths.addPathItem(operationPath, pathItemObject); + } } } @@ -751,9 +770,9 @@ protected void calculatePath(RouterOperation routerOperation, Locale locale, Ope * @return the router operation */ private RouterOperation customizeDataRestRouterOperation(RouterOperation routerOperation) { - Optional> optionalDataRestRouterOperationCustomizers = springDocCustomizers.getDataRestRouterOperationCustomizers(); + Optional> optionalDataRestRouterOperationCustomizers = springDocCustomizers.getDataRestRouterOperationCustomizers(); if (optionalDataRestRouterOperationCustomizers.isPresent()) { - List dataRestRouterOperationCustomizerList = optionalDataRestRouterOperationCustomizers.get(); + Set dataRestRouterOperationCustomizerList = optionalDataRestRouterOperationCustomizers.get(); for (DataRestRouterOperationCustomizer dataRestRouterOperationCustomizer : dataRestRouterOperationCustomizerList) { routerOperation = dataRestRouterOperationCustomizer.customize(routerOperation); } @@ -977,9 +996,9 @@ protected Set getDefaultAllowedHttpMethods() { * @return the operation */ protected Operation customizeOperation(Operation operation, HandlerMethod handlerMethod) { - Optional> optionalOperationCustomizers = springDocCustomizers.getOperationCustomizers(); + Optional> optionalOperationCustomizers = springDocCustomizers.getOperationCustomizers(); if (optionalOperationCustomizers.isPresent()) { - List operationCustomizerList = optionalOperationCustomizers.get(); + Set operationCustomizerList = optionalOperationCustomizers.get(); for (OperationCustomizer operationCustomizer : operationCustomizerList) operation = operationCustomizer.customize(operation, handlerMethod); } @@ -994,9 +1013,9 @@ protected Operation customizeOperation(Operation operation, HandlerMethod handle * @return the router operation */ protected RouterOperation customizeRouterOperation(RouterOperation routerOperation, HandlerMethod handlerMethod) { - Optional> optionalRouterOperationCustomizers = springDocCustomizers.getRouterOperationCustomizers(); + Optional> optionalRouterOperationCustomizers = springDocCustomizers.getRouterOperationCustomizers(); if (optionalRouterOperationCustomizers.isPresent()) { - List routerOperationCustomizerList = optionalRouterOperationCustomizers.get(); + Set routerOperationCustomizerList = optionalRouterOperationCustomizers.get(); for (RouterOperationCustomizer routerOperationCustomizer : routerOperationCustomizerList) { routerOperation = routerOperationCustomizer.customize(routerOperation, handlerMethod); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 06e1e7fd1..078ef9c10 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -31,6 +31,7 @@ import java.util.Locale; import java.util.Map; import java.util.Optional; +import java.util.Set; import com.fasterxml.jackson.databind.node.ObjectNode; import com.querydsl.core.types.Predicate; @@ -54,7 +55,6 @@ import org.springdoc.core.converters.ResponseSupportConverter; import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; import org.springdoc.core.converters.WebFluxSupportConverter; -import org.springdoc.core.customizers.ActuatorOpenApiCustomizer; import org.springdoc.core.customizers.ActuatorOperationCustomizer; import org.springdoc.core.customizers.DataRestRouterOperationCustomizer; import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer; @@ -483,19 +483,6 @@ GlobalOperationCustomizer actuatorCustomizer(SpringDocConfigProperties springDoc return new ActuatorOperationCustomizer(springDocConfigProperties); } - /** - * Actuator customizer OpenAPI customiser. - * - * @param webEndpointProperties the web endpoint properties - * @return the OpenAPI customiser - */ - @Bean - @Lazy(false) - @ConditionalOnManagementPort(ManagementPortType.SAME) - GlobalOpenApiCustomizer actuatorOpenApiCustomizer(WebEndpointProperties webEndpointProperties) { - return new ActuatorOpenApiCustomizer(webEndpointProperties); - } - } /** @@ -612,12 +599,13 @@ public ResponseEntity handleNoHandlerFound(OpenApiResourceNotFound @Bean @ConditionalOnMissingBean @Lazy(false) - public SpringDocCustomizers springDocCustomizers(Optional> openApiCustomizers, - Optional> operationCustomizers, - Optional> routerOperationCustomizers, - Optional> dataRestRouterOperationCustomizers, - Optional> methodFilters, Optional> globalOpenApiCustomizers, Optional> globalOperationCustomizers, - Optional> globalOpenApiMethodFilters){ + public SpringDocCustomizers springDocCustomizers(Optional> openApiCustomizers, + Optional> operationCustomizers, + Optional> routerOperationCustomizers, + Optional> dataRestRouterOperationCustomizers, + Optional> methodFilters, Optional> globalOpenApiCustomizers, + Optional> globalOperationCustomizers, + Optional> globalOpenApiMethodFilters){ return new SpringDocCustomizers(openApiCustomizers, operationCustomizers, routerOperationCustomizers, diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt index ab1504574..8e77b50b0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt @@ -1,7 +1,6 @@ package org.springdoc.core.configuration import io.swagger.v3.oas.annotations.Parameter -import io.swagger.v3.oas.models.media.ByteArraySchema import org.springdoc.core.customizers.ParameterCustomizer import org.springdoc.core.parsers.KotlinCoroutinesReturnTypeParser import org.springdoc.core.utils.Constants diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java index 823e19f72..fbf7aa044 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java @@ -29,7 +29,6 @@ import org.springdoc.core.converters.PageOpenAPIConverter; import org.springdoc.core.converters.PageableOpenAPIConverter; import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; -import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer; import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.providers.RepositoryRestConfigurationProvider; import org.springdoc.core.providers.SpringDataWebPropertiesProvider; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java index d155b9459..289d047c0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java @@ -4,8 +4,6 @@ import io.swagger.v3.core.util.AnnotationsUtils; import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.security.SecurityRequirements; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; @@ -24,10 +22,6 @@ import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; -import io.swagger.v3.oas.models.security.SecurityRequirement; -import io.swagger.v3.oas.models.security.SecurityScheme; -import io.swagger.v3.oas.models.security.SecurityScheme.In; -import io.swagger.v3.oas.models.security.SecurityScheme.Type; import org.apache.commons.lang3.reflect.FieldUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java index 56fa8912a..a6c573d7c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java @@ -29,7 +29,6 @@ import org.springdoc.core.converters.SortOpenAPIConverter; import org.springdoc.core.converters.models.SortObject; import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; -import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer; import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.providers.RepositoryRestConfigurationProvider; import org.springdoc.core.providers.SpringDataWebPropertiesProvider; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java index 0bfcdf5d4..2c38b19be 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java @@ -27,7 +27,6 @@ import java.util.ArrayList; import java.util.List; -import org.springdoc.core.customizers.ActuatorOpenApiCustomizer; import org.springdoc.core.customizers.ActuatorOperationCustomizer; import org.springdoc.core.models.GroupedOpenApi; import org.springdoc.core.properties.SpringDocConfigProperties; @@ -76,9 +75,7 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) WebEndpointProperties webEndpointProperties = result.get(); SpringDocConfigProperties springDocConfigProperties = springDocConfigPropertiesBindResult.get(); List newGroups = new ArrayList<>(); - - ActuatorOpenApiCustomizer actuatorOpenApiCustomizer = new ActuatorOpenApiCustomizer(webEndpointProperties); - beanFactory.registerSingleton("actuatorOpenApiCustomizer", actuatorOpenApiCustomizer); + ActuatorOperationCustomizer actuatorCustomizer = new ActuatorOperationCustomizer(springDocConfigProperties); beanFactory.registerSingleton("actuatorCustomizer", actuatorCustomizer); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java deleted file mode 100644 index 93c367b22..000000000 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package org.springdoc.core.customizers; - -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Stream; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.Paths; -import io.swagger.v3.oas.models.media.StringSchema; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.PathParameter; - -import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; -import org.springframework.util.CollectionUtils; - -import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; - -/** - * The type Actuator open api customiser. - * @author bnasslahsen - */ -public class ActuatorOpenApiCustomizer implements GlobalOpenApiCustomizer { - - /** - * The Path pathern. - */ - private final Pattern pathPathern = Pattern.compile("\\{(.*?)}"); - - /** - * The Web endpoint properties. - */ - private final WebEndpointProperties webEndpointProperties; - - /** - * Instantiates a new Actuator open api customizer. - * - * @param webEndpointProperties the web endpoint properties - */ - public ActuatorOpenApiCustomizer(WebEndpointProperties webEndpointProperties) { - this.webEndpointProperties = webEndpointProperties; - } - - private Stream> actuatorPathEntryStream(OpenAPI openApi, String relativeSubPath) { - String pathPrefix = webEndpointProperties.getBasePath() + Optional.ofNullable(relativeSubPath).orElse(""); - return Optional.ofNullable(openApi.getPaths()) - .map(Paths::entrySet) - .map(Set::stream) - .map(s -> s.filter(entry -> entry.getKey().startsWith(pathPrefix))) - .orElse(Stream.empty()); - } - - private void handleActuatorPathParam(OpenAPI openApi) { - actuatorPathEntryStream(openApi, DEFAULT_PATH_SEPARATOR).forEach(stringPathItemEntry -> { - String path = stringPathItemEntry.getKey(); - Matcher matcher = pathPathern.matcher(path); - while (matcher.find()) { - String pathParam = matcher.group(1); - PathItem pathItem = stringPathItemEntry.getValue(); - pathItem.readOperations().forEach(operation -> { - List existingParameters = operation.getParameters(); - Optional existingParam = Optional.empty(); - if (!CollectionUtils.isEmpty(existingParameters)) - existingParam = existingParameters.stream().filter(p -> pathParam.equals(p.getName())).findAny(); - if (!existingParam.isPresent()) - operation.addParametersItem(new PathParameter().name(pathParam).schema(new StringSchema())); - }); - } - }); - } - - private void handleActuatorOperationIdUniqueness(OpenAPI openApi) { - Set usedOperationIds = new HashSet<>(); - actuatorPathEntryStream(openApi, null) - .sorted(Comparator.comparing(Entry::getKey)) - .forEachOrdered(stringPathItemEntry -> { - stringPathItemEntry.getValue().readOperations().forEach(operation -> { - String initialOperationId = operation.getOperationId(); - String uniqueOperationId = operation.getOperationId(); - int counter = 1; - while (!usedOperationIds.add(uniqueOperationId)) { - uniqueOperationId = initialOperationId + "_" + ++counter; - } - operation.setOperationId(uniqueOperationId); - }); - }); - } - - @Override - public void customise(OpenAPI openApi) { - handleActuatorPathParam(openApi); - handleActuatorOperationIdUniqueness(openApi); - } -} diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java index 985513421..6acdf25cb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java @@ -26,31 +26,36 @@ import java.lang.reflect.Field; import java.lang.reflect.Parameter; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import io.swagger.v3.core.util.AnnotationsUtils; +import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Content; import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.responses.ApiResponses; import org.apache.commons.lang3.reflect.FieldUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springdoc.core.properties.SpringDocConfigProperties; -import org.springframework.boot.actuate.endpoint.OperationType; +import org.springframework.boot.actuate.endpoint.ApiVersion; +import org.springframework.boot.actuate.endpoint.SecurityContext; import org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation; import org.springframework.boot.actuate.endpoint.annotation.Selector; import org.springframework.boot.actuate.endpoint.invoke.OperationParameter; import org.springframework.boot.actuate.endpoint.invoke.reflect.OperationMethod; +import org.springframework.boot.actuate.endpoint.web.WebServerNamespace; +import org.springframework.http.HttpStatus; import org.springframework.web.method.HandlerMethod; import static org.springdoc.core.providers.ActuatorProvider.getTag; /** * The type Actuator operation customizer. + * * @author bnasslahsen */ public class ActuatorOperationCustomizer implements GlobalOperationCustomizer { @@ -70,11 +75,6 @@ public class ActuatorOperationCustomizer implements GlobalOperationCustomizer { */ private static final Logger LOGGER = LoggerFactory.getLogger(ActuatorOperationCustomizer.class); - /** - * The regex pattern for operationId lookup. - */ - private static final Pattern pattern = Pattern.compile(".*'([^']*)'.*"); - /** * The Spring doc config properties. */ @@ -92,44 +92,188 @@ public ActuatorOperationCustomizer(SpringDocConfigProperties springDocConfigProp @Override public Operation customize(Operation operation, HandlerMethod handlerMethod) { - if (operation.getTags() != null && operation.getTags().contains(getTag().getName())) { - Field operationFiled = FieldUtils.getDeclaredField(handlerMethod.getBean().getClass(), OPERATION, true); - Object actuatorOperation; - if (operationFiled != null) { - try { - actuatorOperation = operationFiled.get(handlerMethod.getBean()); - Field actuatorOperationFiled = FieldUtils.getDeclaredField(actuatorOperation.getClass(), OPERATION, true); - if (actuatorOperationFiled != null) { - AbstractDiscoveredOperation discoveredOperation = (AbstractDiscoveredOperation) actuatorOperationFiled.get(actuatorOperation); - OperationMethod operationMethod = discoveredOperation.getOperationMethod(); - if (OperationType.WRITE.equals(operationMethod.getOperationType())) { - for (OperationParameter operationParameter : operationMethod.getParameters()) { - Field parameterField = FieldUtils.getDeclaredField(operationParameter.getClass(), PARAMETER, true); - Parameter parameter = (Parameter) parameterField.get(operationParameter); - Schema schema = AnnotationsUtils.resolveSchemaFromType(parameter.getType(), null, null, springDocConfigProperties.isOpenapi31()); - if (parameter.getAnnotation(Selector.class) == null) { - operation.setRequestBody(new RequestBody() - .content(new Content().addMediaType(org.springframework.http.MediaType.APPLICATION_JSON_VALUE, new MediaType().schema(schema)))); - } - } - } - } - } - catch (IllegalAccessException e) { - LOGGER.warn(e.getMessage()); - } + if (operationHasValidTag(operation)) { + Field operationField = getField(handlerMethod.getBean().getClass(), OPERATION); + if (operationField != null) { + processOperationField(handlerMethod, operation, operationField); } + setOperationSummary(operation, handlerMethod); + } + return operation; + } + + /** + * Operation has valid tag boolean. + * + * @param operation the operation + * @return the boolean + */ + private boolean operationHasValidTag(Operation operation) { + return operation.getTags() != null && operation.getTags().contains(getTag().getName()); + } - String summary = handlerMethod.toString(); - Matcher matcher = pattern.matcher(summary); - String operationId = operation.getOperationId(); - while (matcher.find()) { - operationId = matcher.group(1); + /** + * Gets field. + * + * @param clazz the clazz + * @param fieldName the field name + * @return the field + */ + private Field getField(Class clazz, String fieldName) { + return FieldUtils.getDeclaredField(clazz, fieldName, true); + } + + /** + * Process operation field. + * + * @param handlerMethod the handler method + * @param operation the operation + * @param operationField the operation field + */ + private void processOperationField(HandlerMethod handlerMethod, Operation operation, Field operationField) { + try { + Object actuatorOperation = operationField.get(handlerMethod.getBean()); + Field actuatorOperationField = getField(actuatorOperation.getClass(), OPERATION); + if (actuatorOperationField != null) { + AbstractDiscoveredOperation discoveredOperation = + (AbstractDiscoveredOperation) actuatorOperationField.get(actuatorOperation); + handleOperationMethod(discoveredOperation.getOperationMethod(), operation); } - if (operation.getSummary() == null && !summary.contains("$")) - operation.setSummary(summary); - operation.setOperationId(operationId); } - return operation; + catch (IllegalAccessException e) { + LOGGER.warn(e.getMessage()); + } } + + /** + * Handle operation method. + * + * @param operationMethod the operation method + * @param operation the operation + */ + private void handleOperationMethod(OperationMethod operationMethod, Operation operation) { + String operationId = operationMethod.getMethod().getName(); + operation.setOperationId(operationId); + + switch (operationMethod.getOperationType()) { + case READ: + addParameters(operationMethod, operation, ParameterIn.QUERY); + break; + case WRITE: + addWriteParameters(operationMethod, operation); + operation.setResponses(new ApiResponses() + .addApiResponse(String.valueOf(HttpStatus.NO_CONTENT.value()), new ApiResponse().description(HttpStatus.NO_CONTENT.getReasonPhrase())) + .addApiResponse(String.valueOf(HttpStatus.BAD_REQUEST.value()), new ApiResponse().description(HttpStatus.BAD_REQUEST.getReasonPhrase()))); + break; + case DELETE: + operation.setResponses(new ApiResponses().addApiResponse(String.valueOf(HttpStatus.NO_CONTENT.value()), new ApiResponse().description(HttpStatus.NO_CONTENT.getReasonPhrase()))); + addParameters(operationMethod, operation, ParameterIn.QUERY); + break; + default: + break; + } + } + + /** + * Add parameters. + * + * @param operationMethod the operation method + * @param operation the operation + * @param parameterIn the parameter in + */ + private void addParameters(OperationMethod operationMethod, Operation operation, ParameterIn parameterIn) { + for (OperationParameter operationParameter : operationMethod.getParameters()) { + Parameter parameter = getParameterFromField(operationParameter); + Schema schema = resolveSchema(parameter); + if (parameter.getAnnotation(Selector.class) != null) { + operation.addParametersItem(new io.swagger.v3.oas.models.parameters.PathParameter() + .name(parameter.getName()) + .schema(schema)); + operation.getResponses().addApiResponse(String.valueOf(HttpStatus.NOT_FOUND.value()), new ApiResponse().description(HttpStatus.NOT_FOUND.getReasonPhrase())); + } + else if (isValidParameterType(parameter)) { + operation.addParametersItem(new io.swagger.v3.oas.models.parameters.Parameter() + .name(parameter.getName()) + .in(parameterIn.toString()) + .schema(schema)); + } + } + } + + /** + * Add write parameters. + * + * @param operationMethod the operation method + * @param operation the operation + */ + private void addWriteParameters(OperationMethod operationMethod, Operation operation) { + for (OperationParameter operationParameter : operationMethod.getParameters()) { + Parameter parameter = getParameterFromField(operationParameter); + Schema schema = resolveSchema(parameter); + if (parameter.getAnnotation(Selector.class) != null) { + operation.addParametersItem(new io.swagger.v3.oas.models.parameters.PathParameter() + .name(parameter.getName()) + .schema(schema)); + } + else { + operation.setRequestBody(new RequestBody() + .content(new Content() + .addMediaType(org.springframework.http.MediaType.APPLICATION_JSON_VALUE, + new MediaType().schema(schema)))); + } + } + } + + /** + * Gets parameter from field. + * + * @param operationParameter the operation parameter + * @return the parameter from field + */ + private Parameter getParameterFromField(OperationParameter operationParameter) { + try { + Field parameterField = getField(operationParameter.getClass(), PARAMETER); + return (Parameter) parameterField.get(operationParameter); + } + catch (IllegalAccessException e) { + LOGGER.warn(e.getMessage()); + return null; + } + } + + /** + * Resolve schema schema. + * + * @param parameter the parameter + * @return the schema + */ + private Schema resolveSchema(Parameter parameter) { + return AnnotationsUtils.resolveSchemaFromType(parameter.getType(), null, null, springDocConfigProperties.isOpenapi31()); + } + + /** + * Is valid parameter type boolean. + * + * @param parameter the parameter + * @return the boolean + */ + private boolean isValidParameterType(Parameter parameter) { + return !ApiVersion.class.isAssignableFrom(parameter.getType()) && + !WebServerNamespace.class.isAssignableFrom(parameter.getType()) && + !SecurityContext.class.isAssignableFrom(parameter.getType()); + } + + /** + * Sets operation summary. + * + * @param operation the operation + * @param handlerMethod the handler method + */ + private void setOperationSummary(Operation operation, HandlerMethod handlerMethod) { + String summary = handlerMethod.toString(); + if (operation.getSummary() == null && !summary.contains("$")) { + operation.setSummary(summary); + } + } + } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java index 3b219f199..7e92ec5fb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java @@ -24,7 +24,6 @@ package org.springdoc.core.customizers; -import io.swagger.v3.oas.models.Components; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; @@ -45,6 +44,7 @@ import io.swagger.v3.core.converter.ModelConverterContext; import io.swagger.v3.core.converter.ModelConverterContextImpl; import io.swagger.v3.core.util.AnnotationsUtils; +import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.reflect.FieldUtils; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java index 10ce504c6..e5736a206 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java @@ -23,10 +23,10 @@ */ package org.springdoc.core.customizers; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.Set; import org.springdoc.core.filters.GlobalOpenApiMethodFilter; import org.springdoc.core.filters.OpenApiMethodFilter; @@ -49,23 +49,23 @@ public class SpringDocCustomizers implements ApplicationContextAware, Initializi /** * The Open api customisers. */ - private final Optional> openApiCustomizers; + private final Optional> openApiCustomizers; /** * The Operation customizers. */ - private final Optional> operationCustomizers; + private final Optional> operationCustomizers; /** * The RouterOperation customizers. */ - private final Optional> routerOperationCustomizers; + private final Optional> routerOperationCustomizers; /** * The Data rest router operation customizers. */ - private final Optional> dataRestRouterOperationCustomizers; + private final Optional> dataRestRouterOperationCustomizers; /** * The Context. @@ -75,22 +75,22 @@ public class SpringDocCustomizers implements ApplicationContextAware, Initializi /** * The method filters to use. */ - private final Optional> methodFilters; + private final Optional> methodFilters; /** * The Global open api customizers. */ - private Optional> globalOpenApiCustomizers; + private Optional> globalOpenApiCustomizers; /** * The Global operation customizers. */ - private Optional> globalOperationCustomizers; + private Optional> globalOperationCustomizers; /** * The Global open api method filters. */ - private Optional> globalOpenApiMethodFilters; + private Optional> globalOpenApiMethodFilters; /** @@ -105,13 +105,13 @@ public class SpringDocCustomizers implements ApplicationContextAware, Initializi * @param globalOperationCustomizers the global operation customizers * @param globalOpenApiMethodFilters the global open api method filters */ - public SpringDocCustomizers(Optional> openApiCustomizers, - Optional> operationCustomizers, - Optional> routerOperationCustomizers, - Optional> dataRestRouterOperationCustomizers, - Optional> methodFilters, - Optional> globalOpenApiCustomizers, Optional> globalOperationCustomizers, - Optional> globalOpenApiMethodFilters) { + public SpringDocCustomizers(Optional> openApiCustomizers, + Optional> operationCustomizers, + Optional> routerOperationCustomizers, + Optional> dataRestRouterOperationCustomizers, + Optional> methodFilters, + Optional> globalOpenApiCustomizers, Optional> globalOperationCustomizers, + Optional> globalOpenApiMethodFilters) { this.openApiCustomizers = openApiCustomizers; this.operationCustomizers = operationCustomizers; this.globalOpenApiCustomizers = globalOpenApiCustomizers; @@ -131,8 +131,8 @@ public SpringDocCustomizers(Optional> openApiCustomizers * @param routerOperationCustomizers the router operation customizers * @param openApiMethodFilters the open api method filters */ - public SpringDocCustomizers(Optional> openApiCustomizers, Optional> operationCustomizers, - Optional> routerOperationCustomizers, Optional> openApiMethodFilters) { + public SpringDocCustomizers(Optional> openApiCustomizers, Optional> operationCustomizers, + Optional> routerOperationCustomizers, Optional> openApiMethodFilters) { this.openApiCustomizers = openApiCustomizers; this.operationCustomizers = operationCustomizers; this.routerOperationCustomizers = routerOperationCustomizers; @@ -145,7 +145,7 @@ public SpringDocCustomizers(Optional> openApiCustomizers * * @return the open api customizers */ - public Optional> getOpenApiCustomizers() { + public Optional> getOpenApiCustomizers() { return openApiCustomizers; } @@ -154,7 +154,7 @@ public Optional> getOpenApiCustomizers() { * * @return the operation customizers */ - public Optional> getOperationCustomizers() { + public Optional> getOperationCustomizers() { return operationCustomizers; } @@ -163,7 +163,7 @@ public Optional> getOperationCustomizers() { * * @return the router operation customizers */ - public Optional> getRouterOperationCustomizers() { + public Optional> getRouterOperationCustomizers() { return routerOperationCustomizers; } @@ -172,7 +172,7 @@ public Optional> getRouterOperationCustomizers() * * @return the data rest router operation customizers */ - public Optional> getDataRestRouterOperationCustomizers() { + public Optional> getDataRestRouterOperationCustomizers() { return dataRestRouterOperationCustomizers; } @@ -181,7 +181,7 @@ public Optional> getDataRestRouterOperat * * @return the method filters */ - public Optional> getMethodFilters() { + public Optional> getMethodFilters() { return methodFilters; } @@ -195,7 +195,7 @@ public void setApplicationContext(ApplicationContext applicationContext) throws * * @return the global open api customizers */ - public Optional> getGlobalOpenApiCustomizers() { + public Optional> getGlobalOpenApiCustomizers() { return globalOpenApiCustomizers; } @@ -204,7 +204,7 @@ public Optional> getGlobalOpenApiCustomizers() { * * @return the global operation customizers */ - public Optional> getGlobalOperationCustomizers() { + public Optional> getGlobalOperationCustomizers() { return globalOperationCustomizers; } @@ -213,7 +213,7 @@ public Optional> getGlobalOperationCustomizers() * * @return the global open api method filters */ - public Optional> getGlobalOpenApiMethodFilters() { + public Optional> getGlobalOpenApiMethodFilters() { return globalOpenApiMethodFilters; } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java index 1727b4479..0a5418a15 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java @@ -24,11 +24,12 @@ package org.springdoc.core.models; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.LinkedHashSet; import java.util.List; import java.util.Objects; +import java.util.Set; import org.apache.commons.lang3.StringUtils; import org.springdoc.core.customizers.OpenApiCustomizer; @@ -95,22 +96,22 @@ public class GroupedOpenApi { /** * The Open api customisers. */ - private List openApiCustomizers; + private Set openApiCustomizers; /** * The Operation customizers. */ - private List operationCustomizers; + private Set operationCustomizers; /** * The Router Operation customizers. */ - private List routerOperationCustomizers; + private Set routerOperationCustomizers; /** * The method filters to use. */ - private List openApiMethodFilters; + private Set openApiMethodFilters; /** * Instantiates a new Grouped open api. @@ -231,7 +232,7 @@ public List getPathsToExclude() { * * @return the open api customisers */ - public List getOpenApiCustomizers() { + public Set getOpenApiCustomizers() { return openApiCustomizers; } @@ -240,7 +241,7 @@ public List getOpenApiCustomizers() { * * @return the operation customizers */ - public List getOperationCustomizers() { + public Set getOperationCustomizers() { return operationCustomizers; } @@ -249,7 +250,7 @@ public List getOperationCustomizers() { * * @return the open api method filters */ - public List getOpenApiMethodFilters() { + public Set getOpenApiMethodFilters() { return openApiMethodFilters; } @@ -258,7 +259,7 @@ public List getOpenApiMethodFilters() { * * @return the router operation customizers */ - public List getRouterOperationCustomizers() { + public Set getRouterOperationCustomizers() { return routerOperationCustomizers; } @@ -278,7 +279,7 @@ public String getDisplayName() { * @return the grouped open api */ public GroupedOpenApi addAllOpenApiCustomizer(Collection openApiCustomizerCollection) { - List result = new ArrayList<>(); + Set result = new LinkedHashSet<>(); result.addAll(openApiCustomizerCollection); result.addAll(openApiCustomizers); openApiCustomizers = result; @@ -292,7 +293,7 @@ public GroupedOpenApi addAllOpenApiCustomizer(Collection operationCustomizerCollection) { - List result = new ArrayList<>(); + Set result = new LinkedHashSet<>(); result.addAll(operationCustomizerCollection); result.addAll(operationCustomizers); operationCustomizers = result; @@ -306,7 +307,7 @@ public GroupedOpenApi addAllOperationCustomizer(Collection openApiMethodFilterCollection) { - List result = new ArrayList<>(); + Set result = new LinkedHashSet<>(); result.addAll(openApiMethodFilterCollection); result.addAll(openApiMethodFilters); openApiMethodFilters = result; @@ -321,22 +322,22 @@ public static class Builder { /** * The Open api customisers. */ - private final List openApiCustomizers = new ArrayList<>(); + private final Set openApiCustomizers = new LinkedHashSet<>(); /** * The Operation customizers. */ - private final List operationCustomizers = new ArrayList<>(); + private final Set operationCustomizers = new LinkedHashSet<>(); /** * The Router Operation customizers. */ - private final List routerOperationCustomizers = new ArrayList<>(); + private final Set routerOperationCustomizers = new LinkedHashSet<>(); /** * The methods filters to apply. */ - private final List methodFilters = new ArrayList<>(); + private final Set methodFilters = new LinkedHashSet<>(); /** * The Group. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java index c9159f21e..fbd9a7d24 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java @@ -36,17 +36,9 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; -import org.springdoc.core.configuration.SpringDocConfiguration; -import org.springdoc.core.utils.Constants; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Lazy; import org.springframework.util.CollectionUtils; -import static org.springdoc.core.utils.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; -import static org.springdoc.core.utils.Constants.SWAGGER_UI_OAUTH_REDIRECT_URL; import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 3085f66c9..5f25e7f91 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -478,10 +478,16 @@ private boolean isRequiredAnnotation(MethodParameter parameter) { * @return the boolean */ private boolean isRequestBodyWithMapType(MethodParameter parameter) { + // Exclude parameters from the Actuator package + if (parameter.getContainingClass().getPackageName().startsWith("org.springframework.boot.actuate")) { + return false; + } + // Check for @RequestBody annotation org.springframework.web.bind.annotation.RequestBody requestBody = parameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class); if (requestBody == null) { return false; } + // Check if the parameter type is assignable to Map Class parameterType = parameter.getParameterType(); return Map.class.isAssignableFrom(parameterType); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java index 7973465fe..511327a91 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java @@ -27,7 +27,6 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java index 6e17af03e..55e8d9e48 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java @@ -24,6 +24,8 @@ package org.springdoc.ui; +import java.util.Objects; + import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; @@ -33,8 +35,6 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.util.UriComponentsBuilder; -import java.util.Objects; - import static org.springdoc.core.utils.Constants.SWAGGER_UI_OAUTH_REDIRECT_URL; import static org.springdoc.core.utils.Constants.SWAGGER_UI_URL; import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java index 10ec555b0..0f02ac3db 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java @@ -65,6 +65,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import static java.util.Arrays.asList; +import static java.util.Collections.singleton; import static java.util.Collections.singletonList; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; @@ -206,7 +207,7 @@ void preLoadingModeShouldNotOverwriteServers() throws InterruptedException { requestBuilder, responseBuilder, operationParser, - properties, springDocProviders, new SpringDocCustomizers(Optional.of(singletonList(openApiCustomizer)),Optional.empty(),Optional.empty(),Optional.empty()) + properties, springDocProviders, new SpringDocCustomizers(Optional.of(singleton(openApiCustomizer)),Optional.empty(),Optional.empty(),Optional.empty()) ); // wait for executor to be done diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java index bec69db22..e65bd7602 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/model/MethodAttributesTest.java @@ -1,11 +1,11 @@ package org.springdoc.core.model; -import org.junit.jupiter.api.Test; -import org.springdoc.core.models.MethodAttributes; - import java.lang.reflect.Method; import java.util.Locale; +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.MethodAttributes; + import static org.junit.jupiter.api.Assertions.assertArrayEquals; public class MethodAttributesTest { diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java index 4af7febfb..832257519 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java @@ -5,7 +5,6 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; -import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/OrderDemo.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/OrderDemo.java index 8c1f0a702..638f9c0e9 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/OrderDemo.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/OrderDemo.java @@ -5,28 +5,24 @@ import org.springdoc.core.customizers.GlobalOpenApiCustomizer; import org.springdoc.core.customizers.OpenApiCustomizer; -import org.springframework.core.annotation.Order; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; public class OrderDemo { - @Order(2) public static class Customizer2 implements OpenApiCustomizer, GlobalOpenApiCustomizer { public void customise(OpenAPI openApi) { openApi.addTagsItem(new Tag().name("2")); } } - @Order(3) public static class Customizer3 implements OpenApiCustomizer, GlobalOpenApiCustomizer { public void customise(OpenAPI openApi) { openApi.addTagsItem(new Tag().name("3")); } } - - @Order(1) + public static class Customizer1 implements OpenApiCustomizer, GlobalOpenApiCustomizer { public void customise(OpenAPI openApi) { openApi.addTagsItem(new Tag().name("1")); diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java index 5f4adadd7..8d9f0f88f 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java @@ -21,9 +21,9 @@ public void testApp1() { @SpringBootApplication @Import({ - OrderDemo.Customizer3.class, - OrderDemo.Customizer2.class, OrderDemo.Customizer1.class, + OrderDemo.Customizer2.class, + OrderDemo.Customizer3.class, }) @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app188" }) static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java index 0c1f9938f..87be64b21 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java @@ -28,7 +28,6 @@ import org.springdoc.core.configuration.SpringDocConfiguration; import org.springdoc.core.properties.SpringDocConfigProperties; -import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.properties.SwaggerUiOAuthProperties; import org.springdoc.core.providers.ActuatorProvider; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java index 1248d24e1..418306a86 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java @@ -22,7 +22,6 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import test.org.springdoc.ui.AbstractCommonTest; -import test.org.springdoc.ui.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; @@ -31,7 +30,6 @@ import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; -import org.springframework.test.context.TestPropertySource; import org.springframework.web.reactive.function.client.WebClient; import static org.assertj.core.api.Assertions.assertThat; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java index 812d346c7..2546d833b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java @@ -26,11 +26,11 @@ import org.apache.commons.lang3.JavaVersion; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.web.servlet.MvcResult; import test.org.springdoc.api.AbstractCommonTest; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.web.servlet.MvcResult; import static org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast; import static org.hamcrest.Matchers.is; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/OrderDemo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/OrderDemo.java index 84d04d75a..4e22e653b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/OrderDemo.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/OrderDemo.java @@ -5,28 +5,24 @@ import org.springdoc.core.customizers.GlobalOpenApiCustomizer; import org.springdoc.core.customizers.OpenApiCustomizer; -import org.springframework.core.annotation.Order; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; public class OrderDemo { - @Order(2) public static class Customizer2 implements OpenApiCustomizer, GlobalOpenApiCustomizer { public void customise(OpenAPI openApi) { openApi.addTagsItem(new Tag().name("2")); } } - @Order(3) public static class Customizer3 implements OpenApiCustomizer, GlobalOpenApiCustomizer { public void customise(OpenAPI openApi) { openApi.addTagsItem(new Tag().name("3")); } } - @Order(1) public static class Customizer1 implements OpenApiCustomizer, GlobalOpenApiCustomizer { public void customise(OpenAPI openApi) { openApi.addTagsItem(new Tag().name("1")); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/SpringDocApp203Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/SpringDocApp203Test.java index 11eb5551c..376e2a880 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/SpringDocApp203Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/SpringDocApp203Test.java @@ -41,9 +41,9 @@ public class SpringDocApp203Test extends AbstractSpringDocV30Test { @SpringBootApplication @Import({ - OrderDemo.Customizer3.class, - OrderDemo.Customizer2.class, OrderDemo.Customizer1.class, + OrderDemo.Customizer2.class, + OrderDemo.Customizer3.class, }) static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/GreetController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/GreetController.java index c3b62b1b7..71bcde546 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/GreetController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/GreetController.java @@ -18,13 +18,14 @@ package test.org.springdoc.api.v31.app10; +import java.util.Map; + import io.swagger.v3.oas.annotations.Operation; + import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -import java.util.Map; - @RestController public class GreetController { @PostMapping("/greet") diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java index 6f416b859..af96adf03 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java @@ -18,9 +18,10 @@ package test.org.springdoc.api.v31.app10; -import org.springframework.boot.autoconfigure.SpringBootApplication; import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import org.springframework.boot.autoconfigure.SpringBootApplication; + public class SpringDocApp10Test extends AbstractSpringDocV31Test { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app143.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app143.json index 0c7014757..904951914 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app143.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app143.json @@ -100,37 +100,6 @@ } } } - }, - "/actuator/health/**": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'health-path'", - "operationId": "health-path", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } } }, "components": { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app196.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app196.json index bfcd29f4d..0b39821f1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app196.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app196.json @@ -120,37 +120,6 @@ } } } - }, - "/actuator/health/**": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'health-path'", - "operationId": "health-path", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } } }, "components": { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app205.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app205.json index f7ec3b2b0..70eafa7b4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app205.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app205.json @@ -1,46 +1,46 @@ { - "openapi": "3.0.1", - "info": { - "title": "OpenAPI definition", - "version": "v0" -}, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "paths": { - "/test/{*param}": { - "get": { - "tags": [ - "my-controller" - ], - "operationId": "testingMethod", - "parameters": [ - { - "name": "param", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "string" + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test/{param}": { + "get": { + "tags": [ + "my-controller" + ], + "operationId": "testingMethod", + "parameters": [ + { + "name": "param", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} } -} -} -} -} -} -} -}, - "components": {} -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java index 2b7c83b25..c9ab491d8 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java @@ -28,7 +28,6 @@ import org.springdoc.core.configuration.SpringDocConfiguration; import org.springdoc.core.properties.SpringDocConfigProperties; -import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.properties.SwaggerUiOAuthProperties; import org.springdoc.core.providers.ActuatorProvider; diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java index b2360c1b4..e5006bff6 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java @@ -18,13 +18,14 @@ package test.org.springdoc.ui.app8; +import java.util.concurrent.CompletableFuture; +import java.util.stream.Stream; + import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; import test.org.springdoc.ui.AbstractSpringDocTest; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Stream; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; import static java.util.concurrent.CompletableFuture.allOf; import static java.util.concurrent.CompletableFuture.runAsync; diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java index 8282d1e3a..529659639 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java @@ -26,7 +26,6 @@ import org.junit.jupiter.api.Test; -import org.springdoc.core.customizers.ActuatorOpenApiCustomizer; import org.springdoc.core.customizers.OperationCustomizer; import org.springdoc.core.models.GroupedOpenApi; import org.springdoc.core.utils.Constants; @@ -83,12 +82,10 @@ public void testGroupActuatorAsProperties() { static class SpringDocTestApp { @Bean - public GroupedOpenApi asCodeCheckBackwardsCompatibility(ActuatorOpenApiCustomizer actuatorOpenApiCustomiser, - OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { + public GroupedOpenApi asCodeCheckBackwardsCompatibility(OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { return GroupedOpenApi.builder() .group("group-actuator-as-code-check-backwards-compatibility") .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) - .addOpenApiCustomizer(actuatorOpenApiCustomiser) .addOperationCustomizer(actuatorCustomizer) .build(); } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json index 889f11afa..7b041b75a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json @@ -27,7 +27,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name", + "operationId": "loggerLevels", "parameters": [ { "name": "name", @@ -58,6 +58,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -66,7 +69,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_1", + "operationId": "configureLogLevel", "parameters": [ { "name": "name", @@ -96,15 +99,11 @@ } }, "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" } } } @@ -115,7 +114,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threaddump", + "operationId": "threadDump", "responses": { "200": { "description": "OK", @@ -151,7 +150,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledtasks", + "operationId": "scheduledTasks", "responses": { "200": { "description": "OK", @@ -182,7 +181,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom-id", + "operationId": "sbom", "parameters": [ { "name": "id", @@ -203,6 +202,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -213,7 +215,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom'", - "operationId": "sbom", + "operationId": "sboms", "responses": { "200": { "description": "OK", @@ -244,7 +246,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metrics-requiredMetricName", + "operationId": "metric", "parameters": [ { "name": "requiredMetricName", @@ -253,6 +255,13 @@ "schema": { "type": "string" } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -275,6 +284,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -285,7 +297,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics'", - "operationId": "metrics", + "operationId": "listNames", "responses": { "200": { "description": "OK", @@ -409,7 +421,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapdump", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], "responses": { "200": { "description": "OK", @@ -461,7 +482,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "env-toMatch", + "operationId": "environmentEntry", "parameters": [ { "name": "toMatch", @@ -492,6 +513,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -502,7 +526,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'env'", - "operationId": "env", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -533,7 +566,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configprops-prefix", + "operationId": "configurationPropertiesWithPrefix", "parameters": [ { "name": "prefix", @@ -564,6 +597,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -574,7 +610,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops'", - "operationId": "configprops", + "operationId": "configurationProperties", "responses": { "200": { "description": "OK", @@ -636,7 +672,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache", + "operationId": "cache", "parameters": [ { "name": "cache", @@ -645,6 +681,13 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -667,6 +710,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -675,7 +721,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_1", + "operationId": "clearCache", "parameters": [ { "name": "cache", @@ -684,28 +730,21 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" } } } @@ -745,17 +784,10 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_1", + "operationId": "clearCaches", "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json index 7e30137d2..0c8297c8f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json @@ -27,7 +27,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name", + "operationId": "loggerLevels", "parameters": [ { "name": "name", @@ -58,6 +58,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -66,7 +69,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_1", + "operationId": "configureLogLevel", "parameters": [ { "name": "name", @@ -96,15 +99,11 @@ } }, "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" } } } @@ -115,7 +114,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threaddump", + "operationId": "threadDump", "responses": { "200": { "description": "OK", @@ -151,7 +150,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledtasks", + "operationId": "scheduledTasks", "responses": { "200": { "description": "OK", @@ -182,7 +181,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom-id", + "operationId": "sbom", "parameters": [ { "name": "id", @@ -203,6 +202,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -213,7 +215,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom'", - "operationId": "sbom", + "operationId": "sboms", "responses": { "200": { "description": "OK", @@ -244,7 +246,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metrics-requiredMetricName", + "operationId": "metric", "parameters": [ { "name": "requiredMetricName", @@ -253,6 +255,13 @@ "schema": { "type": "string" } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -275,6 +284,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -285,7 +297,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics'", - "operationId": "metrics", + "operationId": "listNames", "responses": { "200": { "description": "OK", @@ -409,7 +421,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapdump", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], "responses": { "200": { "description": "OK", @@ -461,7 +482,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "env-toMatch", + "operationId": "environmentEntry", "parameters": [ { "name": "toMatch", @@ -492,6 +513,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -502,7 +526,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'env'", - "operationId": "env", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -533,7 +566,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configprops-prefix", + "operationId": "configurationPropertiesWithPrefix", "parameters": [ { "name": "prefix", @@ -564,6 +597,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -574,7 +610,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops'", - "operationId": "configprops", + "operationId": "configurationProperties", "responses": { "200": { "description": "OK", @@ -636,7 +672,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache", + "operationId": "cache", "parameters": [ { "name": "cache", @@ -645,6 +681,13 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -667,6 +710,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -675,7 +721,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_1", + "operationId": "clearCache", "parameters": [ { "name": "cache", @@ -684,28 +730,21 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" } } } @@ -745,17 +784,10 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_1", + "operationId": "clearCaches", "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json index 7e30137d2..0c8297c8f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json @@ -27,7 +27,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name", + "operationId": "loggerLevels", "parameters": [ { "name": "name", @@ -58,6 +58,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -66,7 +69,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_1", + "operationId": "configureLogLevel", "parameters": [ { "name": "name", @@ -96,15 +99,11 @@ } }, "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" } } } @@ -115,7 +114,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threaddump", + "operationId": "threadDump", "responses": { "200": { "description": "OK", @@ -151,7 +150,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledtasks", + "operationId": "scheduledTasks", "responses": { "200": { "description": "OK", @@ -182,7 +181,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom-id", + "operationId": "sbom", "parameters": [ { "name": "id", @@ -203,6 +202,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -213,7 +215,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom'", - "operationId": "sbom", + "operationId": "sboms", "responses": { "200": { "description": "OK", @@ -244,7 +246,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metrics-requiredMetricName", + "operationId": "metric", "parameters": [ { "name": "requiredMetricName", @@ -253,6 +255,13 @@ "schema": { "type": "string" } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -275,6 +284,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -285,7 +297,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics'", - "operationId": "metrics", + "operationId": "listNames", "responses": { "200": { "description": "OK", @@ -409,7 +421,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapdump", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], "responses": { "200": { "description": "OK", @@ -461,7 +482,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "env-toMatch", + "operationId": "environmentEntry", "parameters": [ { "name": "toMatch", @@ -492,6 +513,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -502,7 +526,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'env'", - "operationId": "env", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -533,7 +566,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configprops-prefix", + "operationId": "configurationPropertiesWithPrefix", "parameters": [ { "name": "prefix", @@ -564,6 +597,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -574,7 +610,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops'", - "operationId": "configprops", + "operationId": "configurationProperties", "responses": { "200": { "description": "OK", @@ -636,7 +672,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache", + "operationId": "cache", "parameters": [ { "name": "cache", @@ -645,6 +681,13 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -667,6 +710,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -675,7 +721,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_1", + "operationId": "clearCache", "parameters": [ { "name": "cache", @@ -684,28 +730,21 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" } } } @@ -745,17 +784,10 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_1", + "operationId": "clearCaches", "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json index eec8f3533..bc0a211d0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json @@ -27,7 +27,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name", + "operationId": "loggerLevels", "parameters": [ { "name": "name", @@ -58,6 +58,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -66,7 +69,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_1", + "operationId": "configureLogLevel", "parameters": [ { "name": "name", @@ -96,15 +99,11 @@ } }, "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" } } } @@ -115,7 +114,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threaddump", + "operationId": "threadDump", "responses": { "200": { "description": "OK", @@ -151,7 +150,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledtasks", + "operationId": "scheduledTasks", "responses": { "200": { "description": "OK", @@ -182,7 +181,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom-id", + "operationId": "sbom", "parameters": [ { "name": "id", @@ -203,6 +202,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -213,7 +215,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom'", - "operationId": "sbom", + "operationId": "sboms", "responses": { "200": { "description": "OK", @@ -244,7 +246,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metrics-requiredMetricName", + "operationId": "metric", "parameters": [ { "name": "requiredMetricName", @@ -253,6 +255,13 @@ "schema": { "type": "string" } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -275,6 +284,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -285,7 +297,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics'", - "operationId": "metrics", + "operationId": "listNames", "responses": { "200": { "description": "OK", @@ -409,7 +421,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapdump", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], "responses": { "200": { "description": "OK", @@ -461,7 +482,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "env-toMatch", + "operationId": "environmentEntry", "parameters": [ { "name": "toMatch", @@ -492,6 +513,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -502,7 +526,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'env'", - "operationId": "env", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -533,7 +566,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configprops-prefix", + "operationId": "configurationPropertiesWithPrefix", "parameters": [ { "name": "prefix", @@ -564,6 +597,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -574,7 +610,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops'", - "operationId": "configprops", + "operationId": "configurationProperties", "responses": { "200": { "description": "OK", @@ -636,7 +672,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache", + "operationId": "cache", "parameters": [ { "name": "cache", @@ -645,6 +681,13 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -667,6 +710,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -675,7 +721,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_1", + "operationId": "clearCache", "parameters": [ { "name": "cache", @@ -684,28 +730,21 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" } } } @@ -745,17 +784,10 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_1", + "operationId": "clearCaches", "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json index afc2239c1..962339da3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json @@ -27,7 +27,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name", + "operationId": "loggerLevels", "parameters": [ { "name": "name", @@ -58,6 +58,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -66,7 +69,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_2", + "operationId": "configureLogLevel", "parameters": [ { "name": "name", @@ -96,15 +99,11 @@ } }, "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" } } } @@ -115,7 +114,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threaddump", + "operationId": "threadDump", "responses": { "200": { "description": "OK", @@ -151,7 +150,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledtasks", + "operationId": "scheduledTasks", "responses": { "200": { "description": "OK", @@ -182,7 +181,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom-id", + "operationId": "sbom", "parameters": [ { "name": "id", @@ -203,6 +202,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -213,7 +215,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom'", - "operationId": "sbom", + "operationId": "sboms", "responses": { "200": { "description": "OK", @@ -244,7 +246,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metrics-requiredMetricName", + "operationId": "metric", "parameters": [ { "name": "requiredMetricName", @@ -253,6 +255,13 @@ "schema": { "type": "string" } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -275,79 +284,20 @@ } } } + }, + "404": { + "description": "Not Found" } } } }, - "/actuator/sbom": { - "get": { - "operationId": "sbom", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom'", - "tags": [ - "Actuator" - ] - } - }, - "/actuator/sbom/{id}": { - "get": { - "operationId": "sbom-id", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom-id'", - "tags": [ - "Actuator" - ] - } - }, "/actuator/metrics": { "get": { "tags": [ "Actuator" ], "summary": "Actuator web endpoint 'metrics'", - "operationId": "metrics", + "operationId": "listNames", "responses": { "200": { "description": "OK", @@ -471,7 +421,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapdump", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], "responses": { "200": { "description": "OK", @@ -486,20 +445,23 @@ } } }, - "/actuator/health/{*path}": { + "/actuator/health/{path}": { "get": { "tags": [ "Actuator" ], "summary": "Actuator web endpoint 'health-path'", - "operationId": "health-path", + "operationId": "health", "parameters": [ { - "name": "*path", + "name": "path", "in": "path", "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -523,6 +485,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -533,7 +498,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'health'", - "operationId": "health", + "operationId": "health_1", "responses": { "200": { "description": "OK", @@ -564,7 +529,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "env-toMatch", + "operationId": "environmentEntry", "parameters": [ { "name": "toMatch", @@ -595,6 +560,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -605,7 +573,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'env'", - "operationId": "env", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -636,7 +613,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configprops-prefix", + "operationId": "configurationPropertiesWithPrefix", "parameters": [ { "name": "prefix", @@ -667,6 +644,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -677,7 +657,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops'", - "operationId": "configprops", + "operationId": "configurationProperties", "responses": { "200": { "description": "OK", @@ -739,7 +719,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache", + "operationId": "cache", "parameters": [ { "name": "cache", @@ -748,6 +728,13 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -770,6 +757,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -778,7 +768,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_2", + "operationId": "clearCache", "parameters": [ { "name": "cache", @@ -787,28 +777,21 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" } } } @@ -848,17 +831,10 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_2", + "operationId": "clearCaches", "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" } } } @@ -959,4 +935,4 @@ } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java index 2526bcb3e..7bbc1a20a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java @@ -25,7 +25,6 @@ package test.org.springdoc.api.app186; import org.junit.jupiter.api.Test; -import org.springdoc.core.customizers.ActuatorOpenApiCustomizer; import org.springdoc.core.customizers.OperationCustomizer; import org.springdoc.core.models.GroupedOpenApi; import org.springdoc.core.utils.Constants; @@ -87,12 +86,10 @@ public void testGroupActuatorAsProperties() throws Exception { static class SpringDocTestApp { @Bean - public GroupedOpenApi asCodeCheckBackwardsCompatibility(ActuatorOpenApiCustomizer actuatorOpenApiCustomiser, - OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { + public GroupedOpenApi asCodeCheckBackwardsCompatibility(OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { return GroupedOpenApi.builder() .group("group-actuator-as-code-check-backwards-compatibility") .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) - .addOpenApiCustomizer(actuatorOpenApiCustomiser) .addOperationCustomizer(actuatorCustomizer) .build(); } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json index 801e02898..a5bd4f9dd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json @@ -27,7 +27,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name", + "operationId": "loggerLevels", "parameters": [ { "name": "name", @@ -58,6 +58,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -66,7 +69,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_1", + "operationId": "configureLogLevel", "parameters": [ { "name": "name", @@ -96,15 +99,11 @@ } }, "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" } } } @@ -164,7 +163,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threaddump", + "operationId": "threadDump", "responses": { "200": { "description": "OK", @@ -200,7 +199,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledtasks", + "operationId": "scheduledTasks", "responses": { "200": { "description": "OK", @@ -231,7 +230,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom'", - "operationId": "sbom", + "operationId": "sboms", "responses": { "200": { "description": "OK", @@ -262,7 +261,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom-id", + "operationId": "sbom", "parameters": [ { "name": "id", @@ -283,6 +282,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -293,7 +295,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics'", - "operationId": "metrics", + "operationId": "listNames", "responses": { "200": { "description": "OK", @@ -324,7 +326,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metrics-requiredMetricName", + "operationId": "metric", "parameters": [ { "name": "requiredMetricName", @@ -333,6 +335,13 @@ "schema": { "type": "string" } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -355,6 +364,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -458,7 +470,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapdump", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], "responses": { "200": { "description": "OK", @@ -510,7 +531,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'env'", - "operationId": "env", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -541,7 +571,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "env-toMatch", + "operationId": "environmentEntry", "parameters": [ { "name": "toMatch", @@ -572,6 +602,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -582,7 +615,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops'", - "operationId": "configprops", + "operationId": "configurationProperties", "responses": { "200": { "description": "OK", @@ -613,7 +646,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configprops-prefix", + "operationId": "configurationPropertiesWithPrefix", "parameters": [ { "name": "prefix", @@ -644,6 +677,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -714,17 +750,10 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_1", + "operationId": "clearCaches", "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" } } } @@ -735,7 +764,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache", + "operationId": "cache", "parameters": [ { "name": "cache", @@ -744,6 +773,13 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -766,6 +802,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -774,7 +813,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_1", + "operationId": "clearCache", "parameters": [ { "name": "cache", @@ -783,28 +822,21 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json index f4bc5ee44..a239113a6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json @@ -27,7 +27,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name", + "operationId": "loggerLevels", "parameters": [ { "name": "name", @@ -58,6 +58,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -66,7 +69,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_1", + "operationId": "configureLogLevel", "parameters": [ { "name": "name", @@ -96,15 +99,11 @@ } }, "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" } } } @@ -164,7 +163,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threaddump", + "operationId": "threadDump", "responses": { "200": { "description": "OK", @@ -200,7 +199,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledtasks", + "operationId": "scheduledTasks", "responses": { "200": { "description": "OK", @@ -231,7 +230,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom'", - "operationId": "sbom", + "operationId": "sboms", "responses": { "200": { "description": "OK", @@ -262,7 +261,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom-id", + "operationId": "sbom", "parameters": [ { "name": "id", @@ -283,6 +282,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -293,7 +295,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics'", - "operationId": "metrics", + "operationId": "listNames", "responses": { "200": { "description": "OK", @@ -324,7 +326,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metrics-requiredMetricName", + "operationId": "metric", "parameters": [ { "name": "requiredMetricName", @@ -333,6 +335,13 @@ "schema": { "type": "string" } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -355,6 +364,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -458,7 +470,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapdump", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], "responses": { "200": { "description": "OK", @@ -510,7 +531,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'env'", - "operationId": "env", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -541,7 +571,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "env-toMatch", + "operationId": "environmentEntry", "parameters": [ { "name": "toMatch", @@ -572,6 +602,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -582,7 +615,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops'", - "operationId": "configprops", + "operationId": "configurationProperties", "responses": { "200": { "description": "OK", @@ -613,7 +646,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configprops-prefix", + "operationId": "configurationPropertiesWithPrefix", "parameters": [ { "name": "prefix", @@ -644,6 +677,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -714,17 +750,10 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_1", + "operationId": "clearCaches", "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" } } } @@ -735,7 +764,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache", + "operationId": "cache", "parameters": [ { "name": "cache", @@ -744,6 +773,13 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -766,6 +802,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -774,7 +813,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_1", + "operationId": "clearCache", "parameters": [ { "name": "cache", @@ -783,28 +822,21 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json index 7ecd73866..f585b1519 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json @@ -27,7 +27,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name", + "operationId": "loggerLevels", "parameters": [ { "name": "name", @@ -58,6 +58,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -66,7 +69,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggers-name_2", + "operationId": "configureLogLevel", "parameters": [ { "name": "name", @@ -96,15 +99,11 @@ } }, "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" } } } @@ -164,7 +163,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threaddump", + "operationId": "threadDump", "responses": { "200": { "description": "OK", @@ -200,7 +199,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledtasks", + "operationId": "scheduledTasks", "responses": { "200": { "description": "OK", @@ -231,7 +230,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom'", - "operationId": "sbom", + "operationId": "sboms", "responses": { "200": { "description": "OK", @@ -262,7 +261,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom-id", + "operationId": "sbom", "parameters": [ { "name": "id", @@ -283,6 +282,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -293,7 +295,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics'", - "operationId": "metrics", + "operationId": "listNames", "responses": { "200": { "description": "OK", @@ -324,7 +326,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metrics-requiredMetricName", + "operationId": "metric", "parameters": [ { "name": "requiredMetricName", @@ -333,6 +335,13 @@ "schema": { "type": "string" } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -355,72 +364,13 @@ } } } + }, + "404": { + "description": "Not Found" } } } }, - "/actuator/sbom": { - "get": { - "operationId": "sbom", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom'", - "tags": [ - "Actuator" - ] - } - }, - "/actuator/sbom/{id}": { - "get": { - "operationId": "sbom-id", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - }, - "description": "OK" - } - }, - "summary": "Actuator web endpoint 'sbom-id'", - "tags": [ - "Actuator" - ] - } - }, "/actuator/mappings": { "get": { "tags": [ @@ -520,7 +470,16 @@ "Actuator" ], "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapdump", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], "responses": { "200": { "description": "OK", @@ -566,44 +525,22 @@ } } }, - "/actuator/health/**": { + "/actuator/env": { "get": { "tags": [ "Actuator" ], - "summary": "Actuator web endpoint 'health-path'", - "operationId": "health-path", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" } } - } - } - }, - "/actuator/env": { - "get": { - "tags": [ - "Actuator" ], - "summary": "Actuator web endpoint 'env'", - "operationId": "env", "responses": { "200": { "description": "OK", @@ -634,7 +571,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "env-toMatch", + "operationId": "environmentEntry", "parameters": [ { "name": "toMatch", @@ -665,6 +602,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -675,7 +615,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops'", - "operationId": "configprops", + "operationId": "configurationProperties", "responses": { "200": { "description": "OK", @@ -706,7 +646,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configprops-prefix", + "operationId": "configurationPropertiesWithPrefix", "parameters": [ { "name": "prefix", @@ -737,6 +677,9 @@ } } } + }, + "404": { + "description": "Not Found" } } } @@ -807,17 +750,10 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches'", - "operationId": "caches_2", + "operationId": "clearCaches", "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" } } } @@ -828,7 +764,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache", + "operationId": "cache", "parameters": [ { "name": "cache", @@ -837,6 +773,13 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { @@ -859,6 +802,9 @@ } } } + }, + "404": { + "description": "Not Found" } } }, @@ -867,7 +813,7 @@ "Actuator" ], "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "caches-cache_2", + "operationId": "clearCache", "parameters": [ { "name": "cache", @@ -876,28 +822,21 @@ "schema": { "type": "string" } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app36.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app36.json deleted file mode 100644 index d43f61e5f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app36.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "OpenAPI definition", - "version": "v0" - }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "paths": { - "/persons": { - "get": { - "operationId": "persons", - "responses": { - "200": { - "description": "default response", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - } - } - } - } - }, - "/actuator/health": { - "get": { - "tags": [ - "Actuator" - ], - "operationId": "handle", - "responses": { - "200": { - "description": "default response", - "content": { - } - } - } - } - }, - "/actuator/health/**": { - "get": { - "tags": [ - "Actuator" - ], - "operationId": "handle_1", - "responses": { - "200": { - "description": "default response", - "content": { - } - } - } - } - }, - "/actuator/info": { - "get": { - "tags": [ - "Actuator" - ], - "operationId": "handle_2", - "responses": { - "200": { - "description": "default response", - "content": { - } - } - } - } - }, - "/actuator": { - "get": { - "tags": [ - "Actuator" - ], - "operationId": "links", - "responses": { - "200": { - "description": "default response", - "content": { - } - } - } - } - } - }, - "components": { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java index f3b617ee0..39c01662a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java @@ -27,7 +27,6 @@ import org.springdoc.core.configuration.SpringDocDataRestConfiguration; import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; -import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer; import org.springdoc.core.providers.RepositoryRestConfigurationProvider; import org.springdoc.core.providers.SpringDataWebPropertiesProvider; import test.org.springdoc.api.AbstractSpringDocTest; diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java index c50c69a0e..5c8ef96af 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java @@ -27,7 +27,6 @@ import org.springdoc.core.configuration.SpringDocDataRestConfiguration; import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; -import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer; import org.springdoc.core.providers.RepositoryRestConfigurationProvider; import org.springdoc.core.providers.SpringDataWebPropertiesProvider; import test.org.springdoc.api.AbstractSpringDocTest; From c24e9e7b1e8281f2b9ed3770787a66a5b32f0b45 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Sep 2024 11:29:17 +0200 Subject: [PATCH 070/226] Keeping ActuatorOpenApiCustomizer for backward compatibility --- .../ActuatorOpenApiCustomizer.java | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java new file mode 100644 index 000000000..9dc6a9cdc --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java @@ -0,0 +1,92 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package org.springdoc.core.customizers; + +import java.util.Comparator; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Stream; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.Paths; + +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; + +/** + * The type Actuator open api customiser. + * @author bnasslahsen + * @Deprecated as not anymore required, use your own {@link org.springdoc.core.customizers.GlobalOpenApiCustomizer} instead + */ +public class ActuatorOpenApiCustomizer implements GlobalOpenApiCustomizer { + + + /** + * The Web endpoint properties. + */ + private final WebEndpointProperties webEndpointProperties; + + /** + * Instantiates a new Actuator open api customizer. + * + * @param webEndpointProperties the web endpoint properties + */ + public ActuatorOpenApiCustomizer(WebEndpointProperties webEndpointProperties) { + this.webEndpointProperties = webEndpointProperties; + } + + private Stream> actuatorPathEntryStream(OpenAPI openApi, String relativeSubPath) { + String pathPrefix = webEndpointProperties.getBasePath() + Optional.ofNullable(relativeSubPath).orElse(""); + return Optional.ofNullable(openApi.getPaths()) + .map(Paths::entrySet) + .map(Set::stream) + .map(s -> s.filter(entry -> entry.getKey().startsWith(pathPrefix))) + .orElse(Stream.empty()); + } + + private void handleActuatorOperationIdUniqueness(OpenAPI openApi) { + Set usedOperationIds = new HashSet<>(); + actuatorPathEntryStream(openApi, null) + .sorted(Comparator.comparing(Entry::getKey)) + .forEachOrdered(stringPathItemEntry -> { + stringPathItemEntry.getValue().readOperations().forEach(operation -> { + String initialOperationId = operation.getOperationId(); + String uniqueOperationId = operation.getOperationId(); + int counter = 1; + while (!usedOperationIds.add(uniqueOperationId)) { + uniqueOperationId = initialOperationId + "_" + ++counter; + } + operation.setOperationId(uniqueOperationId); + }); + }); + } + + @Override + public void customise(OpenAPI openApi) { + handleActuatorOperationIdUniqueness(openApi); + } +} From 96324c0f902659dfcd94e7ae895dfc59325aa73e Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Sep 2024 11:48:18 +0200 Subject: [PATCH 071/226] javadoc update --- .../core/customizers/ActuatorOpenApiCustomizer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java index 9dc6a9cdc..9f7d6eaa6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java @@ -38,9 +38,10 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; /** - * The type Actuator open api customiser. + * The type Actuator open api customizer. * @author bnasslahsen - * @Deprecated as not anymore required, use your own {@link org.springdoc.core.customizers.GlobalOpenApiCustomizer} instead + * @deprecated as not anymore required, use your own {@link org.springdoc.core.customizers.GlobalOpenApiCustomizer} instead + * @since 2.7.0 */ public class ActuatorOpenApiCustomizer implements GlobalOpenApiCustomizer { From b0a8b77865aea7051677b05223018576aafb4a5c Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Sep 2024 16:43:00 +0200 Subject: [PATCH 072/226] failed to load api definition after spring boot 3.4.0-M2. Fixes #2687 --- pom.xml | 14 +- .../configuration/SpringDocConfiguration.java | 14 +- .../SpringDocKotlinConfiguration.kt | 13 -- .../core/data/DataRestResponseService.java | 8 +- .../MethodParameterPojoExtractor.java | 4 +- .../KotlinCoroutinesReturnTypeParser.java | 63 ------ .../core/parsers/ReturnTypeParser.java | 206 ------------------ .../core/service/GenericParameterService.java | 4 +- .../core/service/GenericResponseService.java | 63 +++--- .../SpringDocWebFluxConfiguration.java | 6 +- .../springdoc/api/AbstractSpringDocTest.java | 2 + .../api/app150/SpringDocApp150Test.java | 2 - .../api/app65/SpringDocApp65Test.java | 2 - .../SpringDocWebMvcConfiguration.java | 6 +- .../api/AbstractSpringDocFunctionTest.java | 5 + .../springdoc/api/app9/SpringDocApp9Test.java | 2 +- .../configuration/SecurityConfiguration.java | 8 +- 17 files changed, 69 insertions(+), 353 deletions(-) delete mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/parsers/KotlinCoroutinesReturnTypeParser.java delete mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/parsers/ReturnTypeParser.java diff --git a/pom.xml b/pom.xml index ce5af62d1..eb247c3a4 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.0 + 3.4.0-M3 @@ -65,8 +65,8 @@ 1.13.1 0.9.1 0.15.0 - 4.1.2 - 1.3.0 + 4.2.0-M1 + 1.4.0-M2 @@ -319,6 +319,14 @@ true + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 078ef9c10..354299690 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -74,7 +74,6 @@ import org.springdoc.core.filters.GlobalOpenApiMethodFilter; import org.springdoc.core.filters.OpenApiMethodFilter; import org.springdoc.core.models.GroupedOpenApi; -import org.springdoc.core.parsers.ReturnTypeParser; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.providers.ActuatorProvider; import org.springdoc.core.providers.CloudFunctionProvider; @@ -361,18 +360,7 @@ RequestBodyService requestBodyBuilder(GenericParameterService parameterBuilder, SecurityService securityParser(PropertyResolverUtils propertyResolverUtils) { return new SecurityService(propertyResolverUtils); } - - /** - * Generic return type parser return type parser. - * - * @return the return type parser - */ - @Bean - @Lazy(false) - ReturnTypeParser genericReturnTypeParser() { - return new ReturnTypeParser() {}; - } - + /** * Parameter builder generic parameter builder. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt index 8e77b50b0..609a594b3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt @@ -2,7 +2,6 @@ package org.springdoc.core.configuration import io.swagger.v3.oas.annotations.Parameter import org.springdoc.core.customizers.ParameterCustomizer -import org.springdoc.core.parsers.KotlinCoroutinesReturnTypeParser import org.springdoc.core.utils.Constants import org.springdoc.core.utils.SpringDocUtils import org.springframework.boot.autoconfigure.condition.ConditionalOnBean @@ -46,18 +45,6 @@ class SpringDocKotlinConfiguration() { .addDeprecatedType(Deprecated::class.java) } - /** - * Kotlin coroutines return type parser kotlin coroutines return type parser. - * - * @return the kotlin coroutines return type parser - */ - @Bean - @Lazy(false) - @ConditionalOnMissingBean - fun kotlinCoroutinesReturnTypeParser(): KotlinCoroutinesReturnTypeParser { - return KotlinCoroutinesReturnTypeParser() - } - /** * Kotlin springdoc-openapi ParameterCustomizer * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java index cc4967231..57a884d81 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java @@ -39,10 +39,10 @@ import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; import org.springdoc.core.models.MethodAttributes; -import org.springdoc.core.parsers.ReturnTypeParser; import org.springdoc.core.service.GenericResponseService; import org.springdoc.core.utils.SpringDocDataRestUtils; +import org.springframework.core.GenericTypeResolver; import org.springframework.core.MethodParameter; import org.springframework.core.ResolvableType; import org.springframework.data.rest.core.mapping.MethodResourceMapping; @@ -197,7 +197,7 @@ private void addResponse(RequestMethod requestMethod, String operationPath, ApiR */ private Type findSearchReturnType(MethodResourceMapping methodResourceMapping, Class domainType) { Type returnType; - Type returnRepoType = ReturnTypeParser.resolveType(methodResourceMapping.getMethod().getGenericReturnType(), methodResourceMapping.getMethod().getDeclaringClass()); + Type returnRepoType = GenericTypeResolver.resolveType(methodResourceMapping.getMethod().getGenericReturnType(), methodResourceMapping.getMethod().getDeclaringClass()); if (methodResourceMapping.isPagingResource()) { returnType = resolveGenericType(PagedModel.class, EntityModel.class, domainType); } @@ -224,7 +224,7 @@ else if (ClassUtils.isPrimitiveOrWrapper(methodResourceMapping.getReturnedDomain * @return the type */ private Type getType(MethodParameter methodParameterReturn, RequestMethod requestMethod, DataRestRepository dataRestRepository, ResourceMetadata resourceMetadata) { - Type returnType = ReturnTypeParser.resolveType(methodParameterReturn.getGenericParameterType(), methodParameterReturn.getContainingClass()); + Type returnType = GenericTypeResolver.resolveType(methodParameterReturn.getGenericParameterType(), methodParameterReturn.getContainingClass()); Class returnedEntityType = dataRestRepository.getReturnType(); if (returnType instanceof ParameterizedType) { @@ -240,7 +240,7 @@ else if ((HttpEntity.class.equals(parameterizedType.getRawType()) } } else if ((CollectionModel.class.equals(parameterizedType.getRawType()) - && Object.class.equals(parameterizedType.getActualTypeArguments()[0]))) { + && parameterizedType.getActualTypeArguments()[0]!=null)) { return getTypeForCollectionModel(returnedEntityType, resourceMetadata.isPagingResource()); } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index c040264c2..00230a242 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -52,8 +52,8 @@ import io.swagger.v3.core.util.PrimitiveType; import io.swagger.v3.oas.annotations.Parameter; -import org.springdoc.core.parsers.ReturnTypeParser; +import org.springframework.core.GenericTypeResolver; import org.springframework.core.MethodParameter; import static org.springdoc.core.utils.Constants.DOT; @@ -158,7 +158,7 @@ private static Stream fromGetterOfField(Class paramClass, Fi private static Class extractType(Class paramClass, Field field) { Class type = field.getType(); if (field.getGenericType() instanceof TypeVariable) { - Type fieldType = ReturnTypeParser.resolveType(field.getGenericType(), paramClass); + Type fieldType = GenericTypeResolver.resolveType(field.getGenericType(), paramClass); if (fieldType instanceof Class) type = (Class) fieldType; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/parsers/KotlinCoroutinesReturnTypeParser.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/parsers/KotlinCoroutinesReturnTypeParser.java deleted file mode 100644 index e8ab56aad..000000000 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/parsers/KotlinCoroutinesReturnTypeParser.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package org.springdoc.core.parsers; - -import java.lang.reflect.Method; -import java.lang.reflect.Parameter; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.lang.reflect.WildcardType; -import java.util.Arrays; -import java.util.Optional; - -import kotlin.coroutines.Continuation; - -import org.springframework.core.MethodParameter; - -/** - * The type Kotlin coroutines return type parser. - * @author bnasslahsen - */ -public class KotlinCoroutinesReturnTypeParser implements ReturnTypeParser { - - @Override - public Type getReturnType(MethodParameter methodParameter) { - Method method = methodParameter.getMethod(); - Type returnType = Object.class; - assert method != null; - Optional continuationParameter = Arrays.stream(method.getParameters()) - .filter(parameter -> parameter.getType().getCanonicalName().equals(Continuation.class.getCanonicalName())) - .findFirst(); - if (continuationParameter.isPresent()) { - Type continuationType = continuationParameter.get().getParameterizedType(); - if (continuationType instanceof ParameterizedType) { - Type actualTypeArguments = ((ParameterizedType) continuationType).getActualTypeArguments()[0]; - if (actualTypeArguments instanceof WildcardType) - returnType = ((WildcardType) actualTypeArguments).getLowerBounds()[0]; - } - } - return returnType; - } -} diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/parsers/ReturnTypeParser.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/parsers/ReturnTypeParser.java deleted file mode 100644 index 808e64961..000000000 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/parsers/ReturnTypeParser.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package org.springdoc.core.parsers; - -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.lang.reflect.TypeVariable; -import java.util.Arrays; -import java.util.Objects; - -import org.springframework.core.MethodParameter; -import org.springframework.core.ResolvableType; -import org.springframework.lang.Nullable; - -/** - * The interface Return type parser. - * @author bnasslahsen - */ -public interface ReturnTypeParser { - - /** - * This is a copy of GenericTypeResolver.resolveType which is not available on spring 4. - * This also keeps compatibility with spring-boot 1 applications. - * Resolve the given generic type against the given context class, - * substituting type variables as far as possible. - * @param genericType the (potentially) generic type - * @param contextClass a context class for the target type, for example a class in which the target type appears in a method signature (can be {@code null}) - * @return the resolved type (possibly the given generic type as-is) - * @since 5.0 - */ - static Type resolveType(Type genericType, @Nullable Class contextClass) { - if (contextClass != null) { - if (genericType instanceof TypeVariable) { - ResolvableType resolvedTypeVariable = resolveVariable( - (TypeVariable) genericType, ResolvableType.forClass(contextClass)); - if (resolvedTypeVariable != ResolvableType.NONE) { - Class resolved = resolvedTypeVariable.resolve(); - if (resolved != null) { - return resolved; - } - } - } - else if (genericType instanceof ParameterizedType) { - ResolvableType resolvedType = ResolvableType.forType(genericType); - if (resolvedType.hasUnresolvableGenerics()) { - ResolvableType resolvableType = getResolvedType(resolvedType, contextClass); - if (resolvableType != null) - return resolvableType.getType(); - } - else if (resolvedType.hasGenerics()) { - ResolvableType[] resolvableTypes = resolvedType.getGenerics(); - resolveType(resolvableTypes, contextClass); - return ResolvableType.forClassWithGenerics(Objects.requireNonNull(resolvedType.getRawClass()), resolvableTypes).getType(); - } - } - } - return genericType; - } - - /** - * Resolve type. - * - * @param resolvableTypes the resolvable types - * @param contextClass the context class - */ - static void resolveType(ResolvableType[] resolvableTypes, Class contextClass) { - for (int i = 0; i < resolvableTypes.length; i++) { - if (resolvableTypes[i].hasUnresolvableGenerics() && resolvableTypes[i].getType() instanceof ParameterizedType) { - ResolvableType resolvableType = getResolvedType(resolvableTypes[i], contextClass); - if (resolvableType != null) - resolvableTypes[i] = resolvableType; - } - else if (resolvableTypes[i].hasGenerics()) { - if(!Arrays.equals(resolvableTypes[i].getGenerics(), resolvableTypes)) - resolveType(resolvableTypes[i].getGenerics(), contextClass); - if (resolvableTypes[i].getRawClass() != null) - resolvableTypes[i] = ResolvableType.forClassWithGenerics(Objects.requireNonNull(resolvableTypes[i].getRawClass()), resolvableTypes[i].getGenerics()); - } - } - } - - /** - * Gets resolved type. - * - * @param resolvableType the resolvable type - * @param contextClass the context class - * @return the resolved type - */ - static ResolvableType getResolvedType(ResolvableType resolvableType, Class contextClass) { - ParameterizedType parameterizedType = (ParameterizedType) resolvableType.getType(); - Class[] generics = new Class[parameterizedType.getActualTypeArguments().length]; - Type[] typeArguments = parameterizedType.getActualTypeArguments(); - ResolvableType contextType = ResolvableType.forClass(contextClass); - findTypeForGenerics(generics, typeArguments, contextType); - Class rawClass = resolvableType.getRawClass(); - if (rawClass != null) - return ResolvableType.forClassWithGenerics(rawClass, generics); - return null; - } - - /** - * Find type for generics. - * - * @param generics the generics - * @param typeArguments the type arguments - * @param contextType the context type - */ - static void findTypeForGenerics(Class[] generics, Type[] typeArguments, ResolvableType contextType) { - for (int i = 0; i < typeArguments.length; i++) { - Type typeArgument = typeArguments[i]; - if (typeArgument instanceof TypeVariable) { - ResolvableType resolvedTypeArgument = resolveVariable( - (TypeVariable) typeArgument, contextType); - if (resolvedTypeArgument != ResolvableType.NONE) { - generics[i] = resolvedTypeArgument.resolve(); - } - else { - generics[i] = ResolvableType.forType(typeArgument).resolve(); - } - } - else { - generics[i] = ResolvableType.forType(typeArgument).resolve(); - } - } - } - - /** - * Resolve variable resolvable type. - * - * @param typeVariable the type variable - * @param contextType the context type - * @return the resolvable type - */ - static ResolvableType resolveVariable(TypeVariable typeVariable, ResolvableType contextType) { - ResolvableType resolvedType; - if (contextType.hasGenerics() && Objects.equals(contextType.getRawClass(), typeVariable.getGenericDeclaration())) { - resolvedType = ResolvableType.forType(typeVariable, contextType); - if (resolvedType.resolve() != null) { - return resolvedType; - } - } - - ResolvableType superType = contextType.getSuperType(); - if (superType != ResolvableType.NONE) { - resolvedType = resolveVariable(typeVariable, superType); - if (resolvedType.resolve() != null) { - return resolvedType; - } - } - for (ResolvableType ifc : contextType.getInterfaces()) { - resolvedType = resolveVariable(typeVariable, ifc); - if (resolvedType.resolve() != null) { - return resolvedType; - } - } - return ResolvableType.NONE; - } - - /** - * Gets type. - * - * @param methodParameter the method parameter - * @return the type - */ - static Type getType(MethodParameter methodParameter) { - Type genericParameterType = methodParameter.getGenericParameterType(); - if (genericParameterType instanceof ParameterizedType || genericParameterType instanceof TypeVariable) - return ReturnTypeParser.resolveType(genericParameterType, methodParameter.getContainingClass()); - return methodParameter.getParameterType(); - } - - /** - * Gets return type. - * - * @param methodParameter the method parameter - * @return the return type - */ - default Type getReturnType(MethodParameter methodParameter) { - if (methodParameter.getGenericParameterType() instanceof ParameterizedType) - return ReturnTypeParser.resolveType(methodParameter.getGenericParameterType(), methodParameter.getContainingClass()); - return methodParameter.getParameterType(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index 3d6d42426..175db7910 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -66,7 +66,6 @@ import org.springdoc.core.extractor.MethodParameterPojoExtractor; import org.springdoc.core.models.ParameterInfo; import org.springdoc.core.models.RequestBodyInfo; -import org.springdoc.core.parsers.ReturnTypeParser; import org.springdoc.core.providers.JavadocProvider; import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.providers.WebConversionServiceProvider; @@ -77,6 +76,7 @@ import org.springframework.beans.factory.config.BeanExpressionContext; import org.springframework.beans.factory.config.BeanExpressionResolver; import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.core.GenericTypeResolver; import org.springframework.core.MethodParameter; import org.springframework.core.ResolvableType; import org.springframework.core.annotation.AnnotatedElementUtils; @@ -364,7 +364,7 @@ Schema calculateSchema(Components components, ParameterInfo parameterInfo, Reque MethodParameter methodParameter = parameterInfo.getMethodParameter(); if (parameterInfo.getParameterModel() == null || parameterInfo.getParameterModel().getSchema() == null) { - Type type = ReturnTypeParser.getType(methodParameter); + Type type = GenericTypeResolver.resolveType( methodParameter.getGenericParameterType(), methodParameter.getContainingClass()); if (type instanceof Class && !((Class) type).isEnum() && optionalWebConversionServiceProvider.isPresent()) { WebConversionServiceProvider webConversionServiceProvider = optionalWebConversionServiceProvider.get(); if (!MethodParameterPojoExtractor.isSwaggerPrimitiveType((Class) type) && methodParameter.getParameterType().getAnnotation(io.swagger.v3.oas.annotations.media.Schema.class) == null) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index b657a5fc0..84036f7b6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -63,13 +63,16 @@ import org.springdoc.core.models.ControllerAdviceInfo; import org.springdoc.core.models.MethodAdviceInfo; import org.springdoc.core.models.MethodAttributes; -import org.springdoc.core.parsers.ReturnTypeParser; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.providers.JavadocProvider; import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.utils.PropertyResolverUtils; import org.springdoc.core.utils.SpringDocAnnotationsUtils; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.core.GenericTypeResolver; import org.springframework.core.MethodParameter; import org.springframework.core.ResolvableType; import org.springframework.core.annotation.AnnotatedElementUtils; @@ -95,7 +98,7 @@ * * @author bnasslahsen */ -public class GenericResponseService { +public class GenericResponseService implements ApplicationContextAware { /** * This extension name is used to temporary store @@ -113,11 +116,6 @@ public class GenericResponseService { */ private final OperationService operationService; - /** - * The Return type parsers. - */ - private final List returnTypeParsers; - /** * The Spring doc config properties. */ @@ -143,6 +141,11 @@ public class GenericResponseService { */ private final Lock reentrantLock = new ReentrantLock(); + /** + * The Context. + */ + private ApplicationContext applicationContext; + /** * The constant LOGGER. */ @@ -152,16 +155,14 @@ public class GenericResponseService { * Instantiates a new Generic response builder. * * @param operationService the operation builder - * @param returnTypeParsers the return type parsers * @param springDocConfigProperties the spring doc config properties * @param propertyResolverUtils the property resolver utils */ - public GenericResponseService(OperationService operationService, List returnTypeParsers, + public GenericResponseService(OperationService operationService, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils) { super(); this.operationService = operationService; - this.returnTypeParsers = returnTypeParsers; this.springDocConfigProperties = springDocConfigProperties; this.propertyResolverUtils = propertyResolverUtils; } @@ -514,7 +515,7 @@ public Set getApiResponses( * @return the content */ private Content buildContent(Components components, MethodParameter methodParameter, String[] methodProduces, JsonView jsonView) { - Type returnType = getReturnType(methodParameter); + Type returnType = GenericTypeResolver.resolveType(methodParameter.getGenericParameterType(), methodParameter.getContainingClass()); return buildContent(components, methodParameter.getParameterAnnotations(), methodProduces, jsonView, returnType); } @@ -545,25 +546,6 @@ public Content buildContent(Components components, Annotation[] annotations, Str return content; } - /** - * Gets return type. - * - * @param methodParameter the method parameter - * @return the return type - */ - private Type getReturnType(MethodParameter methodParameter) { - Type returnType = Object.class; - for (ReturnTypeParser returnTypeParser : returnTypeParsers) { - if (returnType.getTypeName().equals(Object.class.getTypeName())) { - returnType = returnTypeParser.getReturnType(methodParameter); - } - else - break; - } - - return returnType; - } - /** * Calculate schema schema. * @@ -625,7 +607,7 @@ else if (CollectionUtils.isEmpty(apiResponse.getContent())) ((isGeneric || methodAttributes.isMethodOverloaded()) && methodAttributes.isNoApiResponseDoc()))) { // Merge with existing schema Content existingContent = apiResponse.getContent(); - Type type = ReturnTypeParser.getType(methodParameter); + Type type = GenericTypeResolver.resolveType( methodParameter.getGenericParameterType(), methodParameter.getContainingClass()); Schema schemaN = calculateSchema(components, type, methodAttributes.getJsonViewAnnotation(), methodParameter.getParameterAnnotations()); if (schemaN != null && ArrayUtils.isNotEmpty(methodAttributes.getMethodProduces())) @@ -679,6 +661,13 @@ else if (returnType instanceof ParameterizedType) { return result; } + + private ControllerAdviceBean getControllerAdviceBean(List controllerAdviceBeans, Object controllerAdvice) { + return controllerAdviceBeans.stream() + .filter(controllerAdviceBean -> controllerAdviceBean.getBeanType().getName().equals(controllerAdvice.getClass().getName())) + .findFirst() + .orElse(null); + } /** * Gets generic map response. * @@ -702,9 +691,12 @@ private Map getGenericMapResponse(HandlerMethod handlerMeth .map(ControllerAdviceInfo::getApiResponseMap) .collect(LinkedHashMap::new, Map::putAll, Map::putAll); + List controllerAdviceBeans = ControllerAdviceBean.findAnnotatedBeans(applicationContext); + List controllerAdviceInfosNotInThisBean = controllerAdviceInfos.stream() - .filter(controllerAdviceInfo -> - new ControllerAdviceBean(controllerAdviceInfo.getControllerAdvice()).isApplicableToBeanType(beanType)) + .filter(controllerAdviceInfo -> + getControllerAdviceBean(controllerAdviceBeans, controllerAdviceInfo.getControllerAdvice()) + .isApplicableToBeanType(beanType)) .filter(controllerAdviceInfo -> !beanType.equals(controllerAdviceInfo.getControllerAdvice().getClass())) .toList(); @@ -828,4 +820,9 @@ private boolean isGlobalException(Class exceptionClass) { || exceptionClass.isAssignableFrom(Exception.class) || Error.class.isAssignableFrom(exceptionClass); } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } } diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java index 753dc0ae1..e8819b128 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java @@ -31,7 +31,6 @@ import org.springdoc.core.customizers.ParameterCustomizer; import org.springdoc.core.customizers.SpringDocCustomizers; import org.springdoc.core.discoverer.SpringDocParameterNameDiscoverer; -import org.springdoc.core.parsers.ReturnTypeParser; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.providers.ActuatorProvider; import org.springdoc.core.providers.SpringDocProviders; @@ -130,7 +129,6 @@ RequestService requestBuilder(GenericParameterService parameterBuilder, RequestB * Response builder generic response builder. * * @param operationService the operation builder - * @param returnTypeParsers the return type parsers * @param springDocConfigProperties the spring doc config properties * @param propertyResolverUtils the property resolver utils * @return the generic response builder @@ -138,8 +136,8 @@ RequestService requestBuilder(GenericParameterService parameterBuilder, RequestB @Bean @ConditionalOnMissingBean @Lazy(false) - GenericResponseService responseBuilder(OperationService operationService, List returnTypeParsers, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils) { - return new GenericResponseService(operationService, returnTypeParsers, springDocConfigProperties, propertyResolverUtils); + GenericResponseService responseBuilder(OperationService operationService, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils) { + return new GenericResponseService(operationService, springDocConfigProperties, propertyResolverUtils); } /** diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 0a37e8cc8..990d72f12 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -21,6 +21,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.test.web.reactive.server.EntityExchangeResult; import org.springframework.web.reactive.function.server.HandlerFunction; @@ -30,6 +31,7 @@ @WebFluxTest +@AutoConfigureWebTestClient(timeout = "3600000") public abstract class AbstractSpringDocTest extends AbstractCommonTest { public static final HandlerFunction HANDLER_FUNCTION = request -> ServerResponse.ok().build(); diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java index 570b385f9..8ed30cedf 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java @@ -23,10 +23,8 @@ import test.org.springdoc.api.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.context.annotation.ComponentScan; -@AutoConfigureWebTestClient(timeout = "3600000") public class SpringDocApp150Test extends AbstractSpringDocTest { @SpringBootApplication diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java index 244850375..67e2721fc 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java @@ -21,10 +21,8 @@ import test.org.springdoc.api.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.context.annotation.ComponentScan; -@AutoConfigureWebTestClient(timeout = "3600000") public class SpringDocApp65Test extends AbstractSpringDocTest { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java index be467c29f..b14e61c37 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java @@ -31,7 +31,6 @@ import org.springdoc.core.customizers.ParameterCustomizer; import org.springdoc.core.customizers.SpringDocCustomizers; import org.springdoc.core.discoverer.SpringDocParameterNameDiscoverer; -import org.springdoc.core.parsers.ReturnTypeParser; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.providers.ActuatorProvider; import org.springdoc.core.providers.SpringDocProviders; @@ -150,7 +149,6 @@ SpringWebProvider springWebProvider() { * Response builder generic response builder. * * @param operationService the operation builder - * @param returnTypeParsers the return type parsers * @param springDocConfigProperties the spring doc config properties * @param propertyResolverUtils the property resolver utils * @return the generic response builder @@ -158,8 +156,8 @@ SpringWebProvider springWebProvider() { @Bean @ConditionalOnMissingBean @Lazy(false) - GenericResponseService responseBuilder(OperationService operationService, List returnTypeParsers, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils) { - return new GenericResponseService(operationService, returnTypeParsers, springDocConfigProperties, propertyResolverUtils); + GenericResponseService responseBuilder(OperationService operationService, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils) { + return new GenericResponseService(operationService, springDocConfigProperties, propertyResolverUtils); } /** diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java index 78e2db9f8..d876e9a82 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java @@ -18,6 +18,7 @@ package test.org.springdoc.api; +import org.json.JSONException; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; @@ -52,5 +53,9 @@ public void testApp() { LOGGER.error(result); throw e; } + catch (JSONException e) { + LOGGER.error(result); + throw new RuntimeException(e); + } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java index 608157ccf..bc0071734 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java @@ -30,7 +30,7 @@ @TestPropertySource(properties = { "springdoc.show-login-endpoint=true", "springdoc.enable-spring-security=false" }) public class SpringDocApp9Test extends AbstractSpringDocTest { - @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration,test.org.springdoc.api.app9" }) + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration","test.org.springdoc.api.app9" }) static class SpringDocTestApp { @Bean public OpenAPI customOpenAPI() { diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/configuration/SecurityConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/configuration/SecurityConfiguration.java index f2cf3d86e..6ffda6210 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/configuration/SecurityConfiguration.java +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/configuration/SecurityConfiguration.java @@ -18,8 +18,10 @@ package test.org.springdoc.api.configuration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; @@ -27,9 +29,13 @@ @Configuration class SecurityConfiguration { + @Bean + @ConditionalOnMissingBean + @Lazy(false) public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { - http.authorizeRequests((requests) -> requests.requestMatchers("/").permitAll()); + http.securityMatcher("/**") + .authorizeHttpRequests((requests) -> requests.requestMatchers("/**").permitAll()); return http.build(); } From 7af355222ab9aad3b5bc6ebe11af6f8658554887 Mon Sep 17 00:00:00 2001 From: Kamil Krzywanski Date: Sun, 29 Sep 2024 18:08:45 +0200 Subject: [PATCH 073/226] issue #2733 --- .../core/converters/ConverterUtils.java | 9 ++++ .../converters/ResponseSupportConverter.java | 14 +++-- .../springdoc/api/app227/HelloController.java | 35 ++++++++++++ .../api/app227/SpringDocApp227Test.java | 43 +++++++++++++++ .../api/app227/SpringDocTestApp.java | 11 ++++ .../org/springdoc/api/app227/model/Item.java | 14 +++++ .../app227/wrapper/ResponseEntityWrapper.java | 11 ++++ .../src/test/resources/results/app227.json | 53 +++++++++++++++++++ 8 files changed, 186 insertions(+), 4 deletions(-) create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/model/Item.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/wrapper/ResponseEntityWrapper.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app227.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java index 98b165ee9..6ad44e85f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java @@ -102,6 +102,15 @@ public static boolean isResponseTypeWrapper(Class rawClass) { return RESULT_WRAPPERS_TO_IGNORE.stream().anyMatch(clazz -> clazz.isAssignableFrom(rawClass)); } + /** + * Is exact class + * @param rawClass the raw class + * true if the class is in the list of classes to ignore + */ + public static boolean isExactClass(Class rawClass) { + return RESULT_WRAPPERS_TO_IGNORE.stream().anyMatch(clazz -> clazz == rawClass); + } + /** * Is response type to ignore boolean. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java index 6ce3e79e5..4c651d225 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java @@ -35,9 +35,7 @@ import io.swagger.v3.oas.models.media.StringSchema; import org.springdoc.core.providers.ObjectMapperProvider; -import static org.springdoc.core.converters.ConverterUtils.isFluxTypeWrapper; -import static org.springdoc.core.converters.ConverterUtils.isResponseTypeToIgnore; -import static org.springdoc.core.converters.ConverterUtils.isResponseTypeWrapper; +import static org.springdoc.core.converters.ConverterUtils.*; /** * The type Response support converter. @@ -65,7 +63,7 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if (javaType != null) { Class cls = javaType.getRawClass(); if (isResponseTypeWrapper(cls) && !isFluxTypeWrapper(cls)) { - JavaType innerType = javaType.getBindings().getBoundType(0); + JavaType innerType = resolveInnerType(javaType); if (innerType == null) return new StringSchema(); return context.resolve(new AnnotatedType(innerType) @@ -79,4 +77,12 @@ else if (isResponseTypeToIgnore(cls)) return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; } + private JavaType resolveInnerType(JavaType javaType) { + while(!isExactClass(javaType.getRawClass())) { + javaType = javaType.getSuperClass(); + } + + return javaType.getBindings().getBoundType(0); + } + } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/HelloController.java new file mode 100644 index 000000000..08ffee138 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/HelloController.java @@ -0,0 +1,35 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.app227; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import test.org.springdoc.api.app227.model.Item; +import test.org.springdoc.api.app227.wrapper.ResponseEntityWrapper; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public ResponseEntityWrapper persons() { + return new ResponseEntityWrapper<>(Item.fromPayload("1", "OK", "String"), HttpStatus.OK); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java new file mode 100644 index 000000000..685411fea --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.app227; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.api.AbstractSpringDocTest; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +@TestPropertySource(properties = { + "management.endpoints.enabled-by-default=true", +}) +public class SpringDocApp227Test extends AbstractSpringDocTest { + + @Test + public void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/app227.json"), true)); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocTestApp.java new file mode 100644 index 000000000..f942819c8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocTestApp.java @@ -0,0 +1,11 @@ +package test.org.springdoc.api.app227; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/model/Item.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/model/Item.java new file mode 100644 index 000000000..99da09d97 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/model/Item.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.app227.model; + +/** + * Base item + */ +public record Item(String id, String type, T resource) { + + /** + * Create Item object + */ + public static Item fromPayload(String id, String type, T payload) { + return new Item<>(id, type, payload); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/wrapper/ResponseEntityWrapper.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/wrapper/ResponseEntityWrapper.java new file mode 100644 index 000000000..da22b8ee7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/wrapper/ResponseEntityWrapper.java @@ -0,0 +1,11 @@ +package test.org.springdoc.api.app227.wrapper; + +import org.springframework.http.HttpStatusCode; +import org.springframework.http.ResponseEntity; +import test.org.springdoc.api.app227.model.Item; + +public class ResponseEntityWrapper extends ResponseEntity> { + public ResponseEntityWrapper(Item body, HttpStatusCode status) { + super(body, status); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app227.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app227.json new file mode 100644 index 000000000..604fe4922 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app227.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ItemString" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ItemString": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "resource": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file From d502af269fdcb7b012937510626e6ef3ff1bcf51 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Sep 2024 18:37:15 +0200 Subject: [PATCH 074/226] Improve performance tests --- .../test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java | 4 ++-- .../test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java index 37c7c9b03..63df60b18 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java @@ -85,7 +85,7 @@ public void shouldCalculateUrlsBehindProxy() throws Exception { @Test public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() throws Exception { - var tasks = IntStream.range(0, 100).mapToObj(i -> CompletableFuture.runAsync(() -> { + var tasks = IntStream.range(0, 10).mapToObj(i -> CompletableFuture.runAsync(() -> { try { webTestClient.get().uri("/webjars/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", "/path/prefix" + i) @@ -106,7 +106,7 @@ public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() @Test public void shouldCalculateUrlsBehindProxyWhenChangingForwardedPrefixHeader() { - var tasks = IntStream.range(0, 100).mapToObj(i -> CompletableFuture.runAsync(() -> { + var tasks = IntStream.range(0, 10).mapToObj(i -> CompletableFuture.runAsync(() -> { try { webTestClient.get().uri("/v3/api-docs/swagger-config") .header("X-Forwarded-Prefix", "/path/prefix" + i) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java index 7ac2ed5fa..2a9d8ef61 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java @@ -84,7 +84,7 @@ public void shouldCalculateUrlsBehindProxy() throws Exception { @Test public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() throws Exception { - var tasks = IntStream.range(0, 100).mapToObj(i -> CompletableFuture.runAsync(() -> { + var tasks = IntStream.range(0, 10).mapToObj(i -> CompletableFuture.runAsync(() -> { try { mockMvc.perform(get("/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", "/path/prefix" + i)) @@ -102,7 +102,7 @@ public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() @Test public void shouldCalculateUrlsBehindProxyWhenChangingForwardedPrefixHeader() { - var tasks = IntStream.range(0, 100).mapToObj(i -> CompletableFuture.runAsync(() -> { + var tasks = IntStream.range(0, 10).mapToObj(i -> CompletableFuture.runAsync(() -> { try { mockMvc.perform(get("/v3/api-docs/swagger-config") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX + i)) From f8dfee82a57f444cd6f35c0cf81421455aaa5a8d Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Sep 2024 21:10:50 +0200 Subject: [PATCH 075/226] code review --- .../core/converters/ResponseSupportConverter.java | 9 +++++++-- .../org/springdoc/api/app227/SpringDocApp227Test.java | 4 ++++ .../org/springdoc/api/app227/SpringDocTestApp.java | 11 ----------- 3 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocTestApp.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java index 4c651d225..f183a65fc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java @@ -77,11 +77,16 @@ else if (isResponseTypeToIgnore(cls)) return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; } + /** + * Resolve inner type java type. + * + * @param javaType the java type + * @return the java type + */ private JavaType resolveInnerType(JavaType javaType) { - while(!isExactClass(javaType.getRawClass())) { + if(!isExactClass(javaType.getRawClass())) { javaType = javaType.getSuperClass(); } - return javaType.getBindings().getBoundType(0); } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java index 685411fea..abb77f3ef 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java @@ -20,6 +20,8 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; + +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import test.org.springdoc.api.AbstractSpringDocTest; @@ -40,4 +42,6 @@ public void testApp() throws Exception { .andExpect(content().json(getContent("results/app227.json"), true)); } + @SpringBootApplication + static class SpringDocTestApp {} } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocTestApp.java deleted file mode 100644 index f942819c8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocTestApp.java +++ /dev/null @@ -1,11 +0,0 @@ -package test.org.springdoc.api.app227; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class SpringDocTestApp { - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } -} \ No newline at end of file From 534b7c50cc5e4c17699e8f659f925d067fd6849c Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Sep 2024 23:16:25 +0200 Subject: [PATCH 076/226] Bad schema return type when created a generic wrapper class for response entity. Fixes #2733 --- .../core/converters/ConverterUtils.java | 9 ---- .../converters/ResponseSupportConverter.java | 25 ++++------ .../api/v30}/app227/HelloController.java | 8 ++-- .../api/v30/app227/SpringDocApp227Test.java | 30 ++++++++++++ .../springdoc/api/v30}/app227/model/Item.java | 2 +- .../app227/wrapper/ResponseEntityWrapper.java | 6 ++- .../test/resources/results/3.0.1}/app227.json | 0 .../api/app227/SpringDocApp227Test.java | 47 ------------------- 8 files changed, 49 insertions(+), 78 deletions(-) rename {springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api => springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30}/app227/HelloController.java (86%) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/SpringDocApp227Test.java rename {springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api => springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30}/app227/model/Item.java (84%) rename {springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api => springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30}/app227/wrapper/ResponseEntityWrapper.java (72%) rename {springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results => springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1}/app227.json (100%) delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java index 6ad44e85f..98b165ee9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java @@ -102,15 +102,6 @@ public static boolean isResponseTypeWrapper(Class rawClass) { return RESULT_WRAPPERS_TO_IGNORE.stream().anyMatch(clazz -> clazz.isAssignableFrom(rawClass)); } - /** - * Is exact class - * @param rawClass the raw class - * true if the class is in the list of classes to ignore - */ - public static boolean isExactClass(Class rawClass) { - return RESULT_WRAPPERS_TO_IGNORE.stream().anyMatch(clazz -> clazz == rawClass); - } - /** * Is response type to ignore boolean. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java index f183a65fc..b57c11a01 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java @@ -35,7 +35,9 @@ import io.swagger.v3.oas.models.media.StringSchema; import org.springdoc.core.providers.ObjectMapperProvider; -import static org.springdoc.core.converters.ConverterUtils.*; +import static org.springdoc.core.converters.ConverterUtils.isFluxTypeWrapper; +import static org.springdoc.core.converters.ConverterUtils.isResponseTypeToIgnore; +import static org.springdoc.core.converters.ConverterUtils.isResponseTypeWrapper; /** * The type Response support converter. @@ -63,7 +65,12 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if (javaType != null) { Class cls = javaType.getRawClass(); if (isResponseTypeWrapper(cls) && !isFluxTypeWrapper(cls)) { - JavaType innerType = resolveInnerType(javaType); + JavaType innerType = javaType.getBindings().getBoundType(0); + if(javaType.getSuperClass() !=null + && javaType.getSuperClass().hasGenericTypes() + && isResponseTypeWrapper(javaType.getSuperClass().getRawClass()) + && !Object.class.equals(javaType.getSuperClass().getBindings().getBoundType(0).getRawClass())) + innerType = javaType.getSuperClass().getBindings().getBoundType(0); if (innerType == null) return new StringSchema(); return context.resolve(new AnnotatedType(innerType) @@ -76,18 +83,4 @@ else if (isResponseTypeToIgnore(cls)) } return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; } - - /** - * Resolve inner type java type. - * - * @param javaType the java type - * @return the java type - */ - private JavaType resolveInnerType(JavaType javaType) { - if(!isExactClass(javaType.getRawClass())) { - javaType = javaType.getSuperClass(); - } - return javaType.getBindings().getBoundType(0); - } - } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/HelloController.java similarity index 86% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/HelloController.java rename to springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/HelloController.java index 08ffee138..3f1938cf7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/HelloController.java @@ -16,13 +16,15 @@ * */ -package test.org.springdoc.api.app227; +package test.org.springdoc.api.v30.app227; + + +import test.org.springdoc.api.v30.app227.model.Item; +import test.org.springdoc.api.v30.app227.wrapper.ResponseEntityWrapper; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; -import test.org.springdoc.api.app227.model.Item; -import test.org.springdoc.api.app227.wrapper.ResponseEntityWrapper; @RestController public class HelloController { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/SpringDocApp227Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/SpringDocApp227Test.java new file mode 100644 index 000000000..79e9c1a26 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/SpringDocApp227Test.java @@ -0,0 +1,30 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app227; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp227Test extends AbstractSpringDocV30Test { + + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/model/Item.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/model/Item.java similarity index 84% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/model/Item.java rename to springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/model/Item.java index 99da09d97..fc55e60f0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/model/Item.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/model/Item.java @@ -1,4 +1,4 @@ -package test.org.springdoc.api.app227.model; +package test.org.springdoc.api.v30.app227.model; /** * Base item diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/wrapper/ResponseEntityWrapper.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/ResponseEntityWrapper.java similarity index 72% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/wrapper/ResponseEntityWrapper.java rename to springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/ResponseEntityWrapper.java index da22b8ee7..0c8efb548 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/wrapper/ResponseEntityWrapper.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/ResponseEntityWrapper.java @@ -1,8 +1,10 @@ -package test.org.springdoc.api.app227.wrapper; +package test.org.springdoc.api.v30.app227.wrapper; + + +import test.org.springdoc.api.v30.app227.model.Item; import org.springframework.http.HttpStatusCode; import org.springframework.http.ResponseEntity; -import test.org.springdoc.api.app227.model.Item; public class ResponseEntityWrapper extends ResponseEntity> { public ResponseEntityWrapper(Item body, HttpStatusCode status) { diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app227.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app227.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app227.json rename to springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app227.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java deleted file mode 100644 index abb77f3ef..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app227/SpringDocApp227Test.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app227; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; -import test.org.springdoc.api.AbstractSpringDocTest; - -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; - -@TestPropertySource(properties = { - "management.endpoints.enabled-by-default=true", -}) -public class SpringDocApp227Test extends AbstractSpringDocTest { - - @Test - public void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app227.json"), true)); - } - - @SpringBootApplication - static class SpringDocTestApp {} -} From 9e31a2ca18a99e23e91c247b996903df8dc98d02 Mon Sep 17 00:00:00 2001 From: Kamil Krzywanski Date: Sun, 29 Sep 2024 23:57:48 +0200 Subject: [PATCH 077/226] issue #2733 second change for only check response entity type --- .../converters/ResponseSupportConverter.java | 17 ++++++++++------ .../api/v30/app227/HelloController.java | 6 ++++++ .../v30/app227/wrapper/NoGenericWrapper.java | 11 ++++++++++ .../test/resources/results/3.0.1/app227.json | 20 +++++++++++++++++++ 4 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/NoGenericWrapper.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java index b57c11a01..f45a69eff 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java @@ -34,6 +34,7 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import org.springdoc.core.providers.ObjectMapperProvider; +import org.springframework.http.ResponseEntity; import static org.springdoc.core.converters.ConverterUtils.isFluxTypeWrapper; import static org.springdoc.core.converters.ConverterUtils.isResponseTypeToIgnore; @@ -65,12 +66,7 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if (javaType != null) { Class cls = javaType.getRawClass(); if (isResponseTypeWrapper(cls) && !isFluxTypeWrapper(cls)) { - JavaType innerType = javaType.getBindings().getBoundType(0); - if(javaType.getSuperClass() !=null - && javaType.getSuperClass().hasGenericTypes() - && isResponseTypeWrapper(javaType.getSuperClass().getRawClass()) - && !Object.class.equals(javaType.getSuperClass().getBindings().getBoundType(0).getRawClass())) - innerType = javaType.getSuperClass().getBindings().getBoundType(0); + JavaType innerType = findResponseEntity(javaType).containedType(0); if (innerType == null) return new StringSchema(); return context.resolve(new AnnotatedType(innerType) @@ -83,4 +79,13 @@ else if (isResponseTypeToIgnore(cls)) } return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; } + + private JavaType findResponseEntity(JavaType javaType){ + if(ResponseEntity.class.isAssignableFrom(javaType.getRawClass())){ + while (ResponseEntity.class != javaType.getRawClass()) + javaType = javaType.getSuperClass(); + } + return javaType; + } + } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/HelloController.java index 3f1938cf7..d8d9f0287 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/HelloController.java @@ -20,6 +20,7 @@ import test.org.springdoc.api.v30.app227.model.Item; +import test.org.springdoc.api.v30.app227.wrapper.NoGenericWrapper; import test.org.springdoc.api.v30.app227.wrapper.ResponseEntityWrapper; import org.springframework.http.HttpStatus; @@ -34,4 +35,9 @@ public ResponseEntityWrapper persons() { return new ResponseEntityWrapper<>(Item.fromPayload("1", "OK", "String"), HttpStatus.OK); } + @GetMapping("/persons2") + public NoGenericWrapper persons2() { + return new NoGenericWrapper(Item.fromPayload("1", "OK", "String"), HttpStatus.OK); + } + } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/NoGenericWrapper.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/NoGenericWrapper.java new file mode 100644 index 000000000..c60427ce5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/NoGenericWrapper.java @@ -0,0 +1,11 @@ +package test.org.springdoc.api.v30.app227.wrapper; + + +import org.springframework.http.HttpStatusCode; +import test.org.springdoc.api.v30.app227.model.Item; + +public class NoGenericWrapper extends ResponseEntityWrapper { + public NoGenericWrapper(Item body, HttpStatusCode status) { + super(body, status); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app227.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app227.json index 604fe4922..5daf9e326 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app227.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app227.json @@ -30,6 +30,26 @@ } } } + }, + "/persons2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ItemString" + } + } + } + } + } + } } }, "components": { From d47f438ad59b42155ae4a274cb59868af12b2b1b Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 30 Sep 2024 01:11:00 +0200 Subject: [PATCH 078/226] code review --- .../springdoc/core/converters/ResponseSupportConverter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java index f45a69eff..050f6c515 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java @@ -80,6 +80,12 @@ else if (isResponseTypeToIgnore(cls)) return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; } + /** + * Find response entity java type. + * + * @param javaType the java type + * @return the java type + */ private JavaType findResponseEntity(JavaType javaType){ if(ResponseEntity.class.isAssignableFrom(javaType.getRawClass())){ while (ResponseEntity.class != javaType.getRawClass()) From 618a836aefbe7b775d08d2ae1669c7fe8be6aa14 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Wed, 2 Oct 2024 12:01:42 +0200 Subject: [PATCH 079/226] Swagger-ui ignores property springdoc.swagger-ui.supported-submit-methods Fixes #2740 --- .../properties/SwaggerUiConfigParameters.java | 2 +- .../core/utils/SpringDocPropertiesUtils.java | 2 - .../springdoc/ui/app34/HelloController.java | 37 ++++++++++++++ .../ui/app34/SpringDocApp34Test.java | 48 +++++++++++++++++++ .../springdoc/ui/app35/HelloController.java | 37 ++++++++++++++ .../ui/app35/SpringDocApp35Test.java | 48 +++++++++++++++++++ .../src/test/resources/results/app34 | 25 ++++++++++ .../src/test/resources/results/app35 | 25 ++++++++++ 8 files changed, 221 insertions(+), 3 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/SpringDocApp34Test.java create mode 100644 springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/SpringDocApp35Test.java create mode 100644 springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app34 create mode 100644 springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app35 diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java index fbd9a7d24..800297513 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java @@ -284,7 +284,7 @@ public Map getConfigParameters() { org.springdoc.core.utils.SpringDocPropertiesUtils.put("tagsSorter", tagsSorter, params); org.springdoc.core.utils.SpringDocPropertiesUtils.put(SwaggerUiConfigParameters.LAYOUT_PROPERTY, layout, params); if (supportedSubmitMethods != null) - org.springdoc.core.utils.SpringDocPropertiesUtils.put("supportedSubmitMethods", supportedSubmitMethods.toString(), params); + org.springdoc.core.utils.SpringDocPropertiesUtils.put("supportedSubmitMethods", supportedSubmitMethods, params); org.springdoc.core.utils.SpringDocPropertiesUtils.put(OAUTH2_REDIRECT_URL_PROPERTY, oauth2RedirectUrl, params); org.springdoc.core.utils.SpringDocPropertiesUtils.put(URL_PROPERTY, url, params); put(URLS_PROPERTY, urls, params); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java index 9e53c7200..0cfa2a300 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java @@ -45,9 +45,7 @@ public interface SpringDocPropertiesUtils { * @param params the params */ static void put(String name, List value, Map params) { - if (!CollectionUtils.isEmpty(value)) { params.put(name, value); - } } /** diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/HelloController.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/HelloController.java new file mode 100644 index 000000000..cf97ec3da --- /dev/null +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/HelloController.java @@ -0,0 +1,37 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.ui.app34; + + +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/SpringDocApp34Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/SpringDocApp34Test.java new file mode 100644 index 000000000..5a82f202b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/SpringDocApp34Test.java @@ -0,0 +1,48 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.ui.app34; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { + "springdoc.swagger-ui.supported-submit-methods=" +}) +public class SpringDocApp34Test extends AbstractSpringDocTest { + + @Test + public void test() throws Exception { + mockMvc.perform(get("/swagger-ui.html")) + .andExpect(status().isFound()) + .andExpect(header().string("Location", "/swagger-ui/index.html")); + + super.chekJS(); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/HelloController.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/HelloController.java new file mode 100644 index 000000000..ae5102f80 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/HelloController.java @@ -0,0 +1,37 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.ui.app35; + + +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/SpringDocApp35Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/SpringDocApp35Test.java new file mode 100644 index 000000000..172e4b4c0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/SpringDocApp35Test.java @@ -0,0 +1,48 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.ui.app35; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { + "springdoc.swagger-ui.supported-submit-methods=put, post, delete, options, head, patch, trace" +}) +public class SpringDocApp35Test extends AbstractSpringDocTest { + + @Test + public void test() throws Exception { + mockMvc.perform(get("/swagger-ui.html")) + .andExpect(status().isFound()) + .andExpect(header().string("Location", "/swagger-ui/index.html")); + + super.chekJS(); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app34 b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app34 new file mode 100644 index 000000000..49c29c34d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app34 @@ -0,0 +1,25 @@ +window.onload = function() { + // + + // the following lines will be replaced by docker/configurator, when it runs in a docker-container + window.ui = SwaggerUIBundle({ + url: "https://petstore.swagger.io/v2/swagger.json", + dom_id: '#swagger-ui', + deepLinking: true, + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl + ], + layout: "StandaloneLayout" , + + "configUrl" : "/v3/api-docs/swagger-config", + "supportedSubmitMethods" : [ ], + "validatorUrl" : "" + + }); + + // +}; diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app35 b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app35 new file mode 100644 index 000000000..76480c0fb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app35 @@ -0,0 +1,25 @@ +window.onload = function() { + // + + // the following lines will be replaced by docker/configurator, when it runs in a docker-container + window.ui = SwaggerUIBundle({ + url: "https://petstore.swagger.io/v2/swagger.json", + dom_id: '#swagger-ui', + deepLinking: true, + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl + ], + layout: "StandaloneLayout" , + + "configUrl" : "/v3/api-docs/swagger-config", + "supportedSubmitMethods" : [ "put", "post", "delete", "options", "head", "patch", "trace" ], + "validatorUrl" : "" + + }); + + // +}; From 2dc72a272f2b93e33fc423ecd2397cc8354a3aaf Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Wed, 2 Oct 2024 18:18:01 +0200 Subject: [PATCH 080/226] Serialization to openapi of org.springframework.data.domain.Sort is wrong for Spring Boot >2.x. Fixes #2725 --- .../SpringDocSortConfiguration.java | 2 - .../src/test/resources/results/app24.json | 42 ++-- .../src/test/resources/results/app27.json | 31 ++- .../test/resources/results/app10-direct.json | 110 +++++------ .../test/resources/results/app10-via_dto.json | 186 +++++++++++++++++- 5 files changed, 254 insertions(+), 117 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java index a6c573d7c..83917bbaf 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java @@ -27,7 +27,6 @@ import java.util.Optional; import org.springdoc.core.converters.SortOpenAPIConverter; -import org.springdoc.core.converters.models.SortObject; import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.providers.RepositoryRestConfigurationProvider; @@ -71,7 +70,6 @@ public class SpringDocSortConfiguration { @Lazy(false) SortOpenAPIConverter sortOpenAPIConverter(ObjectMapperProvider objectMapperProvider) { getConfig().replaceParameterObjectWithClass(org.springframework.data.domain.Sort.class, org.springdoc.core.converters.models.Sort.class); - getConfig().replaceWithClass(org.springframework.data.domain.Sort.class, SortObject.class); return new SortOpenAPIConverter(objectMapperProvider); } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app24.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app24.json index ad11e0fd4..33090dcc5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app24.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app24.json @@ -105,13 +105,7 @@ "format": "int32" }, "sort": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SortObject" - } - }, - "first": { - "type": "boolean" + "$ref": "#/components/schemas/SortObject" }, "last": { "type": "boolean" @@ -119,6 +113,9 @@ "pageable": { "$ref": "#/components/schemas/PageableObject" }, + "first": { + "type": "boolean" + }, "numberOfElements": { "type": "integer", "format": "int32" @@ -136,16 +133,7 @@ "format": "int64" }, "sort": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SortObject" - } - }, - "paged": { - "type": "boolean" - }, - "unpaged": { - "type": "boolean" + "$ref": "#/components/schemas/SortObject" }, "pageNumber": { "type": "integer", @@ -154,25 +142,25 @@ "pageSize": { "type": "integer", "format": "int32" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" } } }, "SortObject": { "type": "object", "properties": { - "direction": { - "type": "string" - }, - "nullHandling": { - "type": "string" - }, - "ascending": { + "empty": { "type": "boolean" }, - "property": { - "type": "string" + "sorted": { + "type": "boolean" }, - "ignoreCase": { + "unsorted": { "type": "boolean" } } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app27.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app27.json index cb45a6931..dd3633d7b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app27.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app27.json @@ -63,16 +63,7 @@ "format": "int64" }, "sort": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SortObject" - } - }, - "paged": { - "type": "boolean" - }, - "unpaged": { - "type": "boolean" + "$ref": "#/components/schemas/SortObject" }, "pageNumber": { "type": "integer", @@ -81,25 +72,25 @@ "pageSize": { "type": "integer", "format": "int32" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" } } }, "SortObject": { "type": "object", "properties": { - "direction": { - "type": "string" - }, - "nullHandling": { - "type": "string" - }, - "ascending": { + "empty": { "type": "boolean" }, - "property": { - "type": "string" + "sorted": { + "type": "boolean" }, - "ignoreCase": { + "unsorted": { "type": "boolean" } } diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json index 886b96496..e755bde7a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json @@ -219,15 +219,6 @@ "type": "integer", "format": "int64" }, - "pageable": { - "$ref": "#/components/schemas/PageableObject" - }, - "first": { - "type": "boolean" - }, - "last": { - "type": "boolean" - }, "size": { "type": "integer", "format": "int32" @@ -243,10 +234,16 @@ "format": "int32" }, "sort": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SortObject" - } + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" }, "numberOfElements": { "type": "integer", @@ -260,48 +257,39 @@ "PageableObject": { "type": "object", "properties": { + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, "paged": { "type": "boolean" }, - "pageNumber": { - "type": "integer", - "format": "int32" + "unpaged": { + "type": "boolean" }, "pageSize": { "type": "integer", "format": "int32" }, - "offset": { + "pageNumber": { "type": "integer", - "format": "int64" - }, - "sort": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SortObject" - } - }, - "unpaged": { - "type": "boolean" + "format": "int32" } } }, "SortObject": { "type": "object", "properties": { - "direction": { - "type": "string" - }, - "nullHandling": { - "type": "string" - }, - "ascending": { + "empty": { "type": "boolean" }, - "property": { - "type": "string" + "unsorted": { + "type": "boolean" }, - "ignoreCase": { + "sorted": { "type": "boolean" } } @@ -317,15 +305,6 @@ "type": "integer", "format": "int64" }, - "pageable": { - "$ref": "#/components/schemas/PageableObject" - }, - "first": { - "type": "boolean" - }, - "last": { - "type": "boolean" - }, "size": { "type": "integer", "format": "int32" @@ -341,10 +320,16 @@ "format": "int32" }, "sort": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SortObject" - } + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" }, "numberOfElements": { "type": "integer", @@ -366,15 +351,6 @@ "type": "integer", "format": "int64" }, - "pageable": { - "$ref": "#/components/schemas/PageableObject" - }, - "first": { - "type": "boolean" - }, - "last": { - "type": "boolean" - }, "size": { "type": "integer", "format": "int32" @@ -390,10 +366,16 @@ "format": "int32" }, "sort": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SortObject" - } + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" }, "numberOfElements": { "type": "integer", @@ -406,4 +388,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json index 32cad61c1..e755bde7a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json @@ -83,7 +83,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/PagedModelString" + "$ref": "#/components/schemas/PageString" } } } @@ -103,7 +103,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/PagedModel" + "$ref": "#/components/schemas/Page" } } } @@ -123,7 +123,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/PagedModelDummyListString" + "$ref": "#/components/schemas/PageDummyListString" } } } @@ -207,7 +207,185 @@ "$ref": "#/components/schemas/PageMetadata" } } + }, + "PageString": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "string" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + }, + "PageableObject": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + } + } + }, + "SortObject": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + } + } + }, + "Page": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "object" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + }, + "PageDummyListString": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DummyListString" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } } } } -} \ No newline at end of file +} From 2a0e353e9c4aa05d29e5656335c2968aeb6237dc Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Wed, 2 Oct 2024 19:09:51 +0200 Subject: [PATCH 081/226] fix tests --- .../test/resources/results/app10-via_dto.json | 184 +----------------- 1 file changed, 3 insertions(+), 181 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json index e755bde7a..44350a658 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json @@ -83,7 +83,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/PageString" + "$ref": "#/components/schemas/PagedModelString" } } } @@ -103,7 +103,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/Page" + "$ref": "#/components/schemas/PagedModel" } } } @@ -123,7 +123,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/PageDummyListString" + "$ref": "#/components/schemas/PagedModelDummyListString" } } } @@ -207,184 +207,6 @@ "$ref": "#/components/schemas/PageMetadata" } } - }, - "PageString": { - "type": "object", - "properties": { - "totalPages": { - "type": "integer", - "format": "int32" - }, - "totalElements": { - "type": "integer", - "format": "int64" - }, - "size": { - "type": "integer", - "format": "int32" - }, - "content": { - "type": "array", - "items": { - "type": "string" - } - }, - "number": { - "type": "integer", - "format": "int32" - }, - "sort": { - "$ref": "#/components/schemas/SortObject" - }, - "pageable": { - "$ref": "#/components/schemas/PageableObject" - }, - "first": { - "type": "boolean" - }, - "last": { - "type": "boolean" - }, - "numberOfElements": { - "type": "integer", - "format": "int32" - }, - "empty": { - "type": "boolean" - } - } - }, - "PageableObject": { - "type": "object", - "properties": { - "offset": { - "type": "integer", - "format": "int64" - }, - "sort": { - "$ref": "#/components/schemas/SortObject" - }, - "paged": { - "type": "boolean" - }, - "unpaged": { - "type": "boolean" - }, - "pageSize": { - "type": "integer", - "format": "int32" - }, - "pageNumber": { - "type": "integer", - "format": "int32" - } - } - }, - "SortObject": { - "type": "object", - "properties": { - "empty": { - "type": "boolean" - }, - "unsorted": { - "type": "boolean" - }, - "sorted": { - "type": "boolean" - } - } - }, - "Page": { - "type": "object", - "properties": { - "totalPages": { - "type": "integer", - "format": "int32" - }, - "totalElements": { - "type": "integer", - "format": "int64" - }, - "size": { - "type": "integer", - "format": "int32" - }, - "content": { - "type": "array", - "items": { - "type": "object" - } - }, - "number": { - "type": "integer", - "format": "int32" - }, - "sort": { - "$ref": "#/components/schemas/SortObject" - }, - "pageable": { - "$ref": "#/components/schemas/PageableObject" - }, - "first": { - "type": "boolean" - }, - "last": { - "type": "boolean" - }, - "numberOfElements": { - "type": "integer", - "format": "int32" - }, - "empty": { - "type": "boolean" - } - } - }, - "PageDummyListString": { - "type": "object", - "properties": { - "totalPages": { - "type": "integer", - "format": "int32" - }, - "totalElements": { - "type": "integer", - "format": "int64" - }, - "size": { - "type": "integer", - "format": "int32" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DummyListString" - } - }, - "number": { - "type": "integer", - "format": "int32" - }, - "sort": { - "$ref": "#/components/schemas/SortObject" - }, - "pageable": { - "$ref": "#/components/schemas/PageableObject" - }, - "first": { - "type": "boolean" - }, - "last": { - "type": "boolean" - }, - "numberOfElements": { - "type": "integer", - "format": "int32" - }, - "empty": { - "type": "boolean" - } - } } } } From 832669bf5fd5481d0815ae5da5389f038e1a39ad Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Wed, 2 Oct 2024 19:31:09 +0200 Subject: [PATCH 082/226] Upgrage swagger-core to 2.2.25 --- pom.xml | 2 +- ...stDelegatingMethodParameterCustomizer.java | 9 ++++++++ .../core/fn/builders/schema/Builder.java | 22 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb247c3a4..20e72385f 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.6 2.5.3 1.6.8 - 2.2.24 + 2.2.25 5.17.14 1.13.1 0.9.1 diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java index 8918b2bc4..ab55f98f1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java @@ -189,6 +189,10 @@ public boolean allowReserved() { @Override public Schema schema() { return new Schema() { + @Override + public SchemaResolution schemaResolution() { + return parameterSchema.schemaResolution(); + } private Schema parameterSchema = parameter.schema(); @@ -938,6 +942,11 @@ public String[] examples() { public String _const() { return schema._const(); } + + @Override + public SchemaResolution schemaResolution() { + return schema.schemaResolution(); + } }; } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java index 6746a69a1..c8d5e95e3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java @@ -35,6 +35,7 @@ import io.swagger.v3.oas.annotations.media.Schema.AccessMode; import io.swagger.v3.oas.annotations.media.Schema.AdditionalPropertiesValue; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; +import io.swagger.v3.oas.annotations.media.Schema.SchemaResolution; import org.apache.commons.lang3.ArrayUtils; /** @@ -228,6 +229,11 @@ public class Builder { */ private Extension[] extensions = {}; + /** + * The Schema resolution. + */ + private SchemaResolution schemaResolution; + /** * Allows to specify the additionalProperties value * AdditionalPropertiesValue.TRUE: set to TRUE @@ -818,6 +824,17 @@ public Builder requiredMode(RequiredMode requiredMode) { return this; } + /** + * Schema resolution builder. + * + * @param schemaResolution the schema resolution + * @return the builder + */ + public Builder schemaResolution(SchemaResolution schemaResolution) { + this.schemaResolution = schemaResolution; + return this; + } + /** * Additional properties builder. * @@ -1195,6 +1212,11 @@ public String[] examples() { public String _const() { return _const; } + + @Override + public SchemaResolution schemaResolution() { + return schemaResolution; + } }; } } From 33b651a254fc43b6ee614b0a8a6cd719a087cfb0 Mon Sep 17 00:00:00 2001 From: Alexander Ilinykh Date: Thu, 3 Oct 2024 21:49:09 +0500 Subject: [PATCH 083/226] Add gradle dependency example --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 1295fcf39..e4934fffb 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ This is a community-based project, not maintained by the Spring Framework Contri * Add the `springdoc-openapi-ui` library to the list of your project dependencies (No additional configuration is needed): +Maven ```xml org.springdoc @@ -106,6 +107,11 @@ This is a community-based project, not maintained by the Spring Framework Contri ``` +Gradle +```groovy +implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:latest") +``` + * This step is optional: For custom path of the swagger documentation in HTML format, add a custom springdoc property, in your spring-boot configuration file: @@ -144,6 +150,7 @@ springdoc.swagger-ui.path=/swagger-ui.html * Add the library to the list of your project dependencies. (No additional configuration is needed) +Maven ```xml org.springdoc @@ -152,6 +159,11 @@ springdoc.swagger-ui.path=/swagger-ui.html ``` +Gradle +```groovy +implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:latest") +``` + * This step is optional: For custom path of the OpenAPI documentation in Json format, add a custom springdoc property, in your spring-boot configuration file: @@ -189,6 +201,7 @@ and `@SecurityScheme` annotations within a Spring managed bean. * Add the library to the list of your project dependencies (No additional configuration is needed) +Maven ```xml org.springdoc @@ -197,6 +210,11 @@ and `@SecurityScheme` annotations within a Spring managed bean. ``` +Gradle +```groovy +implementation("org.springdoc:springdoc-openapi-starter-webflux-ui:latest") +``` + * This step is optional: For custom path of the swagger documentation in HTML format, add a custom springdoc property, in your spring-boot configuration file: From 61c106b85ee7fce1372d27b2bc4cb148ce84b2f9 Mon Sep 17 00:00:00 2001 From: Alexander Ilinykh Date: Thu, 3 Oct 2024 21:54:41 +0500 Subject: [PATCH 084/226] change kotlin kts to native groovy --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e4934fffb..65257d011 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Maven Gradle ```groovy -implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:latest") +implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:latest' ``` * This step is optional: For custom path of the swagger documentation in HTML format, add @@ -161,7 +161,7 @@ Maven Gradle ```groovy -implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:latest") +implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:latest' ``` * This step is optional: For custom path of the OpenAPI documentation in Json format, add @@ -212,7 +212,7 @@ Maven Gradle ```groovy -implementation("org.springdoc:springdoc-openapi-starter-webflux-ui:latest") +implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:latest' ``` * This step is optional: For custom path of the swagger documentation in HTML format, add From 02215f1ebe8cdc55d42256a646052395299b048a Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 4 Oct 2024 17:06:48 +0200 Subject: [PATCH 085/226] Spring Boot (Webflux) - Swagger UI - redirect URI does not include Gateway Prefix. Fixes #2708 --- .../SpringDocBehindProxyBasePathTest.java | 18 ++++---- .../springdoc/ui/app33/SpringDocConfig.java | 45 +++++++++++++++++++ .../src/test/resources/results/app33.json | 6 +++ 3 files changed, 61 insertions(+), 8 deletions(-) rename springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/{app32 => app33}/SpringDocBehindProxyBasePathTest.java (80%) create mode 100644 springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocConfig.java create mode 100644 springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java similarity index 80% rename from springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java rename to springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java index 418306a86..1b0a78062 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyBasePathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java @@ -16,7 +16,7 @@ * */ -package test.org.springdoc.ui.app32; +package test.org.springdoc.ui.app33; import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; @@ -37,8 +37,8 @@ @SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { //"spring.webflux.base-path=/test", - "server.forward-headers-strategy=native", + properties = { "spring.webflux.base-path=/test", + "server.forward-headers-strategy=framework", "server.port=9318", "springdoc.swagger-ui.path=/documentation/swagger-ui.html", "springdoc.api-docs.path=/documentation/v3/api-docs", @@ -47,7 +47,8 @@ @Import(SpringDocConfig.class) public class SpringDocBehindProxyBasePathTest extends AbstractCommonTest { - private static final String X_FORWARD_PREFIX = "/path/prefix"; + public static final String WEBFLUX_BASE_PATH = "/test"; + public static final String X_FORWARD_PREFIX = "/path/prefix"; @LocalServerPort private int port; @@ -62,21 +63,22 @@ void init() { @Test public void testIndex() throws Exception { - HttpStatusCode httpStatusMono = webClient.get().uri("/documentation/swagger-ui.html") + HttpStatusCode httpStatusMono = webClient.get().uri(WEBFLUX_BASE_PATH+"/documentation/swagger-ui.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); - httpStatusMono = webClient.get().uri("/documentation/webjars-pref/swagger-ui/index.html") + httpStatusMono = webClient.get().uri(WEBFLUX_BASE_PATH+"/documentation/webjars-pref/swagger-ui/index.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.OK); - String contentAsString = webClient.get().uri("/documentation/v3/api-docs/swagger-config") + String contentAsString = webClient.get().uri(WEBFLUX_BASE_PATH+"/documentation/v3/api-docs/swagger-config") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .retrieve() .bodyToMono(String.class).block(); - String expected = getContent("results/app32-1.json"); + + String expected = getContent("results/app33.json"); assertEquals(expected, contentAsString, true); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocConfig.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocConfig.java new file mode 100644 index 000000000..edf233cb4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocConfig.java @@ -0,0 +1,45 @@ +package test.org.springdoc.ui.app33; + +import java.util.List; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.util.CollectionUtils; +import org.springframework.web.server.ServerWebExchange; +import org.springframework.web.server.WebFilter; +import org.springframework.web.server.WebFilterChain; + +@Configuration +public class SpringDocConfig { + + private static final Logger LOGGER = LoggerFactory.getLogger(SpringDocConfig.class); + + + @Bean + public WebFilter rewritePathWebFilter(WebFluxProperties webFluxProperties) { + return (ServerWebExchange exchange, WebFilterChain chain) -> { + try { + ServerHttpRequest originalRequest = (ServerHttpRequest) FieldUtils.readDeclaredField(exchange.getRequest(), "originalRequest", true); + List forwardedPrefixHeaders = originalRequest.getHeaders().get("X-Forwarded-Prefix"); + if (!CollectionUtils.isEmpty(forwardedPrefixHeaders)) { + String forwardedPrefix = forwardedPrefixHeaders.get(0); + ServerHttpRequest mutatedRequest = exchange.getRequest().mutate() + .contextPath(forwardedPrefix + webFluxProperties.getBasePath()) + .build(); + ServerWebExchange mutatedExchange = exchange.mutate().request(mutatedRequest).build(); + return chain.filter(mutatedExchange); + } + + } catch (Exception e) { + LOGGER.error(e.getMessage()); + } + return chain.filter(exchange); + }; + } +} diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json new file mode 100644 index 000000000..9d03a31f8 --- /dev/null +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json @@ -0,0 +1,6 @@ +{ + "configUrl": "/path/prefix/test/documentation/v3/api-docs/swagger-config", + "oauth2RedirectUrl": "http://localhost:9318/path/prefix/test/documentation/webjars-pref/swagger-ui/oauth2-redirect.html", + "url": "/path/prefix/test/documentation/v3/api-docs", + "validatorUrl": "" +} From 3dba5e618a92982309ae7cf3c8bc145538e35be2 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 4 Oct 2024 20:00:24 +0200 Subject: [PATCH 086/226] SpringDocUI doest add Javadoc into swagger from abstract class. FIXES #2744 --- .../SpringDocJavadocConfiguration.java | 3 + .../api/app174/ExampleController.java | 24 +++ .../org/springdoc/api/app174/Question.java | 42 +++++ .../api/app174/SpringDocApp174Test.java | 19 ++ .../test/org/springdoc/api/app174/Test.java | 44 +++++ .../springdoc/api/app174/TestQuestion.java | 42 +++++ .../springdoc/api/app174/TextQuestion.java | 28 +++ .../src/test/resources/results/app118.json | 166 +++++++++--------- .../src/test/resources/results/app174.json | 122 +++++++++++++ 9 files changed, 408 insertions(+), 82 deletions(-) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Question.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app174.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java index 76adbdcbf..2d554457b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java @@ -38,6 +38,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; /** * The type Spring doc security configuration. @@ -73,6 +75,7 @@ SpringDocJavadocProvider springDocJavadocProvider() { @Bean @ConditionalOnMissingBean @Lazy(false) + @Order(Ordered.HIGHEST_PRECEDENCE) JavadocPropertyCustomizer javadocPropertyCustomizer(JavadocProvider javadocProvider, ObjectMapperProvider objectMapperProvider) { return new JavadocPropertyCustomizer(javadocProvider, objectMapperProvider); } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java new file mode 100644 index 000000000..c83b87613 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.app174; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The Example Controller + */ +@RestController +public class ExampleController { + + @PostMapping + public Test post(){ + return null; + } + +} + + + + + + + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Question.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Question.java new file mode 100644 index 000000000..d0ebf7952 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Question.java @@ -0,0 +1,42 @@ +package test.org.springdoc.api.app174; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** + * The type Question. + * + * @author bnasslahsen base class for all questions in test with polymorphism + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = TestQuestion.class, name = "test"), + @JsonSubTypes.Type(value = TextQuestion.class, name = "text") +}) +public abstract class Question { + private final String question; + private final String type; + + public Question(String question, String type) { + this.question = question; + this.type = type; + } + + public String getQuestion() { + return question; + } + + public String getType() { + return type; + } + + @Override + public String toString() { + return "Question{" + + "question='" + question + '\'' + + ", type='" + type + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java new file mode 100644 index 000000000..8c05daaec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java @@ -0,0 +1,19 @@ +package test.org.springdoc.api.app174; + +import test.org.springdoc.api.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 174 test. + */ +public class SpringDocApp174Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java new file mode 100644 index 000000000..53153d863 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java @@ -0,0 +1,44 @@ +package test.org.springdoc.api.app174; + +import java.io.Serializable; +import java.util.List; + +/** + * The type Test. + * + * @author bnasslahsen + */ + +public class Test implements Serializable { + + private static final long serialVersionUID = 1L; // Recommended for Serializable classes + + private List questions; + + // No-argument constructor + public Test() { + } + + // Constructor with arguments + public Test(List questions) { + this.questions = questions; + } + + // Getter method for 'questions' + public List getQuestions() { + return questions; + } + + // Setter method for 'questions' + public void setQuestions(List questions) { + this.questions = questions; + } + + // Optionally, you can override toString, hashCode, equals, etc. + @Override + public String toString() { + return "Test{" + + "questions=" + questions + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java new file mode 100644 index 000000000..fe7645d87 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java @@ -0,0 +1,42 @@ +package test.org.springdoc.api.app174; + +import java.util.List; + +/** + * The type Test question. + * + * @author bnasslahsen test question + */ +public class TestQuestion extends Question { + /** + * list of variants + */ + private final List variants; + /** + * correct answer + */ + private final int answer; + + public TestQuestion(String question, String type, List variants, int answer) { + super(question, type); + this.variants = variants; + this.answer = answer; + } + + public List getVariants() { + return variants; + } + + public int getAnswer() { + return answer; + } + + @Override + public String toString() { + return "TestQuestion{" + + "question='" + getQuestion() + '\'' + + ", variants=" + variants + + ", answer=" + answer + + '}'; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java new file mode 100644 index 000000000..5c5279de9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java @@ -0,0 +1,28 @@ +package test.org.springdoc.api.app174; + +/** + * The type Text question. + * + * @author bnasslahsen + */ +public class TextQuestion extends Question { + private final String answer; + + public TextQuestion(String question, String type, String answer) { + super(question, type); + this.answer = answer; + } + + public String getAnswer() { + return answer; + } + + @Override + public String toString() { + return "TextQuestion{" + + "question='" + getQuestion() + '\'' + + ", type='" + getType() + '\'' + + ", answer='" + answer + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app118.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app118.json index 7e9c83e20..4a5c62739 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app118.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app118.json @@ -17,14 +17,14 @@ } ], "paths": { - "/class-hierarchy/abstract-parent": { + "/class-hierarchy/concrete-parent": { "post": { "tags": [ "controller" ], - "summary": "Abstract parent response.", - "description": "Abstract parent response.", - "operationId": "abstractParent", + "summary": "Concrete parent response.", + "description": "Concrete parent response.", + "operationId": "concreteParent", "requestBody": { "description": "the payload", "content": { @@ -32,10 +32,13 @@ "schema": { "oneOf": [ { - "$ref": "#/components/schemas/ChildOfAbstract1" + "$ref": "#/components/schemas/ConcreteParent" }, { - "$ref": "#/components/schemas/ChildOfAbstract2" + "$ref": "#/components/schemas/ChildOfConcrete1" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete2" } ] } @@ -57,14 +60,14 @@ } } }, - "/class-hierarchy/concrete-parent": { + "/class-hierarchy/abstract-parent": { "post": { "tags": [ "controller" ], - "summary": "Concrete parent response.", - "description": "Concrete parent response.", - "operationId": "concreteParent", + "summary": "Abstract parent response.", + "description": "Abstract parent response.", + "operationId": "abstractParent", "requestBody": { "description": "the payload", "content": { @@ -72,13 +75,10 @@ "schema": { "oneOf": [ { - "$ref": "#/components/schemas/ConcreteParent" - }, - { - "$ref": "#/components/schemas/ChildOfConcrete1" + "$ref": "#/components/schemas/ChildOfAbstract1" }, { - "$ref": "#/components/schemas/ChildOfConcrete2" + "$ref": "#/components/schemas/ChildOfAbstract2" } ] } @@ -103,136 +103,138 @@ }, "components": { "schemas": { - "AbstractParent": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "type": { - "type": "string" - } - }, - "discriminator": { - "propertyName": "type" - } - }, - "ChildOfAbstract1": { + "ChildOfConcrete1": { "type": "object", - "description": "The type Child of abstract 1.", + "description": "The type Child of concrete 1.", "allOf": [ { - "$ref": "#/components/schemas/AbstractParent" + "$ref": "#/components/schemas/ConcreteParent" }, { "type": "object", "properties": { - "abstrachChild1Param": { - "type": "string", - "description": "The Abstrach child 1 param." - }, "id": { "type": "integer", "description": "The Id.", "format": "int32" + }, + "concreteChild1Param": { + "type": "string", + "description": "The Concrete child 1 param." } } } ] }, - "ChildOfAbstract2": { + "ChildOfConcrete2": { "type": "object", - "description": "The type Child of abstract 2.", + "description": "The type Child of concrete 2.", "allOf": [ { - "$ref": "#/components/schemas/AbstractParent" + "$ref": "#/components/schemas/ConcreteParent" }, { "type": "object", "properties": { - "abstractChild2Param": { - "type": "string", - "description": "The Abstract child 2 param." - }, "id": { "type": "integer", "description": "The Id.", "format": "int32" + }, + "concreteChild2Param": { + "type": "string", + "description": "The Concrete child 2 param." } } } ] }, - "ChildOfConcrete1": { + "ConcreteParent": { + "required": [ + "type" + ], "type": "object", - "description": "The type Child of concrete 1.", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "description": "The type Concrete parent.", + "discriminator": { + "propertyName": "type" + } + }, + "AbstractParent": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "description": "The type Abstract parent.", + "discriminator": { + "propertyName": "type" + } + }, + "ChildOfAbstract1": { + "type": "object", + "description": "The type Child of abstract 1.", "allOf": [ { - "$ref": "#/components/schemas/ConcreteParent" + "$ref": "#/components/schemas/AbstractParent" }, { "type": "object", "properties": { - "concreteChild1Param": { - "type": "string", - "description": "The Concrete child 1 param." - }, "id": { "type": "integer", "description": "The Id.", "format": "int32" + }, + "abstrachChild1Param": { + "type": "string", + "description": "The Abstrach child 1 param." } } } ] }, - "ChildOfConcrete2": { + "ChildOfAbstract2": { "type": "object", - "description": "The type Child of concrete 2.", + "description": "The type Child of abstract 2.", "allOf": [ { - "$ref": "#/components/schemas/ConcreteParent" + "$ref": "#/components/schemas/AbstractParent" }, { "type": "object", "properties": { - "concreteChild2Param": { - "type": "string", - "description": "The Concrete child 2 param." - }, "id": { "type": "integer", "description": "The Id.", "format": "int32" + }, + "abstractChild2Param": { + "type": "string", + "description": "The Abstract child 2 param." } } } ] }, - "ConcreteParent": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "The Id.", - "format": "int32" - }, - "type": { - "type": "string" - } - }, - "description": "The type Concrete parent.", - "discriminator": { - "propertyName": "type" - } - }, "Response": { "type": "object", "properties": { @@ -269,4 +271,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app174.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app174.json new file mode 100644 index 000000000..5347f1a59 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app174.json @@ -0,0 +1,122 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "example-controller", + "description": "The Example Controller" + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "example-controller" + ], + "operationId": "post", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Test" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Question": { + "type": "object", + "properties": { + "question": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "description": "The type Question.", + "discriminator": { + "propertyName": "type" + } + }, + "Test": { + "type": "object", + "properties": { + "questions": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TestQuestion" + }, + { + "$ref": "#/components/schemas/TextQuestion" + } + ] + } + } + }, + "description": "The type Test." + }, + "TestQuestion": { + "type": "object", + "description": "The type Test question.", + "allOf": [ + { + "$ref": "#/components/schemas/Question" + }, + { + "type": "object", + "properties": { + "variants": { + "type": "array", + "description": "list of variants", + "items": { + "type": "string" + } + }, + "answer": { + "type": "integer", + "description": "correct answer", + "format": "int32" + } + } + } + ] + }, + "TextQuestion": { + "type": "object", + "description": "The type Text question.", + "allOf": [ + { + "$ref": "#/components/schemas/Question" + }, + { + "type": "object", + "properties": { + "answer": { + "type": "string" + } + } + } + ] + } + } + } +} From a98d3e6e36fdaf53ace9579a02eed8aae20badad Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 5 Oct 2024 12:29:02 +0200 Subject: [PATCH 087/226] @Schema oneOf config is ignored when generate the api-docs. Fixes #2705 --- .../converters/PolymorphicModelConverter.java | 11 +- .../api/v30/app228/HelloController.java | 56 ++++++++++ .../api/v30/app228/SpringDocApp228Test.java | 35 ++++++ .../test/resources/results/3.0.1/app228.json | 105 ++++++++++++++++++ 4 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/SpringDocApp228Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app228.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 9a4b4ecb8..fce0ac8fc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -38,6 +38,7 @@ import io.swagger.v3.core.converter.ModelConverter; import io.swagger.v3.core.converter.ModelConverterContext; import io.swagger.v3.core.util.AnnotationsUtils; +import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.ObjectSchema; import io.swagger.v3.oas.models.media.Schema; @@ -112,8 +113,16 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato type.resolveAsRef(true); Schema resolvedSchema = chain.next().resolve(type, context, chain); resolvedSchema = getResolvedSchema(javaType, resolvedSchema); - if (resolvedSchema == null || resolvedSchema.get$ref() == null) + if (resolvedSchema == null || resolvedSchema.get$ref() == null) { return resolvedSchema; + } + if(resolvedSchema.get$ref().contains(Components.COMPONENTS_SCHEMAS_REF)) { + String schemaName = resolvedSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); + Schema existingSchema = context.getDefinedModels().get(schemaName); + if (existingSchema != null && existingSchema.getOneOf() != null) { + return resolvedSchema; + } + } return composePolymorphicSchema(type, resolvedSchema, context.getDefinedModels().values()); } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/HelloController.java new file mode 100644 index 000000000..b19e30d3e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/HelloController.java @@ -0,0 +1,56 @@ +package test.org.springdoc.api.v30.app228; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping +public class HelloController { + + + @PostMapping("swaggerTest") + public String swaggerTest(@RequestBody MyRequest myRequest) { + return null; + } + + public class MyRequest { + @Schema(oneOf = {Child1.class, Child2.class}) + @JsonProperty + private Parent parent; + } + + @JsonSubTypes({ + @JsonSubTypes.Type(value = Child1.class), + @JsonSubTypes.Type(value = Child2.class), + @JsonSubTypes.Type(value = Child3.class), + }) + public abstract class Parent { + @JsonProperty + private String parentProperty; + } + + public class Child1 extends Parent { + @JsonProperty + private String childProperty1; + } + + public class Child2 extends Parent { + @JsonProperty + private String childProperty2; + } + + public class Child3 extends Parent { + @JsonProperty + private String childProperty3; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/SpringDocApp228Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/SpringDocApp228Test.java new file mode 100644 index 000000000..300f1b48d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/SpringDocApp228Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2022 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app228; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp228Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app228.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app228.json new file mode 100644 index 000000000..31e46a53e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app228.json @@ -0,0 +1,105 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/swaggerTest": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "swaggerTest", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MyRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Child1": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Parent" + }, + { + "type": "object", + "properties": { + "childProperty1": { + "type": "string" + } + } + } + ] + }, + "Child2": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Parent" + }, + { + "type": "object", + "properties": { + "childProperty2": { + "type": "string" + } + } + } + ] + }, + "MyRequest": { + "type": "object", + "properties": { + "parent": { + "$ref": "#/components/schemas/Parent" + } + } + }, + "Parent": { + "type": "object", + "properties": { + "parentProperty": { + "type": "string" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/Child1" + }, + { + "$ref": "#/components/schemas/Child2" + } + ] + } + } + } +} From ab2538e7280d7403d4e9917069d50efaa5f94635 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 5 Oct 2024 18:26:03 +0200 Subject: [PATCH 088/226] Move to webjars-locator-lite, in preparation for spring-boot 3.4 GA. Fixes #2747 --- .../ui/AbstractSwaggerResourceResolver.java | 48 --------------- .../ui/SwaggerResourceResolverUtils.java | 29 +++++++++ .../AbstractSwaggerResourceResolverTest.java | 51 ---------------- .../ui/SwaggerResourceResolverUtilsTest.java | 36 +++++++++++ springdoc-openapi-starter-webflux-ui/pom.xml | 4 ++ .../webflux/ui/SwaggerResourceResolver.java | 59 ++++++++----------- springdoc-openapi-starter-webmvc-ui/pom.xml | 4 ++ .../webmvc/ui/SwaggerResourceResolver.java | 51 ++++++++-------- 8 files changed, 121 insertions(+), 161 deletions(-) delete mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerResourceResolver.java create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java delete mode 100644 springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerResourceResolverTest.java create mode 100644 springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/SwaggerResourceResolverUtilsTest.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerResourceResolver.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerResourceResolver.java deleted file mode 100644 index 1ead80c67..000000000 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerResourceResolver.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.springdoc.ui; - -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.springdoc.core.properties.SwaggerUiConfigProperties; - -import org.springframework.lang.Nullable; - -/** - * The type Web jars version resource resolver. - * - * @author bnasslahsen - */ -public class AbstractSwaggerResourceResolver { - - /** - * The Swagger ui config properties. - */ - private final SwaggerUiConfigProperties swaggerUiConfigProperties; - - /** - * Instantiates a new Web jars version resource resolver. - * - * @param swaggerUiConfigProperties the swagger ui config properties - */ - public AbstractSwaggerResourceResolver(SwaggerUiConfigProperties swaggerUiConfigProperties) { - this.swaggerUiConfigProperties = swaggerUiConfigProperties; - } - - /** - * Find web jar resource path string. - * - * @param pathStr the path - * @return the string - */ - @Nullable - protected String findWebJarResourcePath(String pathStr) { - Path path = Paths.get(pathStr); - if (path.getNameCount() < 2) return null; - String version = swaggerUiConfigProperties.getVersion(); - if (version == null) return null; - Path first = path.getName(0); - Path rest = path.subpath(1, path.getNameCount()); - return first.resolve(version).resolve(rest).toString(); - } - -} diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java new file mode 100644 index 000000000..b0a1aa3ac --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java @@ -0,0 +1,29 @@ +package org.springdoc.ui; + +import java.nio.file.Path; +import java.nio.file.Paths; + +/** + * The interface Swagger resource resolver utils. + * + * @author bnasslahsen + */ +public interface SwaggerResourceResolverUtils { + + /** + * Find swagger resource path string. + * + * @param pathStr the path + * @param version the version + * @return the string + */ + static String findSwaggerResourcePath(String pathStr, String version) { + Path path = Paths.get(pathStr); + if (path.getNameCount() < 2) return null; + if (version == null) return null; + Path first = path.getName(0); + Path rest = path.subpath(1, path.getNameCount()); + return first.resolve(version).resolve(rest).toString(); + } + +} diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerResourceResolverTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerResourceResolverTest.java deleted file mode 100644 index 0e558fef9..000000000 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerResourceResolverTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.springdoc.ui; - -import java.io.File; -import java.util.Objects; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.springdoc.core.properties.SwaggerUiConfigProperties; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -class AbstractSwaggerResourceResolverTest { - private SwaggerUiConfigProperties swaggerUiConfigProperties; - - private AbstractSwaggerResourceResolver abstractSwaggerResourceResolver; - - private final String VERSION = "4.18.2"; - - @BeforeEach - public void setup(){ - swaggerUiConfigProperties = new SwaggerUiConfigProperties(); - swaggerUiConfigProperties.setVersion(VERSION); - abstractSwaggerResourceResolver = new AbstractSwaggerResourceResolver(swaggerUiConfigProperties); - } - - @Test - void findWebJarResourcePath() { - String path = "swagger-ui/swagger-initializer.js"; - - String actual = abstractSwaggerResourceResolver.findWebJarResourcePath(path); - assertEquals("swagger-ui" + File.separator + "4.18.2" + File.separator + "swagger-initializer.js", actual); - } - - @Test - void returNullWhenPathIsSameAsWebjar() { - String path = "swagger-ui"; - - String actual = abstractSwaggerResourceResolver.findWebJarResourcePath(path); - assertTrue(Objects.isNull(actual)); - } - - @Test - void returNullWhenVersionIsNull() { - String path = "swagger-ui/swagger-initializer.js"; - swaggerUiConfigProperties.setVersion(null); - - String actual = abstractSwaggerResourceResolver.findWebJarResourcePath(path); - assertTrue(Objects.isNull(actual)); - } -} diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/SwaggerResourceResolverUtilsTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/SwaggerResourceResolverUtilsTest.java new file mode 100644 index 000000000..04fd1a1f7 --- /dev/null +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/SwaggerResourceResolverUtilsTest.java @@ -0,0 +1,36 @@ +package org.springdoc.ui; + +import java.io.File; +import java.util.Objects; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.springdoc.ui.SwaggerResourceResolverUtils.findSwaggerResourcePath; + +class SwaggerResourceResolverUtilsTest { + + private final String VERSION = "4.18.2"; + + @Test + void findWebJarResourcePath() { + String path = "swagger-ui/swagger-initializer.js"; + String actual = findSwaggerResourcePath(path,VERSION); + assertEquals("swagger-ui" + File.separator + "4.18.2" + File.separator + "swagger-initializer.js", actual); + } + + @Test + void returnNullWhenPathIsSameAsWebjar() { + String path = "swagger-ui"; + String actual = findSwaggerResourcePath(path,VERSION); + assertTrue(Objects.isNull(actual)); + } + + @Test + void returnNullWhenVersionIsNull() { + String path = "swagger-ui/swagger-initializer.js"; + String actual = findSwaggerResourcePath(path,null); + assertTrue(Objects.isNull(actual)); + } +} diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 36e6ace7b..83b20885c 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -18,6 +18,10 @@ org.webjars swagger-ui + + org.webjars + webjars-locator-lite + org.springframework.boot diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java index 343227120..0b1b8750e 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java @@ -1,58 +1,47 @@ package org.springdoc.webflux.ui; -import java.util.List; - import org.springdoc.core.properties.SwaggerUiConfigProperties; -import org.springdoc.ui.AbstractSwaggerResourceResolver; -import reactor.core.publisher.Mono; -import org.springframework.core.io.Resource; -import org.springframework.web.reactive.resource.ResourceResolver; -import org.springframework.web.reactive.resource.ResourceResolverChain; -import org.springframework.web.server.ServerWebExchange; +import org.springframework.lang.Nullable; +import org.springframework.web.reactive.resource.LiteWebJarsResourceResolver; + +import static org.springdoc.ui.SwaggerResourceResolverUtils.findSwaggerResourcePath; /** - * The type Web jars version resource resolver. + * The type Swagger resource resolver. * * @author bnasslahsen */ -public class SwaggerResourceResolver extends AbstractSwaggerResourceResolver implements ResourceResolver { +public class SwaggerResourceResolver extends LiteWebJarsResourceResolver { + /** + * The Swagger ui config properties. + */ + private final SwaggerUiConfigProperties swaggerUiConfigProperties; + /** * Instantiates a new Web jars version resource resolver. * * @param swaggerUiConfigProperties the swagger ui config properties */ public SwaggerResourceResolver(SwaggerUiConfigProperties swaggerUiConfigProperties) { - super(swaggerUiConfigProperties); + this.swaggerUiConfigProperties = swaggerUiConfigProperties; } - @Override - public Mono resolveResource(ServerWebExchange exchange, String requestPath, List locations, ResourceResolverChain chain) { - return chain.resolveResource(exchange, requestPath, locations) - .switchIfEmpty(Mono.defer(() -> { - String webJarsResourcePath = findWebJarResourcePath(requestPath); - if (webJarsResourcePath != null) { - return chain.resolveResource(exchange, webJarsResourcePath, locations); - } - else { - return Mono.empty(); - } - })); - } + /** + * Find web jar resource path string. + * + * @param pathStr the path + * @return the string + */ + @Nullable @Override - public Mono resolveUrlPath(String resourceUrlPath, List locations, ResourceResolverChain chain) { - return chain.resolveUrlPath(resourceUrlPath, locations) - .switchIfEmpty(Mono.defer(() -> { - String webJarResourcePath = findWebJarResourcePath(resourceUrlPath); - if (webJarResourcePath != null) { - return chain.resolveUrlPath(webJarResourcePath, locations); - } - else { - return Mono.empty(); - } - })); + protected String findWebJarResourcePath(String pathStr) { + String resourcePath = super.findWebJarResourcePath(pathStr); + if(resourcePath == null) + return findSwaggerResourcePath(pathStr, swaggerUiConfigProperties.getVersion()); + return resourcePath; } } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 92eddc837..d3b0ae01a 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -23,6 +23,10 @@ org.webjars swagger-ui + + org.webjars + webjars-locator-lite + org.springframework.boot spring-boot-starter-security diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java index 4a980f69b..3938b1a4c 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java @@ -1,49 +1,46 @@ package org.springdoc.webmvc.ui; -import java.util.List; - -import jakarta.servlet.http.HttpServletRequest; import org.springdoc.core.properties.SwaggerUiConfigProperties; -import org.springdoc.ui.AbstractSwaggerResourceResolver; -import org.springframework.core.io.Resource; -import org.springframework.web.servlet.resource.ResourceResolver; -import org.springframework.web.servlet.resource.ResourceResolverChain; +import org.springframework.lang.Nullable; +import org.springframework.web.servlet.resource.LiteWebJarsResourceResolver; + +import static org.springdoc.ui.SwaggerResourceResolverUtils.findSwaggerResourcePath; /** * The type Web jars version resource resolver. * * @author bnasslahsen */ -public class SwaggerResourceResolver extends AbstractSwaggerResourceResolver implements ResourceResolver { +public class SwaggerResourceResolver extends LiteWebJarsResourceResolver { + /** + * The Swagger ui config properties. + */ + private final SwaggerUiConfigProperties swaggerUiConfigProperties; + /** * Instantiates a new Web jars version resource resolver. * * @param swaggerUiConfigProperties the swagger ui config properties */ public SwaggerResourceResolver(SwaggerUiConfigProperties swaggerUiConfigProperties) { - super(swaggerUiConfigProperties); + this.swaggerUiConfigProperties = swaggerUiConfigProperties; } + /** + * Find web jar resource path string. + * + * @param pathStr the path + * @return the string + */ + @Nullable @Override - public Resource resolveResource(HttpServletRequest request, String requestPath, List locations, ResourceResolverChain chain) { - Resource resolved = chain.resolveResource(request, requestPath, locations); - if (resolved == null) { - String webJarResourcePath = findWebJarResourcePath(requestPath); - if (webJarResourcePath != null) - return chain.resolveResource(request, webJarResourcePath, locations); - } - return resolved; } - - @Override - public String resolveUrlPath(String resourcePath, List locations, ResourceResolverChain chain) { - String path = chain.resolveUrlPath(resourcePath, locations); - if (path == null) { - String webJarResourcePath = findWebJarResourcePath(resourcePath); - if (webJarResourcePath != null) - return chain.resolveUrlPath(webJarResourcePath, locations); - } - return path; + protected String findWebJarResourcePath(String pathStr) { + String resourcePath = super.findWebJarResourcePath(pathStr); + if(resourcePath == null) + return findSwaggerResourcePath(pathStr, swaggerUiConfigProperties.getVersion()); + return resourcePath; } + } \ No newline at end of file From 4ba801d13c2a8c3ba5a8afb5dc6e2d9d8078391a Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 6 Oct 2024 01:18:44 +0200 Subject: [PATCH 089/226] code review --- .../api/AbstractOpenApiResource.java | 2 +- .../java/org/springdoc/api/ErrorMessage.java | 2 +- .../api/OpenApiResourceNotFoundException.java | 2 +- .../core/annotations/ParameterObject.java | 2 +- .../core/annotations/RouterOperation.java | 2 +- .../core/annotations/RouterOperations.java | 2 +- .../CacheOrGroupedOpenApiCondition.java | 2 +- .../MultipleOpenApiGroupsCondition.java | 2 +- .../MultipleOpenApiSupportCondition.java | 2 +- .../configuration/SpringDocConfiguration.java | 7 +- .../SpringDocDataRestConfiguration.java | 2 +- ...SpringDocFunctionCatalogConfiguration.java | 2 +- .../SpringDocGroovyConfiguration.java | 2 +- .../SpringDocHateoasConfiguration.java | 2 +- .../SpringDocJavadocConfiguration.java | 2 +- .../SpringDocKotlinxConfiguration.java | 2 +- .../SpringDocPageableConfiguration.java | 2 +- .../SpringDocRequiredModule.java | 2 +- .../SpringDocSecurityConfiguration.java | 14 +- .../SpringDocSecurityOAuth2Customizer.java | 13 +- .../SpringDocSortConfiguration.java | 2 +- .../SpringDocSpecPropertiesConfiguration.java | 2 +- .../SpringDocUIConfiguration.java | 2 +- .../hints/SpringDocDataRestHints.java | 2 +- .../configuration/hints/SpringDocHints.java | 2 +- .../hints/SpringDocSecurityHints.java | 2 +- ...pringdocActuatorBeanFactoryConfigurer.java | 2 +- .../SpringdocBeanFactoryConfigurer.java | 2 +- .../converters/AdditionalModelsConverter.java | 2 +- .../CollectionModelContentConverter.java | 2 +- .../core/converters/ConverterUtils.java | 2 +- .../core/converters/FileSupportConverter.java | 2 +- .../converters/JavaTypeToIgnoreConverter.java | 2 +- .../converters/ModelConverterRegistrar.java | 6 +- .../converters/PageableOpenAPIConverter.java | 2 +- .../converters/PolymorphicModelConverter.java | 2 +- .../PropertyCustomizingConverter.java | 2 +- .../RepresentationModelLinksOASMixin.java | 2 +- .../converters/ResponseSupportConverter.java | 3 +- .../SchemaPropertyDeprecatingConverter.java | 2 +- .../core/converters/SortOpenAPIConverter.java | 31 +-- .../converters/WebFluxSupportConverter.java | 2 +- .../converters/models/DefaultPageable.java | 2 +- .../converters/models/MonetaryAmount.java | 2 +- .../core/converters/models/Pageable.java | 2 +- .../models/PageableAsQueryParam.java | 2 +- .../core/converters/models/Sort.java | 6 +- .../core/converters/models/SortObject.java | 2 +- .../ActuatorOpenApiCustomizer.java | 9 +- .../ActuatorOperationCustomizer.java | 24 +- ...stDelegatingMethodParameterCustomizer.java | 12 +- .../DelegatingMethodParameterCustomizer.java | 2 +- .../customizers/GlobalOpenApiCustomizer.java | 2 +- .../GlobalOperationCustomizer.java | 2 +- .../customizers/OpenApiBuilderCustomizer.java | 2 +- .../core/customizers/OpenApiCustomizer.java | 2 +- .../OpenApiHateoasLinksCustomizer.java | 2 +- .../customizers/OpenApiLocaleCustomizer.java | 2 +- .../core/customizers/OperationCustomizer.java | 2 +- .../customizers/OperationIdCustomizer.java | 2 +- .../core/customizers/ParameterCustomizer.java | 2 +- .../core/customizers/PropertyCustomizer.java | 2 +- .../QuerydslPredicateOperationCustomizer.java | 15 +- .../customizers/ServerBaseUrlCustomizer.java | 2 +- .../customizers/SpecPropertiesCustomizer.java | 2 +- .../customizers/SpringDocCustomizers.java | 2 +- .../springdoc/core/data/ControllerType.java | 2 +- .../core/data/DataRestOperationService.java | 2 +- .../core/data/DataRestRepository.java | 2 +- .../core/data/DataRestRequestService.java | 2 +- .../core/data/DataRestResponseService.java | 11 +- .../data/DataRestRouterOperationService.java | 2 +- .../core/data/DataRestTagsService.java | 2 +- .../MethodParameterPojoExtractor.java | 2 +- .../filters/GlobalOpenApiMethodFilter.java | 2 +- .../core/filters/OpenApiMethodFilter.java | 2 +- .../fn/AbstractRouterFunctionVisitor.java | 2 +- .../fn/AbstractSpringdocRouteBuilder.java | 2 +- .../springdoc/core/fn/RouterFunctionData.java | 2 +- .../springdoc/core/fn/RouterOperation.java | 2 +- .../core/fn/builders/apiresponse/Builder.java | 2 +- .../core/fn/builders/arrayschema/Builder.java | 2 +- .../core/fn/builders/content/Builder.java | 2 +- .../discriminatormapping/Builder.java | 2 +- .../core/fn/builders/encoding/Builder.java | 2 +- .../fn/builders/exampleobject/Builder.java | 2 +- .../core/fn/builders/extension/Builder.java | 2 +- .../builders/extensionproperty/Builder.java | 2 +- .../externaldocumentation/Builder.java | 2 +- .../core/fn/builders/header/Builder.java | 2 +- .../core/fn/builders/link/Builder.java | 2 +- .../fn/builders/linkparameter/Builder.java | 2 +- .../core/fn/builders/operation/Builder.java | 2 +- .../core/fn/builders/parameter/Builder.java | 2 +- .../core/fn/builders/requestbody/Builder.java | 2 +- .../core/fn/builders/schema/Builder.java | 2 +- .../builders/securityrequirement/Builder.java | 2 +- .../core/fn/builders/server/Builder.java | 2 +- .../fn/builders/servervariable/Builder.java | 2 +- .../core/mixins/SortedOpenAPIMixin.java | 2 +- .../core/mixins/SortedOpenAPIMixin31.java | 2 +- .../core/mixins/SortedSchemaMixin.java | 2 +- .../core/mixins/SortedSchemaMixin31.java | 2 +- .../core/models/ControllerAdviceInfo.java | 2 +- .../springdoc/core/models/GroupedOpenApi.java | 2 +- .../core/models/MethodAdviceInfo.java | 2 +- .../core/models/MethodAttributes.java | 2 +- .../springdoc/core/models/ParameterId.java | 2 +- .../springdoc/core/models/ParameterInfo.java | 2 +- .../core/models/RequestBodyInfo.java | 2 +- .../AbstractSwaggerUiConfigProperties.java | 2 +- .../properties/SwaggerUiConfigParameters.java | 2 +- .../properties/SwaggerUiConfigProperties.java | 2 +- .../properties/SwaggerUiOAuthProperties.java | 2 +- .../core/providers/ActuatorProvider.java | 4 +- .../core/providers/CloudFunctionProvider.java | 2 +- .../core/providers/DataRestHalProvider.java | 2 +- .../core/providers/HateoasHalProvider.java | 2 +- .../core/providers/ObjectMapperProvider.java | 6 +- .../RepositoryRestConfigurationProvider.java | 2 +- .../RepositoryRestResourceProvider.java | 2 +- .../providers/RouterFunctionProvider.java | 2 +- .../providers/SecurityOAuth2Provider.java | 2 +- .../SpringCloudFunctionProvider.java | 2 +- .../SpringDataWebPropertiesProvider.java | 2 +- .../core/providers/SpringDocProviders.java | 10 +- .../SpringRepositoryRestResourceProvider.java | 8 +- .../core/providers/SpringWebProvider.java | 2 +- .../WebConversionServiceProvider.java | 7 +- .../core/service/AbstractRequestService.java | 19 +- .../core/service/GenericParameterService.java | 7 +- .../core/service/GenericResponseService.java | 6 +- .../core/service/OpenAPIService.java | 2 +- .../core/service/RequestBodyService.java | 2 +- .../core/service/SecuritySchemePair.java | 2 +- .../core/service/SecurityService.java | 2 +- .../org/springdoc/core/utils/Constants.java | 2 +- .../org/springdoc/core/utils/EntityInfo.java | 2 +- .../core/utils/PropertyResolverUtils.java | 2 +- .../core/utils/SpringDocAnnotationsUtils.java | 4 +- .../core/utils/SpringDocDataRestUtils.java | 2 +- .../core/utils/SpringDocPropertiesUtils.java | 2 +- .../springdoc/core/utils/SpringDocUtils.java | 2 +- .../ui/AbstractSwaggerIndexTransformer.java | 2 +- .../springdoc/ui/AbstractSwaggerWelcome.java | 4 +- .../springdoc/ui/SpringDocUIException.java | 2 +- .../api/AbstractOpenApiResourceTest.java | 5 +- .../MethodParameterPojoExtractorTest.java | 2 +- .../AbstractSwaggerIndexTransformerTest.java | 2 +- .../api/MultipleOpenApiActuatorResource.java | 2 +- .../webflux/api/MultipleOpenApiResource.java | 2 +- .../api/MultipleOpenApiWebFluxResource.java | 2 +- .../webflux/api/OpenApiResource.java | 4 +- .../webflux/api/OpenApiWebfluxResource.java | 2 +- .../MultipleOpenApiSupportConfiguration.java | 2 +- .../SpringDocWebFluxConfiguration.java | 8 +- .../core/fn/SpringdocRouteBuilder.java | 2 +- .../providers/ActuatorWebFluxProvider.java | 2 +- .../core/providers/SpringWebFluxProvider.java | 2 +- .../webflux/core/service/RequestService.java | 8 +- .../core/visitor/RouterFunctionVisitor.java | 2 +- .../springdoc/api/AbstractSpringDocTest.java | 2 +- .../springdoc/api/app184/HelloController.java | 2 +- .../api/app184/SpringDocApp184Test.java | 6 +- .../api/app187/SpringDocApp187Test.java | 2 +- .../api/app188/SpringDocApp188Test.java | 2 +- .../api/app190/SpringDocApp190Test.java | 2 +- .../api/app190/SpringDocApp190bisTest.java | 2 +- .../api/app191/Handler/GetNameHandler.java | 8 - .../api/app66/SpringDocApp66Test.java | 2 +- .../api/app67/SpringDocApp67Test.java | 2 +- .../core/ReactiveAutoConfigurationTest.java | 8 +- .../src/test/resources/results/app67.json | 12 +- .../springdoc/webflux/ui/SwaggerConfig.java | 2 +- .../webflux/ui/SwaggerConfigResource.java | 2 +- .../ui/SwaggerIndexPageTransformer.java | 2 +- .../webflux/ui/SwaggerIndexTransformer.java | 2 +- .../springdoc/webflux/ui/SwaggerUiHome.java | 2 +- .../webflux/ui/SwaggerWebFluxConfigurer.java | 2 +- .../webflux/ui/SwaggerWelcomeActuator.java | 2 +- .../webflux/ui/SwaggerWelcomeCommon.java | 4 +- .../webflux/ui/SwaggerWelcomeWebFlux.java | 2 +- .../ui/AbstractSpringDocActuatorTest.java | 2 +- .../app1/SpringDocApp1RedirecFilterTest.java | 2 +- .../SpringDocApp1RedirectConfigUrlTest.java | 2 +- .../SpringDocApp1RedirectDefaultTest.java | 2 +- .../app1/SpringDocApp1RedirectLayoutTest.java | 2 +- .../SpringDocApp1RedirectWithConfigTest.java | 2 +- .../springdoc/ui/app1/SpringDocApp1Test.java | 2 +- .../ui/app13/SpringDocApp13Test.java | 6 +- .../ui/app14/SpringDocApp14Test.java | 6 +- .../ui/app15/SpringDocApp15Test.java | 6 +- .../ui/app16/SpringDocApp16Test.java | 6 +- .../ui/app18/SpringDocApp18Test.java | 4 +- .../ui/app19/SpringDocApp19Test.java | 4 +- .../springdoc/ui/app2/SpringDocApp2Test.java | 2 +- .../ui/app20/SpringDocApp20Test.java | 4 +- .../ui/app21/SpringDocApp21Test.java | 2 +- .../ui/app23/SpringDocApp23Test.java | 4 +- .../ui/app24/SpringDocApp24Test.java | 2 +- .../springdoc/ui/app24/SpringDocConfig.java | 2 +- .../SpringDocApp3RedirectDefaultTest.java | 2 +- .../SpringDocApp3RedirectWithPrefixTest.java | 2 +- .../springdoc/ui/app3/SpringDocApp3Test.java | 2 +- .../ui/app32/SpringDocBehindProxyTest.java | 12 +- ...ingDocBehindProxyWithCustomUIPathTest.java | 6 +- ...dProxyWithCustomUIPathWithApiDocsTest.java | 6 +- .../SpringDocBehindProxyBasePathTest.java | 2 +- .../ui/app4/SpringDocOauthPathsTest.java | 2 +- .../SpringDocOauthPathsWithPropertyTest.java | 2 +- ...ingDocOauthRedirectUrlRecalculateTest.java | 2 +- .../app4/SpringDocOauthServletPathsTest.java | 4 +- .../springdoc/ui/app5/SpringDocApp5Test.java | 2 +- .../springdoc/ui/app6/SpringDocApp6Test.java | 2 +- .../springdoc/ui/app7/SpringDocApp7Test.java | 2 +- .../api/MultipleOpenApiActuatorResource.java | 2 +- .../webmvc/api/MultipleOpenApiResource.java | 4 +- .../api/MultipleOpenApiWebMvcResource.java | 2 +- .../webmvc/api/OpenApiActuatorResource.java | 2 +- .../springdoc/webmvc/api/OpenApiResource.java | 4 +- .../webmvc/api/OpenApiWebMvcResource.java | 2 +- .../MultipleOpenApiSupportConfiguration.java | 2 +- .../SpringDocWebMvcConfiguration.java | 7 +- .../webmvc/core/fn/SpringdocRouteBuilder.java | 2 +- .../providers/ActuatorWebMvcProvider.java | 2 +- .../RouterFunctionWebMvcProvider.java | 2 +- .../core/providers/SpringWebMvcProvider.java | 2 +- .../webmvc/core/service/RequestService.java | 8 +- .../api/v30/AbstractSpringDocV30Test.java | 4 +- .../springdoc/api/v30/app1/ApiException.java | 39 ---- .../api/v30/app1/ApiOriginFilter.java | 55 ----- .../api/v30/app1/ApiResponseMessage.java | 100 -------- .../springdoc/api/v30/app1/ErrorMessage.java | 2 +- .../api/v30/app1/ExceptionTranslator.java | 2 +- .../api/v30/app1/HelloController.java | 2 +- .../api/v30/app1/HomeController.java | 2 +- .../springdoc/api/v30/app1/InventoryApi.java | 2 +- .../api/v30/app1/InventoryApiController.java | 2 +- .../springdoc/api/v30/app1/InventoryItem.java | 2 +- .../api/v30/app1/ItemController.java | 2 +- .../org/springdoc/api/v30/app1/ItemDTO.java | 2 +- .../springdoc/api/v30/app1/ItemLightDTO.java | 2 +- .../springdoc/api/v30/app1/Manufacturer.java | 2 +- .../api/v30/app1/PeopleRestService.java | 2 +- .../org/springdoc/api/v30/app1/PersonDTO.java | 2 +- .../api/v30/app1/SpringDocApp1Test.java | 2 +- .../api/v30/app10/HelloController.java | 2 +- .../api/v30/app10/SpringDocApp10Test.java | 2 +- .../api/v30/app100/HelloController.java | 2 +- .../springdoc/api/v30/app100/PersonDTO.java | 2 +- .../api/v30/app100/SpringDocApp100Test.java | 2 +- .../api/v30/app101/HelloController.java | 2 +- .../springdoc/api/v30/app101/HelloDTO.java | 2 +- .../api/v30/app101/SpringDocApp101Test.java | 2 +- .../v30/app102/InheritedRequestParams.java | 2 +- .../api/v30/app102/RequestParams.java | 2 +- .../api/v30/app102/SpringDocApp102Test.java | 2 +- .../api/v30/app102/TestController.java | 2 +- .../springdoc/api/v30/app103/ExampleBody.java | 2 +- .../api/v30/app103/HelloController.java | 2 +- .../api/v30/app103/SpringDocApp103Test.java | 2 +- .../api/v30/app104/CrudController.java | 2 +- .../org/springdoc/api/v30/app104/Design.java | 2 +- .../api/v30/app104/DesignController.java | 2 +- .../springdoc/api/v30/app104/HavingPK.java | 2 +- .../api/v30/app104/SpringDocApp104Test.java | 2 +- .../api/v30/app105/SpringDocApp105Test.java | 10 +- .../springdoc/api/v30/app105/api/ApiUtil.java | 2 +- .../v30/app105/api/ExceptionTranslator.java | 2 +- .../api/v30/app105/api/HomeController.java | 2 +- .../api/v30/app105/api/pet/PetApi.java | 2 +- .../v30/app105/api/pet/PetApiController.java | 2 +- .../v30/app105/api/pet/PetApiDelegate.java | 2 +- .../app105/api/pet/PetApiDelegateImpl.java | 2 +- .../api/v30/app105/api/store/StoreApi.java | 2 +- .../app105/api/store/StoreApiController.java | 2 +- .../app105/api/store/StoreApiDelegate.java | 2 +- .../api/store/StoreApiDelegateImpl.java | 2 +- .../api/v30/app105/api/user/UserApi.java | 2 +- .../app105/api/user/UserApiController.java | 2 +- .../v30/app105/api/user/UserApiDelegate.java | 2 +- .../app105/api/user/UserApiDelegateImpl.java | 2 +- .../springdoc/api/v30/app105/model/Body.java | 2 +- .../springdoc/api/v30/app105/model/Body1.java | 2 +- .../api/v30/app105/model/Category.java | 2 +- .../v30/app105/model/ModelApiResponse.java | 2 +- .../springdoc/api/v30/app105/model/Order.java | 2 +- .../springdoc/api/v30/app105/model/Pet.java | 2 +- .../springdoc/api/v30/app105/model/Tag.java | 2 +- .../springdoc/api/v30/app105/model/User.java | 2 +- .../api/v30/app106/HelloController.java | 2 +- .../api/v30/app106/SpringDocApp106Test.java | 2 +- .../api/v30/app107/HelloController.java | 2 +- .../api/v30/app107/SpringDocApp107Test.java | 2 +- .../api/v30/app108/ActionResult.java | 2 +- .../api/v30/app108/HelloController.java | 2 +- .../api/v30/app108/SpringDocApp108Test.java | 2 +- .../api/v30/app109/HelloController.java | 2 +- .../api/v30/app109/SpringDocApp109Test.java | 2 +- .../api/v30/app11/HelloController.java | 2 +- .../api/v30/app11/SpringDocApp11Test.java | 2 +- .../api/v30/app110/ErrorMessage.java | 2 +- .../v30/app110/GlobalControllerAdvice.java | 7 +- .../org/springdoc/api/v30/app110/Person.java | 2 +- .../api/v30/app110/PersonController.java | 2 +- .../api/v30/app110/PersonController2.java | 2 +- .../org/springdoc/api/v30/app110/Problem.java | 2 +- .../api/v30/app110/SpringDocApp110Test.java | 2 +- .../api/v30/app111/ErrorMessage.java | 2 +- .../v30/app111/GlobalControllerAdvice.java | 7 +- .../org/springdoc/api/v30/app111/Person.java | 2 +- .../api/v30/app111/PersonController.java | 2 +- .../api/v30/app111/PersonController2.java | 2 +- .../org/springdoc/api/v30/app111/Problem.java | 2 +- .../api/v30/app111/SpringDocApp111Test.java | 2 +- .../api/v30/app112/ErrorMessage.java | 2 +- .../v30/app112/GlobalControllerAdvice.java | 7 +- .../org/springdoc/api/v30/app112/Person.java | 2 +- .../api/v30/app112/PersonController.java | 2 +- .../org/springdoc/api/v30/app112/Problem.java | 2 +- .../api/v30/app112/SpringDocApp112Test.java | 2 +- .../v30/app112/sample/PersonController2.java | 2 +- .../api/v30/app113/HelloController.java | 2 +- .../api/v30/app113/SpringDocApp113Test.java | 2 +- .../api/v30/app114/HelloController.java | 2 +- .../api/v30/app114/SpringDocApp114Test.java | 2 +- .../api/v30/app115/HelloController.java | 2 +- .../app115/JavaTimeOperationCustomizer.java | 2 +- .../api/v30/app115/SpringDocApp115Test.java | 2 +- .../api/v30/app116/FooErrorHandler.java | 2 +- .../api/v30/app116/HelloController.java | 2 +- .../api/v30/app116/SpringDocApp116Test.java | 2 +- .../api/v30/app117/HelloApplication.java | 2 +- .../api/v30/app117/SpringDocApp117Test.java | 2 +- .../api/v30/app118/AbstractParent.java | 2 +- .../api/v30/app118/ConcreteParent.java | 2 +- .../springdoc/api/v30/app118/Controller.java | 2 +- .../api/v30/app118/SpringDocApp118Test.java | 2 +- .../api/v30/app119/HelloController.java | 2 +- .../springdoc/api/v30/app119/JsonRequest.java | 2 +- .../api/v30/app119/SpringDocApp119Test.java | 2 +- .../api/v30/app12/HelloController.java | 2 +- .../api/v30/app12/SpringDocApp12Test.java | 2 +- .../springdoc/api/v30/app120/AccountId.java | 2 +- .../v30/app120/MetaAnnotationController.java | 2 +- .../api/v30/app120/SpringDocApp120Test.java | 2 +- .../v30/app121/InheritedRequestParams.java | 2 +- .../api/v30/app121/RequestParams.java | 2 +- .../api/v30/app121/SpringDocApp121Test.java | 2 +- .../api/v30/app121/TestController.java | 2 +- .../api/v30/app122/BaseController.java | 2 +- .../springdoc/api/v30/app122/BaseObject.java | 2 +- .../springdoc/api/v30/app122/CustomerDto.java | 2 +- .../api/v30/app122/FirstController.java | 2 +- .../api/v30/app122/SpringDocApp122Test.java | 2 +- .../org/springdoc/api/v30/app122/Wrapper.java | 2 +- .../api/v30/app123/HelloController.java | 2 +- .../api/v30/app123/MyExceptionHandler.java | 2 +- .../api/v30/app123/SpringDocApp123Test.java | 2 +- .../api/v30/app124/HelloController.java | 2 +- .../api/v30/app124/MyExceptionHandler.java | 2 +- .../api/v30/app124/SpringDocApp124Test.java | 2 +- .../api/v30/app126/HelloController.java | 2 +- .../org/springdoc/api/v30/app126/Problem.java | 2 +- ...SecurityProblemResponsesConfiguration.java | 2 +- .../api/v30/app126/SpringDocApp126Test.java | 2 +- .../api/v30/app127/AbstractObject.java | 2 +- .../api/v30/app127/ConcreteObjectA.java | 2 +- .../api/v30/app127/ConcreteType.java | 2 +- .../springdoc/api/v30/app127/Controller.java | 2 +- .../api/v30/app127/SpringDocApp127Test.java | 4 +- .../springdoc/api/v30/app127/Umbrella.java | 2 +- .../api/v30/app129/ActualReturnedEntity.java | 2 +- .../api/v30/app129/HelloController.java | 2 +- .../api/v30/app129/OperationResponse.java | 2 +- .../api/v30/app129/SpringDocApp129Test.java | 2 +- .../api/v30/app13/HelloController.java | 2 +- .../springdoc/api/v30/app13/PersonDTO.java | 2 +- .../api/v30/app13/SpringDocApp13Test.java | 2 +- .../api/v30/app130/HelloController.java | 2 +- .../api/v30/app130/SpringDocApp130Test.java | 2 +- .../springdoc/api/v30/app130/TrackerData.java | 2 +- .../api/v30/app131/HelloController.java | 2 +- .../api/v30/app131/Organization.java | 2 +- .../api/v30/app131/RestControllerError.java | 2 +- .../api/v30/app131/SpringDocApp131Test.java | 2 +- .../api/v30/app132/HelloController.java | 2 +- .../api/v30/app132/Organization.java | 2 +- .../api/v30/app132/RestControllerError.java | 2 +- .../api/v30/app132/SpringDocApp132Test.java | 2 +- .../api/v30/app133/HelloController.java | 2 +- .../api/v30/app133/SpringDocApp133Test.java | 2 +- .../api/v30/app134/HelloController.java | 2 +- .../api/v30/app134/OpenApiConfig.java | 2 +- .../api/v30/app134/SpringDocApp134Test.java | 12 +- .../org/springdoc/api/v30/app135/Book.java | 2 +- .../api/v30/app135/BookRepository.java | 2 +- .../springdoc/api/v30/app135/BookRouter.java | 2 +- .../api/v30/app135/SpringDocApp135Test.java | 2 +- .../api/v30/app136/OperationIdController.java | 2 +- .../api/v30/app136/SpringDocApp136Test.java | 2 +- .../api/v30/app137/HelloController.java | 2 +- .../api/v30/app137/OpenApiConfig.java | 2 +- .../api/v30/app137/SpringDocApp137Test.java | 2 +- .../api/v30/app138/HelloController.java | 2 +- .../api/v30/app138/SpringDocApp138Test.java | 4 +- .../api/v30/app139/HelloController.java | 2 +- .../api/v30/app139/SpringDocApp139Test.java | 2 +- .../api/v30/app14/HelloController.java | 2 +- .../api/v30/app14/SpringDocApp14Test.java | 2 +- .../api/v30/app140/HelloApplication.java | 2 +- .../api/v30/app140/SpringDocApp140Test.java | 2 +- .../org/springdoc/api/v30/app141/Book.java | 2 +- .../api/v30/app141/BookRepository.java | 2 +- .../springdoc/api/v30/app141/BookRouter.java | 2 +- .../api/v30/app141/SpringDocApp141Test.java | 2 +- .../api/v30/app142/HelloApplication.java | 2 +- .../api/v30/app142/SpringDocApp142Test.java | 2 +- .../api/v30/app143/HelloHiddenController.java | 2 +- .../api/v30/app143/SpringDocApp143Test.java | 2 +- .../api/v30/app149/HelloController.java | 2 +- .../api/v30/app149/HelloMessage.java | 2 +- .../api/v30/app149/HiddenHelloController.java | 2 +- .../api/v30/app149/SpringDocApp149Test.java | 2 +- .../api/v30/app15/HelloController.java | 2 +- .../api/v30/app15/SpringDocApp15Test.java | 2 +- .../api/v30/app150/HelloController.java | 2 +- .../api/v30/app150/SpringDocApp150Test.java | 2 +- .../api/v30/app151/HelloController.java | 2 +- .../api/v30/app151/SpringDocApp151Test.java | 2 +- .../api/v30/app152/HelloController.java | 2 +- .../api/v30/app152/SpringDocApp152Test.java | 2 +- .../springdoc/api/v30/app153/OrderState.java | 2 +- .../api/v30/app153/OrderStateMapper.java | 2 +- .../api/v30/app153/SpringDocApp153Test.java | 2 +- .../api/v30/app153/TestController.java | 2 +- .../api/v30/app154/HelloController.java | 2 +- .../api/v30/app154/OpenApiConfiguration.java | 2 +- .../api/v30/app154/SpringDocApp154Test.java | 2 +- .../app155/AbstractIntParameterObject.java | 2 +- .../v30/app155/AbstractParameterObject.java | 2 +- .../api/v30/app155/ConcreteEnum.java | 2 +- .../app155/ConcreteIntParameterObject.java | 2 +- .../v30/app155/ConcreteParameterObject.java | 2 +- .../api/v30/app155/HelloController.java | 2 +- .../api/v30/app155/SpringDocApp155Test.java | 2 +- .../api/v30/app156/HelloController.java | 2 +- .../springdoc/api/v30/app156/SomeEnum.java | 2 +- .../api/v30/app156/SpringDocApp156Test.java | 2 +- .../org/springdoc/api/v30/app156/User.java | 2 +- .../org/springdoc/api/v30/app157/Bar.java | 2 +- .../org/springdoc/api/v30/app157/Foo.java | 2 +- .../api/v30/app157/HelloController.java | 2 +- .../api/v30/app157/SpringDocApp157Test.java | 4 +- .../api/v30/app157/StringyConverter.java | 2 +- .../api/v30/app158/CommonFooErrorHandler.java | 2 +- .../springdoc/api/v30/app158/ErrorDTO.java | 2 +- .../api/v30/app158/HelloController.java | 2 +- .../springdoc/api/v30/app158/SimpleDTO.java | 2 +- .../v30/app158/SpecificFooErrorHandler.java | 2 +- .../api/v30/app158/SpringDocApp158Test.java | 2 +- .../api/v30/app159/CustomException.java | 2 +- .../org/springdoc/api/v30/app159/FooBean.java | 2 +- .../api/v30/app159/FooErrorHandler.java | 2 +- .../api/v30/app159/HelloController.java | 2 +- .../api/v30/app159/SpringDocApp159Test.java | 2 +- .../org/springdoc/api/v30/app159/Views.java | 2 +- .../api/v30/app16/HelloController.java | 2 +- .../api/v30/app16/SpringDocApp16Test.java | 4 +- .../api/v30/app160/HelloController.java | 2 +- .../api/v30/app160/SpringDocApp160Test.java | 4 +- .../api/v30/app161/HelloController.java | 2 +- .../api/v30/app161/SpringDocApp161Test.java | 4 +- .../api/v30/app162/OpenApiConfig.java | 2 +- .../api/v30/app162/SpringDocApp162Test.java | 4 +- .../api/v30/app163/CommissionDto.java | 2 +- .../api/v30/app163/CommissionsResource.java | 2 +- .../app163/ExampleRegistrationCustomizer.java | 2 +- .../springdoc/api/v30/app163/Examples.java | 2 +- .../api/v30/app163/SpringDocApp163Test.java | 2 +- .../api/v30/app164/SampleResponseClass.java | 2 +- .../api/v30/app164/SpringDocApp164Test.java | 2 +- .../api/v30/app164/TestApiController.java | 2 +- .../api/v30/app165/HelloController.java | 2 +- .../api/v30/app165/SpringDocApp165Test.java | 2 +- .../v30/app166/GlobalErrorResponseDto.java | 2 +- .../v30/app166/GlobalExceptionHandler.java | 2 +- .../api/v30/app166/LocalErrorResponseDto.java | 2 +- .../api/v30/app166/SpringDocApp166Test.java | 2 +- .../api/v30/app166/TestApiController.java | 2 +- .../api/v30/app167/HelloController.java | 2 +- .../api/v30/app167/SpringDocApp167Test.java | 2 +- .../api/v30/app168/AbstractParent.java | 2 +- .../api/v30/app168/ConcreteParent.java | 2 +- .../springdoc/api/v30/app168/Controller.java | 2 +- .../api/v30/app168/SpringDocApp168Test.java | 2 +- .../DefaultRequestMappingHandlerMapping.java | 2 +- .../app169/DefaultWebMvcRegistrations.java | 2 +- .../api/v30/app169/SpringDocApp169Test.java | 2 +- .../api/v30/app169/TestController.java | 2 +- .../api/v30/app17/HelloController.java | 2 +- .../api/v30/app17/SpringDocApp17Test.java | 2 +- .../api/v30/app170/HelloController.java | 2 +- .../api/v30/app170/SpringDocApp170Test.java | 4 +- .../api/v30/app171/HelloLocaleController.java | 2 +- .../api/v30/app171/SpringDocApp171Test.java | 2 +- .../api/v30/app172/HelloController.java | 2 +- .../api/v30/app172/SpringDocApp172Test.java | 4 +- .../api/v30/app173/HelloController.java | 2 +- .../api/v30/app173/SpringDocApp173Test.java | 2 +- .../api/v30/app177/AnnotatedController.java | 2 +- .../api/v30/app177/SpringDocApp177Test.java | 2 +- .../api/v30/app178/AnnotatedController.java | 2 +- .../api/v30/app178/SpringDocApp178Test.java | 2 +- .../api/v30/app179/HelloController.java | 2 +- .../api/v30/app179/MyConfiguration.java | 2 +- .../api/v30/app179/MyIdPathVariable.java | 2 +- .../org/springdoc/api/v30/app179/MyObj.java | 2 +- .../api/v30/app179/MyObjArgumentResolver.java | 2 +- .../v30/app179/MyPathParameterCustomizer.java | 2 +- .../api/v30/app179/SpringDocApp179Test.java | 2 +- .../api/v30/app18/HelloController.java | 2 +- .../api/v30/app18/SpringDocApp18Test.java | 2 +- .../org/springdoc/api/v30/app180/Body.java | 2 +- .../api/v30/app180/MapExclusion.java | 2 +- .../springdoc/api/v30/app180/RESTService.java | 2 +- .../api/v30/app180/SpringDocApp180Test.java | 2 +- .../v30/app181/AbstractParameterObject.java | 2 +- .../v30/app181/ConcreteParameterObject.java | 2 +- .../api/v30/app181/HelloController.java | 2 +- .../api/v30/app181/SpringDocApp181Test.java | 2 +- .../api/v30/app182/HelloController.java | 2 +- .../api/v30/app182/SpringDocApp182Test.java | 2 +- .../api/v30/app183/HelloController.java | 2 +- .../api/v30/app183/SpringDocApp183Test.java | 2 +- .../org/springdoc/api/v30/app183/User.java | 2 +- .../api/v30/app183/UserConverter.java | 2 +- .../springdoc/api/v30/app183/WebConfig.java | 2 +- .../api/v30/app184/HelloController.java | 2 +- .../api/v30/app184/SpringDocApp184Test.java | 8 +- .../org/springdoc/api/v30/app185/Cat.java | 2 +- .../org/springdoc/api/v30/app185/Dog.java | 2 +- .../org/springdoc/api/v30/app185/Pet.java | 2 +- .../api/v30/app185/PetController.java | 2 +- .../api/v30/app185/SpringDocApp185Test.java | 2 +- .../api/v30/app187/HelloController.java | 2 +- .../api/v30/app187/SpringDocApp187Test.java | 2 +- .../org/springdoc/api/v30/app188/FooBar.java | 2 +- .../api/v30/app188/FooBarConverter.java | 2 +- .../api/v30/app188/HelloController.java | 2 +- .../api/v30/app188/SpringDocApp188Test.java | 2 +- .../api/v30/app189/SpringDocApp189Test.java | 2 +- .../api/v30/app19/HelloController.java | 2 +- .../api/v30/app19/SpringDocApp19Test.java | 2 +- .../api/v30/app190/HelloController.java | 2 +- .../api/v30/app190/SpringDocApp190Test.java | 2 +- .../api/v30/app192/HelloController.java | 2 +- .../api/v30/app192/SpringDocApp192Test.java | 2 +- .../api/v30/app192/SpringDocTestApp.java | 2 +- .../api/v30/app193/SpringDocApp193Test.java | 4 +- .../api/v30/app194/SpringDocApp194Test.java | 2 +- .../api/v30/app195/SpringDocApp195Test.java | 2 +- .../api/v30/app196/SpringDocApp196Test.java | 2 +- .../api/v30/app197/SpringDocApp197Test.java | 2 +- .../api/v30/app198/SpringDocApp198Test.java | 2 +- .../api/v30/app199/HelloController.java | 2 +- .../api/v30/app199/SpringDocApp199Test.java | 2 +- .../api/v30/app2/SpringDocApp2Test.java | 2 +- .../springdoc/api/v30/app2/api/ApiUtil.java | 2 +- .../api/v30/app2/api/ExceptionTranslator.java | 2 +- .../api/v30/app2/api/HomeController.java | 2 +- .../springdoc/api/v30/app2/api/PetApi.java | 2 +- .../api/v30/app2/api/PetApiController.java | 2 +- .../api/v30/app2/api/PetApiDelegate.java | 2 +- .../api/v30/app2/api/PetApiDelegateImpl.java | 2 +- .../springdoc/api/v30/app2/api/StoreApi.java | 2 +- .../api/v30/app2/api/StoreApiController.java | 2 +- .../api/v30/app2/api/StoreApiDelegate.java | 2 +- .../v30/app2/api/StoreApiDelegateImpl.java | 2 +- .../springdoc/api/v30/app2/api/UserApi.java | 2 +- .../api/v30/app2/api/UserApiController.java | 2 +- .../api/v30/app2/api/UserApiDelegate.java | 2 +- .../api/v30/app2/api/UserApiDelegateImpl.java | 2 +- .../springdoc/api/v30/app2/model/Body.java | 2 +- .../springdoc/api/v30/app2/model/Body1.java | 105 --------- .../api/v30/app2/model/Category.java | 2 +- .../api/v30/app2/model/ModelApiResponse.java | 2 +- .../springdoc/api/v30/app2/model/Order.java | 2 +- .../org/springdoc/api/v30/app2/model/Pet.java | 2 +- .../org/springdoc/api/v30/app2/model/Tag.java | 2 +- .../springdoc/api/v30/app2/model/User.java | 2 +- .../api/v30/app20/HelloController.java | 2 +- .../api/v30/app20/SpringDocApp20Test.java | 2 +- .../api/v30/app200/SpringDocApp200Test.java | 2 +- .../api/v30/app201/SpringDocApp201Test.java | 2 +- .../api/v30/app203/SpringDocApp203Test.java | 2 +- .../api/v30/app209/SpringDocApp209Test.java | 2 +- .../api/v30/app21/HelloController.java | 2 +- .../api/v30/app21/SpringDocApp21Test.java | 2 +- .../api/v30/app210/SpringDocApp210Test.java | 2 +- .../api/v30/app214/SpringDocApp214Test.java | 2 +- .../api/v30/app215/SpringDocApp215Test.java | 2 +- .../v30/app215/SpringDocApp215bisTest.java | 2 +- .../api/v30/app216/HelloController.java | 2 +- .../api/v30/app217/SpringDocApp217Test.java | 4 +- .../api/v30/app219/HelloController.java | 2 +- .../api/v30/app219/SpringDocApp219Test.java | 2 +- .../springdoc/api/v30/app219/TestObject.java | 2 +- .../api/v30/app22/HelloController.java | 2 +- .../springdoc/api/v30/app22/PersonDTO.java | 2 +- .../api/v30/app22/SpringDocApp22Test.java | 2 +- .../api/v30/app220/SpringDocApp220Test.java | 2 +- .../api/v30/app221/SpringDocApp221Test.java | 2 +- .../api/v30/app222/SpringDocApp222Test.java | 2 +- .../api/v30/app223/SpringDocApp223Test.java | 2 +- .../api/v30/app224/SpringDocApp224Test.java | 2 +- .../api/v30/app225/SpringDocApp225Test.java | 2 +- .../api/v30/app226/SpringDocApp226Test.java | 2 +- .../v30/app227/wrapper/NoGenericWrapper.java | 3 +- .../api/v30/app228/SpringDocApp228Test.java | 2 +- .../api/v30/app23/HelloController.java | 2 +- .../api/v30/app23/SpringDocApp23Test.java | 2 +- .../api/v30/app24/HelloController.java | 2 +- .../api/v30/app24/SpringDocApp24Test.java | 2 +- .../api/v30/app24/SpringDocTestApp.java | 2 +- .../api/v30/app25/HelloController.java | 2 +- .../api/v30/app25/SpringDocApp25Test.java | 2 +- .../test/org/springdoc/api/v30/app26/Bar.java | 2 +- .../test/org/springdoc/api/v30/app26/Foo.java | 2 +- .../api/v30/app26/HelloController.java | 2 +- .../org/springdoc/api/v30/app26/MyModel.java | 2 +- .../api/v30/app26/SpringDocApp26Test.java | 2 +- .../org/springdoc/api/v30/app27/Advice.java | 2 +- .../test/org/springdoc/api/v30/app27/Bar.java | 2 +- .../test/org/springdoc/api/v30/app27/Foo.java | 2 +- .../api/v30/app27/HelloController.java | 2 +- .../springdoc/api/v30/app27/MyException.java | 2 +- .../api/v30/app27/SpringDocApp27Test.java | 4 +- .../api/v30/app28/HelloController.java | 2 +- .../api/v30/app28/SpringDocApp28Test.java | 2 +- .../api/v30/app29/HelloController.java | 2 +- .../api/v30/app29/SpringDocApp29Test.java | 2 +- .../springdoc/api/v30/app29/TrackerData.java | 2 +- .../api/v30/app30/HelloController.java | 2 +- .../api/v30/app30/SpringDocApp30Test.java | 2 +- .../api/v30/app31/HelloController.java | 2 +- .../api/v30/app31/SpringDocApp31Test.java | 2 +- .../api/v30/app32/HelloController.java | 2 +- .../api/v30/app32/SpringDocApp32Test.java | 2 +- .../api/v30/app33/HelloController.java | 2 +- .../api/v30/app33/SpringDocApp33Test.java | 2 +- .../api/v30/app34/HelloController.java | 2 +- .../api/v30/app34/MyExceptionHandler.java | 2 +- .../api/v30/app34/SpringDocApp34Test.java | 2 +- .../api/v30/app35/HelloController.java | 2 +- .../api/v30/app35/SpringDocApp35Test.java | 2 +- .../test/org/springdoc/api/v30/app37/Bar.java | 2 +- .../test/org/springdoc/api/v30/app37/Car.java | 2 +- .../test/org/springdoc/api/v30/app37/Foo.java | 2 +- .../api/v30/app37/HelloController.java | 2 +- .../test/org/springdoc/api/v30/app37/Pet.java | 2 +- .../api/v30/app37/SpringDocApp37Test.java | 2 +- .../api/v30/app38/HelloController.java | 2 +- .../api/v30/app38/SpringDocApp38Test.java | 2 +- .../api/v30/app39/HelloController.java | 2 +- .../api/v30/app39/SpringDocApp39Test.java | 2 +- .../api/v30/app39/SpringDocTestApp.java | 2 +- .../api/v30/app4/HelloController.java | 2 +- .../api/v30/app4/SpringDocApp4Test.java | 2 +- .../springdoc/api/v30/app4/TrackerData.java | 2 +- .../api/v30/app40/HelloController.java | 2 +- .../api/v30/app40/SpringDocApp40Test.java | 2 +- .../api/v30/app41/HelloController.java | 2 +- .../api/v30/app41/SpringDocApp411Test.java | 4 +- .../api/v30/app41/SpringDocApp41Test.java | 4 +- .../api/v30/app42/HelloController.java | 2 +- .../api/v30/app42/SpringDocApp42Test.java | 2 +- .../org/springdoc/api/v30/app42/TweetId.java | 2 +- .../api/v30/app43/HelloController.java | 2 +- .../api/v30/app43/SpringDocApp43Test.java | 2 +- .../api/v30/app44/HelloController.java | 2 +- .../api/v30/app44/SpringDocApp44Test.java | 2 +- .../api/v30/app45/HelloController.java | 2 +- .../api/v30/app45/HelloController2.java | 2 +- .../api/v30/app45/OpenApiConfig.java | 2 +- .../springdoc/api/v30/app45/PersonDTO.java | 2 +- .../api/v30/app45/SpringDocApp45Test.java | 2 +- .../api/v30/app46/HelloController.java | 2 +- .../api/v30/app46/SpringDocApp46Test.java | 2 +- .../api/v30/app47/HelloController.java | 2 +- .../api/v30/app47/SpringDocApp47Test.java | 2 +- .../v30/app48/AbstractHelloController.java | 2 +- .../api/v30/app48/HelloController.java | 2 +- .../api/v30/app48/SpringDocApp48Test.java | 2 +- .../api/v30/app49/HelloController.java | 2 +- .../api/v30/app49/SpringDocApp49Test.java | 2 +- .../api/v30/app49/SpringDocTestApp.java | 2 +- .../api/v30/app5/CustomOpenAPIConfig.java | 2 +- ...gurationComponentsSecuritySchemesTest.java | 8 +- ...penApiResourceCustomConfigurationTest.java | 4 +- .../OpenApiResourceNoConfigurationTest.java | 4 +- .../api/v30/app50/HelloController.java | 2 +- .../api/v30/app50/SpringDocApp50Test.java | 2 +- .../api/v30/app50/SpringDocTestApp.java | 2 +- .../api/v30/app51/HelloController.java | 2 +- .../api/v30/app51/SpringDocApp51Test.java | 2 +- .../api/v30/app52/HelloController.java | 2 +- .../api/v30/app52/SpringDocApp52Test.java | 2 +- .../api/v30/app53/HelloController.java | 2 +- .../HelloControllerWithGlobalApiResponse.java | 2 +- .../api/v30/app53/SpringDocApp53Test.java | 2 +- .../api/v30/app54/HelloController.java | 2 +- .../springdoc/api/v30/app54/MealParty.java | 2 +- .../api/v30/app54/SpringDocApp54Test.java | 2 +- .../org/springdoc/api/v30/app54/Views.java | 2 +- .../api/v30/app55/HelloController.java | 2 +- .../api/v30/app55/SpringDocApp55Test.java | 2 +- .../api/v30/app56/GlobalExceptionHandler.java | 2 +- .../api/v30/app56/HelloController.java | 2 +- .../api/v30/app56/SpringDocApp56Test.java | 2 +- .../api/v30/app57/HelloController.java | 2 +- .../api/v30/app57/SpringDocApp57Test.java | 2 +- .../api/v30/app58/HelloController.java | 2 +- .../api/v30/app58/SpringDocApp58Test.java | 2 +- .../springdoc/api/v30/app59/HelloBody.java | 2 +- .../api/v30/app59/HelloController.java | 2 +- .../api/v30/app59/HelloController2.java | 2 +- .../api/v30/app59/HelloExceptionHandler.java | 2 +- .../api/v30/app59/SpringDocApp59Test.java | 2 +- .../api/v30/app6/HelloController.java | 2 +- .../api/v30/app6/SpringDocApp6Test.java | 2 +- .../api/v30/app60/HelloController.java | 2 +- .../springdoc/api/v30/app60/QueryPaging.java | 2 +- .../springdoc/api/v30/app60/QuerySort.java | 2 +- .../api/v30/app60/SpringDocApp60Test.java | 2 +- .../api/v30/app61/HelloController.java | 2 +- .../api/v30/app61/SpringDocApp61Test.java | 2 +- .../api/v30/app62/BaseController.java | 2 +- .../api/v30/app62/SpringDocApp62Test.java | 2 +- .../api/v30/app62/TestController.java | 2 +- .../api/v30/app63/HelloController.java | 2 +- .../api/v30/app63/SpringDocApp63Test.java | 2 +- .../api/v30/app64/HelloController.java | 2 +- .../api/v30/app64/SpringDocApp64Test.java | 2 +- .../api/v30/app65/HelloController.java | 2 +- .../api/v30/app65/SpringDocApp65Test.java | 2 +- .../api/v30/app66/DefaultHealthCheckApi.java | 2 +- .../api/v30/app66/HelloController.java | 2 +- .../api/v30/app66/SpringDocApp66Test.java | 2 +- .../api/v30/app66/UndocumentedClass.java | 2 +- .../api/v30/app67/HelloController.java | 2 +- .../api/v30/app67/SpringDocApp67Test.java | 2 +- .../api/v30/app69/HelloController.java | 2 +- .../springdoc/api/v30/app69/PersonDTO.java | 2 +- .../api/v30/app69/SpringDocApp69Test.java | 2 +- .../api/v30/app7/HelloController.java | 2 +- .../api/v30/app7/SpringDocApp7Test.java | 2 +- .../api/v30/app70/HelloController.java | 2 +- .../api/v30/app70/SpringDocApp70Test.java | 2 +- .../app70/customizer/CustomizedOperation.java | 2 +- .../app70/customizer/CustomizedParameter.java | 2 +- .../app70/customizer/CustomizedProperty.java | 2 +- .../app70/customizer/OperationCustomizer.java | 2 +- .../app70/customizer/ParameterCustomizer.java | 2 +- .../app70/customizer/PropertyCustomizer.java | 2 +- .../api/v30/app70/model/ApiType.java | 2 +- .../test/org/springdoc/api/v30/app71/Dog.java | 2 +- .../api/v30/app71/HelloController.java | 2 +- .../api/v30/app71/SpringDocApp71Test.java | 2 +- .../app72/BlockingAutoConfigurationTest.java | 14 +- .../app72/CacheAutoConfigurationTest1.java | 10 +- .../v30/app72/GroupAutoConfigurationTest.java | 4 +- .../api/v30/app73/HelloController.java | 2 +- .../api/v30/app73/SpringDocApp73Test.java | 2 +- .../api/v30/app74/HelloController.java | 2 +- .../api/v30/app74/SpringDocApp74Test.java | 2 +- .../api/v30/app75/HelloController.java | 2 +- .../springdoc/api/v30/app75/PersonDTO.java | 2 +- .../RestResponseEntityExceptionHandler.java | 2 +- .../api/v30/app75/SpringDocApp75Test.java | 2 +- .../api/v30/app76/HelloController.java | 2 +- .../api/v30/app76/SpringDocApp76Test.java | 2 +- .../api/v30/app77/HelloController.java | 2 +- .../api/v30/app77/SpringDocApp77Test.java | 2 +- .../api/v30/app78/HelloController.java | 2 +- .../springdoc/api/v30/app78/PersonDTO.java | 2 +- .../api/v30/app78/SpringDocApp78Test.java | 2 +- .../api/v30/app79/HelloController.java | 2 +- .../api/v30/app79/SpringDocApp79Test.java | 2 +- .../api/v30/app8/HelloController.java | 2 +- .../api/v30/app8/SpringDocApp8Test.java | 4 +- .../api/v30/app80/HelloController.java | 2 +- .../api/v30/app80/SpringDocApp80Test.java | 2 +- .../springdoc/api/v30/app80/TestObject.java | 2 +- .../api/v30/app81/HelloController.java | 2 +- .../api/v30/app81/SpringDocApp81Test.java | 4 +- .../api/v30/app82/HelloController.java | 2 +- .../springdoc/api/v30/app82/PersonDTO.java | 2 +- .../api/v30/app82/SpringDocApp82Test.java | 2 +- .../api/v30/app83/HelloController.java | 2 +- .../springdoc/api/v30/app83/PersonDTO.java | 2 +- .../api/v30/app83/SpringDocApp83Test.java | 2 +- .../api/v30/app84/HelloController.java | 2 +- .../api/v30/app84/SpringDocApp84Test.java | 2 +- .../api/v30/app85/HelloController.java | 2 +- .../api/v30/app85/SpringDocApp85Test.java | 2 +- .../api/v30/app86/HelloController.java | 2 +- .../api/v30/app86/SpringDocApp86Test.java | 2 +- .../api/v30/app86/test/HelloController2.java | 2 +- .../api/v30/app87/HelloController.java | 2 +- .../api/v30/app87/SpringDocApp87Test.java | 2 +- .../api/v30/app88/HelloController.java | 2 +- .../api/v30/app88/SpringDocApp88Test.java | 2 +- .../api/v30/app89/HelloController.java | 2 +- .../api/v30/app89/SpringDocApp89Test.java | 2 +- .../org/springdoc/api/v30/app9/MyApi.java | 2 +- .../api/v30/app9/MyApiController.java | 2 +- .../api/v30/app9/SpringDocApp9Test.java | 2 +- .../api/v30/app90/HelloController.java | 2 +- .../api/v30/app90/SpringDocApp90Test.java | 2 +- .../api/v30/app90/SpringDocTestApp.java | 2 +- .../org/springdoc/api/v30/app90/User.java | 2 +- .../org/springdoc/api/v30/app91/Advice.java | 2 +- .../org/springdoc/api/v30/app91/ApiError.java | 2 +- .../org/springdoc/api/v30/app91/Greeting.java | 2 +- .../api/v30/app91/GreetingController.java | 2 +- .../api/v30/app91/SpringDocApp91Test.java | 2 +- .../api/v30/app92/HelloController.java | 2 +- .../api/v30/app92/ParameterCustomizer.java | 2 +- .../api/v30/app92/SpringDocApp92Test.java | 2 +- .../api/v30/app93/BaseClientModel.java | 2 +- .../api/v30/app93/BaseController.java | 2 +- .../api/v30/app93/SpecificClientModel.java | 2 +- .../api/v30/app93/SpecificController.java | 2 +- .../api/v30/app93/SpringDocApp93Test.java | 2 +- .../api/v30/app94/SpringDocApp94Test.java | 2 +- .../api/v30/app95/HelloController.java | 2 +- .../api/v30/app95/SpringDocApp95Test.java | 2 +- .../api/v30/app96/HelloController.java | 2 +- .../api/v30/app96/SpringDocApp96Test.java | 2 +- .../api/v30/app97/HelloController.java | 2 +- .../api/v30/app97/SpringDocApp97Test.java | 2 +- .../springdoc/api/v30/app97/StudentV1.java | 2 +- .../springdoc/api/v30/app97/StudentV2.java | 2 +- .../springdoc/api/v30/app97/StudentV3.java | 2 +- .../api/v30/app98/HelloController.java | 2 +- .../v30/app98/IgnoredAnnotationParameter.java | 2 +- .../api/v30/app98/SpringDocApp98Test.java | 2 +- .../api/v30/app99/HelloController.java | 2 +- .../api/v30/app99/SpringDocApp99Test.java | 2 +- .../api/v31/AbstractSpringDocV31Test.java | 4 +- .../springdoc/api/v31/app1/ApiException.java | 39 ---- .../api/v31/app1/ApiOriginFilter.java | 55 ----- .../api/v31/app1/ApiResponseMessage.java | 100 -------- .../springdoc/api/v31/app1/ErrorMessage.java | 2 +- .../api/v31/app1/ExceptionTranslator.java | 2 +- .../api/v31/app1/HelloController.java | 2 +- .../api/v31/app1/HomeController.java | 2 +- .../springdoc/api/v31/app1/InventoryApi.java | 2 +- .../api/v31/app1/InventoryApiController.java | 2 +- .../springdoc/api/v31/app1/InventoryItem.java | 2 +- .../api/v31/app1/ItemController.java | 2 +- .../org/springdoc/api/v31/app1/ItemDTO.java | 2 +- .../springdoc/api/v31/app1/ItemLightDTO.java | 2 +- .../springdoc/api/v31/app1/Manufacturer.java | 2 +- .../api/v31/app1/PeopleRestService.java | 2 +- .../org/springdoc/api/v31/app1/PersonDTO.java | 2 +- .../api/v31/app1/SpringDocApp1Test.java | 2 +- .../api/v31/app2/SpringDocApp2Test.java | 2 +- .../springdoc/api/v31/app2/api/ApiUtil.java | 2 +- .../api/v31/app2/api/ExceptionTranslator.java | 2 +- .../api/v31/app2/api/HomeController.java | 2 +- .../springdoc/api/v31/app2/api/PetApi.java | 2 +- .../api/v31/app2/api/PetApiController.java | 2 +- .../api/v31/app2/api/PetApiDelegate.java | 2 +- .../api/v31/app2/api/PetApiDelegateImpl.java | 2 +- .../springdoc/api/v31/app2/api/StoreApi.java | 2 +- .../api/v31/app2/api/StoreApiController.java | 2 +- .../api/v31/app2/api/StoreApiDelegate.java | 2 +- .../v31/app2/api/StoreApiDelegateImpl.java | 2 +- .../springdoc/api/v31/app2/api/UserApi.java | 2 +- .../api/v31/app2/api/UserApiController.java | 2 +- .../api/v31/app2/api/UserApiDelegate.java | 2 +- .../api/v31/app2/api/UserApiDelegateImpl.java | 2 +- .../springdoc/api/v31/app2/model/Body.java | 2 +- .../springdoc/api/v31/app2/model/Body1.java | 105 --------- .../api/v31/app2/model/Category.java | 2 +- .../api/v31/app2/model/ModelApiResponse.java | 2 +- .../springdoc/api/v31/app2/model/Order.java | 2 +- .../org/springdoc/api/v31/app2/model/Pet.java | 2 +- .../org/springdoc/api/v31/app2/model/Tag.java | 2 +- .../springdoc/api/v31/app2/model/User.java | 2 +- .../api/v31/app4/HelloController.java | 2 +- .../api/v31/app4/SpringDocApp4Test.java | 2 +- .../springdoc/api/v31/app4/TrackerData.java | 2 +- .../api/v31/app5/SpringDocApp5Test.java | 2 +- .../org/springdoc/api/v31/app6/DummyData.java | 2 +- .../api/v31/app6/GetBodyController.java | 2 +- .../api/v31/app6/SpringDocApp6Test.java | 2 +- .../springdoc/webmvc/ui/SwaggerConfig.java | 2 +- .../webmvc/ui/SwaggerConfigResource.java | 2 +- .../ui/SwaggerIndexPageTransformer.java | 2 +- .../webmvc/ui/SwaggerIndexTransformer.java | 2 +- .../springdoc/webmvc/ui/SwaggerUiHome.java | 2 +- .../webmvc/ui/SwaggerWebMvcConfigurer.java | 2 +- .../webmvc/ui/SwaggerWelcomeActuator.java | 2 +- .../webmvc/ui/SwaggerWelcomeCommon.java | 4 +- .../webmvc/ui/SwaggerWelcomeWebMvc.java | 2 +- .../ui/AbstractSpringDocActuatorTest.java | 2 +- .../springdoc/ui/AbstractSpringDocTest.java | 2 +- .../springdoc/ui/app1/SpringDocApp1Test.java | 4 +- .../SpringDocAppRedirectWithPrefixTest.java | 2 +- .../ui/app1/SpringDocConfigPathsTest.java | 2 +- .../ui/app1/SpringDocRedirectDefaultTest.java | 2 +- .../ui/app1/SpringDocRedirectFilterTest.java | 2 +- ...ingDocRedirectOriginalQueryParamsTest.java | 4 +- .../ui/app1/SpringDocSwaggerConfigTest.java | 2 +- ...rConfigWithBothFileGeneratedSpecsTest.java | 2 +- .../ui/app10/SpringDocApp10Test.java | 4 +- .../ui/app13/SpringDocApp13Test.java | 4 +- .../ui/app14/SpringDocApp14Test.java | 4 +- .../ui/app15/SpringDocApp15Test.java | 4 +- .../ui/app16/SpringDocApp16Test.java | 4 +- .../ui/app18/SpringDocApp18Test.java | 2 +- .../ui/app19/SpringDocApp19Test.java | 2 +- .../springdoc/ui/app2/SpringDocApp2Test.java | 2 +- .../ui/app21/SpringDocApp21Test.java | 4 +- .../ui/app22/SpringDocApp22Test.java | 2 +- .../springdoc/ui/app22/SpringDocTestApp.java | 2 +- .../ui/app24/SpringDocApp24Test.java | 2 +- .../ui/app25/SpringDocApp25Test.java | 2 +- .../ui/app26/SpringDocApp26Test.java | 2 +- .../ui/app27/SpringDocApp27Test.java | 2 +- .../ui/app28/SpringDocApp28Test.java | 2 +- .../ui/app29/SpringDocApp29Test.java | 2 +- .../springdoc/ui/app3/SpringDocApp3Test.java | 4 +- .../ui/app30/SpringDocApp30Test.java | 2 +- .../ui/app31/SpringDocApp31Test.java | 2 +- .../ui/app32/SpringDocBehindProxyTest.java | 12 +- ...ingDocBehindProxyWithCustomUIPathTest.java | 6 +- ...dProxyWithCustomUIPathWithApiDocsTest.java | 6 +- .../ui/app33/SpringDocApp33Test.java | 2 +- .../ui/app34/SpringDocApp34Test.java | 2 +- .../ui/app35/SpringDocApp35Test.java | 2 +- .../springdoc/ui/app4/SpringDocApp4Test.java | 2 +- .../springdoc/ui/app4/SpringDocTestApp.java | 2 +- .../springdoc/ui/app5/SpringDocApp5Test.java | 2 +- .../ui/app5/SpringDocOauthPathsTest.java | 2 +- .../SpringDocOauthPathsWithPropertyTest.java | 2 +- ...ingDocOauthRedirectUrlRecalculateTest.java | 2 +- .../app5/SpringDocOauthServletPathsTest.java | 4 +- .../SpringDocSwaggerUiUrlPropertyTest.java | 2 +- .../springdoc/ui/app7/SpringDocApp7Test.java | 2 +- ...ltipleUrlsSeveralParallelRequestsTest.java | 2 +- .../springdoc/ui/app8/SpringDocApp8Test.java | 2 +- .../springdoc/ui/app9/SpringDocApp9Test.java | 2 +- .../api/AbstractSpringDocActuatorTest.java | 2 +- .../springdoc/api/AbstractSpringDocTest.java | 2 +- .../api/app144/SpringDocApp144Test.java | 4 +- .../api/app145/SpringDocApp1451Test.java | 4 +- .../api/app145/SpringDocApp1452Test.java | 2 +- .../api/app145/SpringDocApp145Test.java | 6 +- .../api/app146/SpringDocApp146Test.java | 4 +- .../api/app147/SpringDocApp147Test.java | 6 +- .../api/app148/SpringDocApp148Test.java | 6 +- .../api/app186/SpringDocApp186Test.java | 10 +- .../api/app76/SpringDocApp76Test.java | 2 +- .../api/AbstractSpringDocActuatorTest.java | 2 +- .../springdoc/api/AbstractSpringDocTest.java | 2 +- .../api/app128/SpringDocApp128Test.java | 2 +- .../api/app144/SpringDocApp144Test.java | 4 +- .../api/app145/SpringDocApp145Test.java | 10 +- .../api/app147/SpringDocApp147Test.java | 8 +- .../api/app148/SpringDocApp148Test.java | 8 +- .../api/app186/SpringDocApp186Test.java | 10 +- .../api/app36/SpringDocApp36Test.java | 2 +- .../api/app68/SpringDocApp68Test.java | 15 +- ...stApp.java => SpringDocConfiguration.java} | 12 +- .../app72/BlockingAutoConfigurationTest.java | 12 +- .../app72/CacheAutoConfigurationTest1.java | 8 +- .../api/app72/GroupAutoConfigurationTest.java | 2 +- .../springdoc/api/AbstractSpringDocTest.java | 2 +- .../test/org/springdoc/api/app20/Bank.java | 4 - .../springdoc/api/app20/BankRepository.java | 2 - .../api/app301/SpringDocApp301Test.java | 16 +- .../springdoc/api/app36/EnumFieldHolder.java | 2 +- .../api/app36/EnumFieldHolderRepository.java | 2 +- .../api/app36/SpringDocApp36Test.java | 2 +- .../api/app37/SpringDocApp37Test.java | 2 +- .../api/app6/EmployeeController.java | 6 - .../springdoc/api/app9/SpringDocApp9Test.java | 16 +- .../api/AbstractSpringDocFunctionTest.java | 2 +- .../springdoc/api/AbstractSpringDocTest.java | 2 +- .../springdoc/api/app174/HelloController.java | 2 +- .../springdoc/api/AbstractSpringDocTest.java | 2 +- .../springdoc/api/app191/HelloController.java | 2 +- .../org/springdoc/api/app191/PersonDTO.java | 2 +- .../api/app191/SpringDocApp191Test.java | 2 +- .../springdoc/api/AbstractSpringDocTest.java | 4 +- .../api/app10/SpringDocApp10DirectTest.java | 2 +- .../app10/SpringDocApp10NotSpecifiedTest.java | 2 +- .../api/app10/SpringDocApp10ViaDtoTest.java | 2 +- .../api/app3/EmployeeController.java | 6 - .../app5/hateoas/CompanyModelAssembler.java | 3 +- .../springdoc/api/app6/SpringDocApp6Test.java | 26 +-- .../application/FooResourceAssembler.java | 2 +- .../springdoc/api/app8/SpringDocApp8Test.java | 16 +- .../springdoc/api/AbstractSpringDocTest.java | 2 +- .../springdoc/api/app1/ApiOriginFilter.java | 2 +- .../api/app1/ApiResponseMessage.java | 2 +- .../org/springdoc/api/app1/ErrorMessage.java | 2 +- .../api/app1/ExceptionTranslator.java | 2 +- .../springdoc/api/app1/HelloController.java | 2 +- .../springdoc/api/app1/HomeController.java | 2 +- .../api/app1/InventoryApiController.java | 2 +- .../org/springdoc/api/app1/InventoryItem.java | 2 +- .../springdoc/api/app1/ItemController.java | 2 +- .../test/org/springdoc/api/app1/ItemDTO.java | 2 +- .../org/springdoc/api/app1/ItemLightDTO.java | 2 +- .../org/springdoc/api/app1/Manufacturer.java | 2 +- .../springdoc/api/app1/PeopleRestService.java | 2 +- .../org/springdoc/api/app1/PersonDTO.java | 2 +- .../springdoc/api/app1/SpringDocApp1Test.java | 2 +- .../springdoc/api/app10/HelloController.java | 2 +- .../api/app10/SpringDocApp10Test.java | 2 +- .../springdoc/api/app100/HelloController.java | 2 +- .../org/springdoc/api/app100/PersonDTO.java | 2 +- .../api/app100/SpringDocApp100Test.java | 2 +- .../springdoc/api/app101/HelloController.java | 2 +- .../org/springdoc/api/app101/HelloDTO.java | 2 +- .../api/app101/SpringDocApp101Test.java | 2 +- .../api/app102/InheritedRequestParams.java | 2 +- .../springdoc/api/app102/RequestParams.java | 2 +- .../api/app102/SpringDocApp102Test.java | 2 +- .../springdoc/api/app102/TestController.java | 2 +- .../org/springdoc/api/app103/ExampleBody.java | 2 +- .../springdoc/api/app103/HelloController.java | 2 +- .../api/app103/SpringDocApp103Test.java | 2 +- .../test/org/springdoc/api/app104/Design.java | 2 +- .../api/app104/DesignController.java | 2 +- .../org/springdoc/api/app104/HavingPK.java | 2 +- .../api/app104/SpringDocApp104Test.java | 2 +- .../api/app105/SpringDocApp105Test.java | 10 +- .../api/app105/api/ExceptionTranslator.java | 2 +- .../api/app105/api/HomeController.java | 2 +- .../api/app105/api/pet/PetApiController.java | 2 +- .../app105/api/pet/PetApiDelegateImpl.java | 2 +- .../app105/api/store/StoreApiController.java | 2 +- .../api/store/StoreApiDelegateImpl.java | 2 +- .../app105/api/user/UserApiController.java | 2 +- .../app105/api/user/UserApiDelegateImpl.java | 2 +- .../org/springdoc/api/app105/model/Body.java | 135 ----------- .../org/springdoc/api/app105/model/Body1.java | 137 ----------- .../springdoc/api/app105/model/Category.java | 2 +- .../org/springdoc/api/app105/model/Tag.java | 2 +- .../springdoc/api/app106/HelloController.java | 2 +- .../api/app106/SpringDocApp106Test.java | 2 +- .../springdoc/api/app107/HelloController.java | 6 +- .../api/app107/SpringDocApp107Test.java | 2 +- .../springdoc/api/app108/ActionResult.java | 2 +- .../springdoc/api/app108/HelloController.java | 2 +- .../api/app108/SpringDocApp108Test.java | 2 +- .../springdoc/api/app109/HelloController.java | 2 +- .../api/app109/SpringDocApp109Test.java | 2 +- .../springdoc/api/app11/HelloController.java | 2 +- .../api/app11/SpringDocApp11Test.java | 2 +- .../springdoc/api/app110/ErrorMessage.java | 2 +- .../api/app110/GlobalControllerAdvice.java | 7 +- .../test/org/springdoc/api/app110/Person.java | 2 +- .../api/app110/PersonController.java | 2 +- .../api/app110/PersonController2.java | 2 +- .../org/springdoc/api/app110/Problem.java | 2 +- .../api/app110/SpringDocApp110Test.java | 2 +- .../springdoc/api/app111/ErrorMessage.java | 2 +- .../api/app111/GlobalControllerAdvice.java | 7 +- .../test/org/springdoc/api/app111/Person.java | 2 +- .../api/app111/PersonController.java | 2 +- .../api/app111/PersonController2.java | 2 +- .../org/springdoc/api/app111/Problem.java | 2 +- .../api/app111/SpringDocApp111Test.java | 2 +- .../springdoc/api/app112/ErrorMessage.java | 2 +- .../api/app112/GlobalControllerAdvice.java | 7 +- .../api/app112/PersonController.java | 2 +- .../org/springdoc/api/app112/Problem.java | 2 +- .../api/app112/SpringDocApp112Test.java | 2 +- .../api/app112/sample/PersonController2.java | 2 +- .../springdoc/api/app113/HelloController.java | 4 +- .../api/app113/SpringDocApp113Test.java | 2 +- .../springdoc/api/app114/HelloController.java | 2 +- .../api/app114/SpringDocApp114Test.java | 2 +- .../springdoc/api/app115/HelloController.java | 2 +- .../app115/JavaTimeOperationCustomizer.java | 2 +- .../api/app115/SpringDocApp115Test.java | 2 +- .../springdoc/api/app116/FooErrorHandler.java | 2 +- .../springdoc/api/app116/HelloController.java | 2 +- .../api/app116/SpringDocApp116Test.java | 2 +- .../api/app117/HelloApplication.java | 2 +- .../api/app117/SpringDocApp117Test.java | 2 +- .../springdoc/api/app118/ConcreteParent.java | 2 +- .../org/springdoc/api/app118/Controller.java | 2 +- .../api/app118/SpringDocApp118Test.java | 2 +- .../springdoc/api/app119/HelloController.java | 2 +- .../org/springdoc/api/app119/JsonRequest.java | 2 +- .../api/app119/SpringDocApp119Test.java | 2 +- .../springdoc/api/app12/HelloController.java | 2 +- .../api/app12/SpringDocApp12Test.java | 2 +- .../api/app120/MetaAnnotationController.java | 2 +- .../api/app120/SpringDocApp120Test.java | 2 +- .../api/app121/InheritedRequestParams.java | 2 +- .../springdoc/api/app121/RequestParams.java | 2 +- .../api/app121/SpringDocApp121Test.java | 2 +- .../springdoc/api/app121/TestController.java | 2 +- .../org/springdoc/api/app122/BaseObject.java | 2 +- .../org/springdoc/api/app122/CustomerDto.java | 2 +- .../springdoc/api/app122/FirstController.java | 2 +- .../api/app122/SpringDocApp122Test.java | 2 +- .../org/springdoc/api/app122/Wrapper.java | 2 +- .../springdoc/api/app123/HelloController.java | 2 +- .../api/app123/MyExceptionHandler.java | 2 +- .../api/app123/SpringDocApp123Test.java | 2 +- .../springdoc/api/app124/HelloController.java | 2 +- .../api/app124/MyExceptionHandler.java | 2 +- .../api/app124/SpringDocApp124Test.java | 2 +- .../api/app125/DeprecatedEntity.java | 2 +- .../springdoc/api/app125/HelloController.java | 2 +- .../api/app125/SpringDocApp125Test.java | 2 +- .../springdoc/api/app126/HelloController.java | 2 +- ...SecurityProblemResponsesConfiguration.java | 2 +- .../api/app126/SpringDocApp126Test.java | 2 +- .../springdoc/api/app127/ConcreteObjectA.java | 2 +- .../org/springdoc/api/app127/Controller.java | 2 +- .../api/app127/SpringDocApp127Test.java | 4 +- .../org/springdoc/api/app127/Umbrella.java | 2 +- .../api/app129/ActualReturnedEntity.java | 2 +- .../springdoc/api/app129/HelloController.java | 2 +- .../api/app129/OperationResponse.java | 2 +- .../api/app129/SpringDocApp129Test.java | 2 +- .../springdoc/api/app13/HelloController.java | 2 +- .../org/springdoc/api/app13/PersonDTO.java | 2 +- .../api/app13/SpringDocApp13Test.java | 2 +- .../springdoc/api/app130/HelloController.java | 2 +- .../api/app130/SpringDocApp130Test.java | 2 +- .../org/springdoc/api/app130/TrackerData.java | 2 +- .../springdoc/api/app131/HelloController.java | 2 +- .../springdoc/api/app131/Organization.java | 2 +- .../api/app131/RestControllerError.java | 2 +- .../api/app131/SpringDocApp131Test.java | 2 +- .../springdoc/api/app132/HelloController.java | 2 +- .../springdoc/api/app132/Organization.java | 2 +- .../api/app132/RestControllerError.java | 2 +- .../api/app132/SpringDocApp132Test.java | 2 +- .../springdoc/api/app133/HelloController.java | 2 +- .../api/app133/SpringDocApp133Test.java | 2 +- .../springdoc/api/app134/HelloController.java | 2 +- .../springdoc/api/app134/OpenApiConfig.java | 2 +- .../api/app134/SpringDocApp134Test.java | 12 +- .../test/org/springdoc/api/app135/Book.java | 2 +- .../springdoc/api/app135/BookRepository.java | 2 +- .../api/app135/SpringDocApp135Test.java | 2 +- .../springdoc/api/app137/HelloController.java | 2 +- .../springdoc/api/app137/OpenApiConfig.java | 2 +- .../api/app137/SpringDocApp137Test.java | 2 +- .../springdoc/api/app138/HelloController.java | 2 +- .../api/app138/SpringDocApp138Test.java | 2 +- .../springdoc/api/app139/HelloController.java | 2 +- .../api/app139/SpringDocApp139Test.java | 2 +- .../springdoc/api/app14/HelloController.java | 2 +- .../api/app14/SpringDocApp14Test.java | 2 +- .../api/app140/HelloApplication.java | 2 +- .../api/app140/SpringDocApp140Test.java | 2 +- .../test/org/springdoc/api/app141/Book.java | 2 +- .../springdoc/api/app141/BookRepository.java | 2 +- .../api/app141/SpringDocApp141Test.java | 2 +- .../api/app142/HelloApplication.java | 14 +- .../api/app142/SpringDocApp142Test.java | 2 +- .../springdoc/api/app149/HelloController.java | 2 +- .../springdoc/api/app149/HelloMessage.java | 2 +- .../api/app149/SpringDocApp149Test.java | 2 +- .../springdoc/api/app15/HelloController.java | 2 +- .../api/app15/SpringDocApp15Test.java | 2 +- .../springdoc/api/app150/HelloController.java | 2 +- .../api/app150/SpringDocApp150Test.java | 2 +- .../springdoc/api/app151/HelloController.java | 2 +- .../api/app151/SpringDocApp151Test.java | 2 +- .../springdoc/api/app152/HelloController.java | 4 +- .../api/app152/SpringDocApp152Test.java | 2 +- .../api/app153/OrderStateMapper.java | 2 +- .../api/app153/SpringDocApp153Test.java | 2 +- .../springdoc/api/app154/HelloController.java | 2 +- .../api/app154/OpenApiConfiguration.java | 2 +- .../api/app154/SpringDocApp154Test.java | 2 +- .../app155/AbstractIntParameterObject.java | 2 +- .../api/app155/AbstractParameterObject.java | 2 +- .../app155/ConcreteIntParameterObject.java | 2 +- .../api/app155/ConcreteParameterObject.java | 2 +- .../springdoc/api/app155/HelloController.java | 2 +- .../api/app155/SpringDocApp155Test.java | 2 +- .../springdoc/api/app156/HelloController.java | 2 +- .../api/app156/SpringDocApp156Test.java | 2 +- .../test/org/springdoc/api/app156/User.java | 2 +- .../test/org/springdoc/api/app157/Bar.java | 2 +- .../test/org/springdoc/api/app157/Foo.java | 2 +- .../springdoc/api/app157/HelloController.java | 2 +- .../api/app157/SpringDocApp157Test.java | 6 +- .../api/app157/StringyConverter.java | 4 +- .../api/app158/CommonFooErrorHandler.java | 2 +- .../org/springdoc/api/app158/ErrorDTO.java | 2 +- .../springdoc/api/app158/HelloController.java | 2 +- .../org/springdoc/api/app158/SimpleDTO.java | 2 +- .../api/app158/SpecificFooErrorHandler.java | 2 +- .../api/app158/SpringDocApp158Test.java | 2 +- .../springdoc/api/app159/CustomException.java | 2 +- .../org/springdoc/api/app159/FooBean.java | 2 +- .../springdoc/api/app159/FooErrorHandler.java | 2 +- .../springdoc/api/app159/HelloController.java | 2 +- .../api/app159/SpringDocApp159Test.java | 2 +- .../test/org/springdoc/api/app159/Views.java | 2 +- .../springdoc/api/app16/HelloController.java | 2 +- .../api/app16/SpringDocApp16Test.java | 4 +- .../springdoc/api/app160/HelloController.java | 6 +- .../api/app160/SpringDocApp160Test.java | 2 +- .../springdoc/api/app161/HelloController.java | 2 +- .../api/app161/SpringDocApp161Test.java | 2 +- .../api/app162/SpringDocApp162Test.java | 2 +- .../rest/JavadocOnlyRestController.java | 2 +- .../rest/util/RestExceptionHandler.java | 2 +- .../api/app163/SpringDocApp163Test.java | 2 +- ...ationOverrideForJavadocRestController.java | 2 +- .../AnnotationOverrideForJavadocRestDto.java | 6 - .../AnnotationOverrideForJavadocRestDto2.java | 5 +- .../AnnotationOverrideForJavadocRestDto3.java | 5 +- .../rest/util/RestExceptionHandler.java | 2 +- .../api/app164/SpringDocApp164Test.java | 2 +- .../rest/NoGenericOverrideRestController.java | 2 +- .../rest/util/RestExceptionHandler.java | 2 +- .../app166/ConcreteSubclassFromGeneric.java | 2 +- .../springdoc/api/app166/HelloController.java | 4 +- .../test/org/springdoc/api/app166/MyData.java | 2 +- .../springdoc/api/app166/SimpleGeneric.java | 2 +- .../api/app166/SimpleInnerClass.java | 2 +- .../api/app166/SimpleInnerInnerClass.java | 2 +- .../api/app166/SimpleOuterClass.java | 2 +- .../api/app166/SpringDocApp166Test.java | 2 +- .../springdoc/api/app167/HelloController.java | 2 +- .../api/app167/SpringDocApp167Test.java | 2 +- ...ionFieldInRequestBodyIsNullController.java | 2 +- .../test/org/springdoc/api/app168/Person.java | 2 +- .../api/app168/SpringDocApp168Test.java | 2 +- .../api/app169/RecordController.java | 2 +- .../api/app169/SpringDocApp169Test.java | 2 +- .../springdoc/api/app17/HelloController.java | 2 +- .../api/app17/SpringDocApp17Test.java | 2 +- .../springdoc/api/app170/BasicController.java | 2 +- .../test/org/springdoc/api/app170/Cat.java | 2 +- .../test/org/springdoc/api/app170/Dog.java | 2 +- .../api/app170/SpringDocApp170Test.java | 2 +- .../springdoc/api/app171/HelloController.java | 2 +- .../org/springdoc/api/app171/PersonDTO.java | 2 +- .../api/app171/SpringDocApp171Test.java | 2 +- .../org/springdoc/api/app173/Example.java | 2 +- .../api/app173/ExampleController.java | 2 +- .../api/app173/SpringDocApp173Test.java | 2 +- .../api/app174/ExampleController.java | 2 +- .../api/app174/SpringDocApp174Test.java | 2 +- .../test/org/springdoc/api/app174/Test.java | 2 +- .../springdoc/api/app174/TestQuestion.java | 2 +- .../springdoc/api/app174/TextQuestion.java | 2 +- .../springdoc/api/app18/HelloController.java | 2 +- .../api/app18/SpringDocApp18Test.java | 2 +- .../springdoc/api/app19/HelloController.java | 2 +- .../api/app19/SpringDocApp19Test.java | 2 +- .../springdoc/api/app2/SpringDocApp2Test.java | 2 +- .../org/springdoc/api/app2/api/ApiUtil.java | 2 +- .../api/app2/api/ExceptionTranslator.java | 2 +- .../api/app2/api/HomeController.java | 2 +- .../api/app2/api/PetApiController.java | 2 +- .../api/app2/api/PetApiDelegateImpl.java | 2 +- .../api/app2/api/StoreApiController.java | 2 +- .../api/app2/api/StoreApiDelegateImpl.java | 2 +- .../api/app2/api/UserApiController.java | 2 +- .../api/app2/api/UserApiDelegateImpl.java | 2 +- .../org/springdoc/api/app2/model/Body.java | 126 ---------- .../org/springdoc/api/app2/model/Body1.java | 128 ---------- .../springdoc/api/app2/model/Category.java | 2 +- .../org/springdoc/api/app2/model/Tag.java | 2 +- .../springdoc/api/app20/HelloController.java | 2 +- .../api/app20/SpringDocApp20Test.java | 2 +- .../springdoc/api/app21/HelloController.java | 2 +- .../api/app21/SpringDocApp21Test.java | 2 +- .../springdoc/api/app22/HelloController.java | 2 +- .../org/springdoc/api/app22/PersonDTO.java | 2 +- .../api/app22/SpringDocApp22Test.java | 2 +- .../springdoc/api/app23/HelloController.java | 2 +- .../api/app23/SpringDocApp23Test.java | 2 +- .../springdoc/api/app24/HelloController.java | 2 +- .../api/app24/SpringDocApp24Test.java | 2 +- .../springdoc/api/app24/SpringDocTestApp.java | 2 +- .../springdoc/api/app25/HelloController.java | 2 +- .../api/app25/SpringDocApp25Test.java | 2 +- .../test/org/springdoc/api/app26/Bar.java | 2 +- .../test/org/springdoc/api/app26/Foo.java | 2 +- .../springdoc/api/app26/HelloController.java | 2 +- .../test/org/springdoc/api/app26/MyModel.java | 2 +- .../api/app26/SpringDocApp26Test.java | 2 +- .../test/org/springdoc/api/app27/Advice.java | 2 +- .../test/org/springdoc/api/app27/Bar.java | 2 +- .../test/org/springdoc/api/app27/Foo.java | 2 +- .../springdoc/api/app27/HelloController.java | 2 +- .../org/springdoc/api/app27/MyException.java | 2 +- .../api/app27/SpringDocApp27Test.java | 4 +- .../springdoc/api/app28/HelloController.java | 2 +- .../api/app28/SpringDocApp28Test.java | 2 +- .../springdoc/api/app29/HelloController.java | 2 +- .../api/app29/SpringDocApp29Test.java | 2 +- .../org/springdoc/api/app29/TrackerData.java | 2 +- .../springdoc/api/app3/HelloController.java | 2 +- .../org/springdoc/api/app3/PersonDTO.java | 2 +- .../org/springdoc/api/app3/PlayingCard.java | 2 +- .../springdoc/api/app3/SpringDocApp3Test.java | 2 +- .../springdoc/api/app30/HelloController.java | 2 +- .../api/app30/SpringDocApp30Test.java | 2 +- .../springdoc/api/app31/HelloController.java | 2 +- .../api/app31/SpringDocApp31Test.java | 2 +- .../springdoc/api/app32/HelloController.java | 2 +- .../api/app32/SpringDocApp32Test.java | 2 +- .../springdoc/api/app33/HelloController.java | 2 +- .../api/app33/SpringDocApp33Test.java | 2 +- .../springdoc/api/app34/HelloController.java | 2 +- .../api/app34/MyExceptionHandler.java | 2 +- .../api/app34/SpringDocApp34Test.java | 2 +- .../springdoc/api/app35/HelloController.java | 2 +- .../api/app35/SpringDocApp35Test.java | 2 +- .../test/org/springdoc/api/app37/Bar.java | 2 +- .../test/org/springdoc/api/app37/Car.java | 2 +- .../test/org/springdoc/api/app37/Foo.java | 2 +- .../springdoc/api/app37/HelloController.java | 2 +- .../test/org/springdoc/api/app37/Pet.java | 2 +- .../api/app37/SpringDocApp37Test.java | 2 +- .../springdoc/api/app38/HelloController.java | 2 +- .../api/app38/SpringDocApp38Test.java | 2 +- .../springdoc/api/app39/HelloController.java | 2 +- .../api/app39/SpringDocApp39Test.java | 2 +- .../springdoc/api/app39/SpringDocTestApp.java | 2 +- .../springdoc/api/app4/HelloController.java | 2 +- .../springdoc/api/app4/SpringDocApp4Test.java | 2 +- .../org/springdoc/api/app4/TrackerData.java | 2 +- .../springdoc/api/app40/HelloController.java | 2 +- .../api/app40/SpringDocApp40Test.java | 2 +- .../springdoc/api/app41/HelloController.java | 2 +- .../api/app41/SpringDocApp411Test.java | 4 +- .../api/app41/SpringDocApp41Test.java | 4 +- .../springdoc/api/app42/HelloController.java | 2 +- .../api/app42/SpringDocApp42Test.java | 2 +- .../test/org/springdoc/api/app42/TweetId.java | 2 +- .../springdoc/api/app43/HelloController.java | 2 +- .../api/app43/SpringDocApp43Test.java | 2 +- .../springdoc/api/app44/HelloController.java | 2 +- .../api/app44/SpringDocApp44Test.java | 4 +- .../springdoc/api/app45/HelloController.java | 2 +- .../springdoc/api/app45/HelloController2.java | 2 +- .../springdoc/api/app45/OpenApiConfig.java | 2 +- .../org/springdoc/api/app45/PersonDTO.java | 2 +- .../api/app45/SpringDocApp45Test.java | 2 +- .../springdoc/api/app46/HelloController.java | 2 +- .../api/app46/SpringDocApp46Test.java | 2 +- .../springdoc/api/app47/HelloController.java | 2 +- .../api/app47/SpringDocApp47Test.java | 2 +- .../api/app48/AbstractHelloController.java | 2 +- .../springdoc/api/app48/HelloController.java | 2 +- .../api/app48/SpringDocApp48Test.java | 2 +- .../springdoc/api/app49/HelloController.java | 2 +- .../api/app49/SpringDocApp49Test.java | 2 +- .../springdoc/api/app49/SpringDocTestApp.java | 2 +- ...gurationComponentsSecuritySchemesTest.java | 8 +- ...penApiResourceCustomConfigurationTest.java | 4 +- .../OpenApiResourceNoConfigurationTest.java | 4 +- .../springdoc/api/app50/HelloController.java | 2 +- .../api/app50/SpringDocApp50Test.java | 2 +- .../springdoc/api/app50/SpringDocTestApp.java | 2 +- .../springdoc/api/app51/HelloController.java | 2 +- .../api/app51/SpringDocApp51Test.java | 2 +- .../springdoc/api/app52/HelloController.java | 2 +- .../api/app52/SpringDocApp52Test.java | 2 +- .../springdoc/api/app53/HelloController.java | 2 +- .../HelloControllerWithGlobalApiResponse.java | 2 +- .../api/app53/SpringDocApp53Test.java | 2 +- .../springdoc/api/app54/HelloController.java | 2 +- .../org/springdoc/api/app54/MealParty.java | 2 +- .../api/app54/SpringDocApp54Test.java | 2 +- .../springdoc/api/app55/HelloController.java | 2 +- .../api/app55/SpringDocApp55Test.java | 2 +- .../api/app56/GlobalExceptionHandler.java | 2 +- .../springdoc/api/app56/HelloController.java | 2 +- .../api/app56/SpringDocApp56Test.java | 2 +- .../springdoc/api/app57/HelloController.java | 2 +- .../api/app57/SpringDocApp57Test.java | 2 +- .../springdoc/api/app58/HelloController.java | 2 +- .../api/app58/SpringDocApp58Test.java | 2 +- .../springdoc/api/app59/HelloController.java | 2 +- .../api/app59/SpringDocApp59Test.java | 2 +- .../springdoc/api/app6/HelloController.java | 2 +- .../springdoc/api/app6/SpringDocApp6Test.java | 2 +- .../springdoc/api/app60/HelloController.java | 2 +- .../api/app60/SpringDocApp60Test.java | 2 +- .../springdoc/api/app61/HelloController.java | 2 +- .../api/app61/SpringDocApp61Test.java | 2 +- .../api/app62/SpringDocApp62Test.java | 2 +- .../springdoc/api/app62/TestController.java | 2 +- .../springdoc/api/app63/HelloController.java | 2 +- .../api/app63/SpringDocApp63Test.java | 2 +- .../springdoc/api/app64/HelloController.java | 2 +- .../api/app64/SpringDocApp64Test.java | 2 +- .../springdoc/api/app65/HelloController.java | 2 +- .../api/app65/SpringDocApp65Test.java | 2 +- .../api/app66/DefaultHealthCheckApi.java | 2 +- .../springdoc/api/app66/HelloController.java | 2 +- .../api/app66/SpringDocApp66Test.java | 2 +- .../api/app66/UndocumentedClass.java | 2 +- .../springdoc/api/app67/HelloController.java | 2 +- .../api/app67/SpringDocApp67Test.java | 2 +- .../springdoc/api/app69/HelloController.java | 2 +- .../org/springdoc/api/app69/PersonDTO.java | 2 +- .../api/app69/SpringDocApp69Test.java | 2 +- .../springdoc/api/app7/HelloController.java | 2 +- .../springdoc/api/app7/SpringDocApp7Test.java | 2 +- .../springdoc/api/app70/HelloController.java | 2 +- .../api/app70/SpringDocApp70Test.java | 2 +- .../app70/customizer/OperationCustomizer.java | 2 +- .../app70/customizer/ParameterCustomizer.java | 2 +- .../app70/customizer/PropertyCustomizer.java | 4 +- .../test/org/springdoc/api/app71/Dog.java | 2 +- .../springdoc/api/app71/HelloController.java | 2 +- .../api/app71/SpringDocApp71Test.java | 2 +- .../app72/BlockingAutoConfigurationTest.java | 10 +- .../app72/CacheAutoConfigurationTest1.java | 10 +- .../api/app72/GroupAutoConfigurationTest.java | 4 +- .../springdoc/api/app73/HelloController.java | 2 +- .../api/app73/SpringDocApp73Test.java | 2 +- .../springdoc/api/app74/HelloController.java | 2 +- .../api/app74/SpringDocApp74Test.java | 2 +- .../springdoc/api/app75/HelloController.java | 2 +- .../org/springdoc/api/app75/PersonDTO.java | 2 +- .../RestResponseEntityExceptionHandler.java | 2 +- .../api/app75/SpringDocApp75Test.java | 2 +- .../springdoc/api/app76/HelloController.java | 2 +- .../api/app76/SpringDocApp76Test.java | 2 +- .../springdoc/api/app77/HelloController.java | 2 +- .../api/app77/SpringDocApp77Test.java | 2 +- .../springdoc/api/app78/HelloController.java | 2 +- .../org/springdoc/api/app78/PersonDTO.java | 2 +- .../api/app78/SpringDocApp78Test.java | 2 +- .../springdoc/api/app79/HelloController.java | 2 +- .../api/app79/SpringDocApp79Test.java | 2 +- .../springdoc/api/app8/HelloController.java | 2 +- .../springdoc/api/app8/SpringDocApp8Test.java | 4 +- .../springdoc/api/app80/HelloController.java | 2 +- .../api/app80/SpringDocApp80Test.java | 2 +- .../org/springdoc/api/app80/TestObject.java | 2 +- .../springdoc/api/app81/HelloController.java | 2 +- .../api/app81/SpringDocApp81Test.java | 4 +- .../springdoc/api/app82/HelloController.java | 2 +- .../org/springdoc/api/app82/PersonDTO.java | 2 +- .../api/app82/SpringDocApp82Test.java | 2 +- .../springdoc/api/app83/HelloController.java | 2 +- .../org/springdoc/api/app83/PersonDTO.java | 2 +- .../api/app83/SpringDocApp83Test.java | 2 +- .../springdoc/api/app84/HelloController.java | 2 +- .../api/app84/SpringDocApp84Test.java | 2 +- .../springdoc/api/app85/HelloController.java | 2 +- .../api/app85/SpringDocApp85Test.java | 2 +- .../springdoc/api/app86/HelloController.java | 2 +- .../api/app86/SpringDocApp86Test.java | 2 +- .../api/app86/test/HelloController2.java | 2 +- .../springdoc/api/app87/HelloController.java | 2 +- .../api/app87/SpringDocApp87Test.java | 2 +- .../springdoc/api/app88/HelloController.java | 2 +- .../api/app88/SpringDocApp88Test.java | 2 +- .../springdoc/api/app89/HelloController.java | 2 +- .../api/app89/SpringDocApp89Test.java | 2 +- .../springdoc/api/app9/MyApiController.java | 2 +- .../springdoc/api/app9/SpringDocApp9Test.java | 2 +- .../springdoc/api/app90/HelloController.java | 2 +- .../api/app90/SpringDocApp90Test.java | 2 +- .../test/org/springdoc/api/app90/User.java | 2 +- .../test/org/springdoc/api/app91/Advice.java | 2 +- .../org/springdoc/api/app91/ApiError.java | 2 +- .../org/springdoc/api/app91/Greeting.java | 2 +- .../api/app91/GreetingController.java | 2 +- .../api/app91/SpringDocApp91Test.java | 2 +- .../springdoc/api/app92/HelloController.java | 2 +- .../api/app92/ParameterCustomizer.java | 2 +- .../api/app92/SpringDocApp92Test.java | 2 +- .../api/app93/SpecificClientModel.java | 2 +- .../api/app93/SpecificController.java | 2 +- .../api/app93/SpringDocApp93Test.java | 2 +- .../org/springdoc/api/app94/Greeting.java | 37 +++ .../api/app94/SpringDocApp94Test.java | 3 +- .../springdoc/api/app95/HelloController.java | 2 +- .../api/app95/SpringDocApp95Test.java | 2 +- .../springdoc/api/app96/HelloController.java | 2 +- .../api/app96/SpringDocApp96Test.java | 2 +- .../springdoc/api/app97/HelloController.java | 2 +- .../api/app97/SpringDocApp97Test.java | 2 +- .../org/springdoc/api/app97/StudentV1.java | 2 +- .../org/springdoc/api/app97/StudentV2.java | 2 +- .../org/springdoc/api/app97/StudentV3.java | 2 +- .../springdoc/api/app98/HelloController.java | 2 +- .../api/app98/SpringDocApp98Test.java | 2 +- .../springdoc/api/app99/HelloController.java | 2 +- .../api/app99/SpringDocApp99Test.java | 2 +- .../springdoc/api/AbstractSpringDocTest.java | 2 +- .../api/app21/SpringDocApp21Test.java | 2 +- .../springdoc/api/app6/ByteArrayController.kt | 2 +- .../springdoc/api/app6/ByteArrayController.kt | 2 +- .../springdoc/api/AbstractSpringDocTest.java | 2 +- .../springdoc/api/app3/SpringOauth2Test.java | 2 +- .../org/springdoc/api/app7/AnotherPerson.java | 3 - .../src/test/resources/results/app10.json | 80 +++---- .../src/test/resources/results/app11.json | 134 +++++------ .../src/test/resources/results/app12.json | 220 +++++++++--------- 1520 files changed, 2052 insertions(+), 3282 deletions(-) delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiException.java delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiOriginFilter.java delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiResponseMessage.java delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Body1.java delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiException.java delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiOriginFilter.java delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiResponseMessage.java delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Body1.java rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/{SpringDocTestApp.java => SpringDocConfiguration.java} (95%) delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Body.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Body1.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Body.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Body1.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/Greeting.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 8d208a136..5405dec81 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java index 35c9d48a9..73dc72646 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java index 10d77eea4..1c4521f65 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java index 0fe189eb3..a37784c94 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java index cb7364ea2..9b0a339dc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java index 175a76916..ef991b89b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java index 79497ccdc..120010a80 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java index 66df9e4ad..98de041ca 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java index bf2136c0b..a6d2df521 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 354299690..29610d961 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -408,7 +408,6 @@ GlobalOpenApiCustomizer propertiesResolverForSchema(OpenAPIService openAPIServic * @param repositoryRestResourceProvider the repository rest resource provider * @param routerFunctionProvider the router function provider * @param springWebProvider the spring web provider - * @param webConversionServiceProvider the web conversion service provider * @param objectMapperProvider the object mapper provider * @return the spring doc providers */ @@ -417,10 +416,10 @@ GlobalOpenApiCustomizer propertiesResolverForSchema(OpenAPIService openAPIServic @Lazy(false) SpringDocProviders springDocProviders(Optional actuatorProvider, Optional springCloudFunctionProvider, Optional springSecurityOAuth2Provider, Optional repositoryRestResourceProvider, Optional routerFunctionProvider, - Optional springWebProvider, Optional webConversionServiceProvider, + Optional springWebProvider, ObjectMapperProvider objectMapperProvider) { objectMapperProvider.jsonMapper().registerModule(new SpringDocRequiredModule()); - return new SpringDocProviders(actuatorProvider, springCloudFunctionProvider, springSecurityOAuth2Provider, repositoryRestResourceProvider, routerFunctionProvider, springWebProvider, webConversionServiceProvider, objectMapperProvider); + return new SpringDocProviders(actuatorProvider, springCloudFunctionProvider, springSecurityOAuth2Provider, repositoryRestResourceProvider, routerFunctionProvider, springWebProvider, objectMapperProvider); } /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java index f36393e54..b8b6d5093 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java index 6735bfe6d..7d0ae1bc5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java index 68d96b7fc..347169643 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java index 54f13f9b2..120f91f44 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java index 2d554457b..71beda859 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java index f80b58154..b426496ca 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java index fbf7aa044..3fa1d389c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java index 7278ca597..e53d078fb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java index 4c2831f36..29bd35eb7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ package org.springdoc.core.configuration; -import java.lang.reflect.Field; import java.util.Optional; import io.swagger.v3.oas.models.Operation; @@ -62,7 +61,6 @@ import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; import org.springframework.security.web.FilterChainProxy; import org.springframework.security.web.SecurityFilterChain; -import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter; import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; @@ -133,9 +131,8 @@ OpenApiCustomizer springSecurityLoginEndpointCustomizer(ApplicationContext appli String mediaType = org.springframework.http.MediaType.APPLICATION_JSON_VALUE; if (optionalDefaultLoginPageGeneratingFilter.isPresent()) { DefaultLoginPageGeneratingFilter defaultLoginPageGeneratingFilter = optionalDefaultLoginPageGeneratingFilter.get(); - Field formLoginEnabledField = FieldUtils.getDeclaredField(DefaultLoginPageGeneratingFilter.class, "formLoginEnabled", true); try { - boolean formLoginEnabled = (boolean) formLoginEnabledField.get(defaultLoginPageGeneratingFilter); + boolean formLoginEnabled = (boolean) FieldUtils.readDeclaredField(defaultLoginPageGeneratingFilter, "formLoginEnabled", true); if (formLoginEnabled) mediaType = org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE; } @@ -152,14 +149,11 @@ OpenApiCustomizer springSecurityLoginEndpointCustomizer(ApplicationContext appli operation.addTagsItem("login-endpoint"); PathItem pathItem = new PathItem().post(operation); try { - Field requestMatcherField = AbstractAuthenticationProcessingFilter.class.getDeclaredField("requiresAuthenticationRequestMatcher"); - requestMatcherField.setAccessible(true); - AntPathRequestMatcher requestMatcher = (AntPathRequestMatcher) requestMatcherField.get(usernamePasswordAuthenticationFilter); + AntPathRequestMatcher requestMatcher = (AntPathRequestMatcher)FieldUtils.readField(usernamePasswordAuthenticationFilter, "requiresAuthenticationRequestMatcher", true); String loginPath = requestMatcher.getPattern(); - requestMatcherField.setAccessible(false); openAPI.getPaths().addPathItem(loginPath, pathItem); } - catch (NoSuchFieldException | IllegalAccessException | + catch (IllegalAccessException | ClassCastException ignored) { // Exception escaped LOGGER.trace(ignored.getMessage()); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java index 289d047c0..eeda096a4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java @@ -282,8 +282,8 @@ private void getOAuth2AuthorizationEndpoint(OpenAPI openAPI, SecurityFilterChain apiResponses.addApiResponse(String.valueOf(HttpStatus.OK.value()), response); buildApiResponsesOnInternalServerError(apiResponses); buildApiResponsesOnBadRequest(apiResponses, openAPI, openapi31); - apiResponses.addApiResponse(String.valueOf(HttpStatus.MOVED_TEMPORARILY.value()), - new ApiResponse().description(HttpStatus.MOVED_TEMPORARILY.getReasonPhrase()) + apiResponses.addApiResponse(String.valueOf(HttpStatus.FOUND.value()), + new ApiResponse().description(HttpStatus.FOUND.getReasonPhrase()) .addHeaderObject("Location", new Header().schema(new StringSchema()))); Operation operation = buildOperation(apiResponses); Schema schema = new ObjectSchema().additionalProperties(new StringSchema()); @@ -468,18 +468,15 @@ private static void buildOAuth2Error(OpenAPI openAPI, ApiResponses apiResponses, */ private void buildPath(Object oAuth2EndpointFilter, String authorizationEndpointMatcher, OpenAPI openAPI, Operation operation, HttpMethod requestMethod) { try { - Field tokenEndpointMatcherField = FieldUtils.getDeclaredField(oAuth2EndpointFilter.getClass(), authorizationEndpointMatcher, true); - RequestMatcher endpointMatcher = (RequestMatcher) tokenEndpointMatcherField.get(oAuth2EndpointFilter); + RequestMatcher endpointMatcher = (RequestMatcher) FieldUtils.readDeclaredField(oAuth2EndpointFilter, authorizationEndpointMatcher, true); String path = null; if (endpointMatcher instanceof AntPathRequestMatcher antPathRequestMatcher) path = antPathRequestMatcher.getPattern(); else if (endpointMatcher instanceof OrRequestMatcher endpointMatchers) { - Field requestMatchersField = FieldUtils.getDeclaredField(OrRequestMatcher.class, "requestMatchers", true); - Iterable requestMatchers = (Iterable) requestMatchersField.get(endpointMatchers); + Iterable requestMatchers = (Iterable) FieldUtils.readDeclaredField(endpointMatchers, "requestMatchers", true); for (RequestMatcher requestMatcher : requestMatchers) { if (requestMatcher instanceof OrRequestMatcher orRequestMatcher) { - requestMatchersField = FieldUtils.getDeclaredField(OrRequestMatcher.class, "requestMatchers", true); - requestMatchers = (Iterable) requestMatchersField.get(orRequestMatcher); + requestMatchers = (Iterable) FieldUtils.readDeclaredField(orRequestMatcher, "requestMatchers", true); for (RequestMatcher matcher : requestMatchers) { if (matcher instanceof AntPathRequestMatcher antPathRequestMatcher) path = antPathRequestMatcher.getPattern(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java index 83917bbaf..68f378a88 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java index bc2deb485..236260078 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java index 07da137fa..778798821 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java index ea83aa73a..a38ba0f9c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java index e4ac1f7b3..3194617a1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java index 22930100e..9af91a764 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java index 2c38b19be..d78d8abc7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java index a67ff7e25..6ed140f99 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java index c565255db..af8a63c0d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java index 0b8b6ae6e..2b0fddb90 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java index 98b165ee9..a7922e4db 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java index 9192f4471..6ae2db5bc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java index 093e2f68e..c7a9f8dfa 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java index d97926ce1..8436dd269 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ package org.springdoc.core.converters; -import java.lang.reflect.Field; import java.util.List; import java.util.Optional; @@ -75,8 +74,7 @@ public ModelConverterRegistrar(List modelConverters, SpringDocCo @SuppressWarnings("unchecked") private Optional getRegisteredConverterSameAs(ModelConverter modelConverter) { try { - Field convertersField = FieldUtils.getDeclaredField(ModelConverters.class, "converters", true); - List modelConverters = (List) convertersField.get(modelConvertersInstance); + List modelConverters = (List) FieldUtils.readDeclaredField(modelConvertersInstance, "converters", true); return modelConverters.stream() .filter(registeredModelConverter -> isSameConverter(registeredModelConverter, modelConverter)) .findFirst(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java index 8bf14d5ea..163345c24 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index fce0ac8fc..fb49bec38 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java index f82afbb45..020efa3a1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java index 6a5f3e7a7..9628be23b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java index 050f6c515..44c3b6bc1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import org.springdoc.core.providers.ObjectMapperProvider; + import org.springframework.http.ResponseEntity; import static org.springdoc.core.converters.ConverterUtils.isFluxTypeWrapper; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java index 919484a4a..1a644b918 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java index bc8fe5ce4..cb51bb9ac 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java @@ -1,27 +1,29 @@ -package org.springdoc.core.converters; - /* * * * * * * - * * * * Copyright 2019-2022 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. * * * * * * */ +package org.springdoc.core.converters; + import java.util.Iterator; import com.fasterxml.jackson.databind.JavaType; @@ -35,7 +37,8 @@ /** * The Spring Data Sort type model converter. - * @author daniel-shuy + * + * @author daniel -shuy */ public class SortOpenAPIConverter implements ModelConverter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java index 08137e942..823e72483 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java index b33db51e0..67fe3f87a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java index 34cd2654c..9fc5b1564 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java index b97360821..5d238563d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java index 7ab5f3a6a..451051900 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java index d698a9a2b..3e63067af 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java @@ -1,10 +1,8 @@ -package org.springdoc.core.converters.models; - /* * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. @@ -22,6 +20,8 @@ * */ +package org.springdoc.core.converters.models; + import java.util.List; import java.util.Objects; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java index c1b851270..7190df2a1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java index 9f7d6eaa6..9ce0092c6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -43,6 +43,7 @@ * @deprecated as not anymore required, use your own {@link org.springdoc.core.customizers.GlobalOpenApiCustomizer} instead * @since 2.7.0 */ +@Deprecated(since = "2.7.0") public class ActuatorOpenApiCustomizer implements GlobalOpenApiCustomizer { @@ -73,7 +74,7 @@ private void handleActuatorOperationIdUniqueness(OpenAPI openApi) { Set usedOperationIds = new HashSet<>(); actuatorPathEntryStream(openApi, null) .sorted(Comparator.comparing(Entry::getKey)) - .forEachOrdered(stringPathItemEntry -> { + .forEachOrdered(stringPathItemEntry -> stringPathItemEntry.getValue().readOperations().forEach(operation -> { String initialOperationId = operation.getOperationId(); String uniqueOperationId = operation.getOperationId(); @@ -82,8 +83,8 @@ private void handleActuatorOperationIdUniqueness(OpenAPI openApi) { uniqueOperationId = initialOperationId + "_" + ++counter; } operation.setOperationId(uniqueOperationId); - }); - }); + }) + ); } @Override diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java index 6acdf25cb..2a85043aa 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -93,7 +93,7 @@ public ActuatorOperationCustomizer(SpringDocConfigProperties springDocConfigProp @Override public Operation customize(Operation operation, HandlerMethod handlerMethod) { if (operationHasValidTag(operation)) { - Field operationField = getField(handlerMethod.getBean().getClass(), OPERATION); + Field operationField = FieldUtils.getDeclaredField(handlerMethod.getBean().getClass(), OPERATION,true); if (operationField != null) { processOperationField(handlerMethod, operation, operationField); } @@ -111,18 +111,7 @@ public Operation customize(Operation operation, HandlerMethod handlerMethod) { private boolean operationHasValidTag(Operation operation) { return operation.getTags() != null && operation.getTags().contains(getTag().getName()); } - - /** - * Gets field. - * - * @param clazz the clazz - * @param fieldName the field name - * @return the field - */ - private Field getField(Class clazz, String fieldName) { - return FieldUtils.getDeclaredField(clazz, fieldName, true); - } - + /** * Process operation field. * @@ -133,7 +122,7 @@ private Field getField(Class clazz, String fieldName) { private void processOperationField(HandlerMethod handlerMethod, Operation operation, Field operationField) { try { Object actuatorOperation = operationField.get(handlerMethod.getBean()); - Field actuatorOperationField = getField(actuatorOperation.getClass(), OPERATION); + Field actuatorOperationField = FieldUtils.getDeclaredField(actuatorOperation.getClass(), OPERATION, true); if (actuatorOperationField != null) { AbstractDiscoveredOperation discoveredOperation = (AbstractDiscoveredOperation) actuatorOperationField.get(actuatorOperation); @@ -184,6 +173,7 @@ private void handleOperationMethod(OperationMethod operationMethod, Operation op private void addParameters(OperationMethod operationMethod, Operation operation, ParameterIn parameterIn) { for (OperationParameter operationParameter : operationMethod.getParameters()) { Parameter parameter = getParameterFromField(operationParameter); + if(parameter == null) continue; Schema schema = resolveSchema(parameter); if (parameter.getAnnotation(Selector.class) != null) { operation.addParametersItem(new io.swagger.v3.oas.models.parameters.PathParameter() @@ -209,6 +199,7 @@ else if (isValidParameterType(parameter)) { private void addWriteParameters(OperationMethod operationMethod, Operation operation) { for (OperationParameter operationParameter : operationMethod.getParameters()) { Parameter parameter = getParameterFromField(operationParameter); + if(parameter == null) continue; Schema schema = resolveSchema(parameter); if (parameter.getAnnotation(Selector.class) != null) { operation.addParametersItem(new io.swagger.v3.oas.models.parameters.PathParameter() @@ -232,8 +223,7 @@ private void addWriteParameters(OperationMethod operationMethod, Operation opera */ private Parameter getParameterFromField(OperationParameter operationParameter) { try { - Field parameterField = getField(operationParameter.getClass(), PARAMETER); - return (Parameter) parameterField.get(operationParameter); + return (Parameter) FieldUtils.readDeclaredField(operationParameter, PARAMETER, true); } catch (IllegalAccessException e) { LOGGER.warn(e.getMessage()); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java index ab55f98f1..c0dd89ea0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ import org.apache.commons.lang3.reflect.FieldUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springdoc.core.extractor.DelegatingMethodParameter; import org.springdoc.core.providers.RepositoryRestConfigurationProvider; import org.springdoc.core.providers.SpringDataWebPropertiesProvider; @@ -103,9 +102,8 @@ public void customize(MethodParameter originalParameter, MethodParameter methodP (Pageable.class.isAssignableFrom(parameterType) || Sort.class.isAssignableFrom(parameterType)) && (isSpringDataWebPropertiesPresent() || isRepositoryRestConfigurationPresent()) )) { - Field field = FieldUtils.getDeclaredField(DelegatingMethodParameter.class, "additionalParameterAnnotations", true); try { - Annotation[] parameterAnnotations = (Annotation[]) field.get(methodParameter); + Annotation[] parameterAnnotations = (Annotation[]) FieldUtils.readDeclaredField(methodParameter, "additionalParameterAnnotations", true); if (ArrayUtils.isNotEmpty(parameterAnnotations)) for (int i = 0; i < parameterAnnotations.length; i++) { if (Parameter.class.equals(parameterAnnotations[i].annotationType())) { @@ -133,8 +131,7 @@ private Optional getNewParameterAnnotationForField(MethodParameter m Field field; Parameter parameterNew; try { - field = methodParameter.getContainingClass().getDeclaredField(parameterName); - Parameter parameter = field.getAnnotation(Parameter.class); + Parameter parameter = methodParameter.getContainingClass().getDeclaredField(parameterName).getAnnotation(Parameter.class); parameterNew = new Parameter() { @Override public Class annotationType() { @@ -1071,8 +1068,7 @@ else if (isSpringDataWebPropertiesPresent()) else name = originalName; break; - case "direction": - case "caseSensitive": + case "direction", "caseSensitive": name = originalName; break; default: diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java index 74a3bac4d..5aca346cf 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java index 8b5130cdc..8d7d1dae0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java index 9dc560053..0c6292dba 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java index 25d8d467e..5d5e73b5b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java index 970203322..7dc5d1d0f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java index 4c1d80b0e..f968dd408 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java index 568945325..2e1cb4aa3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java index 015f4afc7..3db7b105d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java index 25d3e11cc..488fac57c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java index 7dbaa0d3c..4eb65bd2f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java index 447958c3e..f9e50878d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java index bbd45e5d3..401f0d2e4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -155,11 +155,8 @@ public Operation customize(Operation operation, HandlerMethod handlerMethod) { */ private boolean getFieldValueOfBoolean(QuerydslBindings instance, String fieldName) { try { - Field field = FieldUtils.getDeclaredField(instance.getClass(), fieldName, true); - if (field != null) - return (boolean) field.get(instance); - } - catch (IllegalAccessException e) { + return (boolean) FieldUtils.readDeclaredField(instance, fieldName, true); + } catch (IllegalAccessException e) { LOGGER.warn(e.getMessage()); } return false; @@ -215,8 +212,7 @@ private Set getFieldValues(QuerydslBindings instance, String fieldName, */ private Map getPathSpec(QuerydslBindings instance, String fieldName) { try { - Field field = FieldUtils.getDeclaredField(instance.getClass(), fieldName, true); - return (Map) field.get(instance); + return (Map) FieldUtils.readDeclaredField(instance, fieldName, true); } catch (IllegalAccessException e) { LOGGER.warn(e.getMessage()); @@ -235,8 +231,7 @@ private Optional> getPathFromPathSpec(Object instance) { if (instance == null) { return Optional.empty(); } - Field field = FieldUtils.getDeclaredField(instance.getClass(), "path", true); - return (Optional>) field.get(instance); + return (Optional>) FieldUtils.readDeclaredField(instance, "path", true); } catch (IllegalAccessException e) { LOGGER.warn(e.getMessage()); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java index 47c5d3891..96155704b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java index f87f36eca..09f385d40 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java index e5736a206..70c4e72d8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java index 8a6bde515..86beecf4c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java index 7fd17b417..b8fce96f4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java index 12234f84e..df5fd874a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java index 60a5f02fd..0a4203d75 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java index 57a884d81..409e5b76c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -227,14 +227,12 @@ private Type getType(MethodParameter methodParameterReturn, RequestMethod reques Type returnType = GenericTypeResolver.resolveType(methodParameterReturn.getGenericParameterType(), methodParameterReturn.getContainingClass()); Class returnedEntityType = dataRestRepository.getReturnType(); - if (returnType instanceof ParameterizedType) { - ParameterizedType parameterizedType = (ParameterizedType) returnType; + if (returnType instanceof ParameterizedType parameterizedType) { if ((ResponseEntity.class.equals(parameterizedType.getRawType()))) { return getTypeForResponseEntity(requestMethod, dataRestRepository, returnedEntityType, parameterizedType); } else if ((HttpEntity.class.equals(parameterizedType.getRawType()) - && parameterizedType.getActualTypeArguments()[0] instanceof ParameterizedType)) { - ParameterizedType wildcardTypeUpperBound = (ParameterizedType) parameterizedType.getActualTypeArguments()[0]; + && parameterizedType.getActualTypeArguments()[0] instanceof ParameterizedType wildcardTypeUpperBound)) { if (RepresentationModel.class.equals(wildcardTypeUpperBound.getRawType())) { return resolveGenericType(HttpEntity.class, RepresentationModel.class, returnedEntityType); } @@ -294,8 +292,7 @@ private Type getTypeForCollectionModel(Class returnedEntityType, boolean pagingR */ private Type getTypeForWildcardType(RequestMethod requestMethod, DataRestRepository dataRestRepository, Class returnedEntityType, ParameterizedType parameterizedType) { WildcardType wildcardType = (WildcardType) parameterizedType.getActualTypeArguments()[0]; - if (wildcardType.getUpperBounds()[0] instanceof ParameterizedType) { - ParameterizedType wildcardTypeUpperBound = (ParameterizedType) wildcardType.getUpperBounds()[0]; + if (wildcardType.getUpperBounds()[0] instanceof ParameterizedType wildcardTypeUpperBound) { if (RepresentationModel.class.equals(wildcardTypeUpperBound.getRawType())) { Class type = findType(requestMethod, dataRestRepository); if (MapModel.class.equals(type)) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java index 917a66d99..9627bb445 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java index d8c53e613..990b1aa2a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index 00230a242..b5c2bac73 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java index d170a768b..6a9b7381a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java index c5fe4563d..86e65775f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java index 8bd7cbe00..aeaf793fd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java index 1741bd194..70abb947b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java index 1cca044de..2f83d8a6a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java index 8540fb5f9..ebd7a3d9e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java index 915ae1124..b8d259370 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java index d6d8882f7..61751f1b0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java index 827fbe58c..db5e2e81a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java index 93ee0b3fc..b4e2e835c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java index b9983b635..15d854830 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java index 97b6e86a7..243560478 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java index bcfbfa188..94b0d42bd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java index 292472741..df4a743ce 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java index 92d54bb1e..e0a533e1c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java index b48504be1..ce343d5ad 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java index afaf2ebec..7b67785c9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java index aa33b92b8..cd0e60184 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java index 795b3ca70..24671fb31 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java index 93b5ab27a..9e976045d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java index 6c0bb9b8f..5aa9cd4d0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java index c8d5e95e3..692b85eef 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java index fb977cce0..4a37cb158 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java index 662adb9dd..0218598eb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java index df517e6b9..986247162 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java index dcd9afd3a..db78ae162 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java index 77c14fdc8..3110f8e15 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java index 17113e2ca..2366d4d04 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java index f7bb66f28..d5dffe7c8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java index 745775fcd..ea1ec5a57 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java index 0a5418a15..014df19ec 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAdviceInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAdviceInfo.java index 55cf79f90..7c7e2a495 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAdviceInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAdviceInfo.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java index 8ab202d24..f36e0ffe5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java index 8daac917e..8a868682a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java index 1579e25f2..7d885729b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java index cbf0c66cc..6f99e4f78 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java index d8b1eb349..7cfb44a05 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java index 800297513..4f2468a42 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java index 6e96e8da3..6d76995f9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java index e77fe537a..64a3074b0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java index 602c4be14..87eb58c4a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -96,7 +96,7 @@ public abstract class ActuatorProvider implements ApplicationListener managementServerProperties, + protected ActuatorProvider(Optional managementServerProperties, Optional webEndpointProperties, ServerProperties serverProperties, SpringDocConfigProperties springDocConfigProperties) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java index 7ff910eec..76701ea5a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java index 6dc0dac90..c659c668a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java index 7f6cfb964..b29553ddf 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java index 76d4744d1..30d8df82e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -83,9 +83,9 @@ public static ObjectMapper createJson(SpringDocConfigProperties springDocConfigP OpenApiVersion openApiVersion = springDocConfigProperties.getApiDocs().getVersion(); ObjectMapper objectMapper; if (openApiVersion == OpenApiVersion.OPENAPI_3_1) - objectMapper = ObjectMapperProvider.createJson31(); + objectMapper = ObjectMapperFactory.createJson31(); else - objectMapper = ObjectMapperProvider.createJson(); + objectMapper = ObjectMapperFactory.createJson(); if (springDocConfigProperties.isWriterWithOrderByKeys()) sortOutput(objectMapper, springDocConfigProperties); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java index c3faf9ee7..73d4025d4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java index 548be3bda..602eb4cde 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java index 4a6d9277a..67f015c3b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java index c6e52eb1d..d76fb52f6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java index 31d289ca4..b9db4c50a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java index bf60f2368..f95fca286 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java index f435c503a..8b3702ee1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -63,11 +63,6 @@ public class SpringDocProviders { */ private final Optional springWebProvider; - /** - * The Web conversion service. - */ - private final Optional optionalWebConversionServiceProvider; - /** * The Object mapper provider. */ @@ -81,13 +76,11 @@ public class SpringDocProviders { * @param repositoryRestResourceProvider the repository rest resource provider * @param routerFunctionProvider the router function provider * @param springWebProvider the spring web provider - * @param optionalWebConversionServiceProvider the optional web conversion service provider * @param objectMapperProvider the object mapper provider */ public SpringDocProviders(Optional actuatorProvider, Optional springCloudFunctionProvider, Optional springSecurityOAuth2Provider, Optional repositoryRestResourceProvider, Optional routerFunctionProvider, Optional springWebProvider, - Optional optionalWebConversionServiceProvider, ObjectMapperProvider objectMapperProvider) { this.actuatorProvider = actuatorProvider; this.springCloudFunctionProvider = springCloudFunctionProvider; @@ -95,7 +88,6 @@ public SpringDocProviders(Optional actuatorProvider, Optional< this.repositoryRestResourceProvider = repositoryRestResourceProvider; this.routerFunctionProvider = routerFunctionProvider; this.springWebProvider = springWebProvider; - this.optionalWebConversionServiceProvider = optionalWebConversionServiceProvider; this.objectMapperProvider = objectMapperProvider; } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java index 66e4586aa..46ae707cc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -225,8 +225,7 @@ public List getRouterOperations(OpenAPI openAPI, Locale locale) if (!hiddenRepository) { if (resourceMetadata!=null && resourceMetadata.isExported()) { for (HandlerMapping handlerMapping : handlerMappingList) { - if (handlerMapping instanceof RepositoryRestHandlerMapping) { - RepositoryRestHandlerMapping repositoryRestHandlerMapping = (RepositoryRestHandlerMapping) handlerMapping; + if (handlerMapping instanceof RepositoryRestHandlerMapping repositoryRestHandlerMapping) { Map handlerMethodMap = repositoryRestHandlerMapping.getHandlerMethods(); // Entity controllers lookup first Map handlerMethodMapFiltered = handlerMethodMap.entrySet().stream() @@ -253,8 +252,7 @@ public List getRouterOperations(OpenAPI openAPI, Locale locale) } }); } - else if (handlerMapping instanceof BasePathAwareHandlerMapping) { - BasePathAwareHandlerMapping beanBasePathAwareHandlerMapping = (BasePathAwareHandlerMapping) handlerMapping; + else if (handlerMapping instanceof BasePathAwareHandlerMapping beanBasePathAwareHandlerMapping) { Map handlerMethodMap = beanBasePathAwareHandlerMapping.getHandlerMethods(); Map handlerMethodMapFiltered = handlerMethodMap.entrySet().stream() .filter(requestMappingInfoHandlerMethodEntry -> REPOSITORY_SCHEMA_CONTROLLER.equals(requestMappingInfoHandlerMethodEntry diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java index b9f2718c6..740afd38e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java index 9f27a3172..86c4e2c94 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -120,8 +120,7 @@ public Class getSpringConvertedType(Class clazz) { if (!AopUtils.isAopProxy(formattingConversionService)){ try { converters = convertersField.get(formattingConversionService); - convertersField = FieldUtils.getDeclaredField(converters.getClass(), CONVERTERS, true); - Map springConverters = (Map) convertersField.get(converters); + Map springConverters = (Map) FieldUtils.readDeclaredField(converters, CONVERTERS, true); Optional convertiblePairOptional = springConverters.keySet().stream().filter(convertiblePair -> convertiblePair.getTargetType().equals(clazz)).findAny(); if (convertiblePairOptional.isPresent()) { ConvertiblePair convertiblePair = convertiblePairOptional.get(); @@ -147,7 +146,7 @@ private boolean isAssignable(String target, Class type) { try { return ClassUtils.resolveClassName(target, null).isAssignableFrom(type); } - catch (Throwable ex) { + catch (Exception ex) { return false; } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 5f25e7f91..6f7543182 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -156,11 +156,6 @@ public abstract class AbstractRequestService { */ private final RequestBodyService requestBodyService; - /** - * The Operation builder. - */ - private final OperationService operationService; - /** * The Local spring doc parameter name discoverer. */ @@ -181,22 +176,21 @@ public abstract class AbstractRequestService { */ private boolean defaultSupportFormData; + /** * Instantiates a new Abstract request builder. * * @param parameterBuilder the parameter builder * @param requestBodyService the request body builder - * @param operationService the operation builder * @param parameterCustomizers the parameter customizers * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer */ protected AbstractRequestService(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, - OperationService operationService, Optional> parameterCustomizers, + Optional> parameterCustomizers, SpringDocParameterNameDiscoverer localSpringDocParameterNameDiscoverer) { super(); this.parameterBuilder = parameterBuilder; this.requestBodyService = requestBodyService; - this.operationService = operationService; parameterCustomizers.ifPresent(customizers -> customizers.removeIf(Objects::isNull)); this.parameterCustomizers = parameterCustomizers; this.localSpringDocParameterNameDiscoverer = localSpringDocParameterNameDiscoverer; @@ -655,6 +649,15 @@ public boolean isDefaultFlatParamObject() { return defaultFlatParamObject; } + /** + * Gets parameter builder. + * + * @return the parameter builder + */ + public GenericParameterService getParameterBuilder() { + return parameterBuilder; + } + /** * Calculate size. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index 175db7910..1c94d12d5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -532,7 +532,7 @@ private boolean isExplodable(io.swagger.v3.oas.annotations.Parameter p) { * @return the boolean */ public boolean isFile(MethodParameter methodParameter) { - if (methodParameter.getGenericParameterType() instanceof ParameterizedType) { + if (methodParameter.getGenericParameterType() instanceof ParameterizedType ) { ParameterizedType parameterizedType = (ParameterizedType) methodParameter.getGenericParameterType(); return isFile(parameterizedType); } @@ -562,8 +562,7 @@ private boolean isFile(ParameterizedType parameterizedType) { Class fileClass = ResolvableType.forType(type).getRawClass(); if (fileClass != null && isFile(fileClass)) return true; - else if (type instanceof WildcardType) { - WildcardType wildcardType = (WildcardType) type; + else if (type instanceof WildcardType wildcardType) { Type[] upperBounds = wildcardType.getUpperBounds(); return MultipartFile.class.getName().equals(upperBounds[0].getTypeName()); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index 84036f7b6..29c03f9b4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -653,8 +653,8 @@ private boolean isVoid(Type returnType) { boolean result = false; if (Void.TYPE.equals(returnType) || Void.class.equals(returnType)) result = true; - else if (returnType instanceof ParameterizedType) { - Type[] types = ((ParameterizedType) returnType).getActualTypeArguments(); + else if (returnType instanceof ParameterizedType parameterizedType) { + Type[] types = parameterizedType.getActualTypeArguments(); if (types != null && isResponseTypeWrapper(ResolvableType.forType(returnType).getRawClass())) result = isVoid(types[0]); } @@ -664,7 +664,7 @@ else if (returnType instanceof ParameterizedType) { private ControllerAdviceBean getControllerAdviceBean(List controllerAdviceBeans, Object controllerAdvice) { return controllerAdviceBeans.stream() - .filter(controllerAdviceBean -> controllerAdviceBean.getBeanType().getName().equals(controllerAdvice.getClass().getName())) + .filter(controllerAdviceBean -> (controllerAdviceBean.getBeanType()!=null && controllerAdviceBean.getBeanType().isAssignableFrom(controllerAdvice.getClass()))) .findFirst() .orElse(null); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java index d5c471e94..218acd757 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java index 9f289f57e..a563e651e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java index 7db605bf5..baf785889 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java index 9af4243d8..5212600e0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java index a3ff8bb9e..3869e5d9f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java index b4356f0d1..9f00c4e4b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java index 88993014c..781c58037 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java index 905a27f96..7ca39726a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -237,7 +237,7 @@ public static void mergeSchema(Content existingContent, Schema schemaN, Strin schemaObject = schemaN; } else if (firstSchema instanceof ComposedSchema) { - schemaObject = (ComposedSchema) firstSchema; + schemaObject = firstSchema; List listOneOf = schemaObject.getOneOf(); if (!CollectionUtils.isEmpty(listOneOf) && !listOneOf.contains(schemaN)) schemaObject.addOneOfItem(schemaN); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java index 79b9047e5..22cde4283 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java index 0cfa2a300..c2d162050 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java index f1023e3c6..bead59140 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java index 1192af327..361b659eb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java index 55e8d9e48..da9d944f5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ public abstract class AbstractSwaggerWelcome { * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties */ - public AbstractSwaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { + protected AbstractSwaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { this.swaggerUiConfig = swaggerUiConfig; this.springDocConfigProperties = springDocConfigProperties; } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java index e4e906af4..721c289fe 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java index 0f02ac3db..202711f48 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -292,7 +292,6 @@ private static class EmptyPathsOpenApiResource extends AbstractOpenApiResource { } @Override - public void getPaths(Map findRestControllers, Locale locale, OpenAPI openAPI) { - } + public void getPaths(Map findRestControllers, Locale locale, OpenAPI openAPI) {} } } \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/extractor/MethodParameterPojoExtractorTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/extractor/MethodParameterPojoExtractorTest.java index 088192515..771195751 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/extractor/MethodParameterPojoExtractorTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/extractor/MethodParameterPojoExtractorTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java index 832257519..d44d6d887 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/ui/AbstractSwaggerIndexTransformerTest.java @@ -20,7 +20,7 @@ import static org.hamcrest.Matchers.containsString; @ExtendWith(MockitoExtension.class) -public class AbstractSwaggerIndexTransformerTest { +class AbstractSwaggerIndexTransformerTest { private SwaggerUiConfigProperties swaggerUiConfig; @Mock diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java index bf461957a..dc43333c3 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java index 70e54a864..3c3db0343 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java index 61e178951..a54de415e 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java index 0b29503d1..3f429163d 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ public abstract class OpenApiResource extends AbstractOpenApiResource { * @param springDocProviders the spring doc providers * @param springDocCustomizers the spring doc customizers */ - public OpenApiResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, + protected OpenApiResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers) { diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java index e74632781..5122754be 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java index 392b1074d..60b7625eb 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java index e8819b128..bf6d21ebc 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -109,7 +109,6 @@ OpenApiWebfluxResource openApiResource(ObjectFactory openAPIBuil * * @param parameterBuilder the parameter builder * @param requestBodyService the request body builder - * @param operationService the operation builder * @param parameterCustomizers the parameter customizers * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer * @return the request builder @@ -118,11 +117,10 @@ OpenApiWebfluxResource openApiResource(ObjectFactory openAPIBuil @ConditionalOnMissingBean @Lazy(false) RequestService requestBuilder(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, - OperationService operationService, Optional> parameterCustomizers, SpringDocParameterNameDiscoverer localSpringDocParameterNameDiscoverer) { - return new RequestService(parameterBuilder, requestBodyService, - operationService, parameterCustomizers, localSpringDocParameterNameDiscoverer); + return new RequestService(parameterBuilder, requestBodyService, + parameterCustomizers, localSpringDocParameterNameDiscoverer); } /** diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java index 21ba89ac7..6c997efc1 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java index 16298036b..f9a73446e 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java index e9a9453d9..651c7ee9b 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java index bdf9cadd9..2f5f49bd7 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ import org.springdoc.core.discoverer.SpringDocParameterNameDiscoverer; import org.springdoc.core.service.AbstractRequestService; import org.springdoc.core.service.GenericParameterService; -import org.springdoc.core.service.OperationService; import org.springdoc.core.service.RequestBodyService; import org.springframework.http.codec.multipart.FilePart; @@ -60,13 +59,12 @@ public class RequestService extends AbstractRequestService { * * @param parameterBuilder the parameter builder * @param requestBodyService the request body builder - * @param operationService the operation builder * @param parameterCustomizers the parameter customizers * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer */ public RequestService(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, - OperationService operationService, Optional> parameterCustomizers, + Optional> parameterCustomizers, SpringDocParameterNameDiscoverer localSpringDocParameterNameDiscoverer) { - super(parameterBuilder, requestBodyService, operationService, parameterCustomizers, localSpringDocParameterNameDiscoverer); + super(parameterBuilder, requestBodyService, parameterCustomizers, localSpringDocParameterNameDiscoverer); } } diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java index d2bc2a132..dce9ae224 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 990d72f12..5bbdda803 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -40,7 +40,7 @@ public abstract class AbstractSpringDocTest extends AbstractCommonTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { String result = null; try { EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/HelloController.java index a38bd2590..30c0effa2 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/HelloController.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/HelloController.java @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/SpringDocApp184Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/SpringDocApp184Test.java index 5044b27ab..a666d7e51 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/SpringDocApp184Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/SpringDocApp184Test.java @@ -47,21 +47,21 @@ public class SpringDocApp184Test extends AbstractSpringDocTest { @Test - public void testGroup1() throws Exception { + void testGroup1() throws Exception { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group1").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app184-1.json"), true); } @Test - public void testGroup2() throws Exception { + void testGroup2() throws Exception { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group2").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app184-2.json"), true); } @Test - public void testGroup3() throws Exception { + void testGroup3() throws Exception { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group3").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app184-3.json"), true); diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/SpringDocApp187Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/SpringDocApp187Test.java index 6c7dd75b8..c077434bb 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/SpringDocApp187Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/SpringDocApp187Test.java @@ -12,7 +12,7 @@ class SpringDocApp187Test extends AbstractSpringDocTest { @Test - public void testAddRouterOperationCustomizerBean() { + void testAddRouterOperationCustomizerBean() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app187.json"), true); diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java index 8d9f0f88f..295640c02 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java @@ -13,7 +13,7 @@ class SpringDocApp188Test extends AbstractSpringDocTest { @Test - public void testApp1() { + void testApp1() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL +"/mygroup").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app188.json"), true); diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190Test.java index c3152e0ff..c98dbb03e 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190Test.java @@ -36,7 +36,7 @@ public class SpringDocApp190Test extends AbstractCommonTest { static class SpringDocTestApp {} @Test - public void test_disable_default_api_docs() throws Exception { + void test_disable_default_api_docs() throws Exception { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() .expectStatus().isNotFound(); } diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190bisTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190bisTest.java index 50b5a96d0..21a048c82 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190bisTest.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190bisTest.java @@ -36,7 +36,7 @@ public class SpringDocApp190bisTest extends AbstractCommonTest { static class SpringDocTestApp {} @Test - public void test_enable_default_api_docs() throws Exception { + void test_enable_default_api_docs() throws Exception { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() .expectStatus().isOk(); } diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/GetNameHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/GetNameHandler.java index 77c5f8c71..00854782a 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/GetNameHandler.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/GetNameHandler.java @@ -16,12 +16,4 @@ protected Mono apply(ServerRequest serverRequest) { .bodyValue("Name API is called"); } - // Since handle function is present in the BaseHandler class so it is not able to detect but it should - - // Uncommenting below code will work as expected since now explicitly handle is declared here - -// @Override -// public Mono handle(ServerRequest serverRequest) { -// return super.handle(serverRequest); -// } } diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java index dde4ed946..16119b069 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java @@ -29,7 +29,7 @@ public SpringDocApp66Test() { } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "streams").exchange() .expectStatus().isNotFound(); } diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java index 203331366..279d52509 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java @@ -28,7 +28,7 @@ public class SpringDocApp67Test extends AbstractSpringDocTest { @Test - public void testApp() throws Exception { + void testApp() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange().expectStatus().isOk().expectBody() .jsonPath("$.openapi").isEqualTo("3.0.1") .jsonPath("$.paths./api.get.tags[0]").isEqualTo("hello-controller") diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/core/ReactiveAutoConfigurationTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/core/ReactiveAutoConfigurationTest.java index a2d2cd0b3..92cf85aaf 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/core/ReactiveAutoConfigurationTest.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/core/ReactiveAutoConfigurationTest.java @@ -33,7 +33,7 @@ public class ReactiveAutoConfigurationTest { .withUserConfiguration(TestApp.class); @Test - public void configurations_successfully_loaded() { + void configurations_successfully_loaded() { contextRunner .run(context -> assertThat(context) .hasNotFailed() @@ -41,7 +41,7 @@ public void configurations_successfully_loaded() { } @Test - public void configurations_not_loaded_when_application_is_not_web() { + void configurations_not_loaded_when_application_is_not_web() { new ApplicationContextRunner() .withUserConfiguration(TestApp.class) .run(context -> assertThat(context) @@ -50,7 +50,7 @@ public void configurations_not_loaded_when_application_is_not_web() { } @Test - public void configurations_not_loaded_when_disabled() { + void configurations_not_loaded_when_disabled() { contextRunner .withPropertyValues("springdoc.api-docs.enabled=false") .run(context -> assertThat(context) @@ -59,7 +59,7 @@ public void configurations_not_loaded_when_disabled() { } @Test - public void configurations_not_loaded_when_reactor_is_not_on_class_path() { + void configurations_not_loaded_when_reactor_is_not_on_class_path() { contextRunner .withClassLoader(new FilteredClassLoader("org.springframework.web.reactive.HandlerResult")) .run(context -> assertThat(context) diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app67.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app67.json index 8ef7fdaac..91d457d75 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app67.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app67.json @@ -16,7 +16,7 @@ "tags": [ "hello-controller" ], - "operationId": "test_5", + "operationId": "test", "responses": { "200": { "description": "OK", @@ -34,7 +34,7 @@ "tags": [ "hello-controller" ], - "operationId": "test_4", + "operationId": "test_2", "responses": { "200": { "description": "OK", @@ -52,7 +52,7 @@ "tags": [ "hello-controller" ], - "operationId": "test", + "operationId": "test_1", "responses": { "200": { "description": "OK", @@ -70,7 +70,7 @@ "tags": [ "hello-controller" ], - "operationId": "test_1", + "operationId": "test_3", "responses": { "200": { "description": "OK", @@ -106,7 +106,7 @@ "tags": [ "hello-controller" ], - "operationId": "test_2", + "operationId": "test_5", "responses": { "200": { "description": "OK", @@ -124,7 +124,7 @@ "tags": [ "hello-controller" ], - "operationId": "test_3", + "operationId": "test_4", "responses": { "200": { "description": "OK", diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java index 87be64b21..9b88ba2e4 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java index da8eef445..e0dc89b03 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java index 0cd8d4357..54dd14133 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java index 44d90aba8..109fc4ff2 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java index 5a2a80b73..01d8c1ced 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java index ee07fb74a..a0bdc8e6b 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java index 435eba0e3..e8e9688f6 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java index b79397a8c..5661959bc 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ public abstract class SwaggerWelcomeCommon extends AbstractSwaggerWelcome { * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties */ - public SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { + protected SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { super(swaggerUiConfig, springDocConfigProperties); this.webJarsPrefixUrl = springDocConfigProperties.getWebjars().getPrefix(); } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java index 268e24049..54003c0de 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocActuatorTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocActuatorTest.java index 84de35823..a52f1db7e 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocActuatorTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocActuatorTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java index 6bff61bd4..8609d5015 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java @@ -31,7 +31,7 @@ public class SpringDocApp1RedirecFilterTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithConfigUrlIgnoringQueryParams() { + void shouldRedirectWithConfigUrlIgnoringQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java index 822181ba7..753f50363 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java @@ -34,7 +34,7 @@ public class SpringDocApp1RedirectConfigUrlTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithConfigUrlIgnoringQueryParams() { + void shouldRedirectWithConfigUrlIgnoringQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java index 7c524601c..f9e3795ba 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java @@ -29,7 +29,7 @@ public class SpringDocApp1RedirectDefaultTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithDefaultQueryParams() { + void shouldRedirectWithDefaultQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java index c2d5c4a65..0c99df952 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java @@ -31,7 +31,7 @@ public class SpringDocApp1RedirectLayoutTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithConfigUrlIgnoringQueryParams() { + void shouldRedirectWithConfigUrlIgnoringQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java index 5c277dc5a..e663aefd9 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java @@ -33,7 +33,7 @@ public class SpringDocApp1RedirectWithConfigTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithConfiguredParams() { + void shouldRedirectWithConfiguredParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1Test.java index 742ef974f..d4a3cb4e6 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1Test.java @@ -27,7 +27,7 @@ public class SpringDocApp1Test extends AbstractSpringDocTest { @Test - public void shouldDisplaySwaggerUiPage() { + void shouldDisplaySwaggerUiPage() { webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java index 08d178af1..1597a1130 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -57,14 +57,14 @@ void testIndex() { } @Test - public void testIndexActuator() { + void testIndexActuator() { HttpStatusCode httpStatusMono = webClient.get().uri("/application/swagger-ui") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); } @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { String contentAsString = webClient.get().uri("/application/swagger-ui/swagger-config").retrieve() .bodyToMono(String.class).block(); String expected = getContent("results/app13-1.json"); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java index ee6dad883..60b08be10 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -55,14 +55,14 @@ void testIndex() { } @Test - public void testIndexActuator() { + void testIndexActuator() { HttpStatusCode httpStatusMono = webClient.get().uri("/application/swagger-ui") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); } @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { String contentAsString = webClient.get().uri("/application/swagger-ui/swagger-config").retrieve() .bodyToMono(String.class).block(); String expected = getContent("results/app14-1.json"); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java index c8b504997..1f8b2a135 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -58,14 +58,14 @@ void testIndex() { } @Test - public void testIndexActuator() { + void testIndexActuator() { HttpStatusCode httpStatusMono = webClient.get().uri("/test/application/swagger-ui") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); } @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { String contentAsString = webClient.get().uri("/test/application/swagger-ui/swagger-config").retrieve() .bodyToMono(String.class).block(); String expected = getContent("results/app15-1.json"); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java index 9bdc47292..5f23af5e7 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -58,14 +58,14 @@ void testIndex() { } @Test - public void testIndexActuator() { + void testIndexActuator() { HttpStatusCode httpStatusMono = webClient.get().uri("/test/application/swagger-ui") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); } @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { String contentAsString = webClient.get().uri("/test/application/swagger-ui/swagger-config").retrieve() .bodyToMono(String.class).block(); String expected = getContent("results/app16-1.json"); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java index cac864a4e..1a16f01e3 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -61,7 +61,7 @@ void init() { } @Test - public void testIndex() throws Exception { + void testIndex() throws Exception { HttpStatusCode httpStatusMono = webClient.get().uri("/test/documentation/swagger-ui.html") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java index 1a5c13567..a9b7219dc 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ void init() { } @Test - public void testIndex() throws Exception { + void testIndex() throws Exception { HttpStatusCode httpStatusMono = webClient.get().uri("/") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app2/SpringDocApp2Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app2/SpringDocApp2Test.java index 3a01b7ff3..442c2f202 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app2/SpringDocApp2Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app2/SpringDocApp2Test.java @@ -28,7 +28,7 @@ public class SpringDocApp2Test extends AbstractSpringDocTest { @Test - public void shouldDisplaySwaggerUiPage() { + void shouldDisplaySwaggerUiPage() { webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isNotFound(); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java index ae94c3a0a..c529460d7 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ void init() { } @Test - public void testIndex() throws Exception { + void testIndex() throws Exception { HttpStatusCode httpStatusMono = webClient.get().uri("/test/swagger-ui.html") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java index cc60cd3a1..312f11ade 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java @@ -28,7 +28,7 @@ public class SpringDocApp21Test extends AbstractSpringDocTest { @Test - public void testUseRootPath() { + void testUseRootPath() { webTestClient.get().uri("/").exchange() .expectStatus().is3xxRedirection(); webTestClient.get().uri("/swagger-ui.html").exchange() diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app23/SpringDocApp23Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app23/SpringDocApp23Test.java index 5085ce923..2f8949afb 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app23/SpringDocApp23Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app23/SpringDocApp23Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ void init() { } @Test - public void testIndex() throws Exception { + void testIndex() throws Exception { HttpStatusCode httpStatusRoot = webClient.get().uri("/test/") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); Assertions.assertThat(httpStatusRoot).isEqualTo(HttpStatus.FOUND); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java index b2bacf0ac..0eace46d3 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java @@ -34,7 +34,7 @@ public class SpringDocApp24Test extends AbstractSpringDocTest { @Test - public void test_apidocs_disabled() { + void test_apidocs_disabled() { webTestClient.get().uri("/api-docs/swagger-config").exchange() .expectStatus().isOk().expectBody() .jsonPath("$.url").isEqualTo("/api-docs/xxx/v1/openapi.yml") diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocConfig.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocConfig.java index 73416f96e..94c3819b0 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocConfig.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocConfig.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java index cde1c80c4..bcfc081d9 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java @@ -35,7 +35,7 @@ public class SpringDocApp3RedirectDefaultTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithDefaultQueryParams() { + void shouldRedirectWithDefaultQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/documentation/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java index 23c408aa7..c93d0744d 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java @@ -34,7 +34,7 @@ public class SpringDocApp3RedirectWithPrefixTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithPrefix() { + void shouldRedirectWithPrefix() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/documentation/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java index dd934b039..18030ea5d 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java @@ -31,7 +31,7 @@ public class SpringDocApp3Test extends AbstractSpringDocTest { @Test - public void shouldDisplaySwaggerUiPage() { + void shouldDisplaySwaggerUiPage() { webTestClient.get().uri("/documentation/swagger-ui.html").exchange() .expectStatus().isFound(); webTestClient.get().uri("/documentation/webjars/swagger-ui/index.html").exchange() diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java index 63df60b18..d5f5c013c 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java @@ -39,13 +39,13 @@ public class SpringDocBehindProxyTest extends AbstractSpringDocTest { private static final String X_FORWARD_PREFIX = "/path/prefix"; @Test - public void shouldServeSwaggerUIAtDefaultPath() { + void shouldServeSwaggerUIAtDefaultPath() { webTestClient.get().uri("/webjars/swagger-ui/index.html").exchange() .expectStatus().isOk(); } @Test - public void shouldReturnCorrectInitializerJS() throws Exception { + void shouldReturnCorrectInitializerJS() throws Exception { webTestClient .get().uri("/webjars/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) @@ -59,7 +59,7 @@ public void shouldReturnCorrectInitializerJS() throws Exception { } @Test - public void shouldCalculateOauthRedirectBehindProxy() throws Exception { + void shouldCalculateOauthRedirectBehindProxy() throws Exception { webTestClient .get().uri("/v3/api-docs/swagger-config") .header("X-Forwarded-Proto", "https") @@ -71,7 +71,7 @@ public void shouldCalculateOauthRedirectBehindProxy() throws Exception { } @Test - public void shouldCalculateUrlsBehindProxy() throws Exception { + void shouldCalculateUrlsBehindProxy() throws Exception { webTestClient .get().uri("/v3/api-docs/swagger-config") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) @@ -84,7 +84,7 @@ public void shouldCalculateUrlsBehindProxy() throws Exception { } @Test - public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() throws Exception { + void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() throws Exception { var tasks = IntStream.range(0, 10).mapToObj(i -> CompletableFuture.runAsync(() -> { try { webTestClient.get().uri("/webjars/swagger-ui/swagger-initializer.js") @@ -105,7 +105,7 @@ public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() } @Test - public void shouldCalculateUrlsBehindProxyWhenChangingForwardedPrefixHeader() { + void shouldCalculateUrlsBehindProxyWhenChangingForwardedPrefixHeader() { var tasks = IntStream.range(0, 10).mapToObj(i -> CompletableFuture.runAsync(() -> { try { webTestClient.get().uri("/v3/api-docs/swagger-config") diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java index 523036699..3c1cf2bdd 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java @@ -37,7 +37,7 @@ public class SpringDocBehindProxyWithCustomUIPathTest extends AbstractSpringDocT private static final String X_FORWARD_PREFIX = "/path/prefix"; @Test - public void shouldRedirectSwaggerUIFromCustomPath() { + void shouldRedirectSwaggerUIFromCustomPath() { webTestClient .get().uri("/foo/documentation/swagger.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) @@ -47,7 +47,7 @@ public void shouldRedirectSwaggerUIFromCustomPath() { } @Test - public void shouldReturnCorrectInitializerJS() { + void shouldReturnCorrectInitializerJS() { webTestClient .get().uri("/foo/documentation/webjars/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) @@ -61,7 +61,7 @@ public void shouldReturnCorrectInitializerJS() { } @Test - public void shouldCalculateUrlsBehindProxy() throws Exception { + void shouldCalculateUrlsBehindProxy() throws Exception { webTestClient .get().uri("/v3/api-docs/swagger-config") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java index dbeff0461..4ce4ec5d7 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java @@ -38,7 +38,7 @@ public class SpringDocBehindProxyWithCustomUIPathWithApiDocsTest extends Abstrac private static final String X_FORWARD_PREFIX = "/path/prefix"; @Test - public void shouldRedirectSwaggerUIFromCustomPath() { + void shouldRedirectSwaggerUIFromCustomPath() { webTestClient .get().uri("/foo/documentation/swagger.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) @@ -48,7 +48,7 @@ public void shouldRedirectSwaggerUIFromCustomPath() { } @Test - public void shouldReturnCorrectInitializerJS() { + void shouldReturnCorrectInitializerJS() { webTestClient .get().uri("/foo/documentation/webjars/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) @@ -62,7 +62,7 @@ public void shouldReturnCorrectInitializerJS() { } @Test - public void shouldCalculateUrlsBehindProxy() { + void shouldCalculateUrlsBehindProxy() { webTestClient .get().uri("/bar/openapi/v3/swagger-config") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java index 1b0a78062..32b2f2196 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java @@ -62,7 +62,7 @@ void init() { } @Test - public void testIndex() throws Exception { + void testIndex() throws Exception { HttpStatusCode httpStatusMono = webClient.get().uri(WEBFLUX_BASE_PATH+"/documentation/swagger-ui.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java index 16d2c222f..83cb385c0 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java @@ -26,7 +26,7 @@ public class SpringDocOauthPathsTest extends AbstractSpringDocTest { @Test - public void oauth2_redirect_url_calculated() throws Exception { + void oauth2_redirect_url_calculated() throws Exception { webTestClient.get().uri("/v3/api-docs/swagger-config").exchange() .expectStatus().isOk().expectBody() .jsonPath("$.oauth2RedirectUrl").isEqualTo("/webjars/swagger-ui/oauth2-redirect.html"); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsWithPropertyTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsWithPropertyTest.java index dad1c4417..e7766ed00 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsWithPropertyTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsWithPropertyTest.java @@ -30,7 +30,7 @@ public class SpringDocOauthPathsWithPropertyTest extends AbstractSpringDocTest { @Test - public void oauth2_redirect_url_calculated() throws Exception { + void oauth2_redirect_url_calculated() throws Exception { webTestClient.get().uri("/v3/api-docs/swagger-config").exchange() .expectStatus().isOk().expectBody() .jsonPath("oauth2RedirectUrl", equalTo("http://localhost:8080/toto/test/swagger-ui/oauth2-redirect.html")); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java index 4af19f3ec..f141d05fe 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java @@ -28,7 +28,7 @@ public class SpringDocOauthRedirectUrlRecalculateTest extends AbstractSpringDocTest { @Test - public void oauth2_redirect_url_recalculation() throws Exception { + void oauth2_redirect_url_recalculation() throws Exception { webTestClient.get().uri("/v3/api-docs/swagger-config") .header("X-Forwarded-Proto", "https") diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java index 96875348f..aa7fa86ca 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java @@ -30,13 +30,13 @@ public class SpringDocOauthServletPathsTest extends AbstractSpringDocTest { @Test - public void should_display_oauth2_redirect_page() throws Exception { + void should_display_oauth2_redirect_page() throws Exception { webTestClient.get().uri("/test/webjars/swagger-ui/oauth2-redirect.html").exchange() .expectStatus().isOk(); } @Test - public void oauth2_redirect_url_calculated_with_context_path_and_servlet_path() throws Exception { + void oauth2_redirect_url_calculated_with_context_path_and_servlet_path() throws Exception { webTestClient.get().uri("/v3/api-docs/swagger-config").exchange() .expectStatus().isOk(); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java index 9d572af06..75d78cbf4 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java @@ -28,7 +28,7 @@ public class SpringDocApp5Test extends AbstractSpringDocTest { @Test - public void transformed_index_with_oauth() { + void transformed_index_with_oauth() { super.checkJS("index5"); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java index 43e470142..a5f7980a9 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java @@ -35,7 +35,7 @@ public class SpringDocApp6Test extends AbstractSpringDocTest { @Test - public void transformed_index_with_oauth() throws Exception { + void transformed_index_with_oauth() throws Exception { EntityExchangeResult getResult = webTestClient.get().uri("/webjars" + Constants.SWAGGER_INITIALIZER_URL) .exchange() .expectStatus().isOk() diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java index 644c7d0d9..019fc372c 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java @@ -35,7 +35,7 @@ public class SpringDocApp7Test extends AbstractSpringDocTest { @Test - public void transformed_index_with_oauth() throws Exception { + void transformed_index_with_oauth() throws Exception { EntityExchangeResult getResult = webTestClient.get().uri("/webjars" + Constants.SWAGGER_INITIALIZER_URL) .exchange() .expectStatus().isOk() diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java index 9fdde5b9d..b66e7b5aa 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java index 673c63185..ce6503813 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -109,7 +109,7 @@ public abstract class MultipleOpenApiResource implements InitializingBean { * @param springDocProviders the spring doc providers * @param springDocCustomizers the spring doc customizers */ - public MultipleOpenApiResource(List groupedOpenApis, + protected MultipleOpenApiResource(List groupedOpenApis, ObjectFactory defaultOpenAPIBuilder, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers) { diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java index 3096829ae..6d25f3f11 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java index 784077313..871d7de48 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java index 288496a80..19f0d4be1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -84,7 +84,7 @@ public abstract class OpenApiResource extends AbstractOpenApiResource { * @param springDocProviders the spring doc providers * @param springDocCustomizers the spring doc customizers */ - public OpenApiResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, + protected OpenApiResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers) { diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java index e121c9411..2fabe8833 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java index 1eeabe2a0..52c88ce2c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java index b14e61c37..6ed7a4b4f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -118,7 +118,6 @@ OpenApiWebMvcResource openApiResource(ObjectFactory openAPIBuild * * @param parameterBuilder the parameter builder * @param requestBodyService the request body builder - * @param operationService the operation builder * @param parameterCustomizers the parameter customizers * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer * @return the request builder @@ -127,10 +126,10 @@ OpenApiWebMvcResource openApiResource(ObjectFactory openAPIBuild @ConditionalOnMissingBean @Lazy(false) RequestService requestBuilder(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, - OperationService operationService, Optional> parameterCustomizers, + Optional> parameterCustomizers, SpringDocParameterNameDiscoverer localSpringDocParameterNameDiscoverer) { return new RequestService(parameterBuilder, requestBodyService, - operationService, parameterCustomizers, localSpringDocParameterNameDiscoverer); + parameterCustomizers, localSpringDocParameterNameDiscoverer); } /** diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java index 1a6be0f2a..235fb3663 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java index 7f0a867ef..d94298c76 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java index d1916e832..104ce30d3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java index def7487d1..22b0ca818 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java index 1df30d620..6a25793be 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ import org.springdoc.core.discoverer.SpringDocParameterNameDiscoverer; import org.springdoc.core.service.AbstractRequestService; import org.springdoc.core.service.GenericParameterService; -import org.springdoc.core.service.OperationService; import org.springdoc.core.service.RequestBodyService; import static org.springdoc.core.utils.SpringDocUtils.getConfig; @@ -56,13 +55,12 @@ public class RequestService extends AbstractRequestService { * * @param parameterBuilder the parameter builder * @param requestBodyService the request body builder - * @param operationService the operation builder * @param parameterCustomizers the parameter customizers * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer */ public RequestService(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, - OperationService operationService, Optional> parameterCustomizers, + Optional> parameterCustomizers, SpringDocParameterNameDiscoverer localSpringDocParameterNameDiscoverer) { - super(parameterBuilder, requestBodyService, operationService, parameterCustomizers, localSpringDocParameterNameDiscoverer); + super(parameterBuilder, requestBodyService, parameterCustomizers, localSpringDocParameterNameDiscoverer); } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocV30Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocV30Test.java index bdbf37b20..f1c8e81af 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocV30Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocV30Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public abstract class AbstractSpringDocV30Test extends AbstractCommonTest { public static String className; @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiException.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiException.java deleted file mode 100644 index 3c99d2328..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v30.app1; - -public final class ApiException extends Exception { - - private static final long serialVersionUID = 1L; - - @SuppressWarnings("unused") - - private final int code; - - public ApiException(int code, String msg) { - super(msg); - this.code = code; - } -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiOriginFilter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiOriginFilter.java deleted file mode 100644 index f51c4dedc..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiOriginFilter.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v30.app1; - -import java.io.IOException; - -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.http.HttpServletResponse; - -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") -public class ApiOriginFilter implements jakarta.servlet.Filter { - @Override - public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException, ServletException { - HttpServletResponse res = (HttpServletResponse) response; - res.addHeader("Access-Control-Allow-Origin", "*"); - res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); - res.addHeader("Access-Control-Allow-Headers", "Content-Type"); - chain.doFilter(request, response); - } - - @Override - public void destroy() { - } - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - } -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiResponseMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiResponseMessage.java deleted file mode 100644 index e06ad2e49..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ApiResponseMessage.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v30.app1; - -import jakarta.xml.bind.annotation.XmlTransient; - -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") -@jakarta.xml.bind.annotation.XmlRootElement -public class ApiResponseMessage { - public static final int ERROR = 1; - - public static final int WARNING = 2; - - public static final int INFO = 3; - - public static final int OK = 4; - - public static final int TOO_BUSY = 5; - - int code; - - String type; - - String message; - - public ApiResponseMessage() { - } - - public ApiResponseMessage(int code, String message) { - this.code = code; - switch (code) { - case ERROR: - setType("error"); - break; - case WARNING: - setType("warning"); - break; - case INFO: - setType("info"); - break; - case OK: - setType("ok"); - break; - case TOO_BUSY: - setType("too busy"); - break; - default: - setType("unknown"); - break; - } - this.message = message; - } - - @XmlTransient - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ErrorMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ErrorMessage.java index 81fa2f825..ba4ce126a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ErrorMessage.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ErrorMessage.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ExceptionTranslator.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ExceptionTranslator.java index c042e3685..8c5d8dbe2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ExceptionTranslator.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ExceptionTranslator.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java index 2d648b376..f56d97ca9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/HomeController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/HomeController.java index bbcc0dce7..4eb493570 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/HomeController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/HomeController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryApi.java index 9010567a9..2e0d00f5e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryApiController.java index aa4933e48..3c88f7816 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryItem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryItem.java index b59127a5f..89a40c268 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryItem.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/InventoryItem.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemController.java index 804e852d8..1fa72bada 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemDTO.java index bc42fb4c5..53faa1aa9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemLightDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemLightDTO.java index 572e96077..1cebbea5b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemLightDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/ItemLightDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/Manufacturer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/Manufacturer.java index a81ac80cc..8276edb25 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/Manufacturer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/Manufacturer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/PeopleRestService.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/PeopleRestService.java index af2b5c837..b6caeb8ba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/PeopleRestService.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/PeopleRestService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/PersonDTO.java index 4fc6191a9..ee01f5b54 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java index 9b0cd73df..733d822b5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java index b5961527c..1257827a6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java index 60bf777ea..0f305f273 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/HelloController.java index d80fdcba2..4c3f1db37 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/PersonDTO.java index efe29ec5d..6d81886ea 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/SpringDocApp100Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/SpringDocApp100Test.java index 76ea33096..3e9c66f9a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/SpringDocApp100Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app100/SpringDocApp100Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/HelloController.java index 686fffba8..561400241 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/HelloDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/HelloDTO.java index 3a37ecb82..a331b775c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/HelloDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/HelloDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/SpringDocApp101Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/SpringDocApp101Test.java index 71459ebb1..724086f83 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/SpringDocApp101Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app101/SpringDocApp101Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java index fa12b0a82..1d098c5c3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java index 4ef3c62b1..95d040788 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java index 401f0bac5..5383be94c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/TestController.java index 04ecb3c18..384cc792c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/TestController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app102/TestController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/ExampleBody.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/ExampleBody.java index 5264aace2..0f828813b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/ExampleBody.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/ExampleBody.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/HelloController.java index 20063cc09..abe102c33 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/SpringDocApp103Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/SpringDocApp103Test.java index f1e68129e..40b8b7a82 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/SpringDocApp103Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app103/SpringDocApp103Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/CrudController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/CrudController.java index 6c3e4000a..abc9e4ce2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/CrudController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/CrudController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/Design.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/Design.java index 45a3ae0e8..b93a03563 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/Design.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/Design.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/DesignController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/DesignController.java index 18f177621..fe99dda0c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/DesignController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/DesignController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/HavingPK.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/HavingPK.java index cad821173..66b7e14a7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/HavingPK.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/HavingPK.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/SpringDocApp104Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/SpringDocApp104Test.java index f2934b3f8..1271259ad 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/SpringDocApp104Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app104/SpringDocApp104Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/SpringDocApp105Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/SpringDocApp105Test.java index 7297c7249..e43ad48ea 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/SpringDocApp105Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/SpringDocApp105Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -60,7 +60,7 @@ public class SpringDocApp105Test extends AbstractSpringDocV30Test { public static String className; @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -68,7 +68,7 @@ public void testApp() throws Exception { } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -76,7 +76,7 @@ public void testApp2() throws Exception { } @Test - public void testApp3() throws Exception { + void testApp3() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -84,7 +84,7 @@ public void testApp3() throws Exception { } @Test - public void testApp4() throws Exception { + void testApp4() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/ApiUtil.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/ApiUtil.java index b013e3df1..f2693fc23 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/ApiUtil.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/ApiUtil.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/ExceptionTranslator.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/ExceptionTranslator.java index 1d42f8d6e..718b7ecfa 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/ExceptionTranslator.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/ExceptionTranslator.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/HomeController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/HomeController.java index 38d1aadeb..31510e3cf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/HomeController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/HomeController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApi.java index 310b519f8..baa25e173 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiController.java index 756eda3b7..e2b81c158 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegate.java index 2686d2d38..461a6cd6e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegate.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegate.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegateImpl.java index ac9b8fab4..4cb8411d4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegateImpl.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegateImpl.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApi.java index 102dbdd93..82b808b91 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiController.java index abdd875d5..11832dea4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegate.java index 5e074978d..352c2bcd4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegate.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegate.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegateImpl.java index bf38c8a05..e319b6c05 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegateImpl.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegateImpl.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApi.java index da60147fb..9b544228f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiController.java index 5a873402f..aa2912d05 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegate.java index d025a570f..6f6dc5860 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegate.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegate.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegateImpl.java index 9fb9385f2..c7d6237d9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegateImpl.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegateImpl.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Body.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Body.java index 616a4b33b..a39a9c0a0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Body.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Body.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Body1.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Body1.java index db937be72..15aace704 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Body1.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Body1.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Category.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Category.java index cfc392637..bfdabcd30 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Category.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Category.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/ModelApiResponse.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/ModelApiResponse.java index 5e56ca4c1..c082cd09d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/ModelApiResponse.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/ModelApiResponse.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Order.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Order.java index 06edebb83..0f62ecf2e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Order.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Order.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Pet.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Pet.java index c59f240a8..a3ddaf3c9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Pet.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Pet.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Tag.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Tag.java index 315135f05..ef6c62f87 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Tag.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/Tag.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/User.java index f13e7fa8d..387ce683e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/User.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app105/model/User.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app106/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app106/HelloController.java index 0d9736546..95cc687ab 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app106/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app106/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app106/SpringDocApp106Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app106/SpringDocApp106Test.java index 754a89e09..a6ea4d7f3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app106/SpringDocApp106Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app106/SpringDocApp106Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app107/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app107/HelloController.java index fd6afbf07..deb37021a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app107/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app107/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app107/SpringDocApp107Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app107/SpringDocApp107Test.java index c05122160..ce24d893a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app107/SpringDocApp107Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app107/SpringDocApp107Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/ActionResult.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/ActionResult.java index 9094fa151..5604cced0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/ActionResult.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/ActionResult.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/HelloController.java index 1a71d149a..b68c0ff90 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/SpringDocApp108Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/SpringDocApp108Test.java index 4ff7dd5df..416e416a2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/SpringDocApp108Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app108/SpringDocApp108Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app109/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app109/HelloController.java index 727e12ef8..f10a6caed 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app109/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app109/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app109/SpringDocApp109Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app109/SpringDocApp109Test.java index 554dc09f5..b95536b6a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app109/SpringDocApp109Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app109/SpringDocApp109Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java index 8c36bb1c4..fdb87f710 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java index 2c1f6d171..d57cccf07 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/ErrorMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/ErrorMessage.java index 75d5a0741..458a74269 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/ErrorMessage.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/ErrorMessage.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/GlobalControllerAdvice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/GlobalControllerAdvice.java index 2cfe6fa64..6946ff66c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/GlobalControllerAdvice.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/GlobalControllerAdvice.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -60,10 +60,7 @@ public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler @ExceptionHandler(Throwable.class) @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) public ResponseEntity problem(final Throwable e) { - String message = e.getMessage(); - //might actually prefer to use a geeric mesasge - - message = "Problem occured"; + String message = "Problem occured"; UUID uuid = UUID.randomUUID(); String logRef = uuid.toString(); logger.error("logRef=" + logRef, message, e); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/Person.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/Person.java index 58e518385..c27aab2df 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/Person.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/Person.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/PersonController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/PersonController.java index eaac74f59..4f689c20e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/PersonController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/PersonController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/PersonController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/PersonController2.java index 43dd3260d..ed80cd1f8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/PersonController2.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/PersonController2.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/Problem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/Problem.java index d39d8d644..2e4db30bf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/Problem.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/Problem.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/SpringDocApp110Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/SpringDocApp110Test.java index 041471e02..d6cdd00f2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/SpringDocApp110Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app110/SpringDocApp110Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/ErrorMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/ErrorMessage.java index 0ad77cb10..c31ad2d3d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/ErrorMessage.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/ErrorMessage.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/GlobalControllerAdvice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/GlobalControllerAdvice.java index 7567cf84a..1dbf22d68 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/GlobalControllerAdvice.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/GlobalControllerAdvice.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -60,10 +60,7 @@ public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler @ExceptionHandler(Throwable.class) @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) public ResponseEntity problem(final Throwable e) { - String message = e.getMessage(); - //might actually prefer to use a geeric mesasge - - message = "Problem occured"; + String message = "Problem occured"; UUID uuid = UUID.randomUUID(); String logRef = uuid.toString(); logger.error("logRef=" + logRef, message, e); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/Person.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/Person.java index 63fd56ad6..dbbd2084e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/Person.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/Person.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/PersonController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/PersonController.java index b84ca71ee..05ffe922d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/PersonController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/PersonController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/PersonController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/PersonController2.java index d6f088f8a..c791fd3c2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/PersonController2.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/PersonController2.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/Problem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/Problem.java index c4a9e82e2..0206ac1ed 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/Problem.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/Problem.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/SpringDocApp111Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/SpringDocApp111Test.java index 097422656..dad12e8d6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/SpringDocApp111Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app111/SpringDocApp111Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/ErrorMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/ErrorMessage.java index f860b6a5f..f6a59ad0f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/ErrorMessage.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/ErrorMessage.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/GlobalControllerAdvice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/GlobalControllerAdvice.java index f7ac14436..df4676df3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/GlobalControllerAdvice.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/GlobalControllerAdvice.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -60,10 +60,7 @@ public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler @ExceptionHandler(Throwable.class) @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) public ResponseEntity problem(final Throwable e) { - String message = e.getMessage(); - //might actually prefer to use a geeric mesasge - - message = "Problem occured"; + String message = "Problem occured"; UUID uuid = UUID.randomUUID(); String logRef = uuid.toString(); logger.error("logRef=" + logRef, message, e); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/Person.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/Person.java index 261a01ab7..560ec4a4d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/Person.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/Person.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/PersonController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/PersonController.java index acc6048d3..fcb6215a8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/PersonController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/PersonController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/Problem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/Problem.java index 3961b8734..3363db5a6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/Problem.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/Problem.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/SpringDocApp112Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/SpringDocApp112Test.java index b88831b66..68b6e5e6e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/SpringDocApp112Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/SpringDocApp112Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/sample/PersonController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/sample/PersonController2.java index 170ac7ef7..69811786a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/sample/PersonController2.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/sample/PersonController2.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app113/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app113/HelloController.java index 5de8db421..d488d4b6d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app113/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app113/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app113/SpringDocApp113Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app113/SpringDocApp113Test.java index 4e7c725c8..3d6571237 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app113/SpringDocApp113Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app113/SpringDocApp113Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app114/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app114/HelloController.java index 8e059df45..ba7799e63 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app114/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app114/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app114/SpringDocApp114Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app114/SpringDocApp114Test.java index 2f838376f..d9ac7c65c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app114/SpringDocApp114Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app114/SpringDocApp114Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/HelloController.java index 454ac6135..b9dab8b1e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java index a63ffa547..44564e9b6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java index 83247f2c8..b4ad1cf6b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/FooErrorHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/FooErrorHandler.java index db1f6d8fe..91ed77440 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/FooErrorHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/FooErrorHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/HelloController.java index 724e4c8dd..c4d86f4a0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/SpringDocApp116Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/SpringDocApp116Test.java index 5caa1c6a8..57dbdb7c5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/SpringDocApp116Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app116/SpringDocApp116Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app117/HelloApplication.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app117/HelloApplication.java index 393c4d011..7ba64cce8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app117/HelloApplication.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app117/HelloApplication.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app117/SpringDocApp117Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app117/SpringDocApp117Test.java index 07ae5c0de..17184fc53 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app117/SpringDocApp117Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app117/SpringDocApp117Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/AbstractParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/AbstractParent.java index f494538ff..b019187a9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/AbstractParent.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/AbstractParent.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/ConcreteParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/ConcreteParent.java index 4a11af1ed..c5d481343 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/ConcreteParent.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/ConcreteParent.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/Controller.java index a351dd2fd..b2c35af3c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/Controller.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/Controller.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/SpringDocApp118Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/SpringDocApp118Test.java index db406ea63..eec233371 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/SpringDocApp118Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app118/SpringDocApp118Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java index 6a0385656..6b21f521b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/JsonRequest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/JsonRequest.java index f23f27521..ef43fd161 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/JsonRequest.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/JsonRequest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/SpringDocApp119Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/SpringDocApp119Test.java index 08eb3d76d..ccc968cd8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/SpringDocApp119Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app119/SpringDocApp119Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java index 911d8ad5b..23deedaa4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java index 4033c3f76..e4148fda0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/AccountId.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/AccountId.java index cf1f80b54..3fb9b1288 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/AccountId.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/AccountId.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/MetaAnnotationController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/MetaAnnotationController.java index c481d3c13..15b41296f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/MetaAnnotationController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/MetaAnnotationController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/SpringDocApp120Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/SpringDocApp120Test.java index 08c67a3a7..06d0002d9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/SpringDocApp120Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app120/SpringDocApp120Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/InheritedRequestParams.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/InheritedRequestParams.java index 26e06e4b6..3bf12d49b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/InheritedRequestParams.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/InheritedRequestParams.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/RequestParams.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/RequestParams.java index 892e04c60..14f805ed5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/RequestParams.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/RequestParams.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/SpringDocApp121Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/SpringDocApp121Test.java index f711947bc..830de5f42 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/SpringDocApp121Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/SpringDocApp121Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/TestController.java index 8380ead84..af89c0f61 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/TestController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app121/TestController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/BaseController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/BaseController.java index 10a144787..92f340e2b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/BaseController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/BaseController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/BaseObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/BaseObject.java index ffcf7e469..aedb70717 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/BaseObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/BaseObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/CustomerDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/CustomerDto.java index bbd2a2f62..ec42b9030 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/CustomerDto.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/CustomerDto.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/FirstController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/FirstController.java index d3e947a4f..3182aad9e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/FirstController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/FirstController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/SpringDocApp122Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/SpringDocApp122Test.java index bc2818471..11597e396 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/SpringDocApp122Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/SpringDocApp122Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/Wrapper.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/Wrapper.java index cc0c49731..0789873e6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/Wrapper.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app122/Wrapper.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/HelloController.java index c469edb12..8297aac4a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/MyExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/MyExceptionHandler.java index 74fd0dd10..8f86ee05f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/MyExceptionHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/MyExceptionHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/SpringDocApp123Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/SpringDocApp123Test.java index bd93af3ad..668ff7fa4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/SpringDocApp123Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app123/SpringDocApp123Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/HelloController.java index 72ccdfd5a..730c80660 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/MyExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/MyExceptionHandler.java index 17932f0e5..126584f49 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/MyExceptionHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/MyExceptionHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/SpringDocApp124Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/SpringDocApp124Test.java index aede8d54d..9735cd03e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/SpringDocApp124Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app124/SpringDocApp124Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/HelloController.java index 4568c5020..1c9029a9d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/Problem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/Problem.java index 45439b0a6..7491caa32 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/Problem.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/Problem.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/SecurityProblemResponsesConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/SecurityProblemResponsesConfiguration.java index 83526395b..f4dbd955b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/SecurityProblemResponsesConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/SecurityProblemResponsesConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/SpringDocApp126Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/SpringDocApp126Test.java index 3b332b37d..80e826438 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/SpringDocApp126Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app126/SpringDocApp126Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/AbstractObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/AbstractObject.java index e6ba191d2..a205f56ff 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/AbstractObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/AbstractObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/ConcreteObjectA.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/ConcreteObjectA.java index e6eea41a5..f8dfc7d7b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/ConcreteObjectA.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/ConcreteObjectA.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/ConcreteType.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/ConcreteType.java index e15a1c3ca..365140758 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/ConcreteType.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/ConcreteType.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/Controller.java index 0216aed57..051033f40 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/Controller.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/Controller.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/SpringDocApp127Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/SpringDocApp127Test.java index a52c5fc39..facab9836 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/SpringDocApp127Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/SpringDocApp127Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ public class SpringDocApp127Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + ".yaml")).andExpect(status().isOk()).andReturn(); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/Umbrella.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/Umbrella.java index a7eb162ae..95373ed3b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/Umbrella.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app127/Umbrella.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/ActualReturnedEntity.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/ActualReturnedEntity.java index 001a5d0d6..3ef20ac70 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/ActualReturnedEntity.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/ActualReturnedEntity.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/HelloController.java index dae7c80c0..a11b992b9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/OperationResponse.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/OperationResponse.java index 6c3fcc983..18d2690d5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/OperationResponse.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/OperationResponse.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/SpringDocApp129Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/SpringDocApp129Test.java index 4f7dfd009..c30cde342 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/SpringDocApp129Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app129/SpringDocApp129Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java index fbb971edd..17a192ec6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java index 884ab7bc3..c882dc0ec 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java index 3a5477d56..2c9f3b1b8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/HelloController.java index 88b1359e2..55c114e3a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/SpringDocApp130Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/SpringDocApp130Test.java index def2d58bc..b35938dd3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/SpringDocApp130Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/SpringDocApp130Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/TrackerData.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/TrackerData.java index c42519081..9cd3a16f1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/TrackerData.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app130/TrackerData.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/HelloController.java index 58f4d9c1c..8f4ba34b3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/Organization.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/Organization.java index 049955a0e..5f0b658b5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/Organization.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/Organization.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/RestControllerError.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/RestControllerError.java index 713c8d582..e28658bba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/RestControllerError.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/RestControllerError.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/SpringDocApp131Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/SpringDocApp131Test.java index f648a0799..8e2eded3d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/SpringDocApp131Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app131/SpringDocApp131Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/HelloController.java index f221f3f8f..731416081 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/Organization.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/Organization.java index 80203f4ed..89d061a09 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/Organization.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/Organization.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/RestControllerError.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/RestControllerError.java index 80e3f8c11..3172a6792 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/RestControllerError.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/RestControllerError.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/SpringDocApp132Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/SpringDocApp132Test.java index 5658f4e72..ce16f46b6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/SpringDocApp132Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app132/SpringDocApp132Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app133/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app133/HelloController.java index 5b29582b9..74e3f3ce0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app133/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app133/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app133/SpringDocApp133Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app133/SpringDocApp133Test.java index fd5287952..37076e374 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app133/SpringDocApp133Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app133/SpringDocApp133Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/HelloController.java index 2c0e887fb..d99ecc65b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/OpenApiConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/OpenApiConfig.java index a86ef7eb1..f36a27483 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/OpenApiConfig.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/OpenApiConfig.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/SpringDocApp134Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/SpringDocApp134Test.java index 0070e02f6..9fa828dd6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/SpringDocApp134Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app134/SpringDocApp134Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ public class SpringDocApp134Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -50,7 +50,7 @@ public void testApp() throws Exception { } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -58,7 +58,7 @@ public void testApp2() throws Exception { } @Test - public void testApp3() throws Exception { + void testApp3() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-headers-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -66,7 +66,7 @@ public void testApp3() throws Exception { } @Test - public void testApp4() throws Exception { + void testApp4() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-v2-headers-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -74,7 +74,7 @@ public void testApp4() throws Exception { } @Test - public void testApp5() throws Exception { + void testApp5() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-consumes-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/Book.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/Book.java index f50fc0ee1..6f480ff04 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/Book.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/Book.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/BookRepository.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/BookRepository.java index dfb8d6be2..0f30b915f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/BookRepository.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/BookRepository.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/BookRouter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/BookRouter.java index dfdacabf4..cdc463723 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/BookRouter.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/BookRouter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/SpringDocApp135Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/SpringDocApp135Test.java index db6a987d7..8d37cd1d2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/SpringDocApp135Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app135/SpringDocApp135Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/OperationIdController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/OperationIdController.java index 5f8c85ffb..156de6030 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/OperationIdController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/OperationIdController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/SpringDocApp136Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/SpringDocApp136Test.java index 42dcf15e7..98d481358 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/SpringDocApp136Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/SpringDocApp136Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/HelloController.java index a2a4515bc..fcdbe1d71 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/OpenApiConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/OpenApiConfig.java index fd01367fd..c88e8201e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/OpenApiConfig.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/OpenApiConfig.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/SpringDocApp137Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/SpringDocApp137Test.java index 9855b5567..9a7babfaf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/SpringDocApp137Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app137/SpringDocApp137Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app138/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app138/HelloController.java index d5c4aa2d9..e1abbc596 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app138/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app138/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app138/SpringDocApp138Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app138/SpringDocApp138Test.java index 26e366008..8490dbf4c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app138/SpringDocApp138Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app138/SpringDocApp138Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -72,7 +72,7 @@ private static Map apiExtensions() { } @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { MvcResult mockMvcResult = mockMvc.perform(MockMvcRequestBuilders.get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); String result = mockMvcResult.getResponse().getContentAsString(); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app139/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app139/HelloController.java index 5c035b55e..3d0867692 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app139/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app139/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app139/SpringDocApp139Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app139/SpringDocApp139Test.java index 573d3de02..1c3105e69 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app139/SpringDocApp139Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app139/SpringDocApp139Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java index 02049d2eb..bcc830c2f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java index 5d0b5491a..b7d9502a6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app140/HelloApplication.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app140/HelloApplication.java index 025bccc5b..986f2c611 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app140/HelloApplication.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app140/HelloApplication.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app140/SpringDocApp140Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app140/SpringDocApp140Test.java index 357b55726..27e3b94d3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app140/SpringDocApp140Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app140/SpringDocApp140Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/Book.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/Book.java index 87cfb848c..41a5f004c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/Book.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/Book.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/BookRepository.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/BookRepository.java index da37b8896..086b54a61 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/BookRepository.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/BookRepository.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/BookRouter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/BookRouter.java index ef34d6fd6..222196d27 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/BookRouter.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/BookRouter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/SpringDocApp141Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/SpringDocApp141Test.java index c22fd06bc..2c2cd3a34 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/SpringDocApp141Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app141/SpringDocApp141Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app142/HelloApplication.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app142/HelloApplication.java index 125dca684..079b3f46f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app142/HelloApplication.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app142/HelloApplication.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app142/SpringDocApp142Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app142/SpringDocApp142Test.java index 958868b14..5bc18a8fd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app142/SpringDocApp142Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app142/SpringDocApp142Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app143/HelloHiddenController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app143/HelloHiddenController.java index 4f9a048c5..6ef6d86fc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app143/HelloHiddenController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app143/HelloHiddenController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app143/SpringDocApp143Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app143/SpringDocApp143Test.java index 84c3f1e36..7d88dc89a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app143/SpringDocApp143Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app143/SpringDocApp143Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java index 3539c64b2..796242493 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java index 1b93bf6af..0adff9035 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HiddenHelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HiddenHelloController.java index 12d0088f4..327141abb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HiddenHelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/HiddenHelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java index 46299d3de..61393232f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java index 9a487cfe0..8adb0af51 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java index 84b9eb7e5..ac245a9d3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app150/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app150/HelloController.java index 52c14a7d0..a93f2511c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app150/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app150/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java index 54ede6f9e..14339c7d0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app151/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app151/HelloController.java index 46d64da4e..65d74c5f3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app151/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app151/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java index 6d51c5017..4659e9542 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java index 0536dd3d2..bef1e91e6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java index dbb1bdfd0..224c6153a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/OrderState.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/OrderState.java index e2cc0facd..75fa28f58 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/OrderState.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/OrderState.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/OrderStateMapper.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/OrderStateMapper.java index a444f9468..3ded5f0bf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/OrderStateMapper.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/OrderStateMapper.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java index 6e6b4dabf..400e20955 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/TestController.java index 627a20b8d..327ffd84b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/TestController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app153/TestController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/HelloController.java index 0a88bbdf5..0e299ecd5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/OpenApiConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/OpenApiConfiguration.java index 5d86a5b1b..6f5795ba4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/OpenApiConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/OpenApiConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java index 4c86dcfa7..5e6512138 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/AbstractIntParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/AbstractIntParameterObject.java index 86f84d56e..2c5afb8d2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/AbstractIntParameterObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/AbstractIntParameterObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/AbstractParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/AbstractParameterObject.java index 0be206c00..01edd2f75 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/AbstractParameterObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/AbstractParameterObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteEnum.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteEnum.java index 5d0079b99..166d4a7c3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteEnum.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteEnum.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteIntParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteIntParameterObject.java index 9c3820117..f90ba29c7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteIntParameterObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteIntParameterObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteParameterObject.java index 2410f829c..71152caf2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteParameterObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/ConcreteParameterObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/HelloController.java index 421cb613b..b08f8f82b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/SpringDocApp155Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/SpringDocApp155Test.java index 1e88bf4d5..e9948b6fd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/SpringDocApp155Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app155/SpringDocApp155Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/HelloController.java index 9a546a0a3..b5d9269c0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/SomeEnum.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/SomeEnum.java index 724cd090e..d978ab5f8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/SomeEnum.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/SomeEnum.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/SpringDocApp156Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/SpringDocApp156Test.java index bf4435e34..fef61e317 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/SpringDocApp156Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/SpringDocApp156Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/User.java index 6f642b3e8..3835279ba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/User.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app156/User.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/Bar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/Bar.java index 490f32ad1..8b445e9d0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/Bar.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/Bar.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/Foo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/Foo.java index a0d2abc3e..655c576ff 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/Foo.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/Foo.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/HelloController.java index d4004963f..94cd355b5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/SpringDocApp157Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/SpringDocApp157Test.java index 365db33ef..90beb266b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/SpringDocApp157Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/SpringDocApp157Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -60,7 +60,7 @@ public void unregisterConverter() { } @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/StringyConverter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/StringyConverter.java index f715cb6bb..f3e8e4bbc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/StringyConverter.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app157/StringyConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/CommonFooErrorHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/CommonFooErrorHandler.java index 619c50353..a3f1790c2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/CommonFooErrorHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/CommonFooErrorHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/ErrorDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/ErrorDTO.java index 547ff481f..7450b98b5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/ErrorDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/ErrorDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/HelloController.java index 1b8676dd1..3d4784422 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SimpleDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SimpleDTO.java index 33e95b534..5f10a1447 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SimpleDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SimpleDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SpecificFooErrorHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SpecificFooErrorHandler.java index 3cc43ab51..df55c75bb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SpecificFooErrorHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SpecificFooErrorHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SpringDocApp158Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SpringDocApp158Test.java index e57c9f55b..f4ce03fde 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SpringDocApp158Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app158/SpringDocApp158Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/CustomException.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/CustomException.java index 56bc18973..c17bcd2bf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/CustomException.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/CustomException.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/FooBean.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/FooBean.java index 5f4ee5800..688a940c8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/FooBean.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/FooBean.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/FooErrorHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/FooErrorHandler.java index cfc4a1d0f..0aa50257b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/FooErrorHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/FooErrorHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/HelloController.java index 72a7bb0d7..69d977f00 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/SpringDocApp159Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/SpringDocApp159Test.java index 5183b62c6..207ca6708 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/SpringDocApp159Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/SpringDocApp159Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/Views.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/Views.java index 1cb396b25..4d0cef707 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/Views.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app159/Views.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app16/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app16/HelloController.java index b2354b9f9..99b5fafe0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app16/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app16/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java index 5fb8bdc0b..c4bcbef0f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ public class SpringDocApp16Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) .andExpect(status().isNotFound()); } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app160/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app160/HelloController.java index 02210a81b..b66c9d484 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app160/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app160/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app160/SpringDocApp160Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app160/SpringDocApp160Test.java index c9f54324c..0c08f11c4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app160/SpringDocApp160Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app160/SpringDocApp160Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ public class SpringDocApp160Test extends AbstractSpringDocV30Test { @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/test")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app161/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app161/HelloController.java index ddad3ed8d..f8d258e2c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app161/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app161/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app161/SpringDocApp161Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app161/SpringDocApp161Test.java index 35acdb1e8..aa4cacfdc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app161/SpringDocApp161Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app161/SpringDocApp161Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public class SpringDocApp161Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { Locale.setDefault(Locale.US); super.testApp(); } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app162/OpenApiConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app162/OpenApiConfig.java index a3d417a42..ff48d3213 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app162/OpenApiConfig.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app162/OpenApiConfig.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app162/SpringDocApp162Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app162/SpringDocApp162Test.java index d66adf1be..193d21c00 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app162/SpringDocApp162Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app162/SpringDocApp162Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ public class SpringDocApp162Test extends AbstractSpringDocV30Test { @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { super.testApp(); } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/CommissionDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/CommissionDto.java index 99392bfdd..29bcff3bb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/CommissionDto.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/CommissionDto.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/CommissionsResource.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/CommissionsResource.java index 2f93b0517..8c22977be 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/CommissionsResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/CommissionsResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/ExampleRegistrationCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/ExampleRegistrationCustomizer.java index 372785d78..76ab3aa6e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/ExampleRegistrationCustomizer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/ExampleRegistrationCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/Examples.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/Examples.java index d6d91df8d..915e5b11e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/Examples.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/Examples.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/SpringDocApp163Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/SpringDocApp163Test.java index 8a61cc65a..a9c33a4e0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/SpringDocApp163Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app163/SpringDocApp163Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/SampleResponseClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/SampleResponseClass.java index 889f191f2..5807b3e4f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/SampleResponseClass.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/SampleResponseClass.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/SpringDocApp164Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/SpringDocApp164Test.java index 12ca840b6..8151dc8fb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/SpringDocApp164Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/SpringDocApp164Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/TestApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/TestApiController.java index 44bc71fe9..14a27da14 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/TestApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app164/TestApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app165/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app165/HelloController.java index e0d74dfa4..8be8e3cde 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app165/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app165/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app165/SpringDocApp165Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app165/SpringDocApp165Test.java index 6c35ddd12..8d9c48be3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app165/SpringDocApp165Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app165/SpringDocApp165Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/GlobalErrorResponseDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/GlobalErrorResponseDto.java index 7ba133dfd..b7cdd0de0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/GlobalErrorResponseDto.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/GlobalErrorResponseDto.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/GlobalExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/GlobalExceptionHandler.java index 852e8c5ca..e446c5944 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/GlobalExceptionHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/GlobalExceptionHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/LocalErrorResponseDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/LocalErrorResponseDto.java index 5257adc01..689958d37 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/LocalErrorResponseDto.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/LocalErrorResponseDto.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/SpringDocApp166Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/SpringDocApp166Test.java index af0e2f0ec..d07603bd3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/SpringDocApp166Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/SpringDocApp166Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/TestApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/TestApiController.java index 1eb83557f..ce68dd39f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/TestApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app166/TestApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app167/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app167/HelloController.java index d51bebf5a..1d70dfd72 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app167/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app167/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app167/SpringDocApp167Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app167/SpringDocApp167Test.java index 0cdf326fb..1e9c738d4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app167/SpringDocApp167Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app167/SpringDocApp167Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/AbstractParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/AbstractParent.java index 7d7f73930..fd529c3ee 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/AbstractParent.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/AbstractParent.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/ConcreteParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/ConcreteParent.java index c94a0e24d..677cc80f1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/ConcreteParent.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/ConcreteParent.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/Controller.java index 5f43c4688..0cd6e5fb5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/Controller.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/Controller.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/SpringDocApp168Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/SpringDocApp168Test.java index e51629069..71605ec81 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/SpringDocApp168Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app168/SpringDocApp168Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/DefaultRequestMappingHandlerMapping.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/DefaultRequestMappingHandlerMapping.java index df73fed02..fab798cb4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/DefaultRequestMappingHandlerMapping.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/DefaultRequestMappingHandlerMapping.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/DefaultWebMvcRegistrations.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/DefaultWebMvcRegistrations.java index 2e6ed1350..bded61efe 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/DefaultWebMvcRegistrations.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/DefaultWebMvcRegistrations.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/SpringDocApp169Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/SpringDocApp169Test.java index 9c2d53172..cedf609be 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/SpringDocApp169Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/SpringDocApp169Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/TestController.java index 132e269df..a9f480022 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/TestController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app169/TestController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app17/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app17/HelloController.java index 064eb043c..d06a8aa70 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app17/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app17/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java index 76c51206b..41a17e21c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app170/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app170/HelloController.java index 330f27842..5402ea591 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app170/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app170/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app170/SpringDocApp170Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app170/SpringDocApp170Test.java index 906ab6c48..1e7fc1553 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app170/SpringDocApp170Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app170/SpringDocApp170Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ public class SpringDocApp170Test extends AbstractSpringDocV30Test { @Test - public void testApp1() throws Exception { + void testApp1() throws Exception { this.testApp(); } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app171/HelloLocaleController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app171/HelloLocaleController.java index bf5960983..614e748fd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app171/HelloLocaleController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app171/HelloLocaleController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app171/SpringDocApp171Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app171/SpringDocApp171Test.java index 4ab3c472b..1f6fbde0a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app171/SpringDocApp171Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app171/SpringDocApp171Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app172/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app172/HelloController.java index dc6756c28..1d0f05db3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app172/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app172/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app172/SpringDocApp172Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app172/SpringDocApp172Test.java index b16bdf523..0d2c7020f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app172/SpringDocApp172Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app172/SpringDocApp172Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ public class SpringDocApp172Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/sample-group")) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app173/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app173/HelloController.java index d07c0fc2c..c8ef80cfb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app173/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app173/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app173/SpringDocApp173Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app173/SpringDocApp173Test.java index b4ea9bee7..f4f66157d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app173/SpringDocApp173Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app173/SpringDocApp173Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/AnnotatedController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/AnnotatedController.java index 74cc1c134..0b4ea33c5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/AnnotatedController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/AnnotatedController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/SpringDocApp177Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/SpringDocApp177Test.java index 9f63f2f80..ea22a729f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/SpringDocApp177Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app177/SpringDocApp177Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app178/AnnotatedController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app178/AnnotatedController.java index b20204ac6..88d9d6aaf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app178/AnnotatedController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app178/AnnotatedController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app178/SpringDocApp178Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app178/SpringDocApp178Test.java index fb1002a48..e4f400778 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app178/SpringDocApp178Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app178/SpringDocApp178Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/HelloController.java index 7cbd421fb..981c0d464 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyConfiguration.java index 63ed3d732..780850dfe 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyConfiguration.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyIdPathVariable.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyIdPathVariable.java index 1d1d72e7e..7b4b8e105 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyIdPathVariable.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyIdPathVariable.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyObj.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyObj.java index c504d1bb1..71ced306b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyObj.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyObj.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyObjArgumentResolver.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyObjArgumentResolver.java index 8d7d67d51..daefbafe5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyObjArgumentResolver.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyObjArgumentResolver.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyPathParameterCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyPathParameterCustomizer.java index 703661174..860dc2edc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyPathParameterCustomizer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/MyPathParameterCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/SpringDocApp179Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/SpringDocApp179Test.java index 62de415c1..0cdfacc3f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/SpringDocApp179Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app179/SpringDocApp179Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java index c09111ba2..e18d83c5f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java index d7aca2e7d..6d11acb7f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/Body.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/Body.java index d64556eee..24181d80f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/Body.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/Body.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/MapExclusion.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/MapExclusion.java index 68368e20e..eec3fb5e0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/MapExclusion.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/MapExclusion.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/RESTService.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/RESTService.java index 3c6267ceb..4559d766d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/RESTService.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/RESTService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/SpringDocApp180Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/SpringDocApp180Test.java index 8198c4234..4882da98a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/SpringDocApp180Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app180/SpringDocApp180Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/AbstractParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/AbstractParameterObject.java index d35fbc76a..88a887a25 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/AbstractParameterObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/AbstractParameterObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/ConcreteParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/ConcreteParameterObject.java index 7671ee919..e4302aea5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/ConcreteParameterObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/ConcreteParameterObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/HelloController.java index 3943a8ee6..77bbfb541 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/SpringDocApp181Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/SpringDocApp181Test.java index 658506bc9..64bc94694 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/SpringDocApp181Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app181/SpringDocApp181Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app182/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app182/HelloController.java index c8ff3354f..76b7b9260 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app182/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app182/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app182/SpringDocApp182Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app182/SpringDocApp182Test.java index 8217905c6..c9238a62a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app182/SpringDocApp182Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app182/SpringDocApp182Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/HelloController.java index ae6f00491..9c9321ce1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/SpringDocApp183Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/SpringDocApp183Test.java index 44adeed4e..fb5e98fdb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/SpringDocApp183Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/SpringDocApp183Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/User.java index f510a497a..6c66dc426 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/User.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/User.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/UserConverter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/UserConverter.java index e5034cdde..19a8d350b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/UserConverter.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/UserConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/WebConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/WebConfig.java index ca94b778a..534a01e00 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/WebConfig.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app183/WebConfig.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app184/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app184/HelloController.java index 12b4697fc..19382280e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app184/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app184/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app184/SpringDocApp184Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app184/SpringDocApp184Test.java index e89067e09..d27923434 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app184/SpringDocApp184Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app184/SpringDocApp184Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -54,21 +54,21 @@ public class SpringDocApp184Test extends AbstractSpringDocV30Test { @Test - public void testGroup1() throws Exception { + void testGroup1() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group1")) .andExpect(status().isOk()) .andExpect(content().json(getContent("results/3.0.1/app184-1.json"), true)); } @Test - public void testGroup2() throws Exception { + void testGroup2() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group2")) .andExpect(status().isOk()) .andExpect(content().json(getContent("results/3.0.1/app184-2.json"), true)); } @Test - public void testGroup3() throws Exception { + void testGroup3() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group3")) .andExpect(status().isOk()) .andExpect(content().json(getContent("results/3.0.1/app184-3.json"), true)); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Cat.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Cat.java index f9464e04c..ed0226559 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Cat.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Cat.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Dog.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Dog.java index cc4bb66fd..fa34cf70d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Dog.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Dog.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Pet.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Pet.java index 93dc30461..208978064 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Pet.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/Pet.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/PetController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/PetController.java index 3fdf86d6d..9d6417f6e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/PetController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/PetController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/SpringDocApp185Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/SpringDocApp185Test.java index f20df2946..5c2d397ea 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/SpringDocApp185Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app185/SpringDocApp185Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app187/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app187/HelloController.java index 4bc79e85b..2d952aa1a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app187/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app187/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java index d2e602084..a5ff76bda 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/FooBar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/FooBar.java index bbc1704cd..6ccc0e938 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/FooBar.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/FooBar.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/FooBarConverter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/FooBarConverter.java index 1b522ed5a..c973fbadd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/FooBarConverter.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/FooBarConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/HelloController.java index f1bf44e9d..41a8229f9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/SpringDocApp188Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/SpringDocApp188Test.java index 8c5c25e0f..c6e630888 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/SpringDocApp188Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app188/SpringDocApp188Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocApp189Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocApp189Test.java index 39f8cc000..77fc5fd31 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocApp189Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocApp189Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app19/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app19/HelloController.java index 903914d0a..569d94eb1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app19/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app19/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java index 7b7506cb2..de98bcda6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app190/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app190/HelloController.java index ed2eef112..233227850 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app190/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app190/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190Test.java index a342c552f..1723cac94 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/HelloController.java index cc10f5d7e..2e5495630 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/SpringDocApp192Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/SpringDocApp192Test.java index d9a84c3df..468dbf1e2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/SpringDocApp192Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/SpringDocApp192Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/SpringDocTestApp.java index 4a9ed139b..d37fc6d64 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/SpringDocTestApp.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app192/SpringDocTestApp.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java index 2546d833b..0b967785a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public class SpringDocApp193Test extends AbstractCommonTest { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { final MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); final String result = mockMvcResult.getResponse().getContentAsString(); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app194/SpringDocApp194Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app194/SpringDocApp194Test.java index 866543a92..001b102d0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app194/SpringDocApp194Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app194/SpringDocApp194Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app195/SpringDocApp195Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app195/SpringDocApp195Test.java index 0f00c74cc..b7513f033 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app195/SpringDocApp195Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app195/SpringDocApp195Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app196/SpringDocApp196Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app196/SpringDocApp196Test.java index 4d4c21424..54fb71834 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app196/SpringDocApp196Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app196/SpringDocApp196Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app197/SpringDocApp197Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app197/SpringDocApp197Test.java index ec6e25a9b..595a53e40 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app197/SpringDocApp197Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app197/SpringDocApp197Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app198/SpringDocApp198Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app198/SpringDocApp198Test.java index a46966057..f531e1ebf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app198/SpringDocApp198Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app198/SpringDocApp198Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app199/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app199/HelloController.java index 52c3a74ad..f20f32e39 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app199/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app199/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app199/SpringDocApp199Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app199/SpringDocApp199Test.java index 4e526e1d6..1a78f6fe0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app199/SpringDocApp199Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app199/SpringDocApp199Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java index 28d5de8e7..e6f5cc67c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/ApiUtil.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/ApiUtil.java index d22759ad4..4d1da3250 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/ApiUtil.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/ApiUtil.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/ExceptionTranslator.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/ExceptionTranslator.java index 64fd1d1b6..5aa85f08a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/ExceptionTranslator.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/ExceptionTranslator.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/HomeController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/HomeController.java index 4bdc9930e..18e06d6fb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/HomeController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/HomeController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApi.java index 43b2de3d8..10394babc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiController.java index cdf9e9f9e..46baaaeee 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegate.java index 0c243ada2..7426d1124 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegate.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegate.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegateImpl.java index 4fec7b469..3740097f8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegateImpl.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegateImpl.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApi.java index 299a6ab1b..532dd1a8e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiController.java index eb4d80b6b..95faf7014 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegate.java index c17dcde86..d6f2fa32a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegate.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegate.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegateImpl.java index ecbf124d4..c3927936c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegateImpl.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegateImpl.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApi.java index b08a6def3..8e15283ec 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiController.java index fb742fddd..9585e6a06 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegate.java index 4f4a49e38..142eb34de 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegate.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegate.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegateImpl.java index 952a68e5a..6302425f0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegateImpl.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegateImpl.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Body.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Body.java index 3bf970d39..f45fda473 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Body.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Body.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Body1.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Body1.java deleted file mode 100644 index c92272dbe..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Body1.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v30.app2.model; - -import java.io.File; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -public class Body1 { - - @Schema(description = "Additional data to pass to server") - /** - * Additional data to pass to server - **/ - private String additionalMetadata = null; - - @Schema(description = "file to upload") - /** - * file to upload - **/ - private File file = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Additional data to pass to server - * - * @return additionalMetadata - **/ - @JsonProperty("additionalMetadata") - public String getAdditionalMetadata() { - return additionalMetadata; - } - - public void setAdditionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - } - - public Body1 additionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - return this; - } - - /** - * file to upload - * - * @return file - **/ - @JsonProperty("file") - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public Body1 file(File file) { - this.file = file; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Body1 {\n"); - - sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Category.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Category.java index 37535f6e8..ac22ba5a0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Category.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Category.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/ModelApiResponse.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/ModelApiResponse.java index 3752ba48b..9fc14f4a6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/ModelApiResponse.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/ModelApiResponse.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Order.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Order.java index fcc775311..14a2f276c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Order.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Order.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Pet.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Pet.java index 1237fb1f2..dcc384161 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Pet.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Pet.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Tag.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Tag.java index dc87df3ba..84498518a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Tag.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/Tag.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/User.java index 70e9d13c0..9fe9dbd57 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/User.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app2/model/User.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app20/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app20/HelloController.java index 41c11049b..e731ce333 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app20/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app20/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java index ba0355c50..594f26889 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app200/SpringDocApp200Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app200/SpringDocApp200Test.java index c2055b1d6..6393306d2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app200/SpringDocApp200Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app200/SpringDocApp200Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app201/SpringDocApp201Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app201/SpringDocApp201Test.java index c60f9ee93..5c675c8ad 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app201/SpringDocApp201Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app201/SpringDocApp201Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/SpringDocApp203Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/SpringDocApp203Test.java index 376e2a880..b6062a46b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/SpringDocApp203Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app203/SpringDocApp203Test.java @@ -48,7 +48,7 @@ public class SpringDocApp203Test extends AbstractSpringDocV30Test { static class SpringDocTestApp {} @Test - public void testApp1() throws Exception { + void testApp1() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/mygroup")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app209/SpringDocApp209Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app209/SpringDocApp209Test.java index 5c394123c..a18f07ac7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app209/SpringDocApp209Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app209/SpringDocApp209Test.java @@ -96,7 +96,7 @@ public int getNumberOfTimesCalculatePathWasCalled() { } @Test - public void shouldOnlyByCalledOnce() throws Exception { + void shouldOnlyByCalledOnce() throws Exception { // assertEquals(1, openAPIService.getNumberOfTimesCalculatePathWasCalled()); className = getClass().getSimpleName(); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java index 1a77cebc7..9cbae20f9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java index 5f89de351..35ebaba6e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app210/SpringDocApp210Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app210/SpringDocApp210Test.java index 0ac76699a..2908290ad 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app210/SpringDocApp210Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app210/SpringDocApp210Test.java @@ -37,7 +37,7 @@ public class SpringDocApp210Test extends AbstractCommonTest { @Test - public void testApp(){ + protected void testApp(){ assertThrows(IllegalArgumentException.class, () -> GroupedOpenApi.builder().group("").build()); } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app214/SpringDocApp214Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app214/SpringDocApp214Test.java index 65ed3cb17..dc78d90b6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app214/SpringDocApp214Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app214/SpringDocApp214Test.java @@ -54,7 +54,7 @@ public class SpringDocApp214Test extends AbstractCommonTest { static class SpringDocTestApp {} @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { assertEquals(4, springDocConfigProperties.getGroupConfigs().stream().map(GroupConfig::getGroup).toList().size()); } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app215/SpringDocApp215Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app215/SpringDocApp215Test.java index 2871244cb..9a557b7a2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app215/SpringDocApp215Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app215/SpringDocApp215Test.java @@ -38,7 +38,7 @@ public class SpringDocApp215Test extends AbstractCommonTest { static class SpringDocTestApp {} @Test - public void test_disable_default_api_docs() throws Exception { + void test_disable_default_api_docs() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isNotFound()); } } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app215/SpringDocApp215bisTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app215/SpringDocApp215bisTest.java index 2b0999bfe..ca3266181 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app215/SpringDocApp215bisTest.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app215/SpringDocApp215bisTest.java @@ -38,7 +38,7 @@ public class SpringDocApp215bisTest extends AbstractCommonTest { static class SpringDocTestApp {} @Test - public void test_enable_default_api_docs() throws Exception { + void test_enable_default_api_docs() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()); } } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app216/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app216/HelloController.java index e3ea9f4c3..fbb0d54ef 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app216/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app216/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app217/SpringDocApp217Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app217/SpringDocApp217Test.java index 820e5ce8e..c0693a87a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app217/SpringDocApp217Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app217/SpringDocApp217Test.java @@ -43,7 +43,7 @@ public class SpringDocApp217Test extends AbstractSpringDocV30Test { @Test - public void testApp1() throws Exception { + void testApp1() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/demo")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -51,7 +51,7 @@ public void testApp1() throws Exception { } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/user")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/HelloController.java index 0b2b37d5c..c8d6e3438 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java index a9afcaf7b..499fe80aa 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/SpringDocApp219Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/TestObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/TestObject.java index ca336cca3..5f1b261a2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/TestObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app219/TestObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/HelloController.java index e6025f7dd..d842d0e36 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/PersonDTO.java index f35fb2940..f38ea54ba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java index 969d34e5c..2c061bcdd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/SpringDocApp220Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/SpringDocApp220Test.java index 0e5f57595..b7ce13e67 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/SpringDocApp220Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app220/SpringDocApp220Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/SpringDocApp221Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/SpringDocApp221Test.java index d53ee8dbf..d36a828b3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/SpringDocApp221Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app221/SpringDocApp221Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/SpringDocApp222Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/SpringDocApp222Test.java index d25dc5598..1cab9fbe9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/SpringDocApp222Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app222/SpringDocApp222Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/SpringDocApp223Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/SpringDocApp223Test.java index ce55a35c6..663354f98 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/SpringDocApp223Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app223/SpringDocApp223Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/SpringDocApp224Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/SpringDocApp224Test.java index 0d97db4aa..fead355a1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/SpringDocApp224Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app224/SpringDocApp224Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/SpringDocApp225Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/SpringDocApp225Test.java index af8907232..d6e48bb1a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/SpringDocApp225Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app225/SpringDocApp225Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/SpringDocApp226Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/SpringDocApp226Test.java index 5c4d44f06..e7cd0d048 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/SpringDocApp226Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app226/SpringDocApp226Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/NoGenericWrapper.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/NoGenericWrapper.java index c60427ce5..ba32477dc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/NoGenericWrapper.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app227/wrapper/NoGenericWrapper.java @@ -1,9 +1,10 @@ package test.org.springdoc.api.v30.app227.wrapper; -import org.springframework.http.HttpStatusCode; import test.org.springdoc.api.v30.app227.model.Item; +import org.springframework.http.HttpStatusCode; + public class NoGenericWrapper extends ResponseEntityWrapper { public NoGenericWrapper(Item body, HttpStatusCode status) { super(body, status); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/SpringDocApp228Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/SpringDocApp228Test.java index 300f1b48d..60eb499f9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/SpringDocApp228Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app228/SpringDocApp228Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app23/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app23/HelloController.java index 7a23a5b9b..1e273a935 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app23/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app23/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java index 57373c53f..259035d91 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/HelloController.java index c776302ed..c8f8735b4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java index 9d2e3787d..80d6022d4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/SpringDocTestApp.java index f18552720..8798e2c1f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/SpringDocTestApp.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app24/SpringDocTestApp.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app25/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app25/HelloController.java index c7c95a23d..767bf4081 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app25/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app25/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java index ea0c7f40f..6a608f25c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/Bar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/Bar.java index da4f0c71c..ff084dab6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/Bar.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/Bar.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/Foo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/Foo.java index facb931f5..cf2ebcb47 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/Foo.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/Foo.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/HelloController.java index 0db2abcfc..3d473ecf9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/MyModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/MyModel.java index 0ef4dc200..af59bb201 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/MyModel.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/MyModel.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java index 9e336b0e7..338dd6ddd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Advice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Advice.java index e4a0d42d9..4e94e523c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Advice.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Advice.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Bar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Bar.java index b34a91a92..0d0bd36fd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Bar.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Bar.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Foo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Foo.java index 445897c1b..eec77e188 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Foo.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/Foo.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java index 48cd702c8..0fa1100e8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/MyException.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/MyException.java index befe9f784..ded90b503 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/MyException.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/MyException.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java index 23e17245e..876e77de7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ public class SpringDocApp27Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/Bar", "#/components/schemas/Foo"))); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java index 6eaf31816..19ddc3a4c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java index e8ecbe66b..51a4c4fa7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/HelloController.java index 161476706..b8d47c161 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java index e6177cede..2b87a4e0a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/TrackerData.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/TrackerData.java index a776dc7d6..0abb9b905 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/TrackerData.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app29/TrackerData.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java index 47e36d11a..776f6af65 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java index 7a0da7e81..105dd686b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java index 223b14474..3c1794065 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java index fe252bbce..0db299446 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java index d81eda3ea..03d739169 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java index 34b3c4847..bf8acab39 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java index ea0abfb65..a9227e30a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java index c29bc156c..4f585d711 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/HelloController.java index 76506b7b0..b177afadb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/MyExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/MyExceptionHandler.java index d07eb09b4..2001d1ca5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/MyExceptionHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/MyExceptionHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java index 876091ea0..ea3f711c9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app35/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app35/HelloController.java index ea39192c6..332f3a4ad 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app35/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app35/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java index f958d2c5e..97a636002 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Bar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Bar.java index 4e865391b..20544a3d9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Bar.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Bar.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Car.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Car.java index ee3245f37..9e2daf6c5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Car.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Car.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Foo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Foo.java index 779e0e82a..cc2a780be 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Foo.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Foo.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/HelloController.java index 31b17f3b3..f67981680 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Pet.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Pet.java index 3c3820798..5ce9764c3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Pet.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/Pet.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java index c19d9a0c3..65145a0d8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app38/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app38/HelloController.java index 755d441da..d162e881a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app38/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app38/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java index f5cdba754..731fe0f10 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java index d54f1cb45..c39789407 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java index 92d2429c7..61706480b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java index 7334828eb..4962e15db 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java index 183a2279e..4c1023903 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java index b628b879e..38656f4ba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/TrackerData.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/TrackerData.java index 708eb2695..02c7e8cdc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/TrackerData.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app4/TrackerData.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app40/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app40/HelloController.java index 5a8a81592..2aecf94ea 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app40/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app40/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app40/SpringDocApp40Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app40/SpringDocApp40Test.java index f67b5c6ca..54b4e024b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app40/SpringDocApp40Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app40/SpringDocApp40Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/HelloController.java index a73c8ce54..027da3b07 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp411Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp411Test.java index ad612e793..bde96d0ea 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp411Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp411Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ public class SpringDocApp411Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { String className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp41Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp41Test.java index 129512792..f0286ee03 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp41Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp41Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ public class SpringDocApp41Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { String className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/HelloController.java index f63d5dfe0..97dbde609 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/SpringDocApp42Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/SpringDocApp42Test.java index 08709bcf1..6f7a7fea4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/SpringDocApp42Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/SpringDocApp42Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/TweetId.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/TweetId.java index e8ff3b972..4de18ef77 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/TweetId.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app42/TweetId.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app43/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app43/HelloController.java index a5e88d220..d151a5197 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app43/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app43/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app43/SpringDocApp43Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app43/SpringDocApp43Test.java index e842a3b75..475f56975 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app43/SpringDocApp43Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app43/SpringDocApp43Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app44/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app44/HelloController.java index 44b811054..ece6adbfb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app44/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app44/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app44/SpringDocApp44Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app44/SpringDocApp44Test.java index 96a2935d8..07bba944a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app44/SpringDocApp44Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app44/SpringDocApp44Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/HelloController.java index c527d7716..c5cfcf864 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/HelloController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/HelloController2.java index 4afe0a0bf..da0ed0b6c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/HelloController2.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/HelloController2.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/OpenApiConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/OpenApiConfig.java index 368aca339..0cd371330 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/OpenApiConfig.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/OpenApiConfig.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/PersonDTO.java index 53beb0818..f38375254 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/SpringDocApp45Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/SpringDocApp45Test.java index bcdc0c4e5..1f510b817 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/SpringDocApp45Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app45/SpringDocApp45Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app46/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app46/HelloController.java index 3752a0f2c..bc1998051 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app46/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app46/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app46/SpringDocApp46Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app46/SpringDocApp46Test.java index e02b18b06..046f07a81 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app46/SpringDocApp46Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app46/SpringDocApp46Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app47/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app47/HelloController.java index 5e171bde4..b4797b536 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app47/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app47/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app47/SpringDocApp47Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app47/SpringDocApp47Test.java index ca79ad704..54a82610d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app47/SpringDocApp47Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app47/SpringDocApp47Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/AbstractHelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/AbstractHelloController.java index 9489f6cf0..8ddd5fc2d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/AbstractHelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/AbstractHelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/HelloController.java index 1a19cbcde..a1a801027 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/SpringDocApp48Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/SpringDocApp48Test.java index c98f96097..03eb3b97c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/SpringDocApp48Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app48/SpringDocApp48Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/HelloController.java index 215191a39..8a0c52cc5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/SpringDocApp49Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/SpringDocApp49Test.java index 36ac79a9f..878ecf9cd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/SpringDocApp49Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/SpringDocApp49Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/SpringDocTestApp.java index ecf230bd9..decc9a954 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/SpringDocTestApp.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app49/SpringDocTestApp.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/CustomOpenAPIConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/CustomOpenAPIConfig.java index 2257ddcc3..69c8cb8ed 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/CustomOpenAPIConfig.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/CustomOpenAPIConfig.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java index 498fbc049..e6e04ecb4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ public class OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest exten * Then: Return security definitions http basic */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) @@ -71,7 +71,7 @@ public void testApp() throws Exception { * Then: Return security definitions with API key */ @Test - public void shouldDefineComponentsSecuritySchemesForApiKey() throws Exception { + void shouldDefineComponentsSecuritySchemesForApiKey() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) @@ -87,7 +87,7 @@ public void shouldDefineComponentsSecuritySchemesForApiKey() throws Exception { * Then: Return security definitions with OAuth */ @Test - public void shouldDefineComponentsSecuritySchemesForOAuth2() throws Exception { + void shouldDefineComponentsSecuritySchemesForOAuth2() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceCustomConfigurationTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceCustomConfigurationTest.java index 9a2f83a51..cf04ea02b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceCustomConfigurationTest.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceCustomConfigurationTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ public class OpenApiResourceCustomConfigurationTest extends AbstractSpringDocV30 * {"openapi":"3.0.1","info":{"title":"Custom API","version":"100"},"paths":{},"components":{}} */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceNoConfigurationTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceNoConfigurationTest.java index 7cd4a4d32..2fac1b7b5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceNoConfigurationTest.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceNoConfigurationTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public class OpenApiResourceNoConfigurationTest extends AbstractSpringDocV30Test * {"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"paths":{},"components":{}} */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/HelloController.java index a2f15308a..98064646f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/SpringDocApp50Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/SpringDocApp50Test.java index 2499a67a1..027b89d5e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/SpringDocApp50Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/SpringDocApp50Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/SpringDocTestApp.java index 45ce7359f..afee2386f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/SpringDocTestApp.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app50/SpringDocTestApp.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app51/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app51/HelloController.java index c49e5ff1b..2fdc2f84d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app51/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app51/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app51/SpringDocApp51Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app51/SpringDocApp51Test.java index 6795f1393..a7c95d1da 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app51/SpringDocApp51Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app51/SpringDocApp51Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app52/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app52/HelloController.java index ea52fd2f5..550b17a97 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app52/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app52/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app52/SpringDocApp52Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app52/SpringDocApp52Test.java index 07005466b..4dab240ed 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app52/SpringDocApp52Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app52/SpringDocApp52Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/HelloController.java index a1716ffae..9186743a4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/HelloControllerWithGlobalApiResponse.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/HelloControllerWithGlobalApiResponse.java index 6dbaedac5..2a350a88a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/HelloControllerWithGlobalApiResponse.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/HelloControllerWithGlobalApiResponse.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/SpringDocApp53Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/SpringDocApp53Test.java index 02973a80c..b8a748b3a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/SpringDocApp53Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app53/SpringDocApp53Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/HelloController.java index d40c256f3..1d1b9fbf2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/MealParty.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/MealParty.java index cf5b52ccf..d8e469fbb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/MealParty.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/MealParty.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/SpringDocApp54Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/SpringDocApp54Test.java index ec6552755..897598a03 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/SpringDocApp54Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/SpringDocApp54Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/Views.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/Views.java index ff4b83379..780ed9487 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/Views.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app54/Views.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app55/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app55/HelloController.java index 925c07de0..ca713850e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app55/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app55/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app55/SpringDocApp55Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app55/SpringDocApp55Test.java index 050d75fc7..496967733 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app55/SpringDocApp55Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app55/SpringDocApp55Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/GlobalExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/GlobalExceptionHandler.java index 5f0a5b387..8a79b0195 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/GlobalExceptionHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/GlobalExceptionHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/HelloController.java index af7a89aac..f394a811a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/SpringDocApp56Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/SpringDocApp56Test.java index e3b6022e5..28947aa6b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/SpringDocApp56Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app56/SpringDocApp56Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app57/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app57/HelloController.java index 667a5614b..2a02ad52f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app57/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app57/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app57/SpringDocApp57Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app57/SpringDocApp57Test.java index c2cde51ee..d5f8a377d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app57/SpringDocApp57Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app57/SpringDocApp57Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app58/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app58/HelloController.java index bb7c32fed..9dd2d72f4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app58/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app58/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app58/SpringDocApp58Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app58/SpringDocApp58Test.java index 40bccba2b..5c3d0608c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app58/SpringDocApp58Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app58/SpringDocApp58Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloBody.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloBody.java index 885530e76..ec81f6e9a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloBody.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloBody.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloController.java index 4d2bfe6b8..688f1cad5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloController2.java index 51daa8f96..f8423d4c1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloController2.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloController2.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloExceptionHandler.java index eb3cf30e2..f5bae0a43 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloExceptionHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/HelloExceptionHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/SpringDocApp59Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/SpringDocApp59Test.java index 6a3f08f65..9bcea1e0b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/SpringDocApp59Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app59/SpringDocApp59Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app6/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app6/HelloController.java index 2f84d52dc..21f3eb16e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app6/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app6/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java index a8b56f354..fe752afc6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/HelloController.java index 4e3c7b1e7..59032931f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/QueryPaging.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/QueryPaging.java index 3a109e29c..4892089b6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/QueryPaging.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/QueryPaging.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/QuerySort.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/QuerySort.java index 3ec2c58cb..e9a6b5b33 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/QuerySort.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/QuerySort.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/SpringDocApp60Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/SpringDocApp60Test.java index 4f87e82d9..21ec64f9b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/SpringDocApp60Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app60/SpringDocApp60Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app61/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app61/HelloController.java index a84daee7a..f25ee6ee5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app61/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app61/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app61/SpringDocApp61Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app61/SpringDocApp61Test.java index d972425e0..a8700bf61 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app61/SpringDocApp61Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app61/SpringDocApp61Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/BaseController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/BaseController.java index bf6c4db76..562ed8bb9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/BaseController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/BaseController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/SpringDocApp62Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/SpringDocApp62Test.java index 65ef4a67c..f2da57315 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/SpringDocApp62Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/SpringDocApp62Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/TestController.java index 515068e9b..b5d006287 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/TestController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app62/TestController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java index eba650f3b..9d1bc2a4b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java index 90eeb2c06..7cacecc3b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java index 493eeca04..3efb58b43 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java index 404ff57c6..e052e254e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java index f5a86f2b4..257fda53b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java index 881e90fed..dfce1b370 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/DefaultHealthCheckApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/DefaultHealthCheckApi.java index 069329af1..5f95d49d5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/DefaultHealthCheckApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/DefaultHealthCheckApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/HelloController.java index 50d4d20f4..7fb6b5ed8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java index 64b75b093..8abc9b496 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/UndocumentedClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/UndocumentedClass.java index 7f3b45621..fce12ce67 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/UndocumentedClass.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app66/UndocumentedClass.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java index f4badc2db..d87508d2d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java index 9c9e2d21b..8b9f6df9d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/HelloController.java index 625ad6aa9..82d0ddbd7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/PersonDTO.java index b91e8987b..205e53827 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java index cb0c619d3..18037ba00 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java index 8ef06912e..36fc8b159 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java index f47b7d5b7..7a791067c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/HelloController.java index 0a9801dd2..1925d7abf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java index e77dc6e6d..b3161f3e1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedOperation.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedOperation.java index a582c35da..6623777ba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedOperation.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedOperation.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedParameter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedParameter.java index b172ed609..52195cbd9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedParameter.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedParameter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedProperty.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedProperty.java index 0b7d14c54..8d5d144da 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedProperty.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedProperty.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/OperationCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/OperationCustomizer.java index f989c5d71..c9aea4b5d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/OperationCustomizer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/OperationCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/ParameterCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/ParameterCustomizer.java index 62a3a6e74..90b80d245 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/ParameterCustomizer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/ParameterCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/PropertyCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/PropertyCustomizer.java index 4cba96d7f..56bdc8d41 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/PropertyCustomizer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/customizer/PropertyCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/model/ApiType.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/model/ApiType.java index 90955948c..cc8c6d6ce 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/model/ApiType.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app70/model/ApiType.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/Dog.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/Dog.java index dd706c533..7115d8a8b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/Dog.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/Dog.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/HelloController.java index d031a4ccf..3edb0cdc0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java index 53b21bef0..99ab46bed 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java index 8f16214ee..5d3503b78 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -35,13 +35,13 @@ import static org.assertj.core.api.Assertions.assertThat; -public class BlockingAutoConfigurationTest { +class BlockingAutoConfigurationTest { private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() .withUserConfiguration(TestApp.class); @Test - public void configurations_successfully_loaded() { + void configurations_successfully_loaded() { contextRunner .withPropertyValues("springdoc.show-actuator=true") .run(context -> assertThat(context) @@ -53,7 +53,7 @@ public void configurations_successfully_loaded() { } @Test - public void configurations_not_loaded_when_application_is_not_web() { + void configurations_not_loaded_when_application_is_not_web() { new ApplicationContextRunner() .withUserConfiguration(TestApp.class) .run(context -> assertThat(context) @@ -65,7 +65,7 @@ public void configurations_not_loaded_when_application_is_not_web() { } @Test - public void actuator_configuration_not_loaded_when_not_enabled_explicitly() { + void actuator_configuration_not_loaded_when_not_enabled_explicitly() { contextRunner .run(context -> assertThat(context) .hasNotFailed() @@ -76,7 +76,7 @@ public void actuator_configuration_not_loaded_when_not_enabled_explicitly() { } @Test - public void configurations_not_loaded_when_disabled() { + void configurations_not_loaded_when_disabled() { contextRunner .withPropertyValues("springdoc.api-docs.enabled=false") .run(context -> assertThat(context) @@ -88,7 +88,7 @@ public void configurations_not_loaded_when_disabled() { } @Test - public void configurations_not_loaded_when_mvc_is_not_on_class_path() { + void configurations_not_loaded_when_mvc_is_not_on_class_path() { contextRunner .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) .run(context -> assertThat(context) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java index 3938500bd..fa5e75694 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public class CacheAutoConfigurationTest1 { .withUserConfiguration(TestApp.class); @Test - public void cache_configuration_loaded_when_not_disabled_explicitly() { + void cache_configuration_loaded_when_not_disabled_explicitly() { contextRunner .run(context -> assertThat(context) .hasNotFailed() @@ -48,7 +48,7 @@ public void cache_configuration_loaded_when_not_disabled_explicitly() { } @Test - public void cache_configuration_loaded_when_disabled_explicitly() { + void cache_configuration_loaded_when_disabled_explicitly() { contextRunner .withPropertyValues("springdoc.cache.disabled=false") .run(context -> assertThat(context) @@ -60,7 +60,7 @@ public void cache_configuration_loaded_when_disabled_explicitly() { } @Test - public void cache_configurations_successfully_disabled() { + void cache_configurations_successfully_disabled() { contextRunner .withPropertyValues("springdoc.cache.disabled=true") .run(context -> assertThat(context) @@ -72,7 +72,7 @@ public void cache_configurations_successfully_disabled() { } @Test - public void group_configuration_loaded() { + void group_configuration_loaded() { contextRunner .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") .run(context -> assertThat(context) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java index 092e52554..d84e01c5b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ public class GroupAutoConfigurationTest { .withUserConfiguration(TestApp.class); @Test - public void group_configuration_loaded() { + void group_configuration_loaded() { contextRunner .run(context -> assertThat(context) .hasNotFailed() diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app73/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app73/HelloController.java index 6c6ae972f..e682feda0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app73/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app73/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java index 1397926f8..3728cd581 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app74/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app74/HelloController.java index 3e75e0942..23e70c34e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app74/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app74/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java index 1c7558b5b..5e6b7e1ef 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/HelloController.java index cd3ac145d..8467eb7cd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/PersonDTO.java index 7fe41c7b7..e75e5ed5c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/RestResponseEntityExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/RestResponseEntityExceptionHandler.java index 21c44de61..b8831f8a6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/RestResponseEntityExceptionHandler.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/RestResponseEntityExceptionHandler.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java index 3fae6d34e..81df64446 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java index 57d2b1739..3b04950a8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java index 7c887cf6c..ccf8a7c03 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app77/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app77/HelloController.java index 5ad83c772..f91ea3d9b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app77/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app77/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app77/SpringDocApp77Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app77/SpringDocApp77Test.java index 5805afa38..984b16956 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app77/SpringDocApp77Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app77/SpringDocApp77Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java index 1f6998660..112aa549c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/PersonDTO.java index 3f6ab2c7a..e1bf2f615 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java index 036d5adc8..0f3e2f935 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app79/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app79/HelloController.java index b895997a6..3978b6c3c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app79/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app79/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java index b08bb5d92..585c6635c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app8/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app8/HelloController.java index c9532abf7..d9d1d3f67 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app8/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app8/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java index 1b82aa068..03d344e88 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public class SpringDocApp8Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get("/myapp" + Constants.DEFAULT_API_DOCS_URL).contextPath("/myapp")) .andExpect(status().isOk()); } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/HelloController.java index 30b35aac4..04cca3c4c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java index 483170707..a950625f8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/TestObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/TestObject.java index cd34f3105..3a5532024 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/TestObject.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app80/TestObject.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app81/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app81/HelloController.java index 3ee074ec3..2b54d20c4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app81/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app81/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java index 903fcb1af..02bec677d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ public class SpringDocApp81Test extends AbstractSpringDocV30Test { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(jsonPath("$.paths./api.get.tags[0]", containsString("hello-controller"))) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/HelloController.java index 36f1fc074..6a292cf37 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/PersonDTO.java index 86629bb37..0b1e2b6cd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java index bff3332eb..787068c1a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/HelloController.java index 474493397..195629100 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/PersonDTO.java index 3a884922c..9389d5fed 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java index 9e125939a..9ab9e682d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app84/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app84/HelloController.java index b40fdf373..33cf1fd27 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app84/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app84/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java index 72f164008..6cd974a3a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app85/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app85/HelloController.java index 42cc5f58c..f2df69458 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app85/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app85/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java index 39dbefbd2..8f8937e22 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/HelloController.java index fc81e4a93..76667c398 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java index 731e4a464..6996ffbd1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/test/HelloController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/test/HelloController2.java index 7620ec14c..69f3a06f3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/test/HelloController2.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app86/test/HelloController2.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app87/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app87/HelloController.java index b2542f0e7..2dce262b1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app87/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app87/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java index e2553616b..2d427b929 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app88/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app88/HelloController.java index 8748f03b0..8de612c9d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app88/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app88/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java index 30037e41b..5c1ca74d8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app89/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app89/HelloController.java index b7ca9f092..ca70c6510 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app89/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app89/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java index 2b0066c64..c7f07b519 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/MyApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/MyApi.java index db310b226..778f77bc0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/MyApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/MyApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/MyApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/MyApiController.java index e59387022..96210e19b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/MyApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/MyApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java index 749f607c5..082a06908 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/HelloController.java index 39304b074..b38f9ff4b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java index 034121724..037dd0d72 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocTestApp.java index ab5748e25..0665f5a8c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocTestApp.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocTestApp.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/User.java index 748d4504e..dd3d806af 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/User.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app90/User.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/Advice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/Advice.java index 50034311f..8c6bfdd42 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/Advice.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/Advice.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/ApiError.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/ApiError.java index 8de622c02..9badf9447 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/ApiError.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/ApiError.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/Greeting.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/Greeting.java index e0fcd668e..dd4834641 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/Greeting.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/Greeting.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/GreetingController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/GreetingController.java index 88420de2d..743550b26 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/GreetingController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/GreetingController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/SpringDocApp91Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/SpringDocApp91Test.java index e168cc1ce..8c96a9c23 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/SpringDocApp91Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app91/SpringDocApp91Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/HelloController.java index 8dbb76305..1b29de81c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/ParameterCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/ParameterCustomizer.java index fb03d0246..bb32ee472 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/ParameterCustomizer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/ParameterCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/SpringDocApp92Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/SpringDocApp92Test.java index ed9bbc359..35c08b1d9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/SpringDocApp92Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app92/SpringDocApp92Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/BaseClientModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/BaseClientModel.java index 6d52e06a6..7c8f8124a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/BaseClientModel.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/BaseClientModel.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/BaseController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/BaseController.java index 8c38038dc..0cae1642d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/BaseController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/BaseController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpecificClientModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpecificClientModel.java index 7da6f0ffa..33ca124ac 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpecificClientModel.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpecificClientModel.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpecificController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpecificController.java index d217c3364..3b7c854d3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpecificController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpecificController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpringDocApp93Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpringDocApp93Test.java index f8dd6b998..c0764ec1d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpringDocApp93Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app93/SpringDocApp93Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app94/SpringDocApp94Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app94/SpringDocApp94Test.java index 79b54d4b2..9c7856e73 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app94/SpringDocApp94Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app94/SpringDocApp94Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app95/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app95/HelloController.java index e7e334e70..6634d082e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app95/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app95/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app95/SpringDocApp95Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app95/SpringDocApp95Test.java index caeba076d..e32225882 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app95/SpringDocApp95Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app95/SpringDocApp95Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app96/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app96/HelloController.java index 42980338d..f130edd70 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app96/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app96/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app96/SpringDocApp96Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app96/SpringDocApp96Test.java index 2af46b9c6..548affc3c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app96/SpringDocApp96Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app96/SpringDocApp96Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/HelloController.java index 1d44e2c5d..e16ff736f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/SpringDocApp97Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/SpringDocApp97Test.java index 3b992d8c7..913b435d6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/SpringDocApp97Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/SpringDocApp97Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV1.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV1.java index 71985b201..432412ebf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV1.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV1.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV2.java index debbcc0c2..060124337 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV2.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV2.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV3.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV3.java index fcbbac53f..5a584b88f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV3.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app97/StudentV3.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/HelloController.java index 2cd02647c..5fff25c16 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/IgnoredAnnotationParameter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/IgnoredAnnotationParameter.java index 3d9959c25..dcce9187e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/IgnoredAnnotationParameter.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/IgnoredAnnotationParameter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/SpringDocApp98Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/SpringDocApp98Test.java index 4dca9c5fc..c9b65494e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/SpringDocApp98Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app98/SpringDocApp98Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app99/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app99/HelloController.java index 800602c16..87bee3c80 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app99/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app99/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app99/SpringDocApp99Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app99/SpringDocApp99Test.java index 111cbe2a3..891d00872 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app99/SpringDocApp99Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app99/SpringDocApp99Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java index 142c687a0..7c69d37bf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ public abstract class AbstractSpringDocV31Test extends AbstractCommonTest { public static String className; @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiException.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiException.java deleted file mode 100644 index 1d6c04ea4..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v31.app1; - -public final class ApiException extends Exception { - - private static final long serialVersionUID = 1L; - - @SuppressWarnings("unused") - - private final int code; - - public ApiException(int code, String msg) { - super(msg); - this.code = code; - } -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiOriginFilter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiOriginFilter.java deleted file mode 100644 index f079cda74..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiOriginFilter.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v31.app1; - -import java.io.IOException; - -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.http.HttpServletResponse; - -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") -public class ApiOriginFilter implements jakarta.servlet.Filter { - @Override - public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException, ServletException { - HttpServletResponse res = (HttpServletResponse) response; - res.addHeader("Access-Control-Allow-Origin", "*"); - res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); - res.addHeader("Access-Control-Allow-Headers", "Content-Type"); - chain.doFilter(request, response); - } - - @Override - public void destroy() { - } - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - } -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiResponseMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiResponseMessage.java deleted file mode 100644 index c6685f3c3..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ApiResponseMessage.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v31.app1; - -import jakarta.xml.bind.annotation.XmlTransient; - -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") -@jakarta.xml.bind.annotation.XmlRootElement -public class ApiResponseMessage { - public static final int ERROR = 1; - - public static final int WARNING = 2; - - public static final int INFO = 3; - - public static final int OK = 4; - - public static final int TOO_BUSY = 5; - - int code; - - String type; - - String message; - - public ApiResponseMessage() { - } - - public ApiResponseMessage(int code, String message) { - this.code = code; - switch (code) { - case ERROR: - setType("error"); - break; - case WARNING: - setType("warning"); - break; - case INFO: - setType("info"); - break; - case OK: - setType("ok"); - break; - case TOO_BUSY: - setType("too busy"); - break; - default: - setType("unknown"); - break; - } - this.message = message; - } - - @XmlTransient - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ErrorMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ErrorMessage.java index 8bc1a1a10..660748d6f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ErrorMessage.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ErrorMessage.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ExceptionTranslator.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ExceptionTranslator.java index 0f92c139d..60e93e330 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ExceptionTranslator.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ExceptionTranslator.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java index ff1e7332e..9831f9a3d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/HomeController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/HomeController.java index dab8fa0d7..ec377dd41 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/HomeController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/HomeController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryApi.java index 3808d3bc3..c84890178 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryApiController.java index fd8d77680..eea9f4b39 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryItem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryItem.java index ab0459cb1..2a1696383 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryItem.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/InventoryItem.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemController.java index 94b4c5f3c..698de7868 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemDTO.java index e130afa55..254348f72 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemLightDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemLightDTO.java index 4316de4aa..10f6a67f6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemLightDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/ItemLightDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/Manufacturer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/Manufacturer.java index 3a6115626..8b7f16cc2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/Manufacturer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/Manufacturer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/PeopleRestService.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/PeopleRestService.java index 5bbe6f510..f335aac0a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/PeopleRestService.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/PeopleRestService.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/PersonDTO.java index 8d8698130..3023fb457 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/PersonDTO.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/PersonDTO.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java index 083453bc7..cfaf5d013 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java index 10841446b..e594c537f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/ApiUtil.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/ApiUtil.java index a61e54257..fe6bbd103 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/ApiUtil.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/ApiUtil.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/ExceptionTranslator.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/ExceptionTranslator.java index b7597bd97..cf15f5a93 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/ExceptionTranslator.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/ExceptionTranslator.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/HomeController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/HomeController.java index e265a5f8f..f2ded6848 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/HomeController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/HomeController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApi.java index 1a2e87e68..d79020aa0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiController.java index 7f008969f..8fd101313 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegate.java index b6a85a273..9a0f49e4b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegate.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegate.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegateImpl.java index b0f981ea2..cbd296f4a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegateImpl.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegateImpl.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApi.java index d32e42586..6b00e4fbd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiController.java index 03568c39e..8c3f0595c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegate.java index 3ce7fa435..128693766 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegate.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegate.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegateImpl.java index ec5b350c0..914b2c915 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegateImpl.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegateImpl.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApi.java index 53bdb35cd..531c74456 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApi.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApi.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiController.java index dfc32f806..1b9cd2213 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegate.java index 459b11a7b..0a357177b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegate.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegate.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegateImpl.java index 820e16d55..95111dd99 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegateImpl.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegateImpl.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Body.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Body.java index 9155510e5..fb98fe551 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Body.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Body.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Body1.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Body1.java deleted file mode 100644 index e7ff14bef..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Body1.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2022 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v31.app2.model; - -import java.io.File; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -public class Body1 { - - @Schema(description = "Additional data to pass to server") - /** - * Additional data to pass to server - **/ - private String additionalMetadata = null; - - @Schema(description = "file to upload") - /** - * file to upload - **/ - private File file = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Additional data to pass to server - * - * @return additionalMetadata - **/ - @JsonProperty("additionalMetadata") - public String getAdditionalMetadata() { - return additionalMetadata; - } - - public void setAdditionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - } - - public Body1 additionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - return this; - } - - /** - * file to upload - * - * @return file - **/ - @JsonProperty("file") - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public Body1 file(File file) { - this.file = file; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Body1 {\n"); - - sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Category.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Category.java index 48669a394..d949b0c7e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Category.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Category.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/ModelApiResponse.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/ModelApiResponse.java index 42a02aa6d..cd71405e4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/ModelApiResponse.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/ModelApiResponse.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Order.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Order.java index 62aee8e8d..fd91e5034 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Order.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Order.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Pet.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Pet.java index faf0b9bd6..141ea23f0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Pet.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Pet.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Tag.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Tag.java index d780c6ffb..064444ced 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Tag.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/Tag.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/User.java index 4973b610f..1336a7e9c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/User.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/model/User.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java index eab07c403..42a30e27d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java index 21bc18d71..4524da731 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/TrackerData.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/TrackerData.java index c4b444bfe..09e60a18f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/TrackerData.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/TrackerData.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java index 4d7b0e302..166fa1974 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java @@ -19,7 +19,7 @@ class SpringDocApp5Test extends AbstractSpringDocV31Test { @Test - public void testAddRouterOperationCustomizerBean() throws Exception { + void testAddRouterOperationCustomizerBean() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/DummyData.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/DummyData.java index 4cbfaba86..300f59ecd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/DummyData.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/DummyData.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/GetBodyController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/GetBodyController.java index 27a32a8a2..7021d1209 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/GetBodyController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/GetBodyController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java index e80de672b..a334374b3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java index c9ab491d8..62968d649 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java index 3381c8650..6a5b93b6f 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java index dd267bd02..ce618a270 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java index 6e1f911a9..5e74efdd6 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java index f7ca92520..535a6c234 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java index d9af5c7c1..3566d9276 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java index 6a3e49361..e725b78ce 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java index 965525fec..4b829a25b 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public abstract class SwaggerWelcomeCommon extends AbstractSwaggerWelcome { * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties */ - public SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { + protected SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { super(swaggerUiConfig, springDocConfigProperties); } diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java index 65f48986b..2bb6d3795 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocActuatorTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocActuatorTest.java index a8920cba3..96a8a9545 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocActuatorTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocActuatorTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java index 36a25dd7c..a6cd22a4a 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java @@ -58,7 +58,7 @@ protected void chekJS() throws Exception { checkJS("results/app" + testNumber, Constants.SWAGGER_INITIALIZER_URL, StringUtils.EMPTY); } - protected void checkJSResult(String fileName, String htmlResult) throws Exception { + protected void checkJSResult(String fileName, String htmlResult) { assertTrue(htmlResult.contains("window.ui")); assertEquals(this.getContent(fileName), htmlResult.replace("\r", "")); } diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1Test.java index 2b24c0779..a1ddb33fb 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1Test.java @@ -32,14 +32,14 @@ public class SpringDocApp1Test extends AbstractSpringDocTest { @Test - public void shouldDisplaySwaggerUiPage() throws Exception { + void shouldDisplaySwaggerUiPage() throws Exception { mockMvc.perform(get("/swagger-ui/index.html")) .andExpect(status().isOk()) .andExpect(content().string(containsString("Swagger UI"))); } @Test - public void originalIndex() throws Exception { + void originalIndex() throws Exception { super.chekJS(); } diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java index af156580f..36d909224 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java @@ -39,7 +39,7 @@ public class SpringDocAppRedirectWithPrefixTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithPrefix() throws Exception { + void shouldRedirectWithPrefix() throws Exception { mockMvc.perform(get("/documentation/v3/api-docs/swagger-config")) .andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocConfigPathsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocConfigPathsTest.java index 4d35b8312..f707d80cb 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocConfigPathsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocConfigPathsTest.java @@ -40,7 +40,7 @@ public class SpringDocConfigPathsTest extends AbstractSpringDocTest { @Test - public void should_display_swaggerui_page() throws Exception { + void should_display_swaggerui_page() throws Exception { mockMvc.perform(get("/context-path/servlet-path/test/swagger.html").contextPath("/context-path").servletPath("/servlet-path")) .andExpect(status().isFound()); mockMvc.perform(get("/context-path/servlet-path/test/swagger-ui/index.html").contextPath("/context-path").servletPath("/servlet-path")) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectDefaultTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectDefaultTest.java index 22862e0ad..38b9afa0f 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectDefaultTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectDefaultTest.java @@ -30,7 +30,7 @@ public class SpringDocRedirectDefaultTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithDefaultQueryParams() throws Exception { + void shouldRedirectWithDefaultQueryParams() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectFilterTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectFilterTest.java index 1543b09cf..25e0048e6 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectFilterTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectFilterTest.java @@ -32,7 +32,7 @@ public class SpringDocRedirectFilterTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithConfigUrlIgnoringQueryParams() throws Exception { + void shouldRedirectWithConfigUrlIgnoringQueryParams() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectOriginalQueryParamsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectOriginalQueryParamsTest.java index bd8d29e6f..14065e162 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectOriginalQueryParamsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocRedirectOriginalQueryParamsTest.java @@ -30,7 +30,7 @@ public class SpringDocRedirectOriginalQueryParamsTest extends AbstractSpringDocTest { @Test - public void shouldRedirectWithOriginalQueryParams() throws Exception { + void shouldRedirectWithOriginalQueryParams() throws Exception { mockMvc.perform(get("/swagger-ui.html").queryParam("paramA", "123").queryParam("paramB", "e n c o d e d ! % &")) .andExpect(status().isFound()) .andExpect(header().string("Location", @@ -38,7 +38,7 @@ public void shouldRedirectWithOriginalQueryParams() throws Exception { } @Test - public void shouldRedirectWithOriginalQueryParamsHavingMultipleValues() throws Exception { + void shouldRedirectWithOriginalQueryParamsHavingMultipleValues() throws Exception { mockMvc.perform(get("/swagger-ui.html").queryParam("paramA", "1", "2", "3")) .andExpect(status().isFound()) .andExpect(header().string("Location", diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigTest.java index a4e030b47..fedbb254b 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigTest.java @@ -39,7 +39,7 @@ public class SpringDocSwaggerConfigTest extends AbstractSpringDocActuatorTest { @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { mockMvc.perform(get("/demo/api/v3/api-docs/swagger-config").contextPath("/demo/api")) .andExpect(status().isOk()) .andExpect(jsonPath("validatorUrl", equalTo(""))) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigWithBothFileGeneratedSpecsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigWithBothFileGeneratedSpecsTest.java index d32fd1d8f..201a63717 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigWithBothFileGeneratedSpecsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigWithBothFileGeneratedSpecsTest.java @@ -46,7 +46,7 @@ public class SpringDocSwaggerConfigWithBothFileGeneratedSpecsTest extends AbstractSpringDocActuatorTest { @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { mockMvc.perform(get("/demo/api/v3/api-docs/swagger-config").contextPath("/demo/api")) .andExpect(status().isOk()) .andExpect(jsonPath("validatorUrl", equalTo(""))) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app10/SpringDocApp10Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app10/SpringDocApp10Test.java index 3cb104540..a49435e81 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app10/SpringDocApp10Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app10/SpringDocApp10Test.java @@ -34,14 +34,14 @@ public class SpringDocApp10Test extends AbstractSpringDocTest { @Test - public void shouldDisplaySwaggerUiPage() throws Exception { + void shouldDisplaySwaggerUiPage() throws Exception { MvcResult mvcResult = mockMvc.perform(get("/swagger-ui/index.html")).andExpect(status().isOk()).andReturn(); String contentAsString = mvcResult.getResponse().getContentAsString(); assertTrue(contentAsString.contains("Swagger UI")); } @Test - public void originalIndex() throws Exception { + void originalIndex() throws Exception { super.chekJS(); } diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java index 8f8dd0392..4ef00a02a 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java @@ -44,13 +44,13 @@ void testIndex() throws Exception { } @Test - public void testIndexActuator() { + void testIndexActuator() { String contentAsString = actuatorRestTemplate.getForObject("/application/swagger-ui", String.class); assertTrue(contentAsString.contains("Swagger UI")); } @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { String contentAsString = actuatorRestTemplate.getForObject("/application/swagger-ui/swagger-config", String.class); String expected = getContent("results/app13-1.json"); assertEquals(expected, contentAsString, true); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java index 873b6a0ae..b0974c254 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java @@ -44,13 +44,13 @@ void testIndex() throws Exception { } @Test - public void testIndexActuator() { + void testIndexActuator() { String contentAsString = actuatorRestTemplate.getForObject("/application/swagger-ui", String.class); assertTrue(contentAsString.contains("Swagger UI")); } @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { String contentAsString = actuatorRestTemplate.getForObject("/application/swagger-ui/swagger-config", String.class); String expected = getContent("results/app14-1.json"); assertEquals(expected, contentAsString, true); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java index 49bdf6f3f..d22960442 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java @@ -47,13 +47,13 @@ void testIndex() throws Exception { } @Test - public void testIndexActuator() { + void testIndexActuator() { String contentAsString = actuatorRestTemplate.getForObject("/test/application/swagger-ui", String.class); assertTrue(contentAsString.contains("Swagger UI")); } @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { String contentAsString = actuatorRestTemplate.getForObject("/test/application/swagger-ui/swagger-config", String.class); String expected = getContent("results/app15-1.json"); assertEquals(expected, contentAsString, true); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java index 1f0034452..1e904ba5c 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java @@ -47,13 +47,13 @@ void testIndex() throws Exception { } @Test - public void testIndexActuator() { + void testIndexActuator() { String contentAsString = actuatorRestTemplate.getForObject("/test/application/swagger-ui", String.class); assertTrue(contentAsString.contains("Swagger UI")); } @Test - public void testIndexSwaggerConfig() throws Exception { + void testIndexSwaggerConfig() throws Exception { String contentAsString = actuatorRestTemplate.getForObject("/test/application/swagger-ui/swagger-config", String.class); String expected = getContent("results/app16-1.json"); assertEquals(expected, contentAsString, true); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java index 52e486c68..50481e6fe 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java @@ -36,7 +36,7 @@ public class SpringDocApp18Test extends AbstractSpringDocTest { @Test - public void testTryItOutEnabled() throws Exception { + void testTryItOutEnabled() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config")) .andExpect(status().isOk()) .andExpect(jsonPath("displayOperationId", equalTo(true))) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java index af2b15576..44931db39 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java @@ -31,7 +31,7 @@ public class SpringDocApp19Test extends AbstractSpringDocTest { @Test - public void testUseRootPath() throws Exception { + void testUseRootPath() throws Exception { mockMvc.perform(get("/")) .andExpect(status().is3xxRedirection()); mockMvc.perform(get("/swagger-ui.html")) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app2/SpringDocApp2Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app2/SpringDocApp2Test.java index 75676cf5f..4a0fc9163 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app2/SpringDocApp2Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app2/SpringDocApp2Test.java @@ -31,7 +31,7 @@ public class SpringDocApp2Test extends AbstractSpringDocTest { @Test - public void test() throws Exception { + void test() throws Exception { mockMvc.perform(get("/swagger-ui/index.html")) .andExpect(status().isNotFound()); } diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java index 296ec2b3a..acb8278d0 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java @@ -32,7 +32,7 @@ public class SpringDocApp21Test extends AbstractSpringDocTest { @Test - public void testAddSwaggerUiVersionToPath() throws Exception { + void testAddSwaggerUiVersionToPath() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); @@ -41,7 +41,7 @@ public void testAddSwaggerUiVersionToPath() throws Exception { } @Test - public void shouldRedirectWithPrefix() throws Exception { + void shouldRedirectWithPrefix() throws Exception { mockMvc.perform(get("/rest/v3/api-docs/swagger-config")) .andExpect(status().isOk()) .andExpect(jsonPath("validatorUrl", equalTo(""))) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app22/SpringDocApp22Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app22/SpringDocApp22Test.java index 7b4d384e1..8dee4261b 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app22/SpringDocApp22Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app22/SpringDocApp22Test.java @@ -36,7 +36,7 @@ public class SpringDocApp22Test extends AbstractSpringDocTest { @Test - public void test_apidocs_disabled() throws Exception { + void test_apidocs_disabled() throws Exception { mockMvc.perform(get("/api-docs/swagger-config")) .andExpect(status().isOk()) .andExpect(jsonPath("url", equalTo("/api-docs/xxx/v1/openapi.yml"))) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app22/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app22/SpringDocTestApp.java index 1e4474372..71c101737 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app22/SpringDocTestApp.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app22/SpringDocTestApp.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java index 0164f2268..d275e653c 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java @@ -35,7 +35,7 @@ public class SpringDocApp24Test extends AbstractSpringDocTest { @Test - public void shouldRedirectWithConfigUrlIgnoringQueryParams() throws Exception { + void shouldRedirectWithConfigUrlIgnoringQueryParams() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app25/SpringDocApp25Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app25/SpringDocApp25Test.java index 3b77ca896..68585c947 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app25/SpringDocApp25Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app25/SpringDocApp25Test.java @@ -37,7 +37,7 @@ public class SpringDocApp25Test extends AbstractSpringDocTest { @Test - public void shouldRedirectWithConfiguredParams() throws Exception { + void shouldRedirectWithConfiguredParams() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app26/SpringDocApp26Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app26/SpringDocApp26Test.java index cc136644d..6046399e3 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app26/SpringDocApp26Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app26/SpringDocApp26Test.java @@ -32,7 +32,7 @@ public class SpringDocApp26Test extends AbstractSpringDocTest { @Test - public void shouldRedirectWithBaseLayout() throws Exception { + void shouldRedirectWithBaseLayout() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app27/SpringDocApp27Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app27/SpringDocApp27Test.java index 3da48e109..5b2d08982 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app27/SpringDocApp27Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app27/SpringDocApp27Test.java @@ -34,7 +34,7 @@ public class SpringDocApp27Test extends AbstractSpringDocTest { @Test - public void shouldRedirectWithQueryParams() throws Exception { + void shouldRedirectWithQueryParams() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html?operationsSorter=method&configUrl=/v3/api-docs/swagger-config")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app28/SpringDocApp28Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app28/SpringDocApp28Test.java index 722632f35..34209ecf8 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app28/SpringDocApp28Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app28/SpringDocApp28Test.java @@ -32,7 +32,7 @@ public class SpringDocApp28Test extends AbstractSpringDocTest { @Test - public void shouldRedirectWithFilter() throws Exception { + void shouldRedirectWithFilter() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app29/SpringDocApp29Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app29/SpringDocApp29Test.java index 4a7b1d589..84659252c 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app29/SpringDocApp29Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app29/SpringDocApp29Test.java @@ -36,7 +36,7 @@ public class SpringDocApp29Test extends AbstractSpringDocTest { @Test - public void test_url_with_context() throws Exception { + void test_url_with_context() throws Exception { mockMvc.perform(get("/context-path/v3/api-docs/swagger-config").contextPath("/context-path")) .andExpect(status().isOk()) .andExpect(jsonPath("url", equalTo("/context-path/api-docs/xxx/v1/openapi.yml"))) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java index f510f2f15..49fe578a9 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java @@ -35,7 +35,7 @@ public class SpringDocApp3Test extends AbstractSpringDocTest { @Test - public void app_loads_ok() throws Exception { + void app_loads_ok() throws Exception { this.mockMvc.perform(MockMvcRequestBuilders.get("/")) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.forwardedUrl("index.html")); @@ -46,7 +46,7 @@ public void app_loads_ok() throws Exception { } @Test - public void swagger_config_for_no_groups() throws Exception { + void swagger_config_for_no_groups() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config")) .andExpect(status().isOk()) .andExpect(jsonPath("configUrl", equalTo("/v3/api-docs/swagger-config"))) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app30/SpringDocApp30Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app30/SpringDocApp30Test.java index 83734b3dd..6354ba688 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app30/SpringDocApp30Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app30/SpringDocApp30Test.java @@ -37,7 +37,7 @@ public class SpringDocApp30Test extends AbstractSpringDocTest { @Test - public void test_urls_with_context() throws Exception { + void test_urls_with_context() throws Exception { mockMvc.perform(get("/context-path/v3/api-docs/swagger-config").contextPath("/context-path")) .andExpect(status().isOk()) .andExpect(jsonPath("url").doesNotExist()) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app31/SpringDocApp31Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app31/SpringDocApp31Test.java index 9972d91b8..5d4a007f4 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app31/SpringDocApp31Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app31/SpringDocApp31Test.java @@ -36,7 +36,7 @@ public class SpringDocApp31Test extends AbstractSpringDocTest { @Test - public void test_query_config() throws Exception { + void test_query_config() throws Exception { mockMvc.perform(get("/api/")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/api/swagger-ui/index.html?showExtensions=true&configUrl=/v3/api-docs/swagger-config")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java index 2a9d8ef61..7d4e99c67 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java @@ -42,13 +42,13 @@ public class SpringDocBehindProxyTest extends AbstractSpringDocTest { private static final String X_FORWARD_PREFIX = "/path/prefix"; @Test - public void shouldServeSwaggerUIAtDefaultPath() throws Exception { + void shouldServeSwaggerUIAtDefaultPath() throws Exception { mockMvc.perform(get("/swagger-ui/index.html")) .andExpect(status().isOk()); } @Test - public void shouldReturnCorrectInitializerJS() throws Exception { + void shouldReturnCorrectInitializerJS() throws Exception { mockMvc.perform(get("/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX)) .andExpect(status().isOk()) @@ -58,7 +58,7 @@ public void shouldReturnCorrectInitializerJS() throws Exception { } @Test - public void shouldCalculateOauthRedirectBehindProxy() throws Exception { + void shouldCalculateOauthRedirectBehindProxy() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config") .header("X-Forwarded-Proto", "https") .header("X-Forwarded-Host", "proxy-host") @@ -70,7 +70,7 @@ public void shouldCalculateOauthRedirectBehindProxy() throws Exception { } @Test - public void shouldCalculateUrlsBehindProxy() throws Exception { + void shouldCalculateUrlsBehindProxy() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX)) .andExpect(status().isOk()) @@ -83,7 +83,7 @@ public void shouldCalculateUrlsBehindProxy() throws Exception { } @Test - public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() throws Exception { + void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() throws Exception { var tasks = IntStream.range(0, 10).mapToObj(i -> CompletableFuture.runAsync(() -> { try { mockMvc.perform(get("/swagger-ui/swagger-initializer.js") @@ -101,7 +101,7 @@ public void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() } @Test - public void shouldCalculateUrlsBehindProxyWhenChangingForwardedPrefixHeader() { + void shouldCalculateUrlsBehindProxyWhenChangingForwardedPrefixHeader() { var tasks = IntStream.range(0, 10).mapToObj(i -> CompletableFuture.runAsync(() -> { try { mockMvc.perform(get("/v3/api-docs/swagger-config") diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java index 43a1af643..5f637650e 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java @@ -41,7 +41,7 @@ public class SpringDocBehindProxyWithCustomUIPathTest extends AbstractSpringDocT private static final String X_FORWARD_PREFIX = "/path/prefix"; @Test - public void shouldRedirectSwaggerUIFromCustomPath() throws Exception { + void shouldRedirectSwaggerUIFromCustomPath() throws Exception { mockMvc.perform(get("/foo/documentation/swagger.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX)) .andExpect(status().isFound()) @@ -49,7 +49,7 @@ public void shouldRedirectSwaggerUIFromCustomPath() throws Exception { } @Test - public void shouldReturnCorrectInitializerJS() throws Exception { + void shouldReturnCorrectInitializerJS() throws Exception { mockMvc.perform(get("/foo/documentation/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX)) .andExpect(status().isOk()) @@ -59,7 +59,7 @@ public void shouldReturnCorrectInitializerJS() throws Exception { } @Test - public void shouldCalculateUrlsBehindProxy() throws Exception { + void shouldCalculateUrlsBehindProxy() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX)) .andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java index ea6ce57a4..aa069ea58 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java @@ -41,14 +41,14 @@ public class SpringDocBehindProxyWithCustomUIPathWithApiDocsTest extends Abstrac private static final String X_FORWARD_PREFIX = "/path/prefix"; @Test - public void shouldServeOpenapiJsonUnderCustomPath() throws Exception { + void shouldServeOpenapiJsonUnderCustomPath() throws Exception { mockMvc.perform(get("/bar/openapi/v3") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX)) .andExpect(status().isOk()); } @Test - public void shouldReturnCorrectInitializerJS() throws Exception { + void shouldReturnCorrectInitializerJS() throws Exception { mockMvc.perform(get("/foo/documentation/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX)) .andExpect(status().isOk()) @@ -58,7 +58,7 @@ public void shouldReturnCorrectInitializerJS() throws Exception { } @Test - public void shouldCalculateUrlsBehindProxy() throws Exception { + void shouldCalculateUrlsBehindProxy() throws Exception { mockMvc.perform(get("/bar/openapi/v3/swagger-config") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX)) .andExpect(status().isOk()) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocApp33Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocApp33Test.java index 49e2382ce..4b62213ef 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocApp33Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocApp33Test.java @@ -35,7 +35,7 @@ public class SpringDocApp33Test extends AbstractSpringDocTest { @Test - public void shouldRedirectWithConfigUrlIgnoringQueryParams() throws Exception { + void shouldRedirectWithConfigUrlIgnoringQueryParams() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/SpringDocApp34Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/SpringDocApp34Test.java index 5a82f202b..505002f44 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/SpringDocApp34Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app34/SpringDocApp34Test.java @@ -34,7 +34,7 @@ public class SpringDocApp34Test extends AbstractSpringDocTest { @Test - public void test() throws Exception { + void test() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/SpringDocApp35Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/SpringDocApp35Test.java index 172e4b4c0..bca32be6e 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/SpringDocApp35Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app35/SpringDocApp35Test.java @@ -34,7 +34,7 @@ public class SpringDocApp35Test extends AbstractSpringDocTest { @Test - public void test() throws Exception { + void test() throws Exception { mockMvc.perform(get("/swagger-ui.html")) .andExpect(status().isFound()) .andExpect(header().string("Location", "/swagger-ui/index.html")); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocApp4Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocApp4Test.java index 53e2d8a1d..9a9da8c9b 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocApp4Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocApp4Test.java @@ -32,7 +32,7 @@ public class SpringDocApp4Test extends AbstractSpringDocTest { @Test - public void swagger_config_for_multiple_groups() throws Exception { + void swagger_config_for_multiple_groups() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config")) .andExpect(status().isOk()) .andExpect(jsonPath("configUrl", equalTo("/v3/api-docs/swagger-config"))) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocTestApp.java index 13506213c..347ee04c1 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocTestApp.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocTestApp.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java index 02b25dc7e..4f30b091e 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocApp5Test.java @@ -36,7 +36,7 @@ public class SpringDocApp5Test extends AbstractSpringDocTest { public static final String CONTEXT_PATH = "/context-path"; @Test - public void oauth2_redirect_url_calculated_with_context_path() throws Exception { + void oauth2_redirect_url_calculated_with_context_path() throws Exception { mockMvc.perform(get(CONTEXT_PATH+"/v3/api-docs/swagger-config").contextPath("/context-path")) .andExpect(status().isOk()) .andExpect(jsonPath("oauth2RedirectUrl", equalTo("http://localhost/context-path/swagger-ui/oauth2-redirect.html"))); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthPathsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthPathsTest.java index bec8ba6fb..bfc03fa1a 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthPathsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthPathsTest.java @@ -31,7 +31,7 @@ public class SpringDocOauthPathsTest extends AbstractSpringDocTest { @Test - public void oauth2_redirect_url_calculated() throws Exception { + void oauth2_redirect_url_calculated() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config")) .andExpect(status().isOk()) .andExpect(jsonPath("oauth2RedirectUrl", equalTo("http://localhost/swagger-ui/oauth2-redirect.html"))); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthPathsWithPropertyTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthPathsWithPropertyTest.java index 196717f28..29950d602 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthPathsWithPropertyTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthPathsWithPropertyTest.java @@ -33,7 +33,7 @@ public class SpringDocOauthPathsWithPropertyTest extends AbstractSpringDocTest { @Test - public void oauth2_redirect_url_calculated() throws Exception { + void oauth2_redirect_url_calculated() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config")) .andExpect(status().isOk()) .andExpect(jsonPath("oauth2RedirectUrl", equalTo("http://localhost:8080/toto/test/swagger-ui/oauth2-redirect.html"))); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthRedirectUrlRecalculateTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthRedirectUrlRecalculateTest.java index 12737f90f..85f87a998 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthRedirectUrlRecalculateTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthRedirectUrlRecalculateTest.java @@ -33,7 +33,7 @@ public class SpringDocOauthRedirectUrlRecalculateTest extends AbstractSpringDocTest { @Test - public void oauth2_redirect_url_recalculation() throws Exception { + void oauth2_redirect_url_recalculation() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config").header("X-Forwarded-Proto", "https").header("X-Forwarded-Host", "host1")) .andExpect(status().isOk()) .andExpect(jsonPath("oauth2RedirectUrl", equalTo("https://host1/swagger-ui/oauth2-redirect.html"))); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthServletPathsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthServletPathsTest.java index 561f9f5c3..4c1f09f06 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthServletPathsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app5/SpringDocOauthServletPathsTest.java @@ -39,7 +39,7 @@ public class SpringDocOauthServletPathsTest extends AbstractSpringDocTest { @Test - public void should_display_oauth2_redirect_page() throws Exception { + void should_display_oauth2_redirect_page() throws Exception { mockMvc.perform(get("/context-path/servlet-path/test/swagger.html").servletPath("/servlet-path").contextPath("/context-path")).andExpect(status().is3xxRedirection()).andReturn(); mockMvc.perform(get("/context-path/servlet-path/test/swagger-ui/oauth2-redirect.html").servletPath("/servlet-path").contextPath("/context-path")).andExpect(status().isOk()).andReturn(); @@ -50,7 +50,7 @@ public void should_display_oauth2_redirect_page() throws Exception { } @Test - public void oauth2_redirect_url_calculated_with_context_path_and_servlet_path() throws Exception { + void oauth2_redirect_url_calculated_with_context_path_and_servlet_path() throws Exception { mockMvc.perform(get("/context-path/servlet-path/v3/api-docs/swagger-config").contextPath("/context-path").servletPath("/servlet-path")) .andExpect(status().isOk()) .andExpect(jsonPath("oauth2RedirectUrl", equalTo("http://localhost/context-path/servlet-path/test/swagger-ui/oauth2-redirect.html"))); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocSwaggerUiUrlPropertyTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocSwaggerUiUrlPropertyTest.java index 439697254..6059d48c5 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocSwaggerUiUrlPropertyTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocSwaggerUiUrlPropertyTest.java @@ -32,7 +32,7 @@ public class SpringDocSwaggerUiUrlPropertyTest extends AbstractSpringDocTest { @Test - public void with_swagger_ui_property() throws Exception { + void with_swagger_ui_property() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config")) .andExpect(status().isOk()) .andExpect(jsonPath("url", equalTo("http://myserver:8080/v3/api-docs"))); diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java index 4e5ceade8..79f94059f 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java @@ -31,7 +31,7 @@ public class SpringDocApp7Test extends AbstractSpringDocTest { @Test - public void transformed_index_with_oauth() throws Exception { + void transformed_index_with_oauth() throws Exception { super.chekJS(); } diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java index e5006bff6..fb077b093 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8MultipleUrlsSeveralParallelRequestsTest.java @@ -59,7 +59,7 @@ public class SpringDocApp8MultipleUrlsSeveralParallelRequestsTest extends Abstra * simultaneously to make sure no exceptions are thrown when getting Swagger config. */ @Test - public void swagger_config_for_multiple_groups_and_many_parallel_requests() { + void swagger_config_for_multiple_groups_and_many_parallel_requests() { assertDoesNotThrow(() -> { allOf(Stream.generate(() -> runAsync(() -> { try { diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8Test.java index d89295c52..f09fc5add 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app8/SpringDocApp8Test.java @@ -36,7 +36,7 @@ public class SpringDocApp8Test extends AbstractSpringDocTest { @Test - public void swagger_config_for_multiple_groups() throws Exception { + void swagger_config_for_multiple_groups() throws Exception { mockMvc.perform(get("/v3/api-docs/swagger-config")) .andExpect(status().isOk()) .andExpect(jsonPath("configUrl", equalTo("/v3/api-docs/swagger-config"))) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app9/SpringDocApp9Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app9/SpringDocApp9Test.java index 8fc8870c0..ee3aec2cb 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app9/SpringDocApp9Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app9/SpringDocApp9Test.java @@ -36,7 +36,7 @@ public class SpringDocApp9Test extends AbstractSpringDocTest { @Test - public void transformed_index_with_oauth() throws Exception { + void transformed_index_with_oauth() throws Exception { super.chekJS(); } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java index fa81f9c09..d40f8cbd6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index b93e551df..208bea214 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -28,7 +28,7 @@ public abstract class AbstractSpringDocTest extends AbstractCommonTest { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { String className = getClass().getSimpleName(); String testId = className.replaceAll("[^0-9]", ""); testApp(testId, StringUtils.EMPTY); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java index 93163322b..cddabb844 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java @@ -38,13 +38,13 @@ public class SpringDocApp144Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() { + void testApp() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() .expectStatus().isNotFound(); } @Test - public void testApp1() throws Exception { + void testApp1() throws Exception { String result = webClient.get().uri("/application/openapi").retrieve() .bodyToMono(String.class) .block(); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1451Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1451Test.java index d5dd052f9..f47274bb2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1451Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1451Test.java @@ -44,7 +44,7 @@ public class SpringDocApp1451Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() { + void testApp() { try { webClient.get().uri("/application/openapi").retrieve() .bodyToMono(String.class).block(); @@ -59,7 +59,7 @@ public void testApp() { } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { try { String result = webClient.get().uri("/application/openapi/users").retrieve() .bodyToMono(String.class).block(); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1452Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1452Test.java index 09b58d4c7..b2efc928a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1452Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1452Test.java @@ -41,7 +41,7 @@ public class SpringDocApp1452Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { try { String result = webClient.get().uri("/application/openapi/users").retrieve() .bodyToMono(String.class).block(); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java index 8dff87bf2..d723f920b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. @@ -43,14 +43,14 @@ public class SpringDocApp145Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() { + void testApp() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/users") .exchange() .expectStatus().isNotFound(); } @Test - public void testApp3() throws Exception { + void testApp3() throws Exception { try { webClient.get().uri("/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME).retrieve() .bodyToMono(String.class).block(); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java index 53a87de9f..593016888 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java @@ -36,12 +36,12 @@ public class SpringDocApp146Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { super.testApp("146-1", Constants.ACTUATOR_DEFAULT_GROUP); } @Test - public void testApp1() throws Exception { + void testApp1() throws Exception { super.testApp("146-2", Constants.DEFAULT_GROUP_NAME); } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java index 83a884cbf..158bfd4d0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java @@ -36,18 +36,18 @@ public class SpringDocApp147Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { super.testApp("147-1", Constants.ACTUATOR_DEFAULT_GROUP); } @Test - public void testApp1() throws Exception { + void testApp1() throws Exception { super.testApp("147-2", Constants.ACTUATOR_DEFAULT_GROUP); } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.DEFAULT_GROUP_NAME) .exchange() .expectStatus().isNotFound(); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java index 11b004e45..0db1f4cd3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java @@ -44,17 +44,17 @@ public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { super.testWithWebClient("148-1","/test/application/openapi/users"); } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { super.testWithWebClient("148-2","/test/application/openapi/x-actuator"); } @Test - public void testApp3() throws Exception { + void testApp3() throws Exception { try { webClient.get().uri("/test/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME).retrieve() .bodyToMono(String.class).block(); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java index 529659639..7b6509736 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -50,28 +50,28 @@ public class SpringDocApp186Test extends AbstractCommonTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app186.json"), true); } @Test - public void testGroupActuatorAsCodeCheckBackwardsCompatibility() { + void testGroupActuatorAsCodeCheckBackwardsCompatibility() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code-check-backwards-compatibility").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app186.json"), true); } @Test - public void testGroupActuatorAsCode() { + void testGroupActuatorAsCode() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app186.json"), true); } @Test - public void testGroupActuatorAsProperties() { + void testGroupActuatorAsProperties() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-properties").exchange() .expectStatus().isOk() .expectBody().json(getContent("results/app186.json"), true); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java index 9f877e497..ac7d1a833 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java @@ -36,7 +36,7 @@ public class SpringDocApp76Test extends AbstractSpringDocTest { @Test - public void testApp() throws Exception { + protected void testApp() { webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/actuator").exchange().expectStatus().isOk().expectBody() .jsonPath("$.openapi").isEqualTo("3.0.1") .jsonPath("$.paths./actuator/health.get.operationId").exists(); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java index 4173589c8..fb674a750 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 84d9f4294..5824868a0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -36,7 +36,7 @@ public abstract class AbstractSpringDocTest extends AbstractCommonTest { public static String className; @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/SpringDocApp128Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/SpringDocApp128Test.java index 12ffe2ab9..c938ce64f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/SpringDocApp128Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/SpringDocApp128Test.java @@ -51,7 +51,7 @@ public class SpringDocApp128Test extends AbstractSpringDocTest { } @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.operationId", containsString("getTenantById"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java index 4b10dd3ea..d80cb4239 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java @@ -40,13 +40,13 @@ public class SpringDocApp144Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) .andExpect(status().isNotFound()); } @Test - public void testApp1() throws Exception { + void testApp1() throws Exception { String result = actuatorRestTemplate.getForObject("/application/openapi", String.class); String expected = getContent("results/app144.json"); assertEquals(expected, result, true); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java index 251bbf630..b45e5135a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. @@ -47,13 +47,13 @@ public class SpringDocApp145Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) .andExpect(status().isNotFound()); } @Test - public void testApp1() throws Exception { + void testApp1() throws Exception { try { actuatorRestTemplate.getForObject("/application/openapi", String.class); fail(); @@ -67,14 +67,14 @@ public void testApp1() throws Exception { } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { String result = actuatorRestTemplate.getForObject("/application/openapi/users", String.class); String expected = getContent("results/app145.json"); assertEquals(expected, result, true); } @Test - public void testApp3() throws Exception { + void testApp3() throws Exception { try { actuatorRestTemplate.getForObject("/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME, String.class); fail(); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java index 2843e2046..ff34a846c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public class SpringDocApp147Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.ACTUATOR_DEFAULT_GROUP)) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -51,7 +51,7 @@ public void testApp() throws Exception { } @Test - public void testApp1() throws Exception { + void testApp1() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -59,7 +59,7 @@ public void testApp1() throws Exception { } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.DEFAULT_GROUP_NAME)) .andExpect(status().isNotFound()); } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java index 3d9c4a593..089f9835c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. @@ -46,17 +46,17 @@ public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { @Test - public void testApp() throws Exception { + void testApp() throws Exception { super.testWithRestTemplate("148-1","/test/application/openapi/users"); } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { super.testWithRestTemplate("148-2","/test/application/openapi/x-actuator"); } @Test - public void testApp3() throws Exception { + void testApp3() throws Exception { try { actuatorRestTemplate.getForObject("/test/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME, String.class); fail(); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java index 7bbc1a20a..e448b6403 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class SpringDocApp186Test extends AbstractSpringDocTest { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(status().isOk()) @@ -59,7 +59,7 @@ public void testApp() throws Exception { } @Test - public void testGroupActuatorAsCodeCheckBackwardsCompatibility() throws Exception { + void testGroupActuatorAsCodeCheckBackwardsCompatibility() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code-check-backwards-compatibility")) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(status().isOk()) @@ -67,7 +67,7 @@ public void testGroupActuatorAsCodeCheckBackwardsCompatibility() throws Exceptio } @Test - public void testGroupActuatorAsCode() throws Exception { + void testGroupActuatorAsCode() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code")) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(status().isOk()) @@ -75,7 +75,7 @@ public void testGroupActuatorAsCode() throws Exception { } @Test - public void testGroupActuatorAsProperties() throws Exception { + void testGroupActuatorAsProperties() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-properties")) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java index 7883c705c..e51e85383 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java @@ -37,7 +37,7 @@ public class SpringDocApp36Test extends AbstractSpringDocTest { @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(jsonPath("$.paths./actuator/info.get.operationId", containsString("info"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java index a8e32fdad..0cbbe9cf3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java @@ -37,10 +37,9 @@ @TestPropertySource(properties = { "management.endpoints.enabled-by-default=true", "springdoc.show-actuator=true" }) public class SpringDocApp68Test extends AbstractSpringDocTest { - public static String className; @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -48,7 +47,7 @@ public void testApp() throws Exception { } @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -56,7 +55,7 @@ public void testApp2() throws Exception { } @Test - public void testApp3() throws Exception { + void testApp3() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -64,7 +63,7 @@ public void testApp3() throws Exception { } @Test - public void testApp4() throws Exception { + void testApp4() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -72,7 +71,7 @@ public void testApp4() throws Exception { } @Test - public void testActuator() throws Exception { + void testActuator() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(jsonPath("$.paths./actuator/health.get.summary", Matchers.is("Actuator web endpoint 'health'"))) @@ -80,7 +79,7 @@ public void testActuator() throws Exception { } @Test - public void testActuatorDescription() throws Exception { + void testActuatorDescription() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(jsonPath("$.tags", hasSize(4))) @@ -91,7 +90,7 @@ public void testActuatorDescription() throws Exception { } @Test - public void testApp5() throws Exception { + void testApp5() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/user")) .andExpect(status().isNotFound()); } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocConfiguration.java similarity index 95% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocTestApp.java rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocConfiguration.java index 8b1697320..0dfedc891 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocTestApp.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocConfiguration.java @@ -34,16 +34,16 @@ import org.springdoc.core.models.GroupedOpenApi; import org.springdoc.core.utils.Constants; -import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.web.method.HandlerMethod; -@SpringBootApplication -public class SpringDocTestApp { - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } +@Configuration +public class SpringDocConfiguration { + + @SpringBootApplication + static class SpringDocTestApp {} @Bean public GroupedOpenApi storeOpenApi() { diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java index 63b2e4149..50037fee8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java @@ -29,13 +29,13 @@ import static org.assertj.core.api.Assertions.assertThat; -public class BlockingAutoConfigurationTest { +class BlockingAutoConfigurationTest { private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() .withUserConfiguration(TestApp.class); @Test - public void configurations_successfully_loaded() { + void configurations_successfully_loaded() { contextRunner .withPropertyValues("springdoc.show-actuator=true") .run(context -> assertThat(context) @@ -47,7 +47,7 @@ public void configurations_successfully_loaded() { } @Test - public void configurations_not_loaded_when_application_is_not_web() { + void configurations_not_loaded_when_application_is_not_web() { new ApplicationContextRunner() .withUserConfiguration(TestApp.class) .run(context -> assertThat(context) @@ -59,7 +59,7 @@ public void configurations_not_loaded_when_application_is_not_web() { } @Test - public void actuator_configuration_not_loaded_when_not_enabled_explicitly() { + void actuator_configuration_not_loaded_when_not_enabled_explicitly() { contextRunner .run(context -> assertThat(context) .hasNotFailed() @@ -70,7 +70,7 @@ public void actuator_configuration_not_loaded_when_not_enabled_explicitly() { } @Test - public void configurations_not_loaded_when_disabled() { + void configurations_not_loaded_when_disabled() { contextRunner .withPropertyValues("springdoc.api-docs.enabled=false") .run(context -> assertThat(context) @@ -82,7 +82,7 @@ public void configurations_not_loaded_when_disabled() { } @Test - public void configurations_not_loaded_when_mvc_is_not_on_class_path() { + void configurations_not_loaded_when_mvc_is_not_on_class_path() { contextRunner .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) .run(context -> assertThat(context) diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java index 3745fec4c..d1b91cef0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java @@ -31,7 +31,7 @@ public class CacheAutoConfigurationTest1 { .withUserConfiguration(TestApp.class); @Test - public void cache_configuration_loaded_when_not_disabled_explicitly() { + void cache_configuration_loaded_when_not_disabled_explicitly() { contextRunner .run(context -> assertThat(context) .hasNotFailed() @@ -42,7 +42,7 @@ public void cache_configuration_loaded_when_not_disabled_explicitly() { } @Test - public void cache_configuration_loaded_when_disabled_explicitly() { + void cache_configuration_loaded_when_disabled_explicitly() { contextRunner .withPropertyValues("springdoc.cache.disabled=false") .run(context -> assertThat(context) @@ -54,7 +54,7 @@ public void cache_configuration_loaded_when_disabled_explicitly() { } @Test - public void cache_configurations_successfully_disabled() { + void cache_configurations_successfully_disabled() { contextRunner .withPropertyValues("springdoc.cache.disabled=true") .run(context -> assertThat(context) @@ -66,7 +66,7 @@ public void cache_configurations_successfully_disabled() { } @Test - public void group_configuration_loaded() { + void group_configuration_loaded() { contextRunner .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") .run(context -> assertThat(context) diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java index 1c2d75204..ef634e5a7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java @@ -33,7 +33,7 @@ public class GroupAutoConfigurationTest { .withUserConfiguration(TestApp.class); @Test - public void group_configuration_loaded() { + void group_configuration_loaded() { contextRunner .run(context -> assertThat(context) .hasNotFailed() diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 6b2d22ff1..63cff6c93 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -65,7 +65,7 @@ public static String getContent(String fileName) { } @Test - public void testApp() throws Exception { + void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/Bank.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/Bank.java index 6b37ab62a..7683e9d52 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/Bank.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/Bank.java @@ -35,10 +35,6 @@ public String getCode() { return this.code; } - private void setCode(String code) { - this.code = code; - } - public String getName() { return this.name; } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/BankRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/BankRepository.java index c6aea4d7d..81d8e8db3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/BankRepository.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/BankRepository.java @@ -7,6 +7,4 @@ @Repository @RepositoryRestResource(path = "banks") public interface BankRepository extends JpaRepository, CodeLookupRepository { - // moved to CodeLookupRepository - //Bank findOneByCode(String code); } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/SpringDocApp301Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/SpringDocApp301Test.java index 95760e808..2dbbb1436 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/SpringDocApp301Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/SpringDocApp301Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -24,13 +24,11 @@ package test.org.springdoc.api.app301; -import java.lang.reflect.Field; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; import com.fasterxml.jackson.databind.type.ClassKey; import org.apache.commons.lang3.reflect.FieldUtils; @@ -53,10 +51,8 @@ public class SpringDocApp301Test extends AbstractSpringDocTest { @BeforeEach void init() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); Iterator>> it = _localMixIns.entrySet().iterator(); while (it.hasNext()) { Map.Entry> entry = it.next(); @@ -70,10 +66,8 @@ void init() throws IllegalAccessException { @AfterEach void clean() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); _localMixIns.putAll(springMixins); } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolder.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolder.java index 439bd65fe..bd506b1f5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolder.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolder.java @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolderRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolderRepository.java index 88a2b518d..2bde495dd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolderRepository.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolderRepository.java @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java index 4bef9476f..74850c071 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java index abb038dc0..705fb5984 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeController.java index 3c0828e92..0cefc1580 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeController.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeController.java @@ -31,12 +31,6 @@ @RestController class EmployeeController { - private final EmployeeRepository repository; - - EmployeeController(EmployeeRepository repository) { - this.repository = repository; - } - /** * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's * {@link ResponseEntity} fluent API. diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java index 2b09dac80..f17f38fe2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -24,12 +24,10 @@ package test.org.springdoc.api.app9; -import java.lang.reflect.Field; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; import com.fasterxml.jackson.databind.type.ClassKey; import org.apache.commons.lang3.reflect.FieldUtils; @@ -53,10 +51,8 @@ public class SpringDocApp9Test extends AbstractSpringDocTest { @BeforeEach void init() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); Iterator>> it = _localMixIns.entrySet().iterator(); while (it.hasNext()) { Map.Entry> entry = it.next(); @@ -70,10 +66,8 @@ void init() throws IllegalAccessException { @AfterEach void clean() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); _localMixIns.putAll(springMixins); } diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java index d876e9a82..e8332bd55 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java @@ -37,7 +37,7 @@ public abstract class AbstractSpringDocFunctionTest extends AbstractCommonTest { @Test - public void testApp() { + void testApp() { String result = null; try { EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 84d9f4294..d15f27c5f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -36,7 +36,7 @@ public abstract class AbstractSpringDocTest extends AbstractCommonTest { public static String className; @Test - public void testApp() throws Exception { + void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/HelloController.java index b63c7ade6..55674e934 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/HelloController.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java index 1524bc420..e7c091b24 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java @@ -65,7 +65,7 @@ public static String getContent(String fileName) throws Exception { } @Test - public void testApp() throws Exception { + void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/HelloController.java index c1d43c7d9..6942db26f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/PersonDTO.java index b6e006e91..99568fdf2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/PersonDTO.java @@ -4,7 +4,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/SpringDocApp191Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/SpringDocApp191Test.java index 561df94a2..dec9ecf71 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/SpringDocApp191Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/SpringDocApp191Test.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 5e445165e..08aa39f91 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -67,7 +67,7 @@ public static String getContent(String fileName) { } @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java index 4dba111c1..3fee1d1e1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java @@ -39,7 +39,7 @@ public class SpringDocApp10DirectTest extends AbstractSpringDocTest { @Override @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java index 91985d75e..6b1b457fb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java @@ -53,7 +53,7 @@ public static void init() { @Override @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java index 22e8cc2ea..ddf6fef87 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java @@ -39,7 +39,7 @@ public class SpringDocApp10ViaDtoTest extends AbstractSpringDocTest { @Override @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeController.java index 5200b96dd..209dd8d7c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeController.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeController.java @@ -31,12 +31,6 @@ @RestController class EmployeeController { - private final EmployeeRepository repository; - - EmployeeController(EmployeeRepository repository) { - this.repository = repository; - } - /** * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's * {@link ResponseEntity} fluent API. diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/hateoas/CompanyModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/hateoas/CompanyModelAssembler.java index 2eae53159..c893acbf9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/hateoas/CompanyModelAssembler.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/hateoas/CompanyModelAssembler.java @@ -21,10 +21,9 @@ public CompanyModelAssembler() { @Override @NonNull public CompanyDto toModel(@NonNull final Company company) { - final CompanyDto dto = CompanyDto.builder() + return CompanyDto.builder() .id(company.getId()) .name(company.getName()) .build(); - return dto; } } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java index 57b7d2880..92f1dfcdd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -24,13 +24,11 @@ package test.org.springdoc.api.app6; -import java.lang.reflect.Field; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; import com.fasterxml.jackson.databind.type.ClassKey; import org.apache.commons.lang3.reflect.FieldUtils; @@ -53,27 +51,23 @@ public class SpringDocApp6Test extends AbstractSpringDocTest { @BeforeEach void init() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); - Iterator>> it = _localMixIns.entrySet().iterator(); - while (it.hasNext()) { - Entry> entry = it.next(); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(),"_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + Iterator>> iterator = _localMixIns.entrySet().iterator(); + + while (iterator.hasNext()) { + Entry> entry = iterator.next(); if (entry.getKey().toString().startsWith("org.springframework")) { springMixins.put(entry.getKey(), entry.getValue()); - it.remove(); + iterator.remove(); } } - } @AfterEach void clean() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); _localMixIns.putAll(springMixins); } diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooResourceAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooResourceAssembler.java index 5a1d9fb47..6a08e4b23 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooResourceAssembler.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooResourceAssembler.java @@ -23,7 +23,7 @@ public void addLinks(EntityModel resource) { linkTo(methodOn(FooController.class).getFoo(UUID.fromString(foo.getFoo()))).withSelfRel()); } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException(e); } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java index 5f082745c..06a8048d8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -24,13 +24,11 @@ package test.org.springdoc.api.app8; -import java.lang.reflect.Field; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; import com.fasterxml.jackson.databind.type.ClassKey; import org.apache.commons.lang3.reflect.FieldUtils; @@ -53,10 +51,8 @@ public class SpringDocApp8Test extends AbstractSpringDocTest { @BeforeEach void init() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); Iterator>> it = _localMixIns.entrySet().iterator(); while (it.hasNext()) { Map.Entry> entry = it.next(); @@ -70,10 +66,8 @@ void init() throws IllegalAccessException { @AfterEach void clean() throws IllegalAccessException { - Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true); - SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(objectMapperProvider.jsonMapper()); - Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true); - Map> _localMixIns = (Map>) convertersField3.get(_mixIns); + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); _localMixIns.putAll(springMixins); } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 7496133e3..c14aa7c97 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -89,7 +89,7 @@ public static String getContent(String fileName) throws Exception { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiOriginFilter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiOriginFilter.java index ce5c09608..87e872c4a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiOriginFilter.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiOriginFilter.java @@ -30,7 +30,7 @@ /** * The type Api origin filter. */ -public class ApiOriginFilter implements jakarta.servlet.Filter { +class ApiOriginFilter implements jakarta.servlet.Filter { /** * Do filter. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiResponseMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiResponseMessage.java index 5f962de32..e161afb2a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiResponseMessage.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiResponseMessage.java @@ -25,7 +25,7 @@ */ @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") @jakarta.xml.bind.annotation.XmlRootElement -public class ApiResponseMessage { +class ApiResponseMessage { /** * The constant ERROR. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ErrorMessage.java index 6bab556a1..7eb1c3f7b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ErrorMessage.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ErrorMessage.java @@ -21,7 +21,7 @@ /** * The type Error message. */ -public class ErrorMessage { +class ErrorMessage { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ExceptionTranslator.java index 1e1808c05..56b2a89e9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ExceptionTranslator.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ExceptionTranslator.java @@ -33,7 +33,7 @@ * The type Exception translator. */ @ControllerAdvice -public class ExceptionTranslator { +class ExceptionTranslator { /** * The constant LOGGER. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java index a13f3c9f8..1ef1f9b75 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Index string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HomeController.java index 72dd1c664..d11d30441 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HomeController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HomeController.java @@ -30,7 +30,7 @@ * Home redirection to swagger api documentation */ @Controller -public class HomeController { +class HomeController { /** * The Swagger ui path. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApiController.java index 39c2eece5..8969acf11 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApiController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApiController.java @@ -38,7 +38,7 @@ */ @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") @RestController -public class InventoryApiController implements InventoryApi { +class InventoryApiController implements InventoryApi { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryItem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryItem.java index 248238e8f..bd8a96720 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryItem.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryItem.java @@ -33,7 +33,7 @@ */ @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") -public class InventoryItem { +class InventoryItem { /** * The Id. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemController.java index 9d8a26730..ff5a2b887 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemController.java @@ -46,7 +46,7 @@ */ @RestController @Tag(name = "items") -public class ItemController { +class ItemController { /** * Show items list. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemDTO.java index 07b89a5a3..7f8b0aa02 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemDTO.java @@ -24,7 +24,7 @@ * The type Item dto. * @author bnasslahsen */ -public class ItemDTO implements Serializable { +class ItemDTO implements Serializable { /** * serialVersionUID of type long diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemLightDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemLightDTO.java index 058db7c37..366cfa21d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemLightDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemLightDTO.java @@ -24,7 +24,7 @@ * The type Item light dto. * @author bnasslahsen */ -public class ItemLightDTO implements Serializable { +class ItemLightDTO implements Serializable { /** * serialVersionUID of type long diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/Manufacturer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/Manufacturer.java index aa4375d6a..d995b98d5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/Manufacturer.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/Manufacturer.java @@ -32,7 +32,7 @@ */ @Validated @jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") -public class Manufacturer { +class Manufacturer { /** * The Name. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PeopleRestService.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PeopleRestService.java index 4a6b2dcc3..803b88779 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PeopleRestService.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PeopleRestService.java @@ -49,7 +49,7 @@ */ @RestController @Tag(name = "people") -public class PeopleRestService { +class PeopleRestService { /** * The People. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PersonDTO.java index a5b400e69..cd8dd27bc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PersonDTO.java @@ -21,7 +21,7 @@ /** * The type Person dto. */ -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java index bdbef777d..cf33498bc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java @@ -33,7 +33,7 @@ * The type Spring doc app 1 test. */ @TestPropertySource(properties = "springdoc.default-produces-media-type=application/json") -public class SpringDocApp1Test extends AbstractSpringDocTest { +class SpringDocApp1Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java index 4658f364d..72f87433b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java @@ -32,7 +32,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java index a44a5f56d..3af79d360 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 10 test. */ -public class SpringDocApp10Test extends AbstractSpringDocTest { +class SpringDocApp10Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/HelloController.java index d6f1dc07b..519ecc56d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/HelloController.java @@ -30,7 +30,7 @@ */ @RestController @Tags(value = @Tag(name = "hello-ap1")) -public class HelloController { +class HelloController { /** * Gets all pets. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/PersonDTO.java index 55b4206f0..1166d5b3e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/PersonDTO.java @@ -24,7 +24,7 @@ * The type Person dto. */ @Schema -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/SpringDocApp100Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/SpringDocApp100Test.java index 55bf7b695..53e24d5ef 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/SpringDocApp100Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/SpringDocApp100Test.java @@ -26,7 +26,7 @@ /** * The type Spring doc app 100 test. */ -public class SpringDocApp100Test extends AbstractSpringDocTest { +class SpringDocApp100Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloController.java index a6decfff3..82f650bc8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloController.java @@ -13,7 +13,7 @@ */ @RestController @RequestMapping("/hello") -public class HelloController { +class HelloController { /** * Hello hello dto. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloDTO.java index 31f9bbc8d..fe4847ff6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloDTO.java @@ -7,7 +7,7 @@ * The type Hello dto. */ @Schema(description = "${test.app101.schema.hello.description}") -public class HelloDTO { +class HelloDTO { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/SpringDocApp101Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/SpringDocApp101Test.java index 592ec3c5c..7a0368db9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/SpringDocApp101Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/SpringDocApp101Test.java @@ -28,7 +28,7 @@ * The type Spring doc app 101 test. */ @ActiveProfiles("101") -public class SpringDocApp101Test extends AbstractSpringDocTest { +class SpringDocApp101Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java index b1c711584..13fbe8bbb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java @@ -6,7 +6,7 @@ /** * The type Inherited request params. */ -public class InheritedRequestParams extends RequestParams { +class InheritedRequestParams extends RequestParams { /** * The Child param. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/RequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/RequestParams.java index cb882d42c..e8d2b6839 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/RequestParams.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/RequestParams.java @@ -11,7 +11,7 @@ /** * The type Request params. */ -public class RequestParams { +class RequestParams { /** * The String param. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java index 76d220b9a..fe1770c24 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 102 test. */ -public class SpringDocApp102Test extends AbstractSpringDocTest { +class SpringDocApp102Test extends AbstractSpringDocTest { /** * The type Spring doc test app. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/TestController.java index c8730dffb..7ddae72c8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/TestController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/TestController.java @@ -11,7 +11,7 @@ * The type Test controller. */ @RestController -public class TestController { +class TestController { /** * Gets test. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/ExampleBody.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/ExampleBody.java index e8c01b4f0..e6b831c7c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/ExampleBody.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/ExampleBody.java @@ -3,7 +3,7 @@ /** * The type Example body. */ -public class ExampleBody { +class ExampleBody { /** * The String param. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/HelloController.java index 4b59c3603..9f4af3c26 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/HelloController.java @@ -34,7 +34,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Post my request body string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/SpringDocApp103Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/SpringDocApp103Test.java index d33b7f2f4..cbb84e91d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/SpringDocApp103Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/SpringDocApp103Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 103 test. */ -public class SpringDocApp103Test extends AbstractSpringDocTest { +class SpringDocApp103Test extends AbstractSpringDocTest { /** * The type Spring doc test app. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/Design.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/Design.java index 1f7da0ec3..5c9878a01 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/Design.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/Design.java @@ -3,5 +3,5 @@ /** * The type Design. */ -public class Design extends HavingPK { +class Design extends HavingPK { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/DesignController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/DesignController.java index cfeefe031..b4e314246 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/DesignController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/DesignController.java @@ -11,7 +11,7 @@ @Tag(name = "design") @Controller @RequestMapping("/design") -public class DesignController extends CrudController { +class DesignController extends CrudController { } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/HavingPK.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/HavingPK.java index fbd577731..ac3d20aa1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/HavingPK.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/HavingPK.java @@ -3,5 +3,5 @@ /** * The type Having pk. */ -public class HavingPK { +class HavingPK { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/SpringDocApp104Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/SpringDocApp104Test.java index 62c8585ec..2b1d35afd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/SpringDocApp104Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/SpringDocApp104Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 104 test. */ -public class SpringDocApp104Test extends AbstractSpringDocTest { +class SpringDocApp104Test extends AbstractSpringDocTest { /** * The type Spring doc test app. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/SpringDocApp105Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/SpringDocApp105Test.java index afd0453f3..3f91b44c9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/SpringDocApp105Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/SpringDocApp105Test.java @@ -52,7 +52,7 @@ "springdoc.group-configs[3].paths-to-exclude=/v1/users", "springdoc.group-configs[3].packages-to-scan=test.org.springdoc.api.app105.api.user,test.org.springdoc.api.app105.api.store", }) -public class SpringDocApp105Test extends AbstractSpringDocTest { +class SpringDocApp105Test extends AbstractSpringDocTest { /** * The constant className. @@ -65,7 +65,7 @@ public class SpringDocApp105Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -78,7 +78,7 @@ public void testApp() throws Exception { * @throws Exception the exception */ @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -91,7 +91,7 @@ public void testApp2() throws Exception { * @throws Exception the exception */ @Test - public void testApp3() throws Exception { + void testApp3() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -104,7 +104,7 @@ public void testApp3() throws Exception { * @throws Exception the exception */ @Test - public void testApp4() throws Exception { + void testApp4() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ExceptionTranslator.java index c32e20fbe..b743c8622 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ExceptionTranslator.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ExceptionTranslator.java @@ -35,7 +35,7 @@ * The type Exception translator. */ @RestControllerAdvice -public class ExceptionTranslator { +class ExceptionTranslator { /** * The Error attributes. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/HomeController.java index 9a3d663f5..bb86b3787 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/HomeController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/HomeController.java @@ -30,7 +30,7 @@ * Home redirection to swagger api documentation */ @Controller -public class HomeController { +class HomeController { /** * The Swagger ui path. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiController.java index 3c417f7db..65efc6309 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiController.java @@ -30,7 +30,7 @@ @RestController @RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class PetApiController implements PetApi { +class PetApiController implements PetApi { /** * The Delegate. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegateImpl.java index d14a22f07..feb72bed7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegateImpl.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegateImpl.java @@ -24,7 +24,7 @@ * The type Pet api delegate. */ @Service -public class PetApiDelegateImpl implements PetApiDelegate { +class PetApiDelegateImpl implements PetApiDelegate { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiController.java index 4e05f2ec6..7ce9e3984 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiController.java @@ -30,7 +30,7 @@ @RestController @RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class StoreApiController implements StoreApi { +class StoreApiController implements StoreApi { /** * The Delegate. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegateImpl.java index 1446e91ae..cd3051772 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegateImpl.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegateImpl.java @@ -24,7 +24,7 @@ * The type Store api delegate. */ @Service -public class StoreApiDelegateImpl implements StoreApiDelegate { +class StoreApiDelegateImpl implements StoreApiDelegate { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiController.java index b31d03e01..98692328f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiController.java @@ -30,7 +30,7 @@ @RestController @RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class UserApiController implements UserApi { +class UserApiController implements UserApi { /** * The Delegate. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegateImpl.java index 46770a845..91f65c580 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegateImpl.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegateImpl.java @@ -24,7 +24,7 @@ * The type User api delegate. */ @Service -public class UserApiDelegateImpl implements UserApiDelegate { +class UserApiDelegateImpl implements UserApiDelegate { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Body.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Body.java deleted file mode 100644 index 8aa67127a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Body.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Body. - */ -public class Body { - - /** - * The Name. - */ - @Schema(description = "Updated name of the pet") - /** - * Updated name of the pet - **/ - private String name = null; - - /** - * The Status. - */ - @Schema(description = "Updated status of the pet") - /** - * Updated status of the pet - **/ - private String status = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Updated name of the pet - * - * @return name name - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Name body. - * - * @param name the name - * @return the body - */ - public Body name(String name) { - this.name = name; - return this; - } - - /** - * Updated status of the pet - * - * @return status status - */ - @JsonProperty("status") - public String getStatus() { - return status; - } - - /** - * Sets status. - * - * @param status the status - */ - public void setStatus(String status) { - this.status = status; - } - - /** - * Status body. - * - * @param status the status - * @return the body - */ - public Body status(String status) { - this.status = status; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Body {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Body1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Body1.java deleted file mode 100644 index 7cc00d1c1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Body1.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.model; - -import java.io.File; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Body 1. - */ -public class Body1 { - - /** - * The Additional metadata. - */ - @Schema(description = "Additional data to pass to server") - /** - * Additional data to pass to server - **/ - private String additionalMetadata = null; - - /** - * The File. - */ - @Schema(description = "file to upload") - /** - * file to upload - **/ - private File file = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Additional data to pass to server - * - * @return additionalMetadata additional metadata - */ - @JsonProperty("additionalMetadata") - public String getAdditionalMetadata() { - return additionalMetadata; - } - - /** - * Sets additional metadata. - * - * @param additionalMetadata the additional metadata - */ - public void setAdditionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - } - - /** - * Additional metadata body 1. - * - * @param additionalMetadata the additional metadata - * @return the body 1 - */ - public Body1 additionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - return this; - } - - /** - * file to upload - * - * @return file file - */ - @JsonProperty("file") - public File getFile() { - return file; - } - - /** - * Sets file. - * - * @param file the file - */ - public void setFile(File file) { - this.file = file; - } - - /** - * File body 1. - * - * @param file the file - * @return the body 1 - */ - public Body1 file(File file) { - this.file = file; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Body1 {\n"); - - sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Category.java index 2d682beba..70f61cf74 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Category.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Category.java @@ -24,7 +24,7 @@ /** * The type Category. */ -public class Category { +class Category { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Tag.java index c8485cac5..2b5bde9af 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Tag.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Tag.java @@ -24,7 +24,7 @@ /** * The type Tag. */ -public class Tag { +class Tag { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/HelloController.java index a022c7961..fb5acdcab 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/HelloController.java @@ -17,7 +17,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Find articles response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/SpringDocApp106Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/SpringDocApp106Test.java index 9165dcb5b..7bd888b6f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/SpringDocApp106Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/SpringDocApp106Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 106 test. */ -public class SpringDocApp106Test extends AbstractSpringDocTest { +class SpringDocApp106Test extends AbstractSpringDocTest { /** * The type Spring doc test app. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/HelloController.java index 7a9131705..d3197e70f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/HelloController.java @@ -10,7 +10,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets entity b. @@ -25,7 +25,7 @@ public EntityB getEntityB() { /** * The type Entity b. */ - public class EntityB { + class EntityB { /** * The Field b. @@ -46,7 +46,7 @@ public class EntityB { /** * The type Entity a. */ - public class EntityA { + class EntityA { /** * The Field a. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/SpringDocApp107Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/SpringDocApp107Test.java index 5c3376fed..7b9c5e512 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/SpringDocApp107Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/SpringDocApp107Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 107 test. */ -public class SpringDocApp107Test extends AbstractSpringDocTest { +class SpringDocApp107Test extends AbstractSpringDocTest { /** * The type Spring doc test app. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/ActionResult.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/ActionResult.java index 0273e1035..0389238b9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/ActionResult.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/ActionResult.java @@ -5,7 +5,7 @@ * * @param the type parameter */ -public class ActionResult { +class ActionResult { /** * The Value. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/HelloController.java index 70dd4c840..fcb84cde4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/HelloController.java @@ -7,7 +7,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Update action result. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/SpringDocApp108Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/SpringDocApp108Test.java index 882f78dd6..f633f2db1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/SpringDocApp108Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/SpringDocApp108Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 108 test. */ -public class SpringDocApp108Test extends AbstractSpringDocTest { +class SpringDocApp108Test extends AbstractSpringDocTest { /** * The type Spring doc test app. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/HelloController.java index ce36f31b9..2475eb449 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/HelloController.java @@ -13,7 +13,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets resource. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/SpringDocApp109Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/SpringDocApp109Test.java index 51bde5ba9..d54099659 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/SpringDocApp109Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/SpringDocApp109Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 109 test. */ -public class SpringDocApp109Test extends AbstractSpringDocTest { +class SpringDocApp109Test extends AbstractSpringDocTest { /** * The type Spring doc test app. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java index 79fa55657..d331c6143 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java @@ -35,7 +35,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Upload documents response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java index fcaf6fc38..12305efa6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 11 test. */ -public class SpringDocApp11Test extends AbstractSpringDocTest { +class SpringDocApp11Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/ErrorMessage.java index 85220e03b..acaf87337 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/ErrorMessage.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/ErrorMessage.java @@ -8,7 +8,7 @@ /** * The type Error message. */ -public class ErrorMessage { +class ErrorMessage { /** * The Errors. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/GlobalControllerAdvice.java index 4bf34d64f..c6d326ac5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/GlobalControllerAdvice.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/GlobalControllerAdvice.java @@ -28,7 +28,7 @@ * The type Global controller advice. */ @ControllerAdvice(assignableTypes = PersonController.class) -public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +class GlobalControllerAdvice //extends ResponseEntityExceptionHandler { /** * Note use base class if you wish to leverage its handling. @@ -45,10 +45,7 @@ public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler @ExceptionHandler(Throwable.class) @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) public ResponseEntity problem(final Throwable e) { - String message = e.getMessage(); - //might actually prefer to use a geeric mesasge - - message = "Problem occured"; + String message = "Problem occured"; UUID uuid = UUID.randomUUID(); String logRef = uuid.toString(); logger.error("logRef=" + logRef, message, e); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Person.java index 7c84b7a01..b9a8733a9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Person.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Person.java @@ -13,7 +13,7 @@ /** * The type Person. */ -public class Person { +class Person { /** * The Id. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController.java index 371daf1c7..14a140054 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController.java @@ -22,7 +22,7 @@ */ @RestController @Validated -public class PersonController { +class PersonController { /** * The Ran. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController2.java index f5b6f7cd9..4eaede510 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController2.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController2.java @@ -21,7 +21,7 @@ */ @RestController @Validated -public class PersonController2 { +class PersonController2 { /** * The Ran. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Problem.java index 9b56428e5..96317413b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Problem.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Problem.java @@ -3,7 +3,7 @@ /** * The type Problem. */ -public class Problem { +class Problem { /** * The Log ref. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/SpringDocApp110Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/SpringDocApp110Test.java index 016cc1397..5436f3051 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/SpringDocApp110Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/SpringDocApp110Test.java @@ -16,7 +16,7 @@ @TestPropertySource(properties = { "application-description=description", "application-version=v1" }) -public class SpringDocApp110Test extends AbstractSpringDocTest { +class SpringDocApp110Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/ErrorMessage.java index 7a3f6c866..987d07087 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/ErrorMessage.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/ErrorMessage.java @@ -8,7 +8,7 @@ /** * The type Error message. */ -public class ErrorMessage { +class ErrorMessage { /** * The Errors. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/GlobalControllerAdvice.java index 2fc3def41..f33033e8d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/GlobalControllerAdvice.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/GlobalControllerAdvice.java @@ -28,7 +28,7 @@ * The type Global controller advice. */ @ControllerAdvice(basePackages = "test.org.springdoc.api.appzzz") -public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +class GlobalControllerAdvice //extends ResponseEntityExceptionHandler { /** * Note use base class if you wish to leverage its handling. @@ -45,10 +45,7 @@ public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler @ExceptionHandler(Throwable.class) @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) public ResponseEntity problem(final Throwable e) { - String message = e.getMessage(); - //might actually prefer to use a geeric mesasge - - message = "Problem occured"; + String message = "Problem occured"; UUID uuid = UUID.randomUUID(); String logRef = uuid.toString(); logger.error("logRef=" + logRef, message, e); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Person.java index 69e084b82..a73ca5b25 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Person.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Person.java @@ -13,7 +13,7 @@ /** * The type Person. */ -public class Person { +class Person { /** * The Id. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController.java index 3299ab725..dc9549618 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController.java @@ -21,7 +21,7 @@ */ @RestController @Validated -public class PersonController { +class PersonController { /** * The Ran. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController2.java index cc4405191..8d915472a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController2.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController2.java @@ -21,7 +21,7 @@ */ @RestController @Validated -public class PersonController2 { +class PersonController2 { /** * The Ran. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Problem.java index 30af4727f..088ca0795 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Problem.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Problem.java @@ -3,7 +3,7 @@ /** * The type Problem. */ -public class Problem { +class Problem { /** * The Log ref. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/SpringDocApp111Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/SpringDocApp111Test.java index 3a88dd5f1..5894369f9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/SpringDocApp111Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/SpringDocApp111Test.java @@ -16,7 +16,7 @@ @TestPropertySource(properties = { "application-description=description", "application-version=v1" }) -public class SpringDocApp111Test extends AbstractSpringDocTest { +class SpringDocApp111Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/ErrorMessage.java index 5ce591f02..f0404171c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/ErrorMessage.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/ErrorMessage.java @@ -8,7 +8,7 @@ /** * The type Error message. */ -public class ErrorMessage { +class ErrorMessage { /** * The Errors. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/GlobalControllerAdvice.java index d92ef2d4d..1de9557f6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/GlobalControllerAdvice.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/GlobalControllerAdvice.java @@ -28,7 +28,7 @@ * The type Global controller advice. */ @ControllerAdvice(basePackages = "test.org.springdoc.api.app112.sample") -public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +class GlobalControllerAdvice //extends ResponseEntityExceptionHandler { /** * Note use base class if you wish to leverage its handling. @@ -45,10 +45,7 @@ public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler @ExceptionHandler(Throwable.class) @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) public ResponseEntity problem(final Throwable e) { - String message = e.getMessage(); - //might actually prefer to use a geeric mesasge - - message = "Problem occured"; + String message = "Problem occured"; UUID uuid = UUID.randomUUID(); String logRef = uuid.toString(); logger.error("logRef=" + logRef, message, e); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/PersonController.java index 4fda43069..4d81dd572 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/PersonController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/PersonController.java @@ -21,7 +21,7 @@ */ @RestController @Validated -public class PersonController { +class PersonController { /** * The Ran. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Problem.java index d3ceca40c..ee5127936 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Problem.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Problem.java @@ -3,7 +3,7 @@ /** * The type Problem. */ -public class Problem { +class Problem { /** * The Log ref. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/SpringDocApp112Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/SpringDocApp112Test.java index cbfb1bd3f..83cd397c3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/SpringDocApp112Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/SpringDocApp112Test.java @@ -16,7 +16,7 @@ @TestPropertySource(properties = { "application-description=description", "application-version=v1" }) -public class SpringDocApp112Test extends AbstractSpringDocTest { +class SpringDocApp112Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/sample/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/sample/PersonController2.java index abf7d7994..99c5556a1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/sample/PersonController2.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/sample/PersonController2.java @@ -23,7 +23,7 @@ */ @RestController @Validated -public class PersonController2 { +class PersonController2 { /** * The Ran. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/HelloController.java index 77ec88a77..9ae9acdcf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/HelloController.java @@ -28,7 +28,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test. @@ -51,7 +51,7 @@ public void test2(@RequestBody Optional body) { /** * The type Body. */ - public class Body { + class Body { /** * The Field. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/SpringDocApp113Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/SpringDocApp113Test.java index 8bf9ff750..12bdcb85c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/SpringDocApp113Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/SpringDocApp113Test.java @@ -8,7 +8,7 @@ /** * The type Spring doc app 113 test. */ -public class SpringDocApp113Test extends AbstractSpringDocTest { +class SpringDocApp113Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/HelloController.java index 36d39f265..cc51c4e91 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets currency. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/SpringDocApp114Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/SpringDocApp114Test.java index 3a2860c3a..1f1fa7634 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/SpringDocApp114Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/SpringDocApp114Test.java @@ -11,7 +11,7 @@ /** * The type Spring doc app 114 test. */ -public class SpringDocApp114Test extends AbstractSpringDocTest { +class SpringDocApp114Test extends AbstractSpringDocTest { static { SpringDocUtils.getConfig().replaceWithClass(MonetaryAmount.class, org.springdoc.core.converters.models.MonetaryAmount.class); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/HelloController.java index 4a1694486..63f6a4f38 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/HelloController.java @@ -28,7 +28,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Timeouts duration. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/JavaTimeOperationCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/JavaTimeOperationCustomizer.java index 89c254a02..5295dcced 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/JavaTimeOperationCustomizer.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/JavaTimeOperationCustomizer.java @@ -16,7 +16,7 @@ * The type Java time operation customizer. */ @Component -public class JavaTimeOperationCustomizer implements OperationCustomizer { +class JavaTimeOperationCustomizer implements OperationCustomizer { /** * Customize operation. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/SpringDocApp115Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/SpringDocApp115Test.java index 4b7b6ce0a..745e9d73e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/SpringDocApp115Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/SpringDocApp115Test.java @@ -8,7 +8,7 @@ /** * The type Spring doc app 115 test. */ -public class SpringDocApp115Test extends AbstractSpringDocTest { +class SpringDocApp115Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/FooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/FooErrorHandler.java index 3aae65921..01be608ce 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/FooErrorHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/FooErrorHandler.java @@ -9,7 +9,7 @@ * The type Foo error handler. */ @ControllerAdvice(assignableTypes = HelloController.class) -public class FooErrorHandler { +class FooErrorHandler { /** * Store assignment publishing error response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/HelloController.java index 3302edadf..22d268c45 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/HelloController.java @@ -15,7 +15,7 @@ @RestController @RequestMapping("/api") @OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) -public class HelloController { +class HelloController { /** * Create string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/SpringDocApp116Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/SpringDocApp116Test.java index 31528b0bf..dce40d52b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/SpringDocApp116Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/SpringDocApp116Test.java @@ -8,7 +8,7 @@ /** * The type Spring doc app 116 test. */ -public class SpringDocApp116Test extends AbstractSpringDocTest { +class SpringDocApp116Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/HelloApplication.java index 84cef2203..3a8e2ec50 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/HelloApplication.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/HelloApplication.java @@ -37,7 +37,7 @@ * The type Hello application. */ @Configuration -public class HelloApplication { +class HelloApplication { /** * Routes router function. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/SpringDocApp117Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/SpringDocApp117Test.java index ce2de0160..4841fba3c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/SpringDocApp117Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/SpringDocApp117Test.java @@ -8,7 +8,7 @@ /** * The type Spring doc app 117 test. */ -public class SpringDocApp117Test extends AbstractSpringDocTest { +class SpringDocApp117Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/ConcreteParent.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/ConcreteParent.java index 8fe1ea9e1..5355669b9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/ConcreteParent.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/ConcreteParent.java @@ -13,7 +13,7 @@ @Type(ChildOfConcrete1.class), @Type(ChildOfConcrete2.class) }) -public class ConcreteParent { +class ConcreteParent { /** * The Id. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/Controller.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/Controller.java index a3f60295c..34f86e513 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/Controller.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/Controller.java @@ -12,7 +12,7 @@ */ @RestController @RequestMapping("class-hierarchy") -public class Controller { +class Controller { /** * Abstract parent response. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/SpringDocApp118Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/SpringDocApp118Test.java index dd07eec6a..57c55ff5b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/SpringDocApp118Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/SpringDocApp118Test.java @@ -8,7 +8,7 @@ /** * The type Spring doc app 118 test. */ -public class SpringDocApp118Test extends AbstractSpringDocTest { +class SpringDocApp118Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/HelloController.java index ac817bd70..66b0b2568 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/HelloController.java @@ -32,7 +32,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Multi files in multi part string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/JsonRequest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/JsonRequest.java index 5eeff6849..5f0baf0b1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/JsonRequest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/JsonRequest.java @@ -3,7 +3,7 @@ /** * The type Json request. */ -public class JsonRequest { +class JsonRequest { /** * The Name. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/SpringDocApp119Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/SpringDocApp119Test.java index f6ad91b34..cf9ae5ca3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/SpringDocApp119Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/SpringDocApp119Test.java @@ -8,7 +8,7 @@ /** * The type Spring doc app 119 test. */ -public class SpringDocApp119Test extends AbstractSpringDocTest { +class SpringDocApp119Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java index 7978dee2e..b5ccfec4e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java @@ -30,7 +30,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java index 284c74edc..65ee8b3e9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 12 test. */ -public class SpringDocApp12Test extends AbstractSpringDocTest { +class SpringDocApp12Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/MetaAnnotationController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/MetaAnnotationController.java index 27ec703da..811b21f62 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/MetaAnnotationController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/MetaAnnotationController.java @@ -45,7 +45,7 @@ * The type Meta annotation controller. */ @RestController -public class MetaAnnotationController { +class MetaAnnotationController { /** * Simple test string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/SpringDocApp120Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/SpringDocApp120Test.java index 6f7fdb2fa..1302ab5fc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/SpringDocApp120Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/SpringDocApp120Test.java @@ -25,7 +25,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp120Test extends AbstractSpringDocTest { +class SpringDocApp120Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/InheritedRequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/InheritedRequestParams.java index d984c6847..ae7ba5a49 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/InheritedRequestParams.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/InheritedRequestParams.java @@ -5,7 +5,7 @@ /** * The type Inherited request params. */ -public class InheritedRequestParams extends RequestParams { +class InheritedRequestParams extends RequestParams { /** * parameter from child of RequestParams diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/RequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/RequestParams.java index 7fb459ad9..42c96a2ec 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/RequestParams.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/RequestParams.java @@ -10,7 +10,7 @@ /** * The type Request params. */ -public class RequestParams { +class RequestParams { /** * The String param. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/SpringDocApp121Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/SpringDocApp121Test.java index 2ec54e8ac..c67567556 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/SpringDocApp121Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/SpringDocApp121Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp121Test extends AbstractSpringDocTest { +class SpringDocApp121Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/TestController.java index e6fa8808f..da5c4470f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/TestController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/TestController.java @@ -10,7 +10,7 @@ * The type Test controller. */ @RestController -public class TestController { +class TestController { /** * Gets test. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseObject.java index 91f4ea077..3623d55d7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseObject.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseObject.java @@ -28,7 +28,7 @@ /** * The type Base object. */ -public class BaseObject { +class BaseObject { /** * The Base str. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/CustomerDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/CustomerDto.java index 58cc1c756..b7f53ca04 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/CustomerDto.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/CustomerDto.java @@ -28,7 +28,7 @@ /** * The type Customer dto. */ -public class CustomerDto extends BaseObject { +class CustomerDto extends BaseObject { /** * The Customer name. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/FirstController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/FirstController.java index a50dcea94..05cb73f9d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/FirstController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/FirstController.java @@ -32,6 +32,6 @@ */ @RestController @Tag(name = "example") -public class FirstController extends BaseController { +class FirstController extends BaseController { } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/SpringDocApp122Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/SpringDocApp122Test.java index 1a99d848d..580a8447d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/SpringDocApp122Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/SpringDocApp122Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp122Test extends AbstractSpringDocTest { +class SpringDocApp122Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/Wrapper.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/Wrapper.java index 45a82eccd..9912cc1a3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/Wrapper.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/Wrapper.java @@ -30,7 +30,7 @@ * * @param the type parameter */ -public class Wrapper { +class Wrapper { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/HelloController.java index e02791897..9b2f80143 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/HelloController.java @@ -31,7 +31,7 @@ * @param the type parameter */ @RestController -public class HelloController { +class HelloController { /** * Index t. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/MyExceptionHandler.java index 15aff27d2..2e6942fba 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/MyExceptionHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/MyExceptionHandler.java @@ -30,7 +30,7 @@ * The type My exception handler. */ @RestControllerAdvice -public class MyExceptionHandler { +class MyExceptionHandler { /** * Bad. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/SpringDocApp123Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/SpringDocApp123Test.java index 706b1c4d9..abfe6fa0b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/SpringDocApp123Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/SpringDocApp123Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp123Test extends AbstractSpringDocTest { +class SpringDocApp123Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/HelloController.java index 57bc80a45..5a86bb351 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/HelloController.java @@ -35,7 +35,7 @@ * @param the type parameter */ @RestController -public class HelloController { +class HelloController { /** * Bad. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/MyExceptionHandler.java index 2e62169d5..53a315624 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/MyExceptionHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/MyExceptionHandler.java @@ -27,7 +27,7 @@ * The type My exception handler. */ @RestControllerAdvice -public class MyExceptionHandler { +class MyExceptionHandler { /** * Gateway object. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/SpringDocApp124Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/SpringDocApp124Test.java index 6cc175df8..91a4d1629 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/SpringDocApp124Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/SpringDocApp124Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp124Test extends AbstractSpringDocTest { +class SpringDocApp124Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/DeprecatedEntity.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/DeprecatedEntity.java index 14f1032bd..023a0927d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/DeprecatedEntity.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/DeprecatedEntity.java @@ -6,7 +6,7 @@ * The type Deprecated entity. * @author bnasslahsen */ -public class DeprecatedEntity { +class DeprecatedEntity { /** * The My non deprecated field. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/HelloController.java index 9c7ed9662..a62df822d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/HelloController.java @@ -10,7 +10,7 @@ * @author bnasslahsen */ @RestController -public class HelloController { +class HelloController { /** * Gets all pets. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/SpringDocApp125Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/SpringDocApp125Test.java index 6d979c1b8..a3ee34fcf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/SpringDocApp125Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/SpringDocApp125Test.java @@ -37,7 +37,7 @@ * Tests Spring meta-annotations as method parameters */ @TestPropertySource(properties = "springdoc.model-converters.deprecating-converter.enabled=false") -public class SpringDocApp125Test extends AbstractSpringDocTest { +class SpringDocApp125Test extends AbstractSpringDocTest { static { Optional deprecatingConverterOptional = diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/HelloController.java index 7c1839986..e79a7e570 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/HelloController.java @@ -45,7 +45,7 @@ // @ApiResponse(responseCode = "401", description = "Invalid authentication.", content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), // @ApiResponse(responseCode = "401", description = "Invalid authentication.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), // @ApiResponse(responseCode = "403", description = "Missing authorities.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}) }) -public class HelloController { +class HelloController { /** * The constant CURRENCIES. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SecurityProblemResponsesConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SecurityProblemResponsesConfiguration.java index fcd9a8f0b..da9a2a38c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SecurityProblemResponsesConfiguration.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SecurityProblemResponsesConfiguration.java @@ -19,7 +19,7 @@ * Configuration class defining standard OpenAPI Specification for operations */ @Configuration -public class SecurityProblemResponsesConfiguration { +class SecurityProblemResponsesConfiguration { /** * The constant HTTP_401_NO_TOKEN. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SpringDocApp126Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SpringDocApp126Test.java index e47f50b06..2d2c16ebb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SpringDocApp126Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SpringDocApp126Test.java @@ -39,7 +39,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp126Test extends AbstractSpringDocTest { +class SpringDocApp126Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteObjectA.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteObjectA.java index 34e15bcd7..d3339226f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteObjectA.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteObjectA.java @@ -3,7 +3,7 @@ /** * The type Concrete object a. */ -public class ConcreteObjectA extends AbstractObject { +class ConcreteObjectA extends AbstractObject { /** * The Description. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Controller.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Controller.java index a69ddcbfe..b0be57945 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Controller.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Controller.java @@ -14,7 +14,7 @@ * The type Controller. */ @RestController -public class Controller { +class Controller { /** * Bug umbrella. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/SpringDocApp127Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/SpringDocApp127Test.java index 78d202ea5..7fe0afa53 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/SpringDocApp127Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/SpringDocApp127Test.java @@ -37,7 +37,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp127Test extends AbstractSpringDocTest { +class SpringDocApp127Test extends AbstractSpringDocTest { /** * Test app. @@ -45,7 +45,7 @@ public class SpringDocApp127Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + ".yaml")).andExpect(status().isOk()).andReturn(); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Umbrella.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Umbrella.java index 54343057b..ee696ace2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Umbrella.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Umbrella.java @@ -5,7 +5,7 @@ /** * The type Umbrella. */ -public class Umbrella { +class Umbrella { /** * The Object. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/ActualReturnedEntity.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/ActualReturnedEntity.java index 2962144a4..a0f3f4c98 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/ActualReturnedEntity.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/ActualReturnedEntity.java @@ -5,7 +5,7 @@ /** * The type Actual returned entity. */ -public class ActualReturnedEntity { +class ActualReturnedEntity { /** * The Result. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/HelloController.java index 7c5510f4d..b38288785 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/HelloController.java @@ -32,7 +32,7 @@ */ @RestController @RequestMapping(path = "/api", headers = { "userId", "registrationId" }) -public class HelloController { +class HelloController { /** * Update deferred result. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/OperationResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/OperationResponse.java index 66cbd0a38..7b41eb0e3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/OperationResponse.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/OperationResponse.java @@ -7,7 +7,7 @@ * * @param the type parameter */ -public class OperationResponse { +class OperationResponse { /** * The Operation result. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/SpringDocApp129Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/SpringDocApp129Test.java index 046ab9249..2dfe85a0c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/SpringDocApp129Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/SpringDocApp129Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp129Test extends AbstractSpringDocTest { +class SpringDocApp129Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java index 3aae634d8..cd48b3d0f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java index b61220a66..17e68752d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java @@ -25,7 +25,7 @@ * The type Person dto. */ @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java index 8c3f2f163..a1483e4e7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 13 test. */ -public class SpringDocApp13Test extends AbstractSpringDocTest { +class SpringDocApp13Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/HelloController.java index 7897e39bc..1e3e5e5ac 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/HelloController.java @@ -26,7 +26,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * List tracker data. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/SpringDocApp130Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/SpringDocApp130Test.java index d6dd8a514..755a6a025 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/SpringDocApp130Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/SpringDocApp130Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp130Test extends AbstractSpringDocTest { +class SpringDocApp130Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/TrackerData.java index 3766a094f..2dd4405e6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/TrackerData.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/TrackerData.java @@ -28,7 +28,7 @@ * The type Tracker data. */ @Hidden -public class TrackerData { +class TrackerData { /** * The Tracker id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/HelloController.java index e40c5675d..8b8e4f561 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/HelloController.java @@ -38,7 +38,7 @@ * @param the type parameter */ @RestController -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/Organization.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/Organization.java index fefef9780..98c01ca42 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/Organization.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/Organization.java @@ -15,7 +15,7 @@ "This is the description being overwritten") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "id", "name" }) -public class Organization { +class Organization { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/RestControllerError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/RestControllerError.java index 4022ab9e4..d49ae4d19 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/RestControllerError.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/RestControllerError.java @@ -5,7 +5,7 @@ /** * The type Rest controller error. */ -public class RestControllerError { +class RestControllerError { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/SpringDocApp131Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/SpringDocApp131Test.java index 30b42cc24..a7e2bd634 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/SpringDocApp131Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/SpringDocApp131Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp131Test extends AbstractSpringDocTest { +class SpringDocApp131Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/HelloController.java index 24bd87461..a038354b5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/HelloController.java @@ -38,7 +38,7 @@ * @param the type parameter */ @RestController -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/Organization.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/Organization.java index 59bf9ab69..cd1e1127c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/Organization.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/Organization.java @@ -15,7 +15,7 @@ "This is the description being overwritten") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "id", "name" }) -public class Organization { +class Organization { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/RestControllerError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/RestControllerError.java index 250c07d8f..d716511b1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/RestControllerError.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/RestControllerError.java @@ -5,7 +5,7 @@ /** * The type Rest controller error. */ -public class RestControllerError { +class RestControllerError { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/SpringDocApp132Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/SpringDocApp132Test.java index 35bdb45b0..5d5d8fd98 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/SpringDocApp132Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/SpringDocApp132Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp132Test extends AbstractSpringDocTest { +class SpringDocApp132Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/HelloController.java index e55a69220..7133d1542 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets message from header 1. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/SpringDocApp133Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/SpringDocApp133Test.java index f00b023cc..62453d06c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/SpringDocApp133Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/SpringDocApp133Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp133Test extends AbstractSpringDocTest { +class SpringDocApp133Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/HelloController.java index 2a2600c55..e1379a952 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/HelloController.java @@ -45,7 +45,7 @@ @SpringBootApplication @RestController @Tag(name = "The sample resource") -public class HelloController { +class HelloController { // ----------------------------------------------------------------------------------------------------------------- diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/OpenApiConfig.java index fa6d5de7c..aac5b73df 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/OpenApiConfig.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/OpenApiConfig.java @@ -9,7 +9,7 @@ * The type Open api config. */ @Configuration -public class OpenApiConfig { +class OpenApiConfig { /** * Group v 1 open api grouped open api. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/SpringDocApp134Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/SpringDocApp134Test.java index 81a8ec07c..f619e2ca7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/SpringDocApp134Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/SpringDocApp134Test.java @@ -38,7 +38,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp134Test extends AbstractSpringDocTest { +class SpringDocApp134Test extends AbstractSpringDocTest { /** * Test app. @@ -46,7 +46,7 @@ public class SpringDocApp134Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -59,7 +59,7 @@ public void testApp() throws Exception { * @throws Exception the exception */ @Test - public void testApp2() throws Exception { + void testApp2() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -72,7 +72,7 @@ public void testApp2() throws Exception { * @throws Exception the exception */ @Test - public void testApp3() throws Exception { + void testApp3() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-headers-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -85,7 +85,7 @@ public void testApp3() throws Exception { * @throws Exception the exception */ @Test - public void testApp4() throws Exception { + void testApp4() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-v2-headers-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) @@ -98,7 +98,7 @@ public void testApp4() throws Exception { * @throws Exception the exception */ @Test - public void testApp5() throws Exception { + void testApp5() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-consumes-group")) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/Book.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/Book.java index 093a63de0..9ea698276 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/Book.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/Book.java @@ -23,7 +23,7 @@ /** * The type Book. */ -public class Book { +class Book { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRepository.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRepository.java index 6ed607696..caf653823 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRepository.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRepository.java @@ -29,7 +29,7 @@ * The type Book repository. */ @Component -public class BookRepository { +class BookRepository { /** * Find by author list. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/SpringDocApp135Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/SpringDocApp135Test.java index cb84d8c6b..fc78132ae 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/SpringDocApp135Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/SpringDocApp135Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp135Test extends AbstractSpringDocTest { +class SpringDocApp135Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/HelloController.java index 2df7982e1..d3fb51c33 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/HelloController.java @@ -28,7 +28,7 @@ */ @RestController @SecurityRequirement(name = "security_auth") -public class HelloController { +class HelloController { /** * Test. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/OpenApiConfig.java index 5f74e87fa..c48254014 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/OpenApiConfig.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/OpenApiConfig.java @@ -35,4 +35,4 @@ flows = @OAuthFlows(authorizationCode = @OAuthFlow( authorizationUrl = "http://authorization.url" , tokenUrl = "http://token.url", scopes = {}))) -public class OpenApiConfig {} +class OpenApiConfig {} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/SpringDocApp137Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/SpringDocApp137Test.java index 517c9a158..a952c0967 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/SpringDocApp137Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/SpringDocApp137Test.java @@ -32,7 +32,7 @@ * Tests Spring meta-annotations as method parameters */ @TestPropertySource(properties = { "test.server=http://test.toto.com", "test.desc=toto desc" }) -public class SpringDocApp137Test extends AbstractSpringDocTest { +class SpringDocApp137Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/HelloController.java index 52daa9b2d..73e75a5ce 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test a. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/SpringDocApp138Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/SpringDocApp138Test.java index ad0408572..d88d76d96 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/SpringDocApp138Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/SpringDocApp138Test.java @@ -32,7 +32,7 @@ * Tests Spring meta-annotations as method parameters */ @TestPropertySource(properties = "springdoc.writer-with-order-by-keys=true") -public class SpringDocApp138Test extends AbstractSpringDocTest { +class SpringDocApp138Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/HelloController.java index 830d90c1c..7357246fa 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/HelloController.java @@ -27,7 +27,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Echo 1 string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/SpringDocApp139Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/SpringDocApp139Test.java index f98969b4b..0c4918c4f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/SpringDocApp139Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/SpringDocApp139Test.java @@ -32,7 +32,7 @@ * Tests Spring meta-annotations as method parameters */ @TestPropertySource(properties = { "test.name=text", "test.value=text", "test.default-value=default-text" }) -public class SpringDocApp139Test extends AbstractSpringDocTest { +class SpringDocApp139Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java index 539304888..101fb8a55 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java index b252391d9..0faffab68 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 14 test. */ -public class SpringDocApp14Test extends AbstractSpringDocTest { +class SpringDocApp14Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/HelloApplication.java index 73fcb5301..73eab0685 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/HelloApplication.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/HelloApplication.java @@ -60,7 +60,7 @@ * The type Hello application. */ @Configuration -public class HelloApplication { +class HelloApplication { /** * Filter server response. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/SpringDocApp140Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/SpringDocApp140Test.java index 83a9f3961..d4d169907 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/SpringDocApp140Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/SpringDocApp140Test.java @@ -31,7 +31,7 @@ /** * The type Spring doc app 140 test. */ -public class SpringDocApp140Test extends AbstractSpringDocTest { +class SpringDocApp140Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/Book.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/Book.java index cb7144f75..b0ad55ea9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/Book.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/Book.java @@ -26,7 +26,7 @@ /** * The type Book. */ -public class Book { +class Book { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRepository.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRepository.java index e4234d0af..06974d0a7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRepository.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRepository.java @@ -32,7 +32,7 @@ * The type Book repository. */ @Component -public class BookRepository { +class BookRepository { /** * Find by author list. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/SpringDocApp141Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/SpringDocApp141Test.java index 1313b4e60..4cf55c8dc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/SpringDocApp141Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/SpringDocApp141Test.java @@ -30,7 +30,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp141Test extends AbstractSpringDocTest { +class SpringDocApp141Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/HelloApplication.java index c85cdc551..4a53475d1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/HelloApplication.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/HelloApplication.java @@ -47,7 +47,6 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.function.HandlerFunction; import org.springframework.web.servlet.function.RouterFunction; import org.springframework.web.servlet.function.ServerRequest; import org.springframework.web.servlet.function.ServerResponse; @@ -58,19 +57,8 @@ * The type Hello application. */ @Configuration -public class HelloApplication { +class HelloApplication { - /** - * Filter server response. - * - * @param serverRequest the server request - * @param handlerFunction the handler function - * @return the server response - * @throws Exception the exception - */ - private static ServerResponse filter(ServerRequest serverRequest, HandlerFunction handlerFunction) throws Exception { - return handlerFunction.handle(serverRequest); - } /** * Routes router function. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/SpringDocApp142Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/SpringDocApp142Test.java index c1b674439..243c78eea 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/SpringDocApp142Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/SpringDocApp142Test.java @@ -31,7 +31,7 @@ /** * The type Spring doc app 142 test. */ -public class SpringDocApp142Test extends AbstractSpringDocTest { +class SpringDocApp142Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloController.java index 6be8e8545..ad2c4ba32 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloController.java @@ -35,7 +35,7 @@ * @author Azige */ @Controller -public class HelloController { +class HelloController { /** * Hello string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloMessage.java index ddf4549c7..5a59bec2e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloMessage.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloMessage.java @@ -21,7 +21,7 @@ /** * The type Hello message. */ -public class HelloMessage { +class HelloMessage { /** * The Text. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java index 7c0f6d5ab..c744382ba 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java @@ -27,7 +27,7 @@ * The type Spring doc app 149 test. */ @TestPropertySource(properties = "springdoc.model-and-view-allowed=true") -public class SpringDocApp149Test extends AbstractSpringDocTest { +class SpringDocApp149Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java index fef703df3..e45ae4fc0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons json object. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java index ffc51a9b1..edf10ffbe 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java @@ -42,7 +42,7 @@ "springdoc.openapidefinition.info.contact.email=My contact email", "springdoc.openapidefinition.info.contact.url=My contact url" }) -public class SpringDocApp15Test extends AbstractSpringDocTest { +class SpringDocApp15Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/HelloController.java index 97ef24997..d57664d6a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/HelloController.java @@ -38,7 +38,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java index 6ed8926a4..c5f419fca 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java @@ -26,7 +26,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp150Test extends AbstractSpringDocTest { +class SpringDocApp150Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/HelloController.java index 965b79566..ddfa63685 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/HelloController.java @@ -27,7 +27,7 @@ */ @RestController @RequestMapping("/test") -public class HelloController { +class HelloController { /** * Test int. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java index 599840194..9adcff886 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java @@ -26,7 +26,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp151Test extends AbstractSpringDocTest { +class SpringDocApp151Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/HelloController.java index 029102333..cf60ae7e8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/HelloController.java @@ -13,7 +13,7 @@ */ @RestController @RequestMapping("/api") -public class HelloController { +class HelloController { /** * Hello world string. @@ -29,7 +29,7 @@ public String helloWorld() { * The type Web config. */ @Configuration - public class WebConfig implements WebMvcConfigurer { + class WebConfig implements WebMvcConfigurer { /** * Configure path match. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java index 5f6a0527f..f2a86f532 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java @@ -26,7 +26,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp152Test extends AbstractSpringDocTest { +class SpringDocApp152Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderStateMapper.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderStateMapper.java index 22168d6db..f887b0985 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderStateMapper.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderStateMapper.java @@ -8,7 +8,7 @@ /** * The type Order state mapper. */ -public class OrderStateMapper extends PropertyEditorSupport { +class OrderStateMapper extends PropertyEditorSupport { /** * Sets as text. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java index 8cdc86f1c..730e8bebd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java @@ -26,7 +26,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp153Test extends AbstractSpringDocTest { +class SpringDocApp153Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/HelloController.java index 188a309ad..c1d29d062 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/OpenApiConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/OpenApiConfiguration.java index 6b805054f..afb45b440 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/OpenApiConfiguration.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/OpenApiConfiguration.java @@ -26,5 +26,5 @@ bearerFormat = "JWT" ) }) -public class OpenApiConfiguration { +class OpenApiConfiguration { } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java index 0550243dc..7f7df1839 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java @@ -26,7 +26,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp154Test extends AbstractSpringDocTest { +class SpringDocApp154Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractIntParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractIntParameterObject.java index d1cd1a7c1..0d89e059d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractIntParameterObject.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractIntParameterObject.java @@ -5,7 +5,7 @@ * * @param the type parameter */ -public class AbstractIntParameterObject { +class AbstractIntParameterObject { /** * The Primitive base field. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractParameterObject.java index 8c8ac93d1..664a456fd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractParameterObject.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractParameterObject.java @@ -8,7 +8,7 @@ * * @param the type parameter */ -public class AbstractParameterObject> { +class AbstractParameterObject> { /** * The Primitive base field. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteIntParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteIntParameterObject.java index c99364a46..97ef003ac 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteIntParameterObject.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteIntParameterObject.java @@ -3,7 +3,7 @@ /** * The type Concrete int parameter object. */ -public class ConcreteIntParameterObject extends AbstractIntParameterObject { +class ConcreteIntParameterObject extends AbstractIntParameterObject { /** * The Primitive concrete field. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteParameterObject.java index c1a74f77d..e2a21351d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteParameterObject.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteParameterObject.java @@ -3,7 +3,7 @@ /** * The type Concrete parameter object. */ -public class ConcreteParameterObject extends AbstractParameterObject { +class ConcreteParameterObject extends AbstractParameterObject { /** * The Primitive concrete field. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/HelloController.java index 3bab03b89..0587ca62e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Say hello response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/SpringDocApp155Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/SpringDocApp155Test.java index 36910d264..f27a7c5b8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/SpringDocApp155Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/SpringDocApp155Test.java @@ -26,7 +26,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp155Test extends AbstractSpringDocTest { +class SpringDocApp155Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/HelloController.java index 1106e9e3e..d645edb0c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/HelloController.java @@ -13,7 +13,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Hello string. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SpringDocApp156Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SpringDocApp156Test.java index 8365e3768..caeac0895 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SpringDocApp156Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SpringDocApp156Test.java @@ -26,7 +26,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp156Test extends AbstractSpringDocTest { +class SpringDocApp156Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/User.java index 53f9fb579..f4ec1eceb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/User.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/User.java @@ -5,7 +5,7 @@ /** * The type User. */ -public class User { +class User { /** * The Some text. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Bar.java index 9ec03c6e8..4fa42edae 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Bar.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Bar.java @@ -3,7 +3,7 @@ /** * A class without a String in it */ -public class Bar { +class Bar { /** * The Child. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Foo.java index 416e6792b..05b8c39a7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Foo.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Foo.java @@ -3,7 +3,7 @@ /** * A class with a String in it */ -public class Foo { +class Foo { /** * The Child. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/HelloController.java index d19833696..4265a2bdf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/HelloController.java @@ -28,7 +28,7 @@ * ({@code ResponseEntity}). */ @RestController -public class HelloController { +class HelloController { /** * Gets foo. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/SpringDocApp157Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/SpringDocApp157Test.java index a987d207f..ffedde82f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/SpringDocApp157Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/SpringDocApp157Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ * the type is enclosed in an ignored wrapper. We test this by setting up a model converter which * adds "stringy" to the "required" property of a schema's parent, when the sub schema is a String. */ -public class SpringDocApp157Test extends AbstractSpringDocTest { +class SpringDocApp157Test extends AbstractSpringDocTest { /** * The Converters. @@ -71,7 +71,7 @@ public void unregisterConverter() { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) .andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/StringyConverter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/StringyConverter.java index dba53fec5..97e650607 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/StringyConverter.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/StringyConverter.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ @Component -public class StringyConverter implements ModelConverter { +class StringyConverter implements ModelConverter { @Autowired ObjectMapperProvider objectMapperProvider; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/CommonFooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/CommonFooErrorHandler.java index ad14c86b4..47230839c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/CommonFooErrorHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/CommonFooErrorHandler.java @@ -7,7 +7,7 @@ /** * The type Common foo error handler. */ -public class CommonFooErrorHandler { +class CommonFooErrorHandler { /** * On exception error dto. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/ErrorDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/ErrorDTO.java index ab5a164fa..1b3eeef92 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/ErrorDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/ErrorDTO.java @@ -3,7 +3,7 @@ /** * The type Error dto. */ -public class ErrorDTO { +class ErrorDTO { /** * The Message. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/HelloController.java index 1a61537b9..0360f2779 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/HelloController.java @@ -32,7 +32,7 @@ @RestController @RequestMapping("/api") @OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) -public class HelloController { +class HelloController { /** * Hello simple dto. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SimpleDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SimpleDTO.java index 766ce8b79..33618eb50 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SimpleDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SimpleDTO.java @@ -3,7 +3,7 @@ /** * The type Simple dto. */ -public class SimpleDTO { +class SimpleDTO { /** * The Payload. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpecificFooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpecificFooErrorHandler.java index 7dc4bdd00..4680982ae 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpecificFooErrorHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpecificFooErrorHandler.java @@ -6,5 +6,5 @@ * The type Specific foo error handler. */ @ControllerAdvice(assignableTypes = HelloController.class) -public class SpecificFooErrorHandler extends CommonFooErrorHandler { +class SpecificFooErrorHandler extends CommonFooErrorHandler { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpringDocApp158Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpringDocApp158Test.java index 88a31de59..9a06672ae 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpringDocApp158Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpringDocApp158Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 158 test. */ -public class SpringDocApp158Test extends AbstractSpringDocTest { +class SpringDocApp158Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/CustomException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/CustomException.java index acd4d3e30..7ac1e9802 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/CustomException.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/CustomException.java @@ -3,7 +3,7 @@ /** * The type Custom exception. */ -public class CustomException extends RuntimeException { +class CustomException extends RuntimeException { /** * Instantiates a new Custom exception. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooBean.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooBean.java index fe44de982..93849d8ce 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooBean.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooBean.java @@ -5,7 +5,7 @@ /** * The type Foo bean. */ -public class FooBean { +class FooBean { /** * The Message. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooErrorHandler.java index 8ad9bf8fe..352a93f65 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooErrorHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooErrorHandler.java @@ -12,7 +12,7 @@ * The type Foo error handler. */ @ControllerAdvice(assignableTypes = HelloController.class) -public class FooErrorHandler { +class FooErrorHandler { /** * Store assignment publishing error response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/HelloController.java index 672fabe0b..865a3ab2b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/HelloController.java @@ -15,7 +15,7 @@ @RestController @RequestMapping("/api") @OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) -public class HelloController { +class HelloController { /** * Create string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/SpringDocApp159Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/SpringDocApp159Test.java index 1070a54ba..c725aa27c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/SpringDocApp159Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/SpringDocApp159Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 159 test. */ -public class SpringDocApp159Test extends AbstractSpringDocTest { +class SpringDocApp159Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/Views.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/Views.java index 0cb902f50..a1dbcf1e0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/Views.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/Views.java @@ -3,7 +3,7 @@ /** * The type Views. */ -public class Views { +class Views { /** * The type View 1. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/HelloController.java index 6e8f5c36f..dc4bd8641 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java index 77f33eee9..2899cdd77 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java @@ -32,7 +32,7 @@ * The type Spring doc app 16 test. */ @TestPropertySource(properties = "springdoc.api-docs.enabled=false") -public class SpringDocApp16Test extends AbstractSpringDocTest { +class SpringDocApp16Test extends AbstractSpringDocTest { /** * Test app. @@ -40,7 +40,7 @@ public class SpringDocApp16Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) .andExpect(status().isNotFound()); } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/HelloController.java index c55fb8e78..c81884999 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/HelloController.java @@ -33,7 +33,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Do something interesting error response. @@ -77,13 +77,13 @@ public ResourceBundleMessageSource translator() { */ @PropertySource("classpath:swagger-message-160.properties") @Configuration - public class SwaggerMessage {} + class SwaggerMessage {} /** * The type Error response. */ @Schema(description = "${ErrorResponse}") - public class ErrorResponse { + class ErrorResponse { /** * The Error code. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/SpringDocApp160Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/SpringDocApp160Test.java index 72fb55ce4..84a5a06c7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/SpringDocApp160Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/SpringDocApp160Test.java @@ -9,7 +9,7 @@ * The type Spring doc app 160 test. */ @TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") -public class SpringDocApp160Test extends AbstractSpringDocTest { +class SpringDocApp160Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/HelloController.java index 847bc4aef..add930dc7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/SpringDocApp161Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/SpringDocApp161Test.java index d5cd27fc7..13c84e5ad 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/SpringDocApp161Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/SpringDocApp161Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 161 test. */ -public class SpringDocApp161Test extends AbstractSpringDocTest { +class SpringDocApp161Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java index 0a0b1f5e9..1bca98ed2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java @@ -12,7 +12,7 @@ * The type Spring doc app 162 test. */ @TestPropertySource(properties = "springdoc.override-with-generic-response=true") -public class SpringDocApp162Test extends AbstractSpringDocTest { +class SpringDocApp162Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java index 7628e744f..18df12bde 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java @@ -23,7 +23,7 @@ */ @RestController @RequestMapping("/javadoc-only") -public class JavadocOnlyRestController { +class JavadocOnlyRestController { /** * This is the create method's javadoc. * The method's signature: {@code #create(JavadocOnlyRestDto)} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java index f24921bd2..f921989d6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java @@ -15,7 +15,7 @@ * This javadoc description is ignored by the REST documentation. */ @RestControllerAdvice -public class RestExceptionHandler { +class RestExceptionHandler { /** * REST exception handler for {@code NoResultException}. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java index d27a2ae32..4fc870f61 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java @@ -12,7 +12,7 @@ * The type Spring doc app 163 test. */ @TestPropertySource(properties = "springdoc.override-with-generic-response=true") -public class SpringDocApp163Test extends AbstractSpringDocTest { +class SpringDocApp163Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java index a156b28ff..ebdce97de 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java @@ -29,7 +29,7 @@ ) @RestController @RequestMapping("/annotation-override") -public class AnnotationOverrideForJavadocRestController { +class AnnotationOverrideForJavadocRestController { /** * This is the update method's javadoc. * The method's signature: {@code #update(String, AnnotationOverrideForJavadocRestDto)} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java index a04097397..42401b4bc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java @@ -24,9 +24,6 @@ public class AnnotationOverrideForJavadocRestDto { */ private AnnotationOverrideForJavadocStaticInnerRestDto inner; - public AnnotationOverrideForJavadocRestDto() { - } - public String getGuid() { return guid; } @@ -52,9 +49,6 @@ public static class AnnotationOverrideForJavadocStaticInnerRestDto { */ private String content; - public AnnotationOverrideForJavadocStaticInnerRestDto() { - } - public String getContent() { return content; } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java index a076ee42f..b8908c924 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java @@ -3,15 +3,12 @@ /** * This is the {@code AnnotationOverrideForJavadocRestDto2} class javadoc. */ -public class AnnotationOverrideForJavadocRestDto2 { +class AnnotationOverrideForJavadocRestDto2 { /** * This is the private {@code #guid3} field's javadoc. */ private String guid3; - public AnnotationOverrideForJavadocRestDto2() { - } - public String getGuid3() { return guid3; } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java index 5d327a236..b5714e4b2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java @@ -3,15 +3,12 @@ /** * This is the {@code AnnotationOverrideForJavadocRestDto3} class javadoc. */ -public class AnnotationOverrideForJavadocRestDto3 { +class AnnotationOverrideForJavadocRestDto3 { /** * This is the private {@code #guid4} field's javadoc. */ private String guid4; - public AnnotationOverrideForJavadocRestDto3() { - } - public String getGuid4() { return guid4; } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java index 559e10fed..6c0d1e800 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java @@ -15,7 +15,7 @@ * This javadoc description is ignored by the REST documentation. */ @RestControllerAdvice -public class RestExceptionHandler { +class RestExceptionHandler { /** * REST exception handler for {@code NoResultException}. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java index 3e476f0d9..bcfa41c01 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java @@ -10,7 +10,7 @@ /** * The type Spring doc app 164 test. */ -public class SpringDocApp164Test extends AbstractSpringDocTest { +class SpringDocApp164Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java index 9aa01087d..a1072449b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java @@ -19,7 +19,7 @@ */ @RestController @RequestMapping("/no-generic-override") -public class NoGenericOverrideRestController { +class NoGenericOverrideRestController { /** * This is the create method's javadoc. * The method's signature: {@code #create(JavadocOnlyRestDto)} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java index afd8eb031..3bc2c4f54 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java @@ -15,7 +15,7 @@ * This javadoc description is ignored by the REST documentation. */ @RestControllerAdvice -public class RestExceptionHandler { +class RestExceptionHandler { /** * REST exception handler for {@code NoResultException}. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/ConcreteSubclassFromGeneric.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/ConcreteSubclassFromGeneric.java index 546b4b48f..d2c390853 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/ConcreteSubclassFromGeneric.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/ConcreteSubclassFromGeneric.java @@ -1,6 +1,6 @@ package test.org.springdoc.api.app166; -public class ConcreteSubclassFromGeneric extends SimpleGeneric { +class ConcreteSubclassFromGeneric extends SimpleGeneric { /** * Return the top name diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/HelloController.java index 27c360436..9079a8c4c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/HelloController.java @@ -2,7 +2,7 @@ * * * * * * - * * * * Copyright 2019-2022 the original author or authors. + * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController -public class HelloController { +class HelloController { @GetMapping("/nested") public ResponseEntity nested(@ParameterObject final SimpleOuterClass filter) { return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/MyData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/MyData.java index 81f76080b..6a06f045b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/MyData.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/MyData.java @@ -1,6 +1,6 @@ package test.org.springdoc.api.app166; -public class MyData { +class MyData { /** * Returns the first name diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleGeneric.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleGeneric.java index e9ae46fe0..f17f82d3d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleGeneric.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleGeneric.java @@ -1,6 +1,6 @@ package test.org.springdoc.api.app166; -public class SimpleGeneric { +class SimpleGeneric { /** * Returns name diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerClass.java index 2b0680a51..2066685ff 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerClass.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerClass.java @@ -1,6 +1,6 @@ package test.org.springdoc.api.app166; -public class SimpleInnerClass { +class SimpleInnerClass { /** * Returns the inner inner class diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerInnerClass.java index 6b1b758cc..cce502f14 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerInnerClass.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerInnerClass.java @@ -1,6 +1,6 @@ package test.org.springdoc.api.app166; -public class SimpleInnerInnerClass { +class SimpleInnerInnerClass { /** * Returns the name of the inner inner class */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleOuterClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleOuterClass.java index 2a5ad114a..0b27785e3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleOuterClass.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleOuterClass.java @@ -1,6 +1,6 @@ package test.org.springdoc.api.app166; -public class SimpleOuterClass { +class SimpleOuterClass { /** * Returns the name of the outer class diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SpringDocApp166Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SpringDocApp166Test.java index 9963a5f09..326d7e07d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SpringDocApp166Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SpringDocApp166Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 165 test. */ -public class SpringDocApp166Test extends AbstractSpringDocTest { +class SpringDocApp166Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/HelloController.java index f89818acd..ecb71d40a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController("/api") -public class HelloController { +class HelloController { @RequestMapping("/process") public void process() { diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/SpringDocApp167Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/SpringDocApp167Test.java index 25230ce3d..4a4b62b9a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/SpringDocApp167Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/SpringDocApp167Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 167 test. */ -public class SpringDocApp167Test extends AbstractSpringDocTest { +class SpringDocApp167Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/DescriptionFieldInRequestBodyIsNullController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/DescriptionFieldInRequestBodyIsNullController.java index bc4bd0190..b22cd3cb1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/DescriptionFieldInRequestBodyIsNullController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/DescriptionFieldInRequestBodyIsNullController.java @@ -31,7 +31,7 @@ */ @RestController @RequestMapping("description-in-requestbody-is-null") -public class DescriptionFieldInRequestBodyIsNullController { +class DescriptionFieldInRequestBodyIsNullController { /** * Person person. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/Person.java index 4103c0ad0..005af9d69 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/Person.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/Person.java @@ -3,7 +3,7 @@ /** * The type Person. */ -public class Person { +class Person { /** * The Id. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/SpringDocApp168Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/SpringDocApp168Test.java index 5a86ed683..600327a20 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/SpringDocApp168Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/SpringDocApp168Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 168 test. */ -public class SpringDocApp168Test extends AbstractSpringDocTest { +class SpringDocApp168Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/RecordController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/RecordController.java index 71a5cb9b1..0e35bbf72 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/RecordController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/RecordController.java @@ -8,7 +8,7 @@ @RestController @RequestMapping("record") -public class RecordController { +class RecordController { @GetMapping public SimpleOuterClass index(@ParameterObject SimpleOuterClass filter) { return null; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SpringDocApp169Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SpringDocApp169Test.java index ffcef38f2..ef59a25aa 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SpringDocApp169Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SpringDocApp169Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 169 test. */ -public class SpringDocApp169Test extends AbstractSpringDocTest { +class SpringDocApp169Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/HelloController.java index da9030ba2..3afd50f7d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java index b71575d5c..1459831ac 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 17 test. */ -public class SpringDocApp17Test extends AbstractSpringDocTest { +class SpringDocApp17Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/BasicController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/BasicController.java index 776fc465a..82484d5a0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/BasicController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/BasicController.java @@ -8,7 +8,7 @@ @RestController @RequestMapping(path = "/") -public class BasicController { +class BasicController { @GetMapping("/test1") @Operation(summary = "get1", description = "Provides an animal.") diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Cat.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Cat.java index 7f382e927..842c381be 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Cat.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Cat.java @@ -4,7 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema; @Schema -public class Cat implements Animal { +class Cat implements Animal { private Integer speed; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Dog.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Dog.java index 6d365a191..2cf7b0d61 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Dog.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Dog.java @@ -4,7 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema; @Schema(description = "Represents a Dog class.") -public class Dog implements Animal { +class Dog implements Animal { private String name; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/SpringDocApp170Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/SpringDocApp170Test.java index b703c9638..ad6c52307 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/SpringDocApp170Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/SpringDocApp170Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 193 test. */ -public class SpringDocApp170Test extends AbstractSpringDocTest { +class SpringDocApp170Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/HelloController.java index cabd889b5..b2aba84a3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * PersonProjection interface. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonDTO.java index 010b6a328..f85cddf1b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonDTO.java @@ -21,7 +21,7 @@ /** * Simulate a dynamically generated class that implements the PersonProjection interface. */ -public class PersonDTO implements PersonProjection { +class PersonDTO implements PersonProjection { private String email; private String firstName; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/SpringDocApp171Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/SpringDocApp171Test.java index bf70d207c..552bb8fc4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/SpringDocApp171Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/SpringDocApp171Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 193 test. */ -public class SpringDocApp171Test extends AbstractSpringDocTest { +class SpringDocApp171Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/Example.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/Example.java index b464b8493..82ef811f3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/Example.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/Example.java @@ -6,7 +6,7 @@ * The Example object */ @Schema -public class Example { +class Example { private String name; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/ExampleController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/ExampleController.java index 0fc537966..03cf2f588 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/ExampleController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/ExampleController.java @@ -17,7 +17,7 @@ * The Example Controller */ @RestController -public class ExampleController { +class ExampleController { @PostMapping("/example") @Operation(summary = "insert example", description = "Allows to insert an example") diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/SpringDocApp173Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/SpringDocApp173Test.java index dc229e45d..84d942153 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/SpringDocApp173Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/SpringDocApp173Test.java @@ -9,7 +9,7 @@ * The type Spring doc app 173 test. */ @TestPropertySource(properties = "example.description=The example object") -public class SpringDocApp173Test extends AbstractSpringDocTest { +class SpringDocApp173Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java index c83b87613..85c78cae4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java @@ -7,7 +7,7 @@ * The Example Controller */ @RestController -public class ExampleController { +class ExampleController { @PostMapping public Test post(){ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java index 8c05daaec..a69cd90ec 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 174 test. */ -public class SpringDocApp174Test extends AbstractSpringDocTest { +class SpringDocApp174Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java index 53153d863..6c872392b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java @@ -9,7 +9,7 @@ * @author bnasslahsen */ -public class Test implements Serializable { +class Test implements Serializable { private static final long serialVersionUID = 1L; // Recommended for Serializable classes diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java index fe7645d87..2483f271f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java @@ -7,7 +7,7 @@ * * @author bnasslahsen test question */ -public class TestQuestion extends Question { +class TestQuestion extends Question { /** * list of variants */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java index 5c5279de9..1e6cac956 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java @@ -5,7 +5,7 @@ * * @author bnasslahsen */ -public class TextQuestion extends Question { +class TextQuestion extends Question { private final String answer; public TextQuestion(String question, String type, String answer) { diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java index 7184e5d4d..5521bf253 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java @@ -32,7 +32,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java index 0ea688cca..12807f317 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java @@ -27,7 +27,7 @@ * The type Spring doc app 18 test. */ @TestPropertySource(properties = "springdoc.pre-loading-enabled=true") -public class SpringDocApp18Test extends AbstractSpringDocTest { +class SpringDocApp18Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/HelloController.java index c4ec662b4..64862233e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java index b9142c604..a6daf77dc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 19 test. */ -public class SpringDocApp19Test extends AbstractSpringDocTest { +class SpringDocApp19Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java index 331b06545..22da251c5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java @@ -31,7 +31,7 @@ /** * The type Spring doc app 2 test. */ -public class SpringDocApp2Test extends AbstractSpringDocTest { +class SpringDocApp2Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ApiUtil.java index 3bfe80ea1..424fa0e23 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ApiUtil.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ApiUtil.java @@ -29,7 +29,7 @@ /** * The type Api util. */ -public class ApiUtil { +class ApiUtil { /** * Sets example response. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ExceptionTranslator.java index 87fa5a596..12fe1d702 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ExceptionTranslator.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ExceptionTranslator.java @@ -35,7 +35,7 @@ * The type Exception translator. */ @RestControllerAdvice -public class ExceptionTranslator { +class ExceptionTranslator { /** * The Error attributes. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/HomeController.java index 73950cc91..19a4c29ba 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/HomeController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/HomeController.java @@ -30,7 +30,7 @@ * Home redirection to swagger api documentation */ @Controller -public class HomeController { +class HomeController { /** * The Swagger ui path. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiController.java index 842ac9f47..afca46da4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiController.java @@ -30,7 +30,7 @@ @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class PetApiController implements PetApi { +class PetApiController implements PetApi { /** * The Delegate. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegateImpl.java index be7d00d68..cde0ed585 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegateImpl.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegateImpl.java @@ -24,7 +24,7 @@ * The type Pet api delegate. */ @Service -public class PetApiDelegateImpl implements PetApiDelegate { +class PetApiDelegateImpl implements PetApiDelegate { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiController.java index f565367b6..475a59209 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiController.java @@ -30,7 +30,7 @@ @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class StoreApiController implements StoreApi { +class StoreApiController implements StoreApi { /** * The Delegate. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegateImpl.java index 4d7105a8e..48cca44fa 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegateImpl.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegateImpl.java @@ -24,7 +24,7 @@ * The type Store api delegate. */ @Service -public class StoreApiDelegateImpl implements StoreApiDelegate { +class StoreApiDelegateImpl implements StoreApiDelegate { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiController.java index 8bd31faf3..a7900af95 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiController.java @@ -32,7 +32,7 @@ @Controller @ResponseBody @RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class UserApiController implements UserApi { +class UserApiController implements UserApi { /** * The Delegate. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegateImpl.java index 113c40bd5..81c53dc09 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegateImpl.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegateImpl.java @@ -24,7 +24,7 @@ * The type User api delegate. */ @Service -public class UserApiDelegateImpl implements UserApiDelegate { +class UserApiDelegateImpl implements UserApiDelegate { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Body.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Body.java deleted file mode 100644 index 89fd95a99..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Body.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Body. - */ -public class Body { - - /** - * Updated name of the pet - */ - private String name = null; - - /** - * Updated status of the pet - */ - private String status = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Updated name of the pet - * - * @return name name - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Name body. - * - * @param name the name - * @return the body - */ - public Body name(String name) { - this.name = name; - return this; - } - - /** - * Updated status of the pet - * - * @return status status - */ - @JsonProperty("status") - public String getStatus() { - return status; - } - - /** - * Sets status. - * - * @param status the status - */ - public void setStatus(String status) { - this.status = status; - } - - /** - * Status body. - * - * @param status the status - * @return the body - */ - public Body status(String status) { - this.status = status; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Body {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Body1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Body1.java deleted file mode 100644 index abe480fd7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Body1.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.model; - -import java.io.File; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Body 1. - */ -public class Body1 { - - /** - * Additional data to pass to server - */ - private String additionalMetadata = null; - - /** - * file to upload - */ - private File file = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Additional data to pass to server - * - * @return additionalMetadata additional metadata - */ - @JsonProperty("additionalMetadata") - public String getAdditionalMetadata() { - return additionalMetadata; - } - - /** - * Sets additional metadata. - * - * @param additionalMetadata the additional metadata - */ - public void setAdditionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - } - - /** - * Additional metadata body 1. - * - * @param additionalMetadata the additional metadata - * @return the body 1 - */ - public Body1 additionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - return this; - } - - /** - * file to upload - * - * @return file file - */ - @JsonProperty("file") - public File getFile() { - return file; - } - - /** - * Sets file. - * - * @param file the file - */ - public void setFile(File file) { - this.file = file; - } - - /** - * File body 1. - * - * @param file the file - * @return the body 1 - */ - public Body1 file(File file) { - this.file = file; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Body1 {\n"); - - sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Category.java index d70e38473..5673b8e34 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Category.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Category.java @@ -23,7 +23,7 @@ /** * The type Category. */ -public class Category { +class Category { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Tag.java index a4d5bc003..dc541984c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Tag.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Tag.java @@ -24,7 +24,7 @@ /** * The type Tag. */ -public class Tag { +class Tag { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/HelloController.java index 3c60dd77e..a47bf7f0c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java index 95819a4c0..df7d4359d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 20 test. */ -public class SpringDocApp20Test extends AbstractSpringDocTest { +class SpringDocApp20Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java index 8ca19eedb..0fdd1b83e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java @@ -38,7 +38,7 @@ @SecurityScheme(name = "personstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "${springdoc.oAuthFlow.authorizationUrl}", scopes = { @OAuthScope(name = "write:persons", description = "modify persons in your account"), @OAuthScope(name = "read:persons", description = "read your persons") }))) -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java index 6f2b1f171..9d4cb5a3e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java @@ -27,7 +27,7 @@ * The type Spring doc app 21 test. */ @TestPropertySource(properties = "springdoc.oAuthFlow.authorizationUrl=http://personstore.swagger.io/oauth/dialog") -public class SpringDocApp21Test extends AbstractSpringDocTest { +class SpringDocApp21Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/HelloController.java index 925896551..5a5a01002 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/HelloController.java @@ -28,7 +28,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/PersonDTO.java index e1cafed7d..a0f5932e6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/PersonDTO.java @@ -21,7 +21,7 @@ /** * The type Person dto. */ -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java index d1c9c1b03..e39d6c820 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 22 test. */ -public class SpringDocApp22Test extends AbstractSpringDocTest { +class SpringDocApp22Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/HelloController.java index b8f107bf4..a6cb22640 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/HelloController.java @@ -34,7 +34,7 @@ */ @RestController @SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", paramName = "JWT", description = "A core-auth Bearer token") -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java index f2b7fdbde..d6600286c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 23 test. */ -public class SpringDocApp23Test extends AbstractSpringDocTest { +class SpringDocApp23Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/HelloController.java index deadd4fdc..f5b863c78 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/HelloController.java @@ -34,7 +34,7 @@ */ @RestController @SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", description = "A core-auth Bearer token") -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java index 452a079a7..cf24c85eb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java @@ -23,7 +23,7 @@ /** * The type Spring doc app 24 test. */ -public class SpringDocApp24Test extends AbstractSpringDocTest { +class SpringDocApp24Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocTestApp.java index 53a2100ec..172d4166a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocTestApp.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocTestApp.java @@ -35,7 +35,7 @@ * The type Spring doc test app. */ @SpringBootApplication -public class SpringDocTestApp { +class SpringDocTestApp { /** * The entry point of application. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/HelloController.java index 8278e234e..a2760a194 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/HelloController.java @@ -37,7 +37,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Check. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java index ecbdd31ef..f4a12140a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 25 test. */ -public class SpringDocApp25Test extends AbstractSpringDocTest { +class SpringDocApp25Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Bar.java index 660d26ec5..0f0f32164 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Bar.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Bar.java @@ -21,7 +21,7 @@ /** * The type Bar. */ -public class Bar { +class Bar { /** * The Bar. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Foo.java index 4b4f38c70..da6b0a2fb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Foo.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Foo.java @@ -21,7 +21,7 @@ /** * The type Foo. */ -public class Foo { +class Foo { /** * The Foo. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/HelloController.java index b97d78e01..6584e3711 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons my model. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/MyModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/MyModel.java index feaea7d1c..045de17e0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/MyModel.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/MyModel.java @@ -23,7 +23,7 @@ /** * The type My model. */ -public class MyModel { +class MyModel { /** * The Thing. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java index c88531ff5..b871ae8a6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 26 test. */ -public class SpringDocApp26Test extends AbstractSpringDocTest { +class SpringDocApp26Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Advice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Advice.java index 37b5d1fdc..6ba5ed55e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Advice.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Advice.java @@ -30,7 +30,7 @@ * The type Advice. */ @RestControllerAdvice -public class Advice { +class Advice { /** * Handle exception foo. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Bar.java index d726fcf4a..dccaf02a8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Bar.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Bar.java @@ -21,7 +21,7 @@ /** * The type Bar. */ -public class Bar { +class Bar { /** * The Bar. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Foo.java index 048766358..5e3b5bb0d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Foo.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Foo.java @@ -21,7 +21,7 @@ /** * The type Foo. */ -public class Foo { +class Foo { /** * The Foo. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java index 1417cfb9f..3c2742c65 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java @@ -26,7 +26,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * The Flag. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/MyException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/MyException.java index 2ba70a076..f49c3a6e8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/MyException.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/MyException.java @@ -21,7 +21,7 @@ /** * The type My exception. */ -public class MyException extends RuntimeException { +class MyException extends RuntimeException { /** * The constant serialVersionUID. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java index dfbfbe7bb..9e17ed72b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java @@ -33,7 +33,7 @@ /** * The type Spring doc app 27 test. */ -public class SpringDocApp27Test extends AbstractSpringDocTest { +class SpringDocApp27Test extends AbstractSpringDocTest { /** * Test app. @@ -41,7 +41,7 @@ public class SpringDocApp27Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/Bar", "#/components/schemas/Foo"))); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java index fc381231c..30f2c77c6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java @@ -28,7 +28,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Upload 2 string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java index bd16e4bea..a3c5fc1e8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 28 test. */ -public class SpringDocApp28Test extends AbstractSpringDocTest { +class SpringDocApp28Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/HelloController.java index 21de284d2..5f4f4b6db 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/HelloController.java @@ -34,7 +34,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Post entity list. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java index 282c01d00..dca022fc9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 29 test. */ -public class SpringDocApp29Test extends AbstractSpringDocTest { +class SpringDocApp29Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/TrackerData.java index 702e75efd..190835bc3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/TrackerData.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/TrackerData.java @@ -27,7 +27,7 @@ * The type Tracker data. */ @Schema(name = "TrackerData") -public class TrackerData { +class TrackerData { /** * The Tracker id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java index a08e47582..0e3e4e96f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java @@ -27,7 +27,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Echo playing card. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PersonDTO.java index 4035d5108..973c8443b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PersonDTO.java @@ -21,7 +21,7 @@ /** * The type Person dto. */ -public class PersonDTO { +class PersonDTO { /** * The email diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PlayingCard.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PlayingCard.java index c0246fe3f..747a0c2d4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PlayingCard.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PlayingCard.java @@ -7,7 +7,7 @@ /** * The type Playing card. */ -public class PlayingCard { +class PlayingCard { /** * The Suit. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java index d927f83a0..25467759a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java @@ -7,7 +7,7 @@ /** * The type Spring doc app 3 test. */ -public class SpringDocApp3Test extends AbstractSpringDocTest { +class SpringDocApp3Test extends AbstractSpringDocTest { /** * The type Spring doc test app. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java index bc895a284..fe0d6daae 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java @@ -27,7 +27,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Echo string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java index 3a70faa91..9b06f5862 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 30 test. */ -public class SpringDocApp30Test extends AbstractSpringDocTest { +class SpringDocApp30Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java index 97a397d04..082a24e48 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java @@ -34,7 +34,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Subscribe subscription response. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java index e1cc00973..ca0a7ecc4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 31 test. */ -public class SpringDocApp31Test extends AbstractSpringDocTest { +class SpringDocApp31Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java index d0ebc973c..9da86e547 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java @@ -30,7 +30,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Filter post string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java index 8837c18f1..403a3e8be 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 32 test. */ -public class SpringDocApp32Test extends AbstractSpringDocTest { +class SpringDocApp32Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java index 9d8b3177e..085dbf071 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java @@ -31,7 +31,7 @@ * @param the type parameter */ @RestController -public class HelloController { +class HelloController { /** * Index t. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java index 4b7b66446..84116c241 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 33 test. */ -public class SpringDocApp33Test extends AbstractSpringDocTest { +class SpringDocApp33Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/HelloController.java index c79651bba..e192e5093 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/HelloController.java @@ -31,7 +31,7 @@ * @param the type parameter */ @RestController -public class HelloController { +class HelloController { /** * Index t. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/MyExceptionHandler.java index 2b52ca999..f83158ab7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/MyExceptionHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/MyExceptionHandler.java @@ -31,7 +31,7 @@ */ @RestControllerAdvice @Hidden -public class MyExceptionHandler extends ResponseEntityExceptionHandler { +class MyExceptionHandler extends ResponseEntityExceptionHandler { /** * Bad object. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java index 454c91e37..5d5acccf0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 34 test. */ -public class SpringDocApp34Test extends AbstractSpringDocTest { +class SpringDocApp34Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/HelloController.java index 6218ab930..8d2c1dfd7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/HelloController.java @@ -33,7 +33,7 @@ */ @Controller @RequestMapping("/api/v1/poc/") -public class HelloController { +class HelloController { /** * Testme response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java index 12e59d8e6..686ba0304 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java @@ -27,7 +27,7 @@ /** * The type Spring doc app 35 test. */ -public class SpringDocApp35Test extends AbstractSpringDocTest { +class SpringDocApp35Test extends AbstractSpringDocTest { static { getConfig().addRestControllers(HelloController.class); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Bar.java index dbb5941b7..0ef75bedf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Bar.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Bar.java @@ -21,7 +21,7 @@ /** * The type Bar. */ -public class Bar { +class Bar { /** * The Bar. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Car.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Car.java index a310baa09..8e8d11c13 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Car.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Car.java @@ -21,7 +21,7 @@ /** * The type Car. */ -public class Car { +class Car { /** * The Car. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Foo.java index e907f5032..85756d914 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Foo.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Foo.java @@ -21,7 +21,7 @@ /** * The type Foo. */ -public class Foo { +class Foo { /** * The Foo. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/HelloController.java index 6f7f2e3d3..3df46159a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController("/api") -public class HelloController { +class HelloController { /** * Process foo. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Pet.java index dc1561507..dd3446b17 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Pet.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Pet.java @@ -21,7 +21,7 @@ /** * The type Pet. */ -public class Pet { +class Pet { /** * The Pet. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java index 9eaf15162..624d08eca 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 37 test. */ -public class SpringDocApp37Test extends AbstractSpringDocTest { +class SpringDocApp37Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/HelloController.java index e958ee5d5..090351308 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/HelloController.java @@ -28,7 +28,7 @@ * The type Hello controller. */ @RestController("/api") -public class HelloController { +class HelloController { /** * Gets model resource. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java index 5d25438c2..cf49de2bf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 38 test. */ -public class SpringDocApp38Test extends AbstractSpringDocTest { +class SpringDocApp38Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/HelloController.java index 692a10eaa..84af2ee98 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Search employee. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java index c3740d63a..03c832a91 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java @@ -23,7 +23,7 @@ /** * The type Spring doc app 39 test. */ -public class SpringDocApp39Test extends AbstractSpringDocTest { +class SpringDocApp39Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java index ed9dfeada..185111bb0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java @@ -32,7 +32,7 @@ * The type Spring doc test app. */ @SpringBootApplication -public class SpringDocTestApp { +class SpringDocTestApp { /** * The entry point of application. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/HelloController.java index 5a870001d..f86ea0cca 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * List tracker data. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java index ca5ee412b..eef0de0a4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java @@ -29,7 +29,7 @@ * The type Spring doc app 4 test. */ @TestPropertySource(properties = "springdoc.use-fqn=true") -public class SpringDocApp4Test extends AbstractSpringDocTest { +class SpringDocApp4Test extends AbstractSpringDocTest { /** * Restore. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/TrackerData.java index 2978b3ff0..19f06fb86 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/TrackerData.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/TrackerData.java @@ -26,7 +26,7 @@ /** * The type Tracker data. */ -public class TrackerData { +class TrackerData { /** * The Tracker id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/HelloController.java index 0d6a8dfc2..6b88a1d03 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/HelloController.java @@ -28,7 +28,7 @@ * The type Hello controller. */ @RestController("/api") -public class HelloController { +class HelloController { /** * Gets start form properties. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/SpringDocApp40Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/SpringDocApp40Test.java index 7fe4d0c7c..6877c71ee 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/SpringDocApp40Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/SpringDocApp40Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 40 test. */ -public class SpringDocApp40Test extends AbstractSpringDocTest { +class SpringDocApp40Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/HelloController.java index c65c7f6e0..c1eae2978 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/HelloController.java @@ -38,7 +38,7 @@ * The type Hello controller. */ @RestController("/api") -public class HelloController { +class HelloController { /** * Gets file. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp411Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp411Test.java index d3b62e5d4..19de007a6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp411Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp411Test.java @@ -38,7 +38,7 @@ /** * The type Spring doc app 411 test. */ -public class SpringDocApp411Test extends AbstractSpringDocTest { +class SpringDocApp411Test extends AbstractSpringDocTest { /** * Test app. @@ -46,7 +46,7 @@ public class SpringDocApp411Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { String className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp41Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp41Test.java index 251c9364e..32892d65e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp41Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp41Test.java @@ -40,7 +40,7 @@ * The type Spring doc app 41 test. */ @TestPropertySource(properties = "springdoc.cache.disabled=true") -public class SpringDocApp41Test extends AbstractSpringDocTest { +class SpringDocApp41Test extends AbstractSpringDocTest { /** * Test app. @@ -48,7 +48,7 @@ public class SpringDocApp41Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { String className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/HelloController.java index 5722d0dad..da264542d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/HelloController.java @@ -27,7 +27,7 @@ * The type Hello controller. */ @RestController("/api") -public class HelloController { +class HelloController { /** * Tweets. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/SpringDocApp42Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/SpringDocApp42Test.java index a6109b3e0..0c92fc0cd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/SpringDocApp42Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/SpringDocApp42Test.java @@ -29,7 +29,7 @@ /** * The type Spring doc app 42 test. */ -public class SpringDocApp42Test extends AbstractSpringDocTest { +class SpringDocApp42Test extends AbstractSpringDocTest { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/TweetId.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/TweetId.java index 600d7b88b..dc34326e0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/TweetId.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/TweetId.java @@ -21,7 +21,7 @@ /** * The type Tweet id. */ -public class TweetId { +class TweetId { /** * The Value. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/HelloController.java index a457a0be9..c99a02e26 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/HelloController.java @@ -30,7 +30,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Upload documents response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/SpringDocApp43Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/SpringDocApp43Test.java index 6e0b90963..7d6f801d0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/SpringDocApp43Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/SpringDocApp43Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 43 test. */ -public class SpringDocApp43Test extends AbstractSpringDocTest { +class SpringDocApp43Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/HelloController.java index e8d056211..6b78db2f1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/HelloController.java @@ -33,7 +33,7 @@ * The type Hello controller. */ @RestController("/api") -public class HelloController { +class HelloController { /** * Hello response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/SpringDocApp44Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/SpringDocApp44Test.java index d0d885415..52d07050d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/SpringDocApp44Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/SpringDocApp44Test.java @@ -33,7 +33,7 @@ /** * The type Spring doc app 44 test. */ -public class SpringDocApp44Test extends AbstractSpringDocTest { +class SpringDocApp44Test extends AbstractSpringDocTest { /** * Test app. @@ -41,7 +41,7 @@ public class SpringDocApp44Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/HelloDTO2", "#/components/schemas/HelloDTO1"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController.java index be019dec0..55440ef8a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController.java @@ -41,7 +41,7 @@ @Tag(name = "People", description = "Use this resource to serve all requests and initiate all operations related to people") @RestController @RequestMapping(value = "/v1/people") -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController2.java index a6946f6b1..d2bf8df88 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController2.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController2.java @@ -42,7 +42,7 @@ @SecurityRequirement(name = "bearer") @RestController @RequestMapping(value = "/v1/people2") -public class HelloController2 { +class HelloController2 { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/OpenApiConfig.java index 509391370..de9a8d0e4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/OpenApiConfig.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/OpenApiConfig.java @@ -29,5 +29,5 @@ */ @OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) @SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") -public class OpenApiConfig { +class OpenApiConfig { } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/PersonDTO.java index a8e8b10de..9f2912e80 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/PersonDTO.java @@ -21,7 +21,7 @@ /** * The type Person dto. */ -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/SpringDocApp45Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/SpringDocApp45Test.java index 1b2debce7..762e7ff56 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/SpringDocApp45Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/SpringDocApp45Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 45 test. */ -public class SpringDocApp45Test extends AbstractSpringDocTest { +class SpringDocApp45Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/HelloController.java index 6f54428da..7fb014288 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/HelloController.java @@ -33,7 +33,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/SpringDocApp46Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/SpringDocApp46Test.java index c7f13733e..8b6eacd97 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/SpringDocApp46Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/SpringDocApp46Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 46 test. */ -public class SpringDocApp46Test extends AbstractSpringDocTest { +class SpringDocApp46Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/HelloController.java index 658b2d1bc..f75afbfc1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/HelloController.java @@ -32,7 +32,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets documents with locale. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/SpringDocApp47Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/SpringDocApp47Test.java index 998eca522..bdea686c2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/SpringDocApp47Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/SpringDocApp47Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 47 test. */ -public class SpringDocApp47Test extends AbstractSpringDocTest { +class SpringDocApp47Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/AbstractHelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/AbstractHelloController.java index 2a95742fe..2f91b87ca 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/AbstractHelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/AbstractHelloController.java @@ -31,7 +31,7 @@ @ApiResponses({ @ApiResponse(responseCode = "411") }) -public class AbstractHelloController { +class AbstractHelloController { /** * Gets documents. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/HelloController.java index fea96d42a..efa7bb7f7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/HelloController.java @@ -34,7 +34,7 @@ @ApiResponses({ @ApiResponse(responseCode = "401") }) -public class HelloController extends AbstractHelloController { +class HelloController extends AbstractHelloController { /** * Gets documents. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/SpringDocApp48Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/SpringDocApp48Test.java index 6e75450ed..e13b06ee5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/SpringDocApp48Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/SpringDocApp48Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 48 test. */ -public class SpringDocApp48Test extends AbstractSpringDocTest { +class SpringDocApp48Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/HelloController.java index 901e72b64..7b75fa82a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/HelloController.java @@ -32,7 +32,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * List list. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocApp49Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocApp49Test.java index 3e701da7a..8a1ac3db3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocApp49Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocApp49Test.java @@ -23,7 +23,7 @@ /** * The type Spring doc app 49 test. */ -public class SpringDocApp49Test extends AbstractSpringDocTest { +class SpringDocApp49Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocTestApp.java index aae8a33f5..603e563af 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocTestApp.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocTestApp.java @@ -33,7 +33,7 @@ * The type Spring doc test app. */ @SpringBootApplication -public class SpringDocTestApp { +class SpringDocTestApp { /** * The entry point of application. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java index d24768952..f5500c3d7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java @@ -44,7 +44,7 @@ * The type Open api resource bean configuration components security schemes test. */ @TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") -public class OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest extends AbstractSpringDocTest { +class OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest extends AbstractSpringDocTest { /** * Given: Bean configuration with security scheme http basic (shouldDefineComponentsSecuritySchemesForHttpBasic) @@ -53,7 +53,7 @@ public class OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest exten * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) @@ -70,7 +70,7 @@ public void testApp() throws Exception { * @throws Exception the exception */ @Test - public void shouldDefineComponentsSecuritySchemesForApiKey() throws Exception { + void shouldDefineComponentsSecuritySchemesForApiKey() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) @@ -87,7 +87,7 @@ public void shouldDefineComponentsSecuritySchemesForApiKey() throws Exception { * @throws Exception the exception */ @Test - public void shouldDefineComponentsSecuritySchemesForOAuth2() throws Exception { + void shouldDefineComponentsSecuritySchemesForOAuth2() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceCustomConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceCustomConfigurationTest.java index b7d9835ca..c354dcd65 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceCustomConfigurationTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceCustomConfigurationTest.java @@ -36,7 +36,7 @@ */ @Import(CustomOpenAPIConfig.class) @TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") -public class OpenApiResourceCustomConfigurationTest extends AbstractSpringDocTest { +class OpenApiResourceCustomConfigurationTest extends AbstractSpringDocTest { /** * givenNoConfiguration_whenGetApiJson_returnsDefaultEmptyDocs - should return @@ -44,7 +44,7 @@ public class OpenApiResourceCustomConfigurationTest extends AbstractSpringDocTes * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceNoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceNoConfigurationTest.java index bee493f69..9e94b8bcb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceNoConfigurationTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceNoConfigurationTest.java @@ -33,7 +33,7 @@ * The type Open api resource no configuration test. */ @TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") -public class OpenApiResourceNoConfigurationTest extends AbstractSpringDocTest { +class OpenApiResourceNoConfigurationTest extends AbstractSpringDocTest { /** * givenNoConfiguration_whenGetApiJson_returnsDefaultEmptyDocs - should return @@ -41,7 +41,7 @@ public class OpenApiResourceNoConfigurationTest extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc .perform(get("/api-docs")) .andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/HelloController.java index c563901af..d634d8207 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * List list. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocApp50Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocApp50Test.java index 9fc27ef66..55c44dc39 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocApp50Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocApp50Test.java @@ -23,7 +23,7 @@ /** * The type Spring doc app 50 test. */ -public class SpringDocApp50Test extends AbstractSpringDocTest { +class SpringDocApp50Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocTestApp.java index 1d256dcc6..3d84acfe7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocTestApp.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocTestApp.java @@ -33,7 +33,7 @@ * The type Spring doc test app. */ @SpringBootApplication -public class SpringDocTestApp { +class SpringDocTestApp { /** * The entry point of application. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/HelloController.java index 63c553df1..19bad65da 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/HelloController.java @@ -38,7 +38,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test 1 string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/SpringDocApp51Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/SpringDocApp51Test.java index e05f2e760..4a19e4253 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/SpringDocApp51Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/SpringDocApp51Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 51 test. */ -public class SpringDocApp51Test extends AbstractSpringDocTest { +class SpringDocApp51Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/HelloController.java index 056a8554b..4ac240cc1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Create test 1 string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/SpringDocApp52Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/SpringDocApp52Test.java index 6b4d07703..be590d244 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/SpringDocApp52Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/SpringDocApp52Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 52 test. */ -public class SpringDocApp52Test extends AbstractSpringDocTest { +class SpringDocApp52Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloController.java index ee570048b..8da9c35ff 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloController.java @@ -35,7 +35,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * List with no api response list. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloControllerWithGlobalApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloControllerWithGlobalApiResponse.java index fe9ea5601..4aeb6e41e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloControllerWithGlobalApiResponse.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloControllerWithGlobalApiResponse.java @@ -35,7 +35,7 @@ */ @RestController @RequestMapping(path = "/global") -public class HelloControllerWithGlobalApiResponse { +class HelloControllerWithGlobalApiResponse { /** * List with no api response list. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/SpringDocApp53Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/SpringDocApp53Test.java index 5ca862165..907519058 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/SpringDocApp53Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/SpringDocApp53Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 53 test. */ -public class SpringDocApp53Test extends AbstractSpringDocTest { +class SpringDocApp53Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/HelloController.java index 10b9b7d9c..c62439f8d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/HelloController.java @@ -34,7 +34,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets meal party. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/MealParty.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/MealParty.java index fb07ef4f5..5f5f4020f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/MealParty.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/MealParty.java @@ -26,7 +26,7 @@ /** * The type Meal party. */ -public class MealParty { +class MealParty { /** * The Name. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/SpringDocApp54Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/SpringDocApp54Test.java index 29a5db426..c01ac10c9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/SpringDocApp54Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/SpringDocApp54Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 54 test. */ -public class SpringDocApp54Test extends AbstractSpringDocTest { +class SpringDocApp54Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/HelloController.java index 7559efb2d..c1cd59288 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/HelloController.java @@ -35,7 +35,7 @@ */ @Controller @Tag(name = "health") -public class HelloController { +class HelloController { /** * Ping endpoint used for health checks. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/SpringDocApp55Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/SpringDocApp55Test.java index 8c9e873ac..949c6cd7e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/SpringDocApp55Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/SpringDocApp55Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 55 test. */ -public class SpringDocApp55Test extends AbstractSpringDocTest { +class SpringDocApp55Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/GlobalExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/GlobalExceptionHandler.java index 55cc2e6e0..a9fdfc46d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/GlobalExceptionHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/GlobalExceptionHandler.java @@ -32,7 +32,7 @@ * The type Global exception handler. */ @RestControllerAdvice -public class GlobalExceptionHandler { +class GlobalExceptionHandler { /** * Handle unhandled error error dto. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/HelloController.java index 0e3fb20f1..f5b696dc2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/SpringDocApp56Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/SpringDocApp56Test.java index 480bc9e4f..6fa54f02e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/SpringDocApp56Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/SpringDocApp56Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 56 test. */ -public class SpringDocApp56Test extends AbstractSpringDocTest { +class SpringDocApp56Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/HelloController.java index a7c457000..1e88921ca 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets text. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/SpringDocApp57Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/SpringDocApp57Test.java index c69fc19d5..085514048 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/SpringDocApp57Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/SpringDocApp57Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 57 test. */ -public class SpringDocApp57Test extends AbstractSpringDocTest { +class SpringDocApp57Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/HelloController.java index b4940cc82..bc90da29c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/HelloController.java @@ -33,7 +33,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Example object. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/SpringDocApp58Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/SpringDocApp58Test.java index f154d2281..e9326afa4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/SpringDocApp58Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/SpringDocApp58Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 58 test. */ -public class SpringDocApp58Test extends AbstractSpringDocTest { +class SpringDocApp58Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/HelloController.java index 8800ef8bf..45c8db86d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/SpringDocApp59Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/SpringDocApp59Test.java index 07a2bee10..6779a221d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/SpringDocApp59Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/SpringDocApp59Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 59 test. */ -public class SpringDocApp59Test extends AbstractSpringDocTest { +class SpringDocApp59Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/HelloController.java index 6010fbdec..a7b5ffdb6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/HelloController.java @@ -32,7 +32,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Say hello response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java index 0dcc432bf..f5e18904b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 6 test. */ -public class SpringDocApp6Test extends AbstractSpringDocTest { +class SpringDocApp6Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/HelloController.java index 949274cc3..e51a5b071 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * List 1 list. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/SpringDocApp60Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/SpringDocApp60Test.java index 45f411a90..4e607b47e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/SpringDocApp60Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/SpringDocApp60Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 60 test. */ -public class SpringDocApp60Test extends AbstractSpringDocTest { +class SpringDocApp60Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/HelloController.java index d30656562..970eebc77 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/HelloController.java @@ -32,7 +32,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/SpringDocApp61Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/SpringDocApp61Test.java index 7da4ecd7e..050afb6d7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/SpringDocApp61Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/SpringDocApp61Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 61 test. */ -public class SpringDocApp61Test extends AbstractSpringDocTest { +class SpringDocApp61Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/SpringDocApp62Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/SpringDocApp62Test.java index 842d3c176..08f628182 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/SpringDocApp62Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/SpringDocApp62Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 62 test. */ -public class SpringDocApp62Test extends AbstractSpringDocTest { +class SpringDocApp62Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/TestController.java index 1b496d3b8..cc61e35eb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/TestController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/TestController.java @@ -30,7 +30,7 @@ */ @BaseController @Tag(name = "Test Controller") -public class TestController { +class TestController { /** * Test string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/HelloController.java index 69ceec9a2..471f45b20 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java index 0939fb96a..aa1cf7088 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java @@ -30,7 +30,7 @@ @TestPropertySource(properties = { "springdoc.packagesToScan=hell,hello1, hello.me", "springdoc.packagesToExclude=test.org.springdoc.api.app63.65" }) -public class SpringDocApp63Test extends AbstractSpringDocTest { +class SpringDocApp63Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/HelloController.java index a3045f025..758acfb7d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/HelloController.java @@ -27,7 +27,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test 1. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java index 8156fdc28..2251b372d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java @@ -27,7 +27,7 @@ * The type Spring doc app 64 test. */ @TestPropertySource(properties = "springdoc.paths-to-match=/v1, /api/**") -public class SpringDocApp64Test extends AbstractSpringDocTest { +class SpringDocApp64Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/HelloController.java index 9e7991e1b..e479d9e88 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/HelloController.java @@ -31,7 +31,7 @@ */ @Tag(name = "Health", description = "Health check / ping API") @RestController -public class HelloController { +class HelloController { /** * Ping response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java index ce3fdfc46..102afe729 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 65 test. */ -public class SpringDocApp65Test extends AbstractSpringDocTest { +class SpringDocApp65Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/DefaultHealthCheckApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/DefaultHealthCheckApi.java index b5f1f2214..651299d3b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/DefaultHealthCheckApi.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/DefaultHealthCheckApi.java @@ -33,7 +33,7 @@ */ @RestController @Hidden -public class DefaultHealthCheckApi { +class DefaultHealthCheckApi { /** * Test date echo string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/HelloController.java index 350d17f83..dc32d1cfa 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/HelloController.java @@ -31,7 +31,7 @@ */ @Tag(name = "Health", description = "Health check / ping API") @RestController -public class HelloController { +class HelloController { /** * Ping response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java index 270eeeb8b..c54781196 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 66 test. */ -public class SpringDocApp66Test extends AbstractSpringDocTest { +class SpringDocApp66Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/UndocumentedClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/UndocumentedClass.java index 2252ac363..9404d0987 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/UndocumentedClass.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/UndocumentedClass.java @@ -24,6 +24,6 @@ * The type Undocumented class. */ @Hidden -public class UndocumentedClass { +class UndocumentedClass { } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/HelloController.java index f22531f45..e60ca14cd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/HelloController.java @@ -40,7 +40,7 @@ @RestController @RequestMapping(path = "/demo", produces = MediaType.TEXT_PLAIN_VALUE) -public class HelloController { +class HelloController { /** * Operation 1 string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java index 9af91eb2a..01dd40162 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 67 test. */ -public class SpringDocApp67Test extends AbstractSpringDocTest { +class SpringDocApp67Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/HelloController.java index da91e141a..a9a837cd8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets tasks. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/PersonDTO.java index d48dc9e2f..614c352d5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/PersonDTO.java @@ -21,7 +21,7 @@ /** * The type Person dto. */ -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java index d7fb9ed82..5e2d3632c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 69 test. */ -public class SpringDocApp69Test extends AbstractSpringDocTest { +class SpringDocApp69Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java index d8b7aeac9..926ba4511 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java @@ -30,7 +30,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Search employee. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java index 4f50512d9..a6fee1e8d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 7 test. */ -public class SpringDocApp7Test extends AbstractSpringDocTest { +class SpringDocApp7Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/HelloController.java index 398ecb807..99bb18f19 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/HelloController.java @@ -32,7 +32,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test api type. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java index ffdf546d0..1b400bae2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 70 test. */ -public class SpringDocApp70Test extends AbstractSpringDocTest { +class SpringDocApp70Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/OperationCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/OperationCustomizer.java index 0073afeac..ed8d5cf2f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/OperationCustomizer.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/OperationCustomizer.java @@ -27,7 +27,7 @@ * The type Operation customizer. */ @Component -public class OperationCustomizer implements org.springdoc.core.customizers.OperationCustomizer { +class OperationCustomizer implements org.springdoc.core.customizers.OperationCustomizer { /** * Customize operation. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/ParameterCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/ParameterCustomizer.java index 674f8e815..8611b8c12 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/ParameterCustomizer.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/ParameterCustomizer.java @@ -27,7 +27,7 @@ * The type Parameter customizer. */ @Component -public class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { +class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { /** * Customize parameter. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/PropertyCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/PropertyCustomizer.java index edf6543d2..3a71c3dbc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/PropertyCustomizer.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/PropertyCustomizer.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ * The type Property customizer. */ @Component -public class PropertyCustomizer implements org.springdoc.core.customizers.PropertyCustomizer { +class PropertyCustomizer implements org.springdoc.core.customizers.PropertyCustomizer { @Autowired ObjectMapperProvider objectMapperProvider; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/Dog.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/Dog.java index b42159153..edcf892b4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/Dog.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/Dog.java @@ -26,7 +26,7 @@ * The type Dog. */ @Schema(name = "Dog") -public class Dog { +class Dog { /** * The Display name. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/HelloController.java index 1d98e5358..4d1e0c56b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java index cc3683621..051921c85 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 71 test. */ -public class SpringDocApp71Test extends AbstractSpringDocTest { +class SpringDocApp71Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java index b39b6bc3f..c553ef06b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java @@ -32,7 +32,7 @@ /** * The type Blocking auto configuration test. */ -public class BlockingAutoConfigurationTest { +class BlockingAutoConfigurationTest { /** * The Context runner. @@ -45,7 +45,7 @@ public class BlockingAutoConfigurationTest { * Configurations not loaded when application is not web. */ @Test - public void configurations_not_loaded_when_application_is_not_web() { + void configurations_not_loaded_when_application_is_not_web() { new ApplicationContextRunner() .withUserConfiguration(TestApp.class) .run(context -> assertThat(context) @@ -60,7 +60,7 @@ public void configurations_not_loaded_when_application_is_not_web() { * Actuator configuration not loaded when not enabled explicitly. */ @Test - public void actuator_configuration_not_loaded_when_not_enabled_explicitly() { + void actuator_configuration_not_loaded_when_not_enabled_explicitly() { contextRunner .run(context -> assertThat(context) .hasNotFailed() @@ -74,7 +74,7 @@ public void actuator_configuration_not_loaded_when_not_enabled_explicitly() { * Configurations not loaded when disabled. */ @Test - public void configurations_not_loaded_when_disabled() { + void configurations_not_loaded_when_disabled() { contextRunner .withPropertyValues("springdoc.api-docs.enabled=false") .run(context -> assertThat(context) @@ -89,7 +89,7 @@ public void configurations_not_loaded_when_disabled() { * Configurations not loaded when mvc is not on class path. */ @Test - public void configurations_not_loaded_when_mvc_is_not_on_class_path() { + void configurations_not_loaded_when_mvc_is_not_on_class_path() { contextRunner .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) .run(context -> assertThat(context) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java index 6ce16aaba..01a1c1945 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java @@ -28,7 +28,7 @@ /** * The type Cache auto configuration test 1. */ -public class CacheAutoConfigurationTest1 { +class CacheAutoConfigurationTest1 { /** * The Context runner. @@ -40,7 +40,7 @@ public class CacheAutoConfigurationTest1 { * Cache configuration loaded when not disabled explicitly. */ @Test - public void cache_configuration_loaded_when_not_disabled_explicitly() { + void cache_configuration_loaded_when_not_disabled_explicitly() { contextRunner .run(context -> assertThat(context) .hasNotFailed() @@ -54,7 +54,7 @@ public void cache_configuration_loaded_when_not_disabled_explicitly() { * Cache configuration loaded when disabled explicitly. */ @Test - public void cache_configuration_loaded_when_disabled_explicitly() { + void cache_configuration_loaded_when_disabled_explicitly() { contextRunner .withPropertyValues("springdoc.cache.disabled=false") .run(context -> assertThat(context) @@ -69,7 +69,7 @@ public void cache_configuration_loaded_when_disabled_explicitly() { * Cache configurations successfully disabled. */ @Test - public void cache_configurations_successfully_disabled() { + void cache_configurations_successfully_disabled() { contextRunner .withPropertyValues("springdoc.cache.disabled=true") .run(context -> assertThat(context) @@ -84,7 +84,7 @@ public void cache_configurations_successfully_disabled() { * Group configuration loaded. */ @Test - public void group_configuration_loaded() { + void group_configuration_loaded() { contextRunner .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") .run(context -> assertThat(context) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java index e611a4567..ae17c3212 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java @@ -30,7 +30,7 @@ /** * The type Group auto configuration test. */ -public class GroupAutoConfigurationTest { +class GroupAutoConfigurationTest { /** * The Context runner. @@ -42,7 +42,7 @@ public class GroupAutoConfigurationTest { * Group configuration loaded. */ @Test - public void group_configuration_loaded() { + void group_configuration_loaded() { contextRunner .run(context -> assertThat(context) .hasNotFailed() diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/HelloController.java index 4c6d4f92a..66b2debc0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/HelloController.java @@ -35,7 +35,7 @@ */ @RestController @RequestMapping({ "/{country_code}/persons/", "/persons" }) -public class HelloController { +class HelloController { /** * Delete. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java index e15babaf9..330a6ffdf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 73 test. */ -public class SpringDocApp73Test extends AbstractSpringDocTest { +class SpringDocApp73Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/HelloController.java index e6dcbf6c9..aab5ab2c0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/HelloController.java @@ -30,7 +30,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Post my request body string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java index 72fd0c9bd..3006d60e5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 74 test. */ -public class SpringDocApp74Test extends AbstractSpringDocTest { +class SpringDocApp74Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/HelloController.java index 9f0cd5342..5cd7892de 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/HelloController.java @@ -33,7 +33,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Post my request body 1 string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/PersonDTO.java index bc2b3bd83..e07dbfcea 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/PersonDTO.java @@ -21,7 +21,7 @@ /** * The type Person dto. */ -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/RestResponseEntityExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/RestResponseEntityExceptionHandler.java index 3756a5cb2..4d0feeddb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/RestResponseEntityExceptionHandler.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/RestResponseEntityExceptionHandler.java @@ -33,7 +33,7 @@ * The type Rest response entity exception handler. */ @ControllerAdvice -public class RestResponseEntityExceptionHandler +class RestResponseEntityExceptionHandler extends ResponseEntityExceptionHandler { /** * Bad request response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java index f64fd7141..5dbd1acc9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 75 test. */ -public class SpringDocApp75Test extends AbstractSpringDocTest { +class SpringDocApp75Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java index 47090323d..fb8df1e31 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Secured string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java index 0e39d6492..422cb11fb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java @@ -32,7 +32,7 @@ /** * The type Spring doc app 76 test. */ -public class SpringDocApp76Test extends AbstractSpringDocTest { +class SpringDocApp76Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/HelloController.java index 9252bdd9d..6eb96004e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/HelloController.java @@ -35,7 +35,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/SpringDocApp77Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/SpringDocApp77Test.java index 55940c939..af48953bf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/SpringDocApp77Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/SpringDocApp77Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 77 test. */ -public class SpringDocApp77Test extends AbstractSpringDocTest { +class SpringDocApp77Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/HelloController.java index 7d76440c1..a7099fc40 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/HelloController.java @@ -30,7 +30,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets person 1. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/PersonDTO.java index 6784f8c69..ab764145b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/PersonDTO.java @@ -21,7 +21,7 @@ /** * The type Person dto. */ -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java index 0cb2d5250..e16cd0967 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 78 test. */ -public class SpringDocApp78Test extends AbstractSpringDocTest { +class SpringDocApp78Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/HelloController.java index 80e009851..fb6f299bd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Echo string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java index 85aa5c8f2..131461c13 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java @@ -26,7 +26,7 @@ /** * The type Spring doc app 79 test. */ -public class SpringDocApp79Test extends AbstractSpringDocTest { +class SpringDocApp79Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/HelloController.java index 13a1e7dc3..bcb51786d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java index 7ef7a1c84..9b42f39b0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java @@ -31,7 +31,7 @@ /** * The type Spring doc app 8 test. */ -public class SpringDocApp8Test extends AbstractSpringDocTest { +class SpringDocApp8Test extends AbstractSpringDocTest { /** * Test app. @@ -39,7 +39,7 @@ public class SpringDocApp8Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get("/myapp" + Constants.DEFAULT_API_DOCS_URL).contextPath("/myapp")) .andExpect(status().isOk()); } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/HelloController.java index 4ca3a21f8..d7f13a317 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/HelloController.java @@ -32,7 +32,7 @@ */ @RestController @RequestMapping("/api") -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java index baf25afe5..dcb068d88 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java @@ -27,7 +27,7 @@ * The type Spring doc app 80 test. */ @ActiveProfiles("80") -public class SpringDocApp80Test extends AbstractSpringDocTest { +class SpringDocApp80Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/TestObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/TestObject.java index 545cdb94e..cc6a2182b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/TestObject.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/TestObject.java @@ -5,7 +5,7 @@ /** * The type Test object. */ -public class TestObject { +class TestObject { /** * The String value. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/HelloController.java index b8747fee7..ddd00b1ac 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/HelloController.java @@ -26,7 +26,7 @@ */ @RestController @RequestMapping("/api") -public class HelloController { +class HelloController { /** * Test string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java index f5dd82923..ac273d741 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java @@ -34,7 +34,7 @@ /** * The type Spring doc app 81 test. */ -public class SpringDocApp81Test extends AbstractSpringDocTest { +class SpringDocApp81Test extends AbstractSpringDocTest { /** * Test app. @@ -42,7 +42,7 @@ public class SpringDocApp81Test extends AbstractSpringDocTest { * @throws Exception the exception */ @Test - public void testApp() throws Exception { + protected void testApp() throws Exception { mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) .andExpect(jsonPath("$.openapi", is("3.0.1"))) .andExpect(jsonPath("$.paths./api.get.tags[0]", containsString("hello-controller"))) diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/HelloController.java index cc76a0729..9e1496699 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/HelloController.java @@ -26,7 +26,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/PersonDTO.java index e682fd745..5cdfbce51 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/PersonDTO.java @@ -21,7 +21,7 @@ /** * The type Person dto. */ -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java index acb24ee7d..ce42a3b2a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 82 test. */ -public class SpringDocApp82Test extends AbstractSpringDocTest { +class SpringDocApp82Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/HelloController.java index 6490f6f8d..df5fd5935 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/HelloController.java @@ -34,7 +34,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/PersonDTO.java index 9404626b9..82b3d6afc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/PersonDTO.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/PersonDTO.java @@ -21,7 +21,7 @@ /** * The type Person dto. */ -public class PersonDTO { +class PersonDTO { /** * The Email. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java index 0e5c1eac0..8088cb240 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 83 test. */ -public class SpringDocApp83Test extends AbstractSpringDocTest { +class SpringDocApp83Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/HelloController.java index 50abec6f5..1e7476764 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/HelloController.java @@ -27,7 +27,7 @@ */ @RestController @RequestMapping("/api") -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java index 34dbcb75b..c48dcf3df 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 84 test. */ -public class SpringDocApp84Test extends AbstractSpringDocTest { +class SpringDocApp84Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/HelloController.java index 7c87c87d8..8579bcf0a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/HelloController.java @@ -31,7 +31,7 @@ */ @RestController @RequestMapping("/api") -public class HelloController { +class HelloController { /** * Testme. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java index fd073aaf0..7ec0b689b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 85 test. */ -public class SpringDocApp85Test extends AbstractSpringDocTest { +class SpringDocApp85Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/HelloController.java index e4749c624..0a4158c98 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/HelloController.java @@ -31,7 +31,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java index 68f89bd2e..a9ab50eb9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java @@ -29,7 +29,7 @@ @TestPropertySource(properties = { "springdoc.packagesToScan=test.org.springdoc.api.app86", "springdoc.packagesToExclude=test.org.springdoc.api.app86.test" }) -public class SpringDocApp86Test extends AbstractSpringDocTest { +class SpringDocApp86Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/test/HelloController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/test/HelloController2.java index 6104e5e34..d90c176c3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/test/HelloController2.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/test/HelloController2.java @@ -31,7 +31,7 @@ * The type Hello controller 2. */ @RestController -public class HelloController2 { +class HelloController2 { /** * Test. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/HelloController.java index 2cd68d9af..54f05e75a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/HelloController.java @@ -34,7 +34,7 @@ * The type Hello controller. */ @RestController("cookie") -public class HelloController { +class HelloController { /** * Put item response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java index cff90bd03..4e42c27a7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 87 test. */ -public class SpringDocApp87Test extends AbstractSpringDocTest { +class SpringDocApp87Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/HelloController.java index d685409e6..7f0d0755a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/HelloController.java @@ -25,7 +25,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java index 0199bd7e2..a9a47dc5c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java @@ -27,7 +27,7 @@ * The type Spring doc app 88 test. */ @TestPropertySource(properties = "springdoc.auto-tag-classes=false") -public class SpringDocApp88Test extends AbstractSpringDocTest { +class SpringDocApp88Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/HelloController.java index 4632ccc8e..4f882cc2d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/HelloController.java @@ -30,7 +30,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Gets address. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java index 5d9db76b3..cc124b074 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java @@ -32,7 +32,7 @@ * The type Spring doc app 89 test. */ @TestPropertySource(properties = "springdoc.model-and-view-allowed=true") -public class SpringDocApp89Test extends AbstractSpringDocTest { +class SpringDocApp89Test extends AbstractSpringDocTest { static { getConfig().replaceWithSchema(ModelAndView.class, new ObjectSchema()); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApiController.java index b8e4ead91..304ec0fbb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApiController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApiController.java @@ -28,7 +28,7 @@ * The type My api controller. */ @RestController -public class MyApiController implements MyApi { +class MyApiController implements MyApi { /** * Get string. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java index 2e089f609..743b3482a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java @@ -25,7 +25,7 @@ /** * The type Spring doc app 9 test. */ -public class SpringDocApp9Test extends AbstractSpringDocTest { +class SpringDocApp9Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/HelloController.java index 315138062..ee39766e1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/HelloController.java @@ -34,7 +34,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Test 1. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java index 74a048dbf..08ea75648 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java @@ -24,6 +24,6 @@ /** * The type Spring doc app 90 test. */ -public class SpringDocApp90Test extends AbstractSpringDocTest { +class SpringDocApp90Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/User.java index adf7f1368..49a51389f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/User.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/User.java @@ -29,7 +29,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-11-30T09:49:26.034469-01:00[Atlantic/Azores]") -public class User { +class User { /** * The Id. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Advice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Advice.java index dcffbe6c7..fb5baf5cc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Advice.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Advice.java @@ -18,7 +18,7 @@ * The type Advice. */ @RestControllerAdvice -public class Advice { +class Advice { /** * Bad request response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/ApiError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/ApiError.java index 70a1ce2ec..4cf6bdcb3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/ApiError.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/ApiError.java @@ -11,7 +11,7 @@ name = "ApiError", title = "ApiError", description = "A consistent response object for sending errors over the wire.") -public class ApiError { +class ApiError { /** * The Status. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Greeting.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Greeting.java index 3603b8d86..fb37663f6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Greeting.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Greeting.java @@ -11,7 +11,7 @@ name = "Greeting", title = "Greeting", description = "An object containing a greeting message") -public class Greeting { +class Greeting { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/GreetingController.java index c19321462..edb144c15 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/GreetingController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/GreetingController.java @@ -17,7 +17,7 @@ */ @RestController @Tag(name = "Demo", description = "The Demo API") -public class GreetingController { +class GreetingController { /** * Say hello response entity. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/SpringDocApp91Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/SpringDocApp91Test.java index 6261c8529..23a390257 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/SpringDocApp91Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/SpringDocApp91Test.java @@ -28,7 +28,7 @@ * The type Spring doc app 91 test. */ @TestPropertySource(properties = "springdoc.override-with-generic-response=false") -public class SpringDocApp91Test extends AbstractSpringDocTest { +class SpringDocApp91Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/HelloController.java index 3690867ac..5c9ce3272 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/HelloController.java @@ -29,7 +29,7 @@ */ @RestController @RequestMapping("/test") -public class HelloController { +class HelloController { /** * Index string. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/ParameterCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/ParameterCustomizer.java index 095af2529..351251c49 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/ParameterCustomizer.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/ParameterCustomizer.java @@ -28,7 +28,7 @@ * The type Parameter customizer. */ @Component -public class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { +class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { /** * Customize parameter. * diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/SpringDocApp92Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/SpringDocApp92Test.java index f8790ce84..dbfbf1657 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/SpringDocApp92Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/SpringDocApp92Test.java @@ -26,7 +26,7 @@ /** * The type Spring doc app 92 test. */ -public class SpringDocApp92Test extends AbstractSpringDocTest { +class SpringDocApp92Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificClientModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificClientModel.java index 1b6aa1476..591bc5804 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificClientModel.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificClientModel.java @@ -5,7 +5,7 @@ /** * The type Specific client model. */ -public class SpecificClientModel extends BaseClientModel { +class SpecificClientModel extends BaseClientModel { /** * The Name. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificController.java index a5dad2a2e..8c45f0910 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificController.java @@ -6,4 +6,4 @@ * The type Specific controller. */ @RestController -public class SpecificController extends BaseController {} \ No newline at end of file +class SpecificController extends BaseController {} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpringDocApp93Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpringDocApp93Test.java index 75baedad0..40f48fb16 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpringDocApp93Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpringDocApp93Test.java @@ -26,7 +26,7 @@ /** * The type Spring doc app 93 test. */ -public class SpringDocApp93Test extends AbstractSpringDocTest { +class SpringDocApp93Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/Greeting.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/Greeting.java new file mode 100644 index 000000000..1cfca3a7a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/Greeting.java @@ -0,0 +1,37 @@ +package test.org.springdoc.api.app94; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Greeting. + */ +@Schema( + type = "object", + name = "Greeting", + title = "Greeting", + description = "An object containing a greeting message") +class Greeting { + + + /** + * The Payload. + */ + @Schema( + name = "payload", + description = "The greeting value", + type = "string", + nullable = false, + example = "sdfsdfs") + @JsonProperty("payload") + private String payload; + + /** + * Instantiates a new Greeting. + * + * @param payload the payload + */ + public Greeting(String payload) { + this.payload = payload; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/SpringDocApp94Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/SpringDocApp94Test.java index bf6d349cb..dad845771 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/SpringDocApp94Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/SpringDocApp94Test.java @@ -35,7 +35,6 @@ import org.springdoc.core.service.OperationService; import org.springdoc.webmvc.api.OpenApiWebMvcResource; import test.org.springdoc.api.AbstractSpringDocTest; -import test.org.springdoc.api.app91.Greeting; import org.springframework.beans.BeansException; import org.springframework.beans.factory.ObjectFactory; @@ -59,7 +58,7 @@ * The type Spring doc app 94 test. */ @TestPropertySource(properties = "springdoc.default-produces-media-type=application/json") -public class SpringDocApp94Test extends AbstractSpringDocTest { +class SpringDocApp94Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/HelloController.java index f91b2be8e..9e6bc3a9b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/HelloController.java @@ -12,7 +12,7 @@ */ @RestController @RequestMapping("/persons") -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/SpringDocApp95Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/SpringDocApp95Test.java index 179c81ea8..8f197c9c9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/SpringDocApp95Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/SpringDocApp95Test.java @@ -28,7 +28,7 @@ * The type Spring doc app 95 test. */ @ActiveProfiles("95") -public class SpringDocApp95Test extends AbstractSpringDocTest { +class SpringDocApp95Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/HelloController.java index f2dac3d0a..25c658079 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/HelloController.java @@ -29,7 +29,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/SpringDocApp96Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/SpringDocApp96Test.java index 3906f97e2..eb13e5e75 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/SpringDocApp96Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/SpringDocApp96Test.java @@ -26,7 +26,7 @@ /** * The type Spring doc app 96 test. */ -public class SpringDocApp96Test extends AbstractSpringDocTest { +class SpringDocApp96Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/HelloController.java index 6bed1304e..65986b5e0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/HelloController.java @@ -27,7 +27,7 @@ */ @RestController @RequestMapping("/api") -public class HelloController { +class HelloController { /** * Header v 1 student v 1. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/SpringDocApp97Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/SpringDocApp97Test.java index 28254d179..1340c442d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/SpringDocApp97Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/SpringDocApp97Test.java @@ -26,7 +26,7 @@ /** * The type Spring doc app 97 test. */ -public class SpringDocApp97Test extends AbstractSpringDocTest { +class SpringDocApp97Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV1.java index 76eccbbcb..5a6a5ae2d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV1.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV1.java @@ -5,7 +5,7 @@ /** * The type Student v 1. */ -public class StudentV1 { +class StudentV1 { /** * The Name. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV2.java index be99618e6..e76f0cb46 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV2.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV2.java @@ -5,7 +5,7 @@ /** * The type Student v 2. */ -public class StudentV2 { +class StudentV2 { /** * The Name. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV3.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV3.java index 41016cb35..9907b8544 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV3.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV3.java @@ -5,7 +5,7 @@ /** * The type Student v 3. */ -public class StudentV3 { +class StudentV3 { /** * The Name. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/HelloController.java index e8f9add1d..b5becd942 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/HelloController.java @@ -7,7 +7,7 @@ * The type Hello controller. */ @RestController -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/SpringDocApp98Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/SpringDocApp98Test.java index e0f2ef18c..cacfce2ac 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/SpringDocApp98Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/SpringDocApp98Test.java @@ -27,7 +27,7 @@ /** * The type Spring doc app 98 test. */ -public class SpringDocApp98Test extends AbstractSpringDocTest { +class SpringDocApp98Test extends AbstractSpringDocTest { static { SpringDocUtils.getConfig().addAnnotationsToIgnore(IgnoredAnnotationParameter.class); diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/HelloController.java index 29dbf07f3..5980368b2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/HelloController.java @@ -12,7 +12,7 @@ */ @RestController @RequestMapping("/persons") -public class HelloController { +class HelloController { /** * Persons. diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/SpringDocApp99Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/SpringDocApp99Test.java index 7b5477c8f..f7639bf8a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/SpringDocApp99Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/SpringDocApp99Test.java @@ -28,7 +28,7 @@ * The type Spring doc app 99 test. */ @ActiveProfiles("99") -public class SpringDocApp99Test extends AbstractSpringDocTest { +class SpringDocApp99Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index cdbfd68fd..010552690 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -57,7 +57,7 @@ public static String getContent(String fileName) { } @Test - public void testApp() throws Exception { + void testApp() throws Exception { String result = null; try { EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java index 4340e6ee1..b5e473e96 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java @@ -3,7 +3,7 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. + * * * * * Copyright 2019-2024 the original author or authors. * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt index 9f201c3d7..584d2f3ed 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt index f3de98487..78fda637e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt @@ -1,6 +1,6 @@ /* * - * * Copyright 2019-2022 the original author or authors. + * * Copyright 2019-2024 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index e7101fdaf..ca3eec8b9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -64,7 +64,7 @@ public static String getContent(String fileName) { } @Test - public void testApp() throws Exception { + void testApp() throws Exception { className = getClass().getSimpleName(); String testNumber = className.replaceAll("[^0-9]", ""); MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app3/SpringOauth2Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app3/SpringOauth2Test.java index 04d08e95a..210c3f908 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app3/SpringOauth2Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app3/SpringOauth2Test.java @@ -31,7 +31,7 @@ public class SpringOauth2Test { .withUserConfiguration(TestApp.class); @Test - public void configurations_successfully_loaded() { + void configurations_successfully_loaded() { contextRunner .run(context -> assertThat(context) .hasNotFailed() diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/AnotherPerson.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/AnotherPerson.java index 160873143..c70e2a495 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/AnotherPerson.java +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/AnotherPerson.java @@ -25,9 +25,6 @@ public class AnotherPerson { @Hidden private String name; - public AnotherPerson() { - } - public String getName() { return name; } diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json index 9ca244228..c06487ef1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json @@ -265,7 +265,7 @@ } }, "302": { - "description": "Moved Temporarily", + "description": "Found", "headers": { "Location": { "schema": { @@ -394,18 +394,36 @@ "OAuth2AuthorizationServerMetadata": { "type": "object", "properties": { - "token_endpoint_auth_methods_supported": { + "response_types_supported": { "type": "array", "items": { "type": "string" } }, - "revocation_endpoint_auth_methods_supported": { + "grant_types_supported": { "type": "array", "items": { "type": "string" } }, + "revocation_endpoint": { + "type": "string" + }, + "introspection_endpoint": { + "type": "string" + }, + "authorization_endpoint": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "token_endpoint": { + "type": "string" + }, + "issuer": { + "type": "string" + }, "introspection_endpoint_auth_methods_supported": { "type": "array", "items": { @@ -418,35 +436,17 @@ "type": "string" } }, - "authorization_endpoint": { - "type": "string" - }, - "token_endpoint": { - "type": "string" - }, - "response_types_supported": { + "token_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } }, - "introspection_endpoint": { - "type": "string" - }, - "revocation_endpoint": { - "type": "string" - }, - "grant_types_supported": { + "revocation_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } - }, - "issuer": { - "type": "string" - }, - "jwks_uri": { - "type": "string" } } }, @@ -456,6 +456,9 @@ "scope": { "type": "string" }, + "refresh_token": { + "type": "string" + }, "expires_in": { "type": "integer", "format": "int64" @@ -465,26 +468,19 @@ }, "access_token": { "type": "string" - }, - "refresh_token": { - "type": "string" } } }, "OAuth2TokenIntrospection": { "type": "object", "properties": { - "scope": { - "type": "string" - }, "jti": { "type": "string" }, - "exp": { - "type": "integer", - "format": "int64" + "scope": { + "type": "string" }, - "nbf": { + "iat": { "type": "integer", "format": "int64" }, @@ -500,21 +496,25 @@ "client_id": { "type": "string" }, - "username": { - "type": "string" + "exp": { + "type": "integer", + "format": "int64" }, "iss": { "type": "string" }, - "active": { - "type": "boolean" + "username": { + "type": "string" }, - "iat": { + "sub": { + "type": "string" + }, + "nbf": { "type": "integer", "format": "int64" }, - "sub": { - "type": "string" + "active": { + "type": "boolean" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json index 8d7a90106..9e089d0ab 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json @@ -265,7 +265,7 @@ } }, "302": { - "description": "Moved Temporarily", + "description": "Found", "headers": { "Location": { "schema": { @@ -474,18 +474,36 @@ "OAuth2AuthorizationServerMetadata": { "type": "object", "properties": { - "token_endpoint_auth_methods_supported": { + "response_types_supported": { "type": "array", "items": { "type": "string" } }, - "revocation_endpoint_auth_methods_supported": { + "grant_types_supported": { "type": "array", "items": { "type": "string" } }, + "revocation_endpoint": { + "type": "string" + }, + "introspection_endpoint": { + "type": "string" + }, + "authorization_endpoint": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "token_endpoint": { + "type": "string" + }, + "issuer": { + "type": "string" + }, "introspection_endpoint_auth_methods_supported": { "type": "array", "items": { @@ -498,35 +516,17 @@ "type": "string" } }, - "authorization_endpoint": { - "type": "string" - }, - "token_endpoint": { - "type": "string" - }, - "response_types_supported": { + "token_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } }, - "introspection_endpoint": { - "type": "string" - }, - "revocation_endpoint": { - "type": "string" - }, - "grant_types_supported": { + "revocation_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } - }, - "issuer": { - "type": "string" - }, - "jwks_uri": { - "type": "string" } } }, @@ -536,6 +536,9 @@ "scope": { "type": "string" }, + "refresh_token": { + "type": "string" + }, "expires_in": { "type": "integer", "format": "int64" @@ -545,26 +548,19 @@ }, "access_token": { "type": "string" - }, - "refresh_token": { - "type": "string" } } }, "OAuth2TokenIntrospection": { "type": "object", "properties": { - "scope": { - "type": "string" - }, "jti": { "type": "string" }, - "exp": { - "type": "integer", - "format": "int64" + "scope": { + "type": "string" }, - "nbf": { + "iat": { "type": "integer", "format": "int64" }, @@ -580,91 +576,95 @@ "client_id": { "type": "string" }, - "username": { - "type": "string" + "exp": { + "type": "integer", + "format": "int64" }, "iss": { "type": "string" }, - "active": { - "type": "boolean" + "username": { + "type": "string" }, - "iat": { + "sub": { + "type": "string" + }, + "nbf": { "type": "integer", "format": "int64" }, - "sub": { - "type": "string" + "active": { + "type": "boolean" } } }, "OidcProviderConfiguration": { "type": "object", "properties": { - "id_token_signing_alg_values_supported": { + "subject_types_supported": { "type": "string" }, - "token_endpoint_auth_methods_supported": { - "type": "array", - "items": { - "type": "string" - } - }, - "revocation_endpoint_auth_methods_supported": { + "response_types_supported": { "type": "array", "items": { "type": "string" } }, - "introspection_endpoint_auth_methods_supported": { + "grant_types_supported": { "type": "array", "items": { "type": "string" } }, - "code_challenge_methods_supported": { - "type": "array", - "items": { - "type": "string" - } + "revocation_endpoint": { + "type": "string" }, - "subject_types_supported": { + "introspection_endpoint": { "type": "string" }, - "scopes_supported": { + "authorization_endpoint": { "type": "string" }, "userinfo_endpoint": { "type": "string" }, - "authorization_endpoint": { + "jwks_uri": { + "type": "string" + }, + "scopes_supported": { "type": "string" }, "token_endpoint": { "type": "string" }, - "response_types_supported": { + "issuer": { + "type": "string" + }, + "introspection_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } }, - "introspection_endpoint": { - "type": "string" - }, - "revocation_endpoint": { - "type": "string" + "code_challenge_methods_supported": { + "type": "array", + "items": { + "type": "string" + } }, - "grant_types_supported": { + "token_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } }, - "issuer": { - "type": "string" + "revocation_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } }, - "jwks_uri": { + "id_token_signing_alg_values_supported": { "type": "string" } } diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json index a45d84f60..2acc281c9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json @@ -265,7 +265,7 @@ } }, "302": { - "description": "Moved Temporarily", + "description": "Found", "headers": { "Location": { "schema": { @@ -544,18 +544,36 @@ "OAuth2AuthorizationServerMetadata": { "type": "object", "properties": { - "token_endpoint_auth_methods_supported": { + "response_types_supported": { "type": "array", "items": { "type": "string" } }, - "revocation_endpoint_auth_methods_supported": { + "grant_types_supported": { "type": "array", "items": { "type": "string" } }, + "revocation_endpoint": { + "type": "string" + }, + "introspection_endpoint": { + "type": "string" + }, + "authorization_endpoint": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "token_endpoint": { + "type": "string" + }, + "issuer": { + "type": "string" + }, "introspection_endpoint_auth_methods_supported": { "type": "array", "items": { @@ -568,35 +586,17 @@ "type": "string" } }, - "authorization_endpoint": { - "type": "string" - }, - "token_endpoint": { - "type": "string" - }, - "response_types_supported": { + "token_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } }, - "introspection_endpoint": { - "type": "string" - }, - "revocation_endpoint": { - "type": "string" - }, - "grant_types_supported": { + "revocation_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } - }, - "issuer": { - "type": "string" - }, - "jwks_uri": { - "type": "string" } } }, @@ -606,6 +606,9 @@ "scope": { "type": "string" }, + "refresh_token": { + "type": "string" + }, "expires_in": { "type": "integer", "format": "int64" @@ -615,26 +618,19 @@ }, "access_token": { "type": "string" - }, - "refresh_token": { - "type": "string" } } }, "OAuth2TokenIntrospection": { "type": "object", "properties": { - "scope": { - "type": "string" - }, "jti": { "type": "string" }, - "exp": { - "type": "integer", - "format": "int64" + "scope": { + "type": "string" }, - "nbf": { + "iat": { "type": "integer", "format": "int64" }, @@ -650,91 +646,95 @@ "client_id": { "type": "string" }, - "username": { - "type": "string" + "exp": { + "type": "integer", + "format": "int64" }, "iss": { "type": "string" }, - "active": { - "type": "boolean" + "username": { + "type": "string" }, - "iat": { + "sub": { + "type": "string" + }, + "nbf": { "type": "integer", "format": "int64" }, - "sub": { - "type": "string" + "active": { + "type": "boolean" } } }, "OidcProviderConfiguration": { "type": "object", "properties": { - "id_token_signing_alg_values_supported": { + "subject_types_supported": { "type": "string" }, - "token_endpoint_auth_methods_supported": { - "type": "array", - "items": { - "type": "string" - } - }, - "revocation_endpoint_auth_methods_supported": { + "response_types_supported": { "type": "array", "items": { "type": "string" } }, - "introspection_endpoint_auth_methods_supported": { + "grant_types_supported": { "type": "array", "items": { "type": "string" } }, - "code_challenge_methods_supported": { - "type": "array", - "items": { - "type": "string" - } + "revocation_endpoint": { + "type": "string" }, - "subject_types_supported": { + "introspection_endpoint": { "type": "string" }, - "scopes_supported": { + "authorization_endpoint": { "type": "string" }, "userinfo_endpoint": { "type": "string" }, - "authorization_endpoint": { + "jwks_uri": { + "type": "string" + }, + "scopes_supported": { "type": "string" }, "token_endpoint": { "type": "string" }, - "response_types_supported": { + "issuer": { + "type": "string" + }, + "introspection_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } }, - "introspection_endpoint": { - "type": "string" - }, - "revocation_endpoint": { - "type": "string" + "code_challenge_methods_supported": { + "type": "array", + "items": { + "type": "string" + } }, - "grant_types_supported": { + "token_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" } }, - "issuer": { - "type": "string" + "revocation_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } }, - "jwks_uri": { + "id_token_signing_alg_values_supported": { "type": "string" } } @@ -742,19 +742,6 @@ "ClientRegistrationResponse": { "type": "object", "properties": { - "token_endpoint_auth_method": { - "type": "string" - }, - "id_token_signed_response_alg": { - "type": "string" - }, - "registration_access_token": { - "type": "string" - }, - "client_secret_expires_at": { - "type": "integer", - "format": "int64" - }, "registration_client_uri": { "type": "string" }, @@ -768,8 +755,11 @@ "type": "string" } }, - "client_secret": { - "type": "string" + "grant_types": { + "type": "array", + "items": { + "type": "string" + } }, "response_types": { "type": "array", @@ -777,42 +767,42 @@ "type": "string" } }, - "client_id": { - "type": "string" - }, "client_name": { "type": "string" }, "jwks_uri": { "type": "string" }, + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, "scope": { "type": "string" }, "token_endpoint_auth_signing_alg": { "type": "string" }, - "grant_types": { - "type": "array", - "items": { - "type": "string" - } + "client_secret_expires_at": { + "type": "integer", + "format": "int64" + }, + "registration_access_token": { + "type": "string" + }, + "id_token_signed_response_alg": { + "type": "string" + }, + "token_endpoint_auth_method": { + "type": "string" } } }, "ClientRegistrationRequest": { "type": "object", "properties": { - "token_endpoint_auth_method": { - "type": "string" - }, - "id_token_signed_response_alg": { - "type": "string" - }, - "client_secret_expires_at": { - "type": "string", - "format": "date-time" - }, "client_id_issued_at": { "type": "string", "format": "date-time" @@ -823,8 +813,11 @@ "type": "string" } }, - "client_secret": { - "type": "string" + "grant_types": { + "type": "array", + "items": { + "type": "string" + } }, "response_types": { "type": "array", @@ -832,26 +825,33 @@ "type": "string" } }, - "client_id": { - "type": "string" - }, "client_name": { "type": "string" }, "jwks_uri": { "type": "string" }, + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, "scope": { "type": "string" }, "token_endpoint_auth_signing_alg": { "type": "string" }, - "grant_types": { - "type": "array", - "items": { - "type": "string" - } + "client_secret_expires_at": { + "type": "string", + "format": "date-time" + }, + "id_token_signed_response_alg": { + "type": "string" + }, + "token_endpoint_auth_method": { + "type": "string" } } } From 4495df6741c2ad20c4cbe100724428d87694c1a0 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 6 Oct 2024 01:42:23 +0200 Subject: [PATCH 090/226] code review --- .../main/java/org/springdoc/webflux/api/OpenApiResource.java | 2 +- .../src/main/java/org/springdoc/webmvc/api/OpenApiResource.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java index 3f429163d..bf4bc8758 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java @@ -96,7 +96,7 @@ protected OpenApiResource(String groupName, ObjectFactory openAP * @param springDocConfigProperties the spring doc config properties * @param springDocProviders the spring doc providers */ - public OpenApiResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, + protected OpenApiResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers ) { diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java index 19f0d4be1..fd2519bcb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java @@ -102,7 +102,7 @@ protected OpenApiResource(String groupName, ObjectFactory openAP * @param springDocProviders the spring doc providers * @param springDocCustomizers the spring doc customizers */ - public OpenApiResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, + protected OpenApiResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers) { From c9d36fd1b46e75c8015abc0831ac9900d98d63a1 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 6 Oct 2024 01:54:01 +0200 Subject: [PATCH 091/226] code review --- .../DataRestDelegatingMethodParameterCustomizer.java | 2 -- .../org/springdoc/webflux/api/MultipleOpenApiResource.java | 4 +--- .../org/springdoc/webmvc/api/MultipleOpenApiResource.java | 4 +--- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java index c0dd89ea0..7b90c781d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java @@ -23,7 +23,6 @@ package org.springdoc.core.customizers; import java.lang.annotation.Annotation; -import java.lang.reflect.Field; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -128,7 +127,6 @@ public void customize(MethodParameter originalParameter, MethodParameter methodP */ private Optional getNewParameterAnnotationForField(MethodParameter methodParameter, PageableDefault pageableDefault, SortDefault sortDefault) { String parameterName = methodParameter.getParameterName(); - Field field; Parameter parameterNew; try { Parameter parameter = methodParameter.getContainingClass().getDeclaredField(parameterName).getAnnotation(Parameter.class); diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java index 3c3db0343..1637fa3ef 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java @@ -141,9 +141,7 @@ public void afterPropertiesSet() { springDocConfigProperties.addGroupConfig(groupConfig); return buildWebFluxOpenApiResource(item); }, - (existingValue, newValue) -> { - return existingValue; // choice to keep the existing value - } + (existingValue, newValue) -> existingValue // choice to keep the existing value )); } diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java index ce6503813..dee0d9d86 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java @@ -140,9 +140,7 @@ public void afterPropertiesSet() { springDocConfigProperties.addGroupConfig(groupConfig); return buildWebMvcOpenApiResource(item); }, - (existingValue, newValue) -> { - return existingValue; // choice to keep the existing value - } + (existingValue, newValue) -> existingValue // choice to keep the existing value )); } From 85e3dbe86b6d3d3d8d06f788fadab2a7cd4d2c12 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 6 Oct 2024 14:52:20 +0200 Subject: [PATCH 092/226] Javadoc / Copyright update --- .../api/AbstractOpenApiResource.java | 29 +-- .../java/org/springdoc/api/ErrorMessage.java | 26 +-- .../api/OpenApiResourceNotFoundException.java | 27 +-- .../core/annotations/ParameterObject.java | 27 +-- .../core/annotations/RouterOperation.java | 36 ++-- .../core/annotations/RouterOperations.java | 28 +-- .../CacheOrGroupedOpenApiCondition.java | 29 +-- .../MultipleOpenApiGroupsCondition.java | 29 +-- .../MultipleOpenApiSupportCondition.java | 29 +-- .../conditions/SpecPropertiesCondition.java | 26 +++ .../configuration/SpringDocConfiguration.java | 92 ++++----- .../SpringDocDataRestConfiguration.java | 68 +++---- ...SpringDocFunctionCatalogConfiguration.java | 29 +-- .../SpringDocGroovyConfiguration.java | 27 +-- .../SpringDocHateoasConfiguration.java | 37 ++-- ...ngDocJacksonKotlinModuleConfiguration.java | 28 ++- .../SpringDocJavadocConfiguration.java | 29 +-- .../SpringDocKotlinConfiguration.kt | 26 +++ .../SpringDocKotlinxConfiguration.java | 27 +-- .../SpringDocPageableConfiguration.java | 31 ++-- .../SpringDocRequiredModule.java | 28 +-- .../SpringDocSecurityConfiguration.java | 30 +-- .../SpringDocSecurityOAuth2Customizer.java | 40 +++- .../SpringDocSecurityOAuth2EndpointUtils.java | 26 +++ .../SpringDocSortConfiguration.java | 29 +-- .../SpringDocSpecPropertiesConfiguration.java | 68 ++++--- .../SpringDocUIConfiguration.java | 27 +-- .../hints/SpringDocDataRestHints.java | 32 ++-- .../configuration/hints/SpringDocHints.java | 30 +-- .../hints/SpringDocSecurityHints.java | 32 ++-- ...gDocOAuth2AuthorizationServerMetadata.java | 88 ++++++++- .../oauth2/SpringDocOAuth2Token.java | 53 +++++- .../SpringDocOAuth2TokenIntrospection.java | 90 ++++++++- ...pringDocOidcClientRegistrationRequest.java | 93 +++++++++- ...ringDocOidcClientRegistrationResponse.java | 103 ++++++++++- .../SpringDocOidcProviderConfiguration.java | 108 ++++++++++- ...pringdocActuatorBeanFactoryConfigurer.java | 29 +-- .../SpringdocBeanFactoryConfigurer.java | 26 +-- .../converters/AdditionalModelsConverter.java | 27 +-- .../CollectionModelContentConverter.java | 32 ++-- .../core/converters/ConverterUtils.java | 26 +-- .../core/converters/FileSupportConverter.java | 27 +-- .../converters/JavaTypeToIgnoreConverter.java | 27 +-- .../converters/ModelConverterRegistrar.java | 27 +-- .../core/converters/PageOpenAPIConverter.java | 41 ++-- .../converters/PageableOpenAPIConverter.java | 27 +-- .../converters/PolymorphicModelConverter.java | 33 ++-- .../PropertyCustomizingConverter.java | 27 +-- .../RepresentationModelLinksOASMixin.java | 27 +-- .../converters/ResponseSupportConverter.java | 27 +-- .../SchemaPropertyDeprecatingConverter.java | 27 +-- .../core/converters/SortOpenAPIConverter.java | 29 +-- .../converters/WebFluxSupportConverter.java | 27 +-- .../converters/models/DefaultPageable.java | 27 +-- .../converters/models/MonetaryAmount.java | 27 +-- .../core/converters/models/Pageable.java | 27 +-- .../models/PageableAsQueryParam.java | 27 +-- .../core/converters/models/Sort.java | 31 ++-- .../core/converters/models/SortObject.java | 27 +-- .../ActuatorOpenApiCustomizer.java | 41 ++-- .../ActuatorOperationCustomizer.java | 28 +-- ...stDelegatingMethodParameterCustomizer.java | 76 +++++--- .../DataRestRouterOperationCustomizer.java | 26 +++ .../DelegatingMethodParameterCustomizer.java | 28 +-- .../customizers/GlobalOpenApiCustomizer.java | 28 +-- .../GlobalOperationCustomizer.java | 28 +-- .../JavadocPropertyCustomizer.java | 29 +-- .../customizers/OpenApiBuilderCustomizer.java | 27 +-- .../core/customizers/OpenApiCustomizer.java | 28 +-- .../OpenApiHateoasLinksCustomizer.java | 27 +-- .../customizers/OpenApiLocaleCustomizer.java | 29 +-- .../core/customizers/OperationCustomizer.java | 30 +-- .../customizers/OperationIdCustomizer.java | 36 ++-- .../core/customizers/ParameterCustomizer.java | 29 +-- ...rameterObjectNamingStrategyCustomizer.java | 28 +-- .../core/customizers/PropertyCustomizer.java | 29 +-- .../QuerydslPredicateOperationCustomizer.java | 55 +++--- .../RouterOperationCustomizer.java | 28 ++- .../customizers/ServerBaseUrlCustomizer.java | 29 +-- .../customizers/SpecPropertiesCustomizer.java | 26 +-- .../customizers/SpringDocCustomizers.java | 46 ++--- .../springdoc/core/data/ControllerType.java | 37 ++-- .../core/data/DataRestOperationService.java | 96 +++++----- .../core/data/DataRestRepository.java | 31 ++-- .../core/data/DataRestRequestService.java | 77 ++++---- .../core/data/DataRestResponseService.java | 94 +++++----- .../data/DataRestRouterOperationService.java | 125 +++++++------ .../core/data/DataRestTagsService.java | 44 +++-- .../SpringDocParameterNameDiscoverer.java | 26 +-- .../extractor/DelegatingMethodParameter.java | 44 +++-- .../MethodParameterPojoExtractor.java | 42 +++-- .../filters/GlobalOpenApiMethodFilter.java | 28 +-- .../core/filters/OpenApiMethodFilter.java | 28 +-- .../fn/AbstractRouterFunctionVisitor.java | 41 ++-- .../fn/AbstractSpringdocRouteBuilder.java | 27 +-- .../springdoc/core/fn/RouterFunctionData.java | 29 +-- .../springdoc/core/fn/RouterOperation.java | 40 ++-- .../core/fn/builders/apiresponse/Builder.java | 33 ++-- .../core/fn/builders/arrayschema/Builder.java | 26 +-- .../core/fn/builders/content/Builder.java | 26 +-- .../discriminatormapping/Builder.java | 29 +-- .../core/fn/builders/encoding/Builder.java | 34 ++-- .../fn/builders/exampleobject/Builder.java | 27 +-- .../core/fn/builders/extension/Builder.java | 29 +-- .../builders/extensionproperty/Builder.java | 30 +-- .../externaldocumentation/Builder.java | 30 +-- .../core/fn/builders/header/Builder.java | 28 +-- .../core/fn/builders/link/Builder.java | 35 ++-- .../fn/builders/linkparameter/Builder.java | 29 +-- .../core/fn/builders/operation/Builder.java | 42 ++--- .../core/fn/builders/parameter/Builder.java | 43 ++--- .../core/fn/builders/requestbody/Builder.java | 34 ++-- .../core/fn/builders/schema/Builder.java | 28 +-- .../builders/securityrequirement/Builder.java | 29 +-- .../core/fn/builders/server/Builder.java | 31 ++-- .../fn/builders/servervariable/Builder.java | 33 ++-- .../core/mixins/SortedOpenAPIMixin.java | 29 +-- .../core/mixins/SortedOpenAPIMixin31.java | 29 +-- .../core/mixins/SortedSchemaMixin.java | 29 +-- .../core/mixins/SortedSchemaMixin31.java | 29 +-- .../core/models/ControllerAdviceInfo.java | 36 ++-- .../springdoc/core/models/GroupedOpenApi.java | 28 +-- .../core/models/MethodAdviceInfo.java | 26 +-- .../core/models/MethodAttributes.java | 54 +++--- .../springdoc/core/models/ParameterId.java | 31 ++-- .../springdoc/core/models/ParameterInfo.java | 36 ++-- .../core/models/RequestBodyInfo.java | 29 +-- .../AbstractSwaggerUiConfigProperties.java | 39 ++-- .../properties/SpringDocConfigProperties.java | 28 +-- .../properties/SwaggerUiConfigParameters.java | 33 ++-- .../properties/SwaggerUiConfigProperties.java | 29 +-- .../properties/SwaggerUiOAuthProperties.java | 27 +-- .../core/providers/ActuatorProvider.java | 33 ++-- .../core/providers/CloudFunctionProvider.java | 27 +-- .../core/providers/DataRestHalProvider.java | 32 ++-- .../core/providers/HateoasHalProvider.java | 29 +-- .../core/providers/JavadocProvider.java | 30 +-- .../core/providers/ObjectMapperProvider.java | 29 +-- .../RepositoryRestConfigurationProvider.java | 27 +-- .../RepositoryRestResourceProvider.java | 29 +-- .../providers/RouterFunctionProvider.java | 27 +-- .../providers/SecurityOAuth2Provider.java | 27 +-- .../SpringCloudFunctionProvider.java | 60 +++--- .../SpringDataWebPropertiesProvider.java | 27 +-- .../providers/SpringDocJavadocProvider.java | 27 +-- .../core/providers/SpringDocProviders.java | 40 ++-- .../SpringRepositoryRestResourceProvider.java | 67 +++---- .../core/providers/SpringWebProvider.java | 27 +-- .../WebConversionServiceProvider.java | 31 ++-- .../core/service/AbstractRequestService.java | 26 +-- .../core/service/GenericParameterService.java | 73 ++++---- .../core/service/GenericResponseService.java | 40 ++-- .../core/service/OpenAPIService.java | 29 +-- .../core/service/OperationService.java | 31 ++-- .../core/service/RequestBodyService.java | 100 +++++----- .../core/service/SecuritySchemePair.java | 27 +-- .../core/service/SecurityService.java | 41 ++-- .../org/springdoc/core/utils/Constants.java | 28 +-- .../org/springdoc/core/utils/EntityInfo.java | 27 +-- .../core/utils/PropertyResolverUtils.java | 39 ++-- .../core/utils/SpringDocAnnotationsUtils.java | 26 +-- .../core/utils/SpringDocDataRestUtils.java | 44 +++-- .../core/utils/SpringDocPropertiesUtils.java | 47 ++--- .../springdoc/core/utils/SpringDocUtils.java | 26 +-- .../ui/AbstractSwaggerIndexTransformer.java | 44 +++-- .../springdoc/ui/AbstractSwaggerWelcome.java | 32 ++-- .../springdoc/ui/SpringDocUIException.java | 29 +-- .../ui/SwaggerResourceResolverUtils.java | 26 +++ .../MethodParameterPojoExtractorTest.java | 43 +++++ .../api/MultipleOpenApiActuatorResource.java | 53 +++--- .../webflux/api/MultipleOpenApiResource.java | 40 ++-- .../api/MultipleOpenApiWebFluxResource.java | 53 +++--- .../webflux/api/OpenApiActuatorResource.java | 57 +++--- .../webflux/api/OpenApiResource.java | 75 ++++---- .../webflux/api/OpenApiWebfluxResource.java | 52 +++--- .../MultipleOpenApiSupportConfiguration.java | 56 +++--- .../SpringDocWebFluxConfiguration.java | 69 +++---- .../core/fn/SpringdocRouteBuilder.java | 175 +++++++++--------- .../providers/ActuatorWebFluxProvider.java | 37 ++-- .../core/providers/SpringWebFluxProvider.java | 27 +-- .../webflux/core/service/RequestService.java | 33 ++-- .../core/visitor/RouterFunctionVisitor.java | 27 +-- .../springdoc/webflux/ui/SwaggerConfig.java | 50 ++--- .../webflux/ui/SwaggerConfigResource.java | 27 +-- .../ui/SwaggerIndexPageTransformer.java | 34 ++-- .../webflux/ui/SwaggerIndexTransformer.java | 27 +-- .../webflux/ui/SwaggerResourceResolver.java | 28 ++- .../springdoc/webflux/ui/SwaggerUiHome.java | 27 +-- .../webflux/ui/SwaggerWebFluxConfigurer.java | 35 ++-- .../webflux/ui/SwaggerWelcomeActuator.java | 33 ++-- .../webflux/ui/SwaggerWelcomeCommon.java | 37 ++-- .../webflux/ui/SwaggerWelcomeWebFlux.java | 33 ++-- .../api/MultipleOpenApiActuatorResource.java | 49 ++--- .../webmvc/api/MultipleOpenApiResource.java | 40 ++-- .../api/MultipleOpenApiWebMvcResource.java | 52 +++--- .../webmvc/api/OpenApiActuatorResource.java | 57 +++--- .../springdoc/webmvc/api/OpenApiResource.java | 72 +++---- .../webmvc/api/OpenApiWebMvcResource.java | 53 +++--- .../MultipleOpenApiSupportConfiguration.java | 56 +++--- .../SpringDocWebMvcConfiguration.java | 73 ++++---- .../webmvc/core/fn/SpringdocRouteBuilder.java | 175 +++++++++--------- .../providers/ActuatorWebMvcProvider.java | 37 ++-- .../RouterFunctionWebMvcProvider.java | 28 +-- .../core/providers/SpringWebMvcProvider.java | 27 +-- .../webmvc/core/service/RequestService.java | 33 ++-- .../springdoc/webmvc/ui/SwaggerConfig.java | 49 ++--- .../webmvc/ui/SwaggerConfigResource.java | 27 +-- .../ui/SwaggerIndexPageTransformer.java | 34 ++-- .../webmvc/ui/SwaggerIndexTransformer.java | 27 +-- .../webmvc/ui/SwaggerResourceResolver.java | 28 ++- .../springdoc/webmvc/ui/SwaggerUiHome.java | 32 ++-- .../webmvc/ui/SwaggerWebMvcConfigurer.java | 33 ++-- .../webmvc/ui/SwaggerWelcomeActuator.java | 34 ++-- .../webmvc/ui/SwaggerWelcomeCommon.java | 33 ++-- .../webmvc/ui/SwaggerWelcomeWebMvc.java | 32 ++-- 215 files changed, 4950 insertions(+), 3420 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 5405dec81..c1ce2781a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.api; @@ -718,6 +720,7 @@ else if (routerOperation.getOperationModel() != null && StringUtils.isNotBlank(r * * @param routerOperation the router operation * @param locale the locale + * @param openAPI the open api */ protected void calculatePath(RouterOperation routerOperation, Locale locale, OpenAPI openAPI) { routerOperation = customizeDataRestRouterOperation(routerOperation); @@ -789,7 +792,9 @@ private RouterOperation customizeDataRestRouterOperation(RouterOperation routerO * @param consumes the consumes * @param produces the produces * @param headers the headers + * @param params the params * @param locale the locale + * @param openAPI the open api */ protected void calculatePath(HandlerMethod handlerMethod, String operationPath, Set requestMethods, String[] consumes, String[] produces, String[] headers, String[] params, Locale locale, OpenAPI openAPI) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java index 73dc72646..034d96972 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.api; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java index 1c4521f65..cff51003c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java @@ -3,29 +3,32 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.api; /** * The type Open api resource not found exception. + * * @author bnasslahsen */ public class OpenApiResourceNotFoundException extends RuntimeException { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java index a37784c94..6693bb7c6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.annotations; @@ -31,6 +33,7 @@ /** * The interface Parameter object. + * * @author bnasslahsen */ @Target({ ElementType.PARAMETER, ElementType.TYPE }) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java index 9b0a339dc..0a8540d50 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.annotations; @@ -48,6 +50,7 @@ /** * The path mapping URIs (e.g. {@code "/profile"}). * Path mapping URIs may contain placeholders (e.g. "/${profile_path}"). + * * @return the string */ String path() default ""; @@ -55,6 +58,7 @@ /** * The HTTP request methods to map to, narrowing the primary mapping: * GET, POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE. + * * @return the request method [ ] */ RequestMethod[] method() default {}; @@ -68,6 +72,7 @@ * consumes = {"text/plain", "application/*"} * consumes = MediaType.TEXT_PLAIN_VALUE * + * * @return the string [ ] */ String[] consumes() default {}; @@ -84,6 +89,7 @@ * produces = MediaType.TEXT_PLAIN_VALUE * produces = "text/plain;charset=UTF-8" * + * * @return the string [ ] */ String[] produces() default {}; @@ -93,6 +99,7 @@ *

Same format for any environment: a sequence of "My-Header=myValue" style * expressions, with a request only mapped if each such header is found * to have the given value. + * * @return the string [ ] */ String[] headers() default {}; @@ -101,24 +108,28 @@ * The parameters of the mapped request, narrowing the primary mapping. * Same format for any environment: a sequence of "myParam=myValue" style expressions, * with a request only mapped if each such parameter is found to have the given value. + * * @return the string [ ] */ String[] params() default {}; /** * The class of the Handler bean. + * * @return the class of the Bean */ Class beanClass() default Void.class; /** * The method of the handler Bean. + * * @return The method of the handler Bean. */ String beanMethod() default ""; /** * The parameters of the handler method. + * * @return The parameters of the handler method. */ Class[] parameterTypes() default {}; @@ -126,6 +137,7 @@ /** * The swagger operation description * Alias for {@link Operation}. + * * @return The operation */ Operation operation() default @Operation(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java index ef991b89b..f2241a337 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.annotations; @@ -36,7 +38,7 @@ * Container for repeatable {@link RouterOperation} annotation * * @author bnasslahsen - * @see RouterOperation + * @see RouterOperation */ @Target({ METHOD, ANNOTATION_TYPE }) @Retention(RetentionPolicy.RUNTIME) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java index 120010a80..b4d95e0ff 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.conditions; @@ -35,6 +37,7 @@ /** * The type Cache or grouped open api condition. + * * @author bnasslahsen */ public class CacheOrGroupedOpenApiCondition extends AnyNestedCondition { @@ -48,6 +51,7 @@ public class CacheOrGroupedOpenApiCondition extends AnyNestedCondition { /** * The type On multiple open api support condition. + * * @author bnasslahsen */ @Conditional(MultipleOpenApiSupportCondition.class) @@ -55,6 +59,7 @@ static class OnMultipleOpenApiSupportCondition {} /** * The type On cache disabled. + * * @author bnasslahsen */ @ConditionalOnProperty(name = SPRINGDOC_CACHE_DISABLED) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java index 98de041ca..27123ae9a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.conditions; @@ -36,6 +38,7 @@ /** * The type Multiple open api support condition. + * * @author bnasslahsen */ public class MultipleOpenApiGroupsCondition extends AnyNestedCondition { @@ -49,6 +52,7 @@ public class MultipleOpenApiGroupsCondition extends AnyNestedCondition { /** * The type On grouped open api bean. + * * @author bnasslahsen */ @ConditionalOnBean(GroupedOpenApi.class) @@ -56,6 +60,7 @@ static class OnGroupedOpenApiBean {} /** * The type On group config property. + * * @author bnasslahsen */ @ConditionalOnProperty(name = GROUP_CONFIG_FIRST_PROPERTY) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java index a6d2df521..77239a9f0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.conditions; @@ -34,6 +36,7 @@ /** * The type Multiple open api support condition. + * * @author bnasslashen */ public class MultipleOpenApiSupportCondition extends AnyNestedCondition { @@ -47,6 +50,7 @@ public class MultipleOpenApiSupportCondition extends AnyNestedCondition { /** * The type On multiple open api support condition. + * * @author bnasslahsen */ @Conditional(MultipleOpenApiGroupsCondition.class) @@ -54,6 +58,7 @@ static class OnMultipleOpenApiSupportCondition {} /** * The type On actuator different port. + * * @author bnasslashen */ @ConditionalOnManagementPort(ManagementPortType.DIFFERENT) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/SpecPropertiesCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/SpecPropertiesCondition.java index f7bc019fd..def8a40d9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/SpecPropertiesCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/SpecPropertiesCondition.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.conditions; /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 29610d961..15dcd9014 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ @@ -132,6 +134,7 @@ /** * The type Spring doc configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -270,13 +273,13 @@ PolymorphicModelConverter polymorphicModelConverter(ObjectMapperProvider objectM /** * Open api builder open api builder. * - * @param openAPI the open api - * @param securityParser the security parser + * @param openAPI the open api + * @param securityParser the security parser * @param springDocConfigProperties the spring doc config properties - * @param propertyResolverUtils the property resolver utils + * @param propertyResolverUtils the property resolver utils * @param openApiBuilderCustomisers the open api builder customisers - * @param serverBaseUrlCustomisers the server base url customisers - * @param javadocProvider the javadoc provider + * @param serverBaseUrlCustomisers the server base url customisers + * @param javadocProvider the javadoc provider * @return the open api builder */ @Bean @@ -306,9 +309,9 @@ ModelConverterRegistrar modelConverterRegistrar(Optional> m /** * Operation builder operation service. * - * @param parameterBuilder the parameter builder - * @param requestBodyService the request body service - * @param securityParser the security parser + * @param parameterBuilder the parameter builder + * @param requestBodyService the request body service + * @param securityParser the security parser * @param propertyResolverUtils the property resolver utils * @return the operation service */ @@ -324,8 +327,8 @@ OperationService operationBuilder(GenericParameterService parameterBuilder, Requ /** * Property resolver utils property resolver utils. * - * @param factory the factory - * @param messageSource the message source + * @param factory the factory + * @param messageSource the message source * @param springDocConfigProperties the spring doc config properties * @return the property resolver utils */ @@ -338,7 +341,8 @@ PropertyResolverUtils propertyResolverUtils(ConfigurableBeanFactory factory, Mes /** * Request body builder request body builder. * - * @param parameterBuilder the parameter builder + * @param parameterBuilder the parameter builder + * @param propertyResolverUtils the property resolver utils * @return the request body builder */ @Bean @@ -360,15 +364,15 @@ RequestBodyService requestBodyBuilder(GenericParameterService parameterBuilder, SecurityService securityParser(PropertyResolverUtils propertyResolverUtils) { return new SecurityService(propertyResolverUtils); } - + /** * Parameter builder generic parameter builder. * - * @param propertyResolverUtils the property resolver utils + * @param propertyResolverUtils the property resolver utils * @param optionalDelegatingMethodParameterCustomizers the optional list delegating method parameter customizer - * @param optionalWebConversionServiceProvider the optional web conversion service provider - * @param objectMapperProvider the object mapper provider - * @param javadocProvider the javadoc provider + * @param optionalWebConversionServiceProvider the optional web conversion service provider + * @param objectMapperProvider the object mapper provider + * @param javadocProvider the javadoc provider * @return the generic parameter builder */ @Bean @@ -402,13 +406,13 @@ GlobalOpenApiCustomizer propertiesResolverForSchema(OpenAPIService openAPIServic /** * Spring doc providers spring doc providers. * - * @param actuatorProvider the actuator provider - * @param springCloudFunctionProvider the spring cloud function provider - * @param springSecurityOAuth2Provider the spring security o auth 2 provider + * @param actuatorProvider the actuator provider + * @param springCloudFunctionProvider the spring cloud function provider + * @param springSecurityOAuth2Provider the spring security o auth 2 provider * @param repositoryRestResourceProvider the repository rest resource provider - * @param routerFunctionProvider the router function provider - * @param springWebProvider the spring web provider - * @param objectMapperProvider the object mapper provider + * @param routerFunctionProvider the router function provider + * @param springWebProvider the spring web provider + * @param objectMapperProvider the object mapper provider * @return the spring doc providers */ @Bean @@ -437,6 +441,7 @@ ObjectMapperProvider springdocObjectMapperProvider(SpringDocConfigProperties spr /** * The type Spring doc web mvc actuator configuration. + * * @author bnasslashen */ @ConditionalOnClass(WebEndpointProperties.class) @@ -446,7 +451,7 @@ static class SpringDocActuatorConfiguration { /** * Springdoc bean factory post processor 3 bean factory post processor. * - * @param groupedOpenApis the grouped open apis + * @param groupedOpenApis the grouped open apis * @return the bean factory post processor */ @Bean @@ -474,6 +479,7 @@ GlobalOperationCustomizer actuatorCustomizer(SpringDocConfigProperties springDoc /** * The type Web conversion service configuration. + * * @author bnasslashen */ @ConditionalOnClass(WebConversionService.class) @@ -552,6 +558,7 @@ WebFluxSupportConverter webFluxSupportConverter(ObjectMapperProvider objectMappe /** * The type Open api resource advice. + * * @author bnasslashen */ @RestControllerAdvice @@ -573,14 +580,14 @@ public ResponseEntity handleNoHandlerFound(OpenApiResourceNotFound /** * Spring doc customizers spring doc customizers. * - * @param openApiCustomizers the open api customizers - * @param operationCustomizers the operation customizers - * @param routerOperationCustomizers the router operation customizers + * @param openApiCustomizers the open api customizers + * @param operationCustomizers the operation customizers + * @param routerOperationCustomizers the router operation customizers * @param dataRestRouterOperationCustomizers the data rest router operation customizers - * @param methodFilters the method filters - * @param globalOpenApiCustomizers the global open api customizers - * @param globalOperationCustomizers the global operation customizers - * @param globalOpenApiMethodFilters the global open api method filters + * @param methodFilters the method filters + * @param globalOpenApiCustomizers the global open api customizers + * @param globalOperationCustomizers the global operation customizers + * @param globalOpenApiMethodFilters the global open api method filters * @return the spring doc customizers */ @Bean @@ -602,6 +609,7 @@ public SpringDocCustomizers springDocCustomizers(Optional /** * The type Querydsl provider. + * * @author bnasslashen */ @ConditionalOnClass(value = QuerydslBindingsFactory.class) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java index b8b6d5093..eca9faf04 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -76,6 +78,7 @@ /** * The type Spring doc data rest configuration. + * * @author bnasslashen */ @Lazy(false) @@ -91,8 +94,8 @@ public class SpringDocDataRestConfiguration { * Hal provider data rest hal provider. * * @param repositoryRestConfiguration the repository rest configuration - * @param hateoasPropertiesOptional the hateoas properties optional - * @param objectMapperProvider the object mapper provider + * @param hateoasPropertiesOptional the hateoas properties optional + * @param objectMapperProvider the object mapper provider * @return the data rest hal provider */ @Bean @@ -105,6 +108,7 @@ DataRestHalProvider halProvider(Optional repository /** * The type Spring repository rest resource provider configuration. + * * @author bnasslashen */ @Lazy(false) @@ -121,14 +125,14 @@ static class SpringRepositoryRestResourceProviderConfiguration { /** * Spring repository rest resource provider spring repository rest resource provider. * - * @param mappings the mappings - * @param repositories the repositories - * @param associations the associations - * @param applicationContext the application context + * @param mappings the mappings + * @param repositories the repositories + * @param associations the associations + * @param applicationContext the application context * @param dataRestRouterOperationService the data rest router operation service - * @param persistentEntities the persistent entities - * @param mapper the mapper - * @param springDocDataRestUtils the spring doc data rest utils + * @param persistentEntities the persistent entities + * @param mapper the mapper + * @param springDocDataRestUtils the spring doc data rest utils * @return the spring repository rest resource provider */ @Bean @@ -145,10 +149,10 @@ SpringRepositoryRestResourceProvider springRepositoryRestResourceProvider(Resour /** * Data rest router operation builder data rest router operation service. * - * @param dataRestOperationService the data rest operation service - * @param springDocConfigProperties the spring doc config properties + * @param dataRestOperationService the data rest operation service + * @param springDocConfigProperties the spring doc config properties * @param repositoryRestConfiguration the repository rest configuration - * @param dataRestHalProvider the data rest hal provider + * @param dataRestHalProvider the data rest hal provider * @return the data rest router operation service */ @Bean @@ -162,10 +166,10 @@ DataRestRouterOperationService dataRestRouterOperationBuilder(DataRestOperationS /** * Data rest operation builder data rest operation builder. * - * @param dataRestRequestService the data rest request builder - * @param tagsBuilder the tags builder + * @param dataRestRequestService the data rest request builder + * @param tagsBuilder the tags builder * @param dataRestResponseService the data rest response builder - * @param operationService the operation service + * @param operationService the operation service * @return the data rest operation builder */ @Bean @@ -180,10 +184,10 @@ DataRestOperationService dataRestOperationBuilder(DataRestRequestService dataRes * Data rest request builder data rest request builder. * * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer - * @param parameterBuilder the parameter builder - * @param requestBodyService the request body builder - * @param requestBuilder the request builder - * @param springDocDataRestUtils the spring doc data rest utils + * @param parameterBuilder the parameter builder + * @param requestBodyService the request body builder + * @param requestBuilder the request builder + * @param springDocDataRestUtils the spring doc data rest utils * @return the data rest request builder */ @Bean @@ -225,7 +229,7 @@ DataRestTagsService dataRestTagsBuilder(OpenAPIService openAPIService) { /** * Spring doc data rest utils spring doc data rest utils. * - * @param linkRelationProvider the link relation provider + * @param linkRelationProvider the link relation provider * @param repositoryRestConfiguration the repository rest configuration * @return the spring doc data rest utils */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java index 7d0ae1bc5..7db8ef5d0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -43,6 +45,7 @@ /** * The type Spring doc function catalog configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -56,7 +59,7 @@ public class SpringDocFunctionCatalogConfiguration { /** * Spring cloud function provider spring cloud function provider. * - * @param functionCatalog the function catalog + * @param functionCatalog the function catalog * @param springDocConfigProperties the spring doc config properties * @return the spring cloud function provider */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java index 347169643..c98ac1227 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -40,6 +42,7 @@ /** * The type Spring doc groovy configuration. + * * @author bnasslahsen */ @Lazy(false) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java index 120f91f44..f9ab95450 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -52,6 +54,7 @@ /** * The type Spring doc hateoas configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -66,7 +69,7 @@ public class SpringDocHateoasConfiguration { * Hateoas hal provider hateoas hal provider. * * @param hateoasPropertiesOptional the hateoas properties optional - * @param objectMapperProvider the object mapper provider + * @param objectMapperProvider the object mapper provider * @return the hateoas hal provider */ @Bean @@ -79,7 +82,7 @@ HateoasHalProvider hateoasHalProvider(Optional hateoasPropert /** * Collection model content converter collection model content converter. * - * @param halProvider the hal provider + * @param halProvider the hal provider * @param linkRelationProvider the link relation provider * @return the collection model content converter */ @@ -94,11 +97,11 @@ CollectionModelContentConverter collectionModelContentConverter(HateoasHalProvid * Registers an OpenApiCustomizer and a jackson mixin to ensure the definition of `Links` matches the serialized * output. This is done because the customer serializer converts the data to a map before serializing it. * - * @param halProvider the hal provider + * @param halProvider the hal provider * @param springDocConfigProperties the spring doc config properties - * @param objectMapperProvider the object mapper provider + * @param objectMapperProvider the object mapper provider * @return the open api customizer - * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) + * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) */ @Bean(Constants.LINKS_SCHEMA_CUSTOMISER) @ConditionalOnMissingBean(name = Constants.LINKS_SCHEMA_CUSTOMISER) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java index f325a73ba..bffa81467 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration; import com.fasterxml.jackson.module.kotlin.KotlinModule; @@ -30,8 +56,8 @@ public class SpringDocJacksonKotlinModuleConfiguration { * Instantiates a new objectMapperProvider with a kotlin module. * * @param springDocConfigProperties the spring doc config properties + * @return the object mapper provider */ - @Bean @Primary ObjectMapperProvider springdocKotlinObjectMapperProvider(SpringDocConfigProperties springDocConfigProperties) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java index 71beda859..9d94a0761 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -43,6 +45,7 @@ /** * The type Spring doc security configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -68,7 +71,7 @@ SpringDocJavadocProvider springDocJavadocProvider() { /** * Javadoc property customizer javadoc property customizer. * - * @param javadocProvider the javadoc provider + * @param javadocProvider the javadoc provider * @param objectMapperProvider the object mapper provider * @return the javadoc property customizer */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt index 609a594b3..dd0f423e8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration import io.swagger.v3.oas.annotations.Parameter diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java index b426496ca..62002637a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -37,6 +39,7 @@ /** * The type Spring doc kotlinx configuration. + * * @author bnasslahsen */ @Lazy(false) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java index 3fa1d389c..7f1e351de 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -52,6 +54,7 @@ /** * The type Spring doc pageable configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -80,6 +83,8 @@ PageableOpenAPIConverter pageableOpenAPIConverter(ObjectMapperProvider objectMap /** * Page open api converter. + * + * @param settings the settings * @param objectMapperProvider the object mapper provider * @return the page open api converter */ @@ -99,7 +104,7 @@ PageOpenAPIConverter pageOpenAPIConverter(Optional settin * Delegating method parameter customizer delegating method parameter customizer. * * @param optionalSpringDataWebPropertiesProvider the optional spring data web properties - * @param optionalRepositoryRestConfiguration the optional repository rest configuration + * @param optionalRepositoryRestConfiguration the optional repository rest configuration * @return the delegating method parameter customizer */ @Bean diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java index e53d078fb..64258a469 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java @@ -2,22 +2,26 @@ * * * * * * - * * * * Copyright 2019-2024 the original author or authors. * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. * * * * * - * + * */ package org.springdoc.core.configuration; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java index 29bd35eb7..ddbc478da 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -72,6 +74,7 @@ /** * The type Spring doc security configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -83,6 +86,9 @@ @ImportRuntimeHints(SpringDocSecurityHints.class) public class SpringDocSecurityConfiguration { + /** + * The constant LOGGER. + */ private static final Logger LOGGER = LoggerFactory.getLogger(SpringDocSecurityConfiguration.class); static { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java index eeda096a4..026287bfa 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration; import java.lang.reflect.Field; @@ -326,7 +352,7 @@ private void getOidcProviderConfigurationEndpoint(OpenAPI openAPI, SecurityFilte /** * Gets OpenID UserInfo endpoint filter * - * @param openAPI the open api + * @param openAPI the open api * @param securityFilterChain the security filter chain */ private void getOidcUserInfoEndpoint(OpenAPI openAPI, SecurityFilterChain securityFilterChain) { @@ -392,7 +418,7 @@ private Operation buildOperation(ApiResponses apiResponses) { * Build api responses api responses on success. * * @param apiResponses the api responses - * @param schema the schema + * @param schema the schema * @return the api responses */ private ApiResponses buildApiResponsesOnSuccess(ApiResponses apiResponses, Schema schema) { @@ -407,7 +433,7 @@ private ApiResponses buildApiResponsesOnSuccess(ApiResponses apiResponses, Schem * Build api responses api responses on created. * * @param apiResponses the api responses - * @param schema the schema + * @param schema the schema * @return the api responses */ private ApiResponses buildApiResponsesOnCreated(ApiResponses apiResponses, Schema schema) { @@ -460,11 +486,11 @@ private static void buildOAuth2Error(OpenAPI openAPI, ApiResponses apiResponses, /** * Build path. * - * @param oAuth2EndpointFilter the o auth 2 endpoint filter + * @param oAuth2EndpointFilter the o auth 2 endpoint filter * @param authorizationEndpointMatcher the authorization endpoint matcher - * @param openAPI the open api - * @param operation the operation - * @param requestMethod the request method + * @param openAPI the open api + * @param operation the operation + * @param requestMethod the request method */ private void buildPath(Object oAuth2EndpointFilter, String authorizationEndpointMatcher, OpenAPI openAPI, Operation operation, HttpMethod requestMethod) { try { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2EndpointUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2EndpointUtils.java index 7d9881357..dd7b1ba5f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2EndpointUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2EndpointUtils.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration; import java.util.Optional; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java index 68f378a88..f1f79de3c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -48,6 +50,7 @@ /** * The type Spring doc pageable configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -77,7 +80,7 @@ SortOpenAPIConverter sortOpenAPIConverter(ObjectMapperProvider objectMapperProvi * Delegating method parameter customizer delegating method parameter customizer. * * @param optionalSpringDataWebPropertiesProvider the optional spring data web properties - * @param optionalRepositoryRestConfiguration the optional repository rest configuration + * @param optionalRepositoryRestConfiguration the optional repository rest configuration * @return the delegating method parameter customizer */ @Bean diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java index 236260078..99136c420 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -53,13 +55,14 @@ @Conditional(SpecPropertiesCondition.class) public class SpringDocSpecPropertiesConfiguration { - /** - * Springdoc customizer that takes care of the specification string properties customization. - * Will be applied to general openapi schema. - * - * @return the springdoc customizer - */ - @Bean + /** + * Springdoc customizer that takes care of the specification string properties customization. + * Will be applied to general openapi schema. + * + * @param springDocConfigProperties the spring doc config properties + * @return the springdoc customizer + */ + @Bean @ConditionalOnMissingBean @Lazy(false) SpecPropertiesCustomizer specificationStringPropertiesCustomizer( @@ -68,13 +71,14 @@ SpecPropertiesCustomizer specificationStringPropertiesCustomizer( return new SpecPropertiesCustomizer(springDocConfigProperties); } - /** - * Bean post processor that applies the specification string properties customization to - * grouped openapi schemas by using group name as a prefix for properties. - * - * @return the bean post processor - */ - @Bean + /** + * Bean post processor that applies the specification string properties customization to + * grouped openapi schemas by using group name as a prefix for properties. + * + * @param springDocConfigProperties the spring doc config properties + * @return the bean post processor + */ + @Bean @ConditionalOnMissingBean @Lazy(false) SpecificationStringPropertiesCustomizerBeanPostProcessor specificationStringPropertiesCustomizerBeanPostProcessor( @@ -89,9 +93,17 @@ SpecificationStringPropertiesCustomizerBeanPostProcessor specificationStringProp */ private static class SpecificationStringPropertiesCustomizerBeanPostProcessor implements BeanPostProcessor { - private final SpringDocConfigProperties springDocConfigProperties; + /** + * The Spring doc config properties. + */ + private final SpringDocConfigProperties springDocConfigProperties; - public SpecificationStringPropertiesCustomizerBeanPostProcessor( + /** + * Instantiates a new Specification string properties customizer bean post processor. + * + * @param springDocConfigProperties the spring doc config properties + */ + public SpecificationStringPropertiesCustomizerBeanPostProcessor( SpringDocConfigProperties springDocConfigProperties ) { this.springDocConfigProperties = springDocConfigProperties; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java index 778798821..d54cb124c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration; @@ -43,6 +45,7 @@ /** * The type Spring doc Native Configuration. + * * @author bnasslahsen */ @Lazy(false) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java index a38ba0f9c..e15d4c5ff 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration.hints; @@ -36,11 +38,15 @@ /** * The type Spring doc DataRest hints. + * * @author bnasslahsen */ public class SpringDocDataRestHints implements RuntimeHintsRegistrar { - //spring-data-rest + /** + * The Spring data rest type names. + */ +//spring-data-rest static String[] springDataRestTypeNames = { "org.springframework.data.rest.webmvc.config.DelegatingHandlerMapping", "org.springframework.data.rest.webmvc.support.DelegatingHandlerMapping", "org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController", diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java index 3194617a1..55428fa3d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration.hints; @@ -82,10 +84,14 @@ /** * The type Spring doc hints. + * * @author bnasslahsen */ public class SpringDocHints implements RuntimeHintsRegistrar { + /** + * The Types to register. + */ static Class[] typesToRegister = { //swagger-models io.swagger.v3.oas.models.security.SecurityScheme.Type.class, diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java index 9af91a764..9bd3d02c5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configuration.hints; @@ -32,11 +34,15 @@ /** * The type Spring doc DataRest hints. + * * @author bnasslahsen */ public class SpringDocSecurityHints implements RuntimeHintsRegistrar { - //spring-security + /** + * The Spring security type names. + */ +//spring-security static String[] springSecurityTypeNames = { "org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter", "org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter", "org.springframework.security.web.util.matcher.OrRequestMatcher" diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2AuthorizationServerMetadata.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2AuthorizationServerMetadata.java index f16e14158..ad57c68a1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2AuthorizationServerMetadata.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2AuthorizationServerMetadata.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration.oauth2; import java.util.List; @@ -10,45 +36,105 @@ /** * The type Spring doc o auth 2 authorization server metadata. * - * @see OAuth2AuthorizationServerMetadata * @author bnasslahsen * @author yuta.saito + * @see OAuth2AuthorizationServerMetadata */ @Schema(name = "OAuth2AuthorizationServerMetadata") public interface SpringDocOAuth2AuthorizationServerMetadata { + /** + * Issuer string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.ISSUER) String issuer(); + /** + * Authorization endpoint string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.AUTHORIZATION_ENDPOINT) String authorizationEndpoint(); + /** + * Token endpoint string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.TOKEN_ENDPOINT) String tokenEndpoint(); + /** + * Token endpoint auth methods supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.TOKEN_ENDPOINT_AUTH_METHODS_SUPPORTED) List tokenEndpointAuthMethodsSupported(); + /** + * Jwks uri string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.JWKS_URI) String jwksUri(); + /** + * Response types supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.RESPONSE_TYPES_SUPPORTED) List responseTypesSupported(); + /** + * Grant types supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.GRANT_TYPES_SUPPORTED) List grantTypesSupported(); + /** + * Revocation endpoint string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.REVOCATION_ENDPOINT) String revocationEndpoint(); + /** + * Revocation endpoint auth methods supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.REVOCATION_ENDPOINT_AUTH_METHODS_SUPPORTED) List revocationEndpointAuthMethodsSupported(); + /** + * Introspection endpoint string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.INTROSPECTION_ENDPOINT) String introspectionEndpoint(); + /** + * Introspection endpoint auth methods supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.INTROSPECTION_ENDPOINT_AUTH_METHODS_SUPPORTED) List introspectionEndpointAuthMethodsSupported(); + /** + * Code challenge methods supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.CODE_CHALLENGE_METHODS_SUPPORTED) List codeChallengeMethodsSupported(); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2Token.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2Token.java index 4aedaf5ec..369fafc39 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2Token.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2Token.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration.oauth2; import com.fasterxml.jackson.databind.PropertyNamingStrategies; @@ -7,19 +33,44 @@ /** * The type Spring doc o auth 2 token. * - * @see DefaultOAuth2AccessTokenResponseMapConverter * @author yuta.saito + * @see DefaultOAuth2AccessTokenResponseMapConverter */ @Schema(name = "OAuth2Token") @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public interface SpringDocOAuth2Token { + /** + * Gets access token. + * + * @return the access token + */ String getAccessToken(); + /** + * Gets token type. + * + * @return the token type + */ String getTokenType(); + /** + * Gets expires in. + * + * @return the expires in + */ long getExpiresIn(); + /** + * Gets scope. + * + * @return the scope + */ String getScope(); + /** + * Gets refresh token. + * + * @return the refresh token + */ String getRefreshToken(); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2TokenIntrospection.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2TokenIntrospection.java index ae2cc9ee0..13b34a0b7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2TokenIntrospection.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2TokenIntrospection.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration.oauth2; import java.util.List; @@ -10,46 +36,106 @@ /** * The type Spring doc o auth 2 token introspection. * - * @see OAuth2TokenIntrospectionHttpMessageConverter - * @see OAuth2TokenIntrospection * @author bnasslahsen * @author yuta.saito + * @see OAuth2TokenIntrospectionHttpMessageConverter + * @see OAuth2TokenIntrospection */ @Schema(name = "OAuth2TokenIntrospection") public interface SpringDocOAuth2TokenIntrospection { + /** + * Gets active. + * + * @return the active + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.ACTIVE) boolean getActive(); + /** + * Gets scope. + * + * @return the scope + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.SCOPE) String getScope(); + /** + * Gets client id. + * + * @return the client id + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.CLIENT_ID) String getClientId(); + /** + * Gets username. + * + * @return the username + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.USERNAME) String getUsername(); + /** + * Gets token type. + * + * @return the token type + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.TOKEN_TYPE) String getTokenType(); + /** + * Gets expires at. + * + * @return the expires at + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.EXP) long getExpiresAt(); + /** + * Gets issue at. + * + * @return the issue at + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.IAT) long getIssueAt(); + /** + * Gets not before. + * + * @return the not before + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.NBF) long getNotBefore(); + /** + * Gets subject. + * + * @return the subject + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.SUB) String getSubject(); + /** + * Gets audience. + * + * @return the audience + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.AUD) List getAudience(); + /** + * Gets issuer. + * + * @return the issuer + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.ISS) String getIssuer(); + /** + * Gets id. + * + * @return the id + */ @JsonProperty(OAuth2TokenIntrospectionClaimNames.JTI) String getId(); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationRequest.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationRequest.java index 984d7539a..97c0c327d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationRequest.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationRequest.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration.oauth2; import java.time.Instant; @@ -11,48 +37,113 @@ /** * The type Spring doc OpenID Client Registration Request * + * @author yuta.saito * @see OidcClientRegistration * @see OidcClientRegistrationHttpMessageConverter - * @author yuta.saito */ @Schema(name = "ClientRegistrationRequest") public interface SpringDocOidcClientRegistrationRequest { + /** + * Client id string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_ID) String clientId(); + /** + * Client id issued at instant. + * + * @return the instant + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_ID_ISSUED_AT) Instant clientIdIssuedAt(); + /** + * Client secret string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_SECRET) String clientSecret(); + /** + * Client secret expires at instant. + * + * @return the instant + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_SECRET_EXPIRES_AT) Instant CLIENT_SECRET_EXPIRES_AT(); + /** + * Client name string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_NAME) String clientName(); + /** + * Redirect uris list. + * + * @return the list + */ @JsonProperty(OidcClientMetadataClaimNames.REDIRECT_URIS) List redirectUris(); + /** + * Token endpoint authentication method string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.TOKEN_ENDPOINT_AUTH_METHOD) String tokenEndpointAuthenticationMethod(); + /** + * Token endpoint authentication signing algorithm string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.TOKEN_ENDPOINT_AUTH_SIGNING_ALG) String tokenEndpointAuthenticationSigningAlgorithm(); + /** + * Grant types list. + * + * @return the list + */ @JsonProperty(OidcClientMetadataClaimNames.GRANT_TYPES) List grantTypes(); + /** + * Response type list. + * + * @return the list + */ @JsonProperty(OidcClientMetadataClaimNames.RESPONSE_TYPES) List responseType(); + /** + * Scopes string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.SCOPE) String scopes(); + /** + * Jwk set url string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.JWKS_URI) String jwkSetUrl(); + /** + * Id token signed response algorithm string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.ID_TOKEN_SIGNED_RESPONSE_ALG) String idTokenSignedResponseAlgorithm(); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationResponse.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationResponse.java index f62c8d0c0..ecd9d852b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationResponse.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationResponse.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration.oauth2; import java.util.List; @@ -10,54 +36,129 @@ /** * The type Spring doc OpenID Client Registration Request * + * @author yuta.saito * @see OidcClientRegistration * @see OidcClientRegistrationHttpMessageConverter - * @author yuta.saito */ @Schema(name = "ClientRegistrationResponse") public interface SpringDocOidcClientRegistrationResponse { + /** + * Client id string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_ID) String clientId(); + /** + * Client id issued at long. + * + * @return the long + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_ID_ISSUED_AT) long clientIdIssuedAt(); + /** + * Client secret string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_SECRET) String clientSecret(); + /** + * Client secret expires at long. + * + * @return the long + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_SECRET_EXPIRES_AT) long CLIENT_SECRET_EXPIRES_AT(); + /** + * Client name string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.CLIENT_NAME) String clientName(); + /** + * Redirect uris list. + * + * @return the list + */ @JsonProperty(OidcClientMetadataClaimNames.REDIRECT_URIS) List redirectUris(); + /** + * Token endpoint authentication method string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.TOKEN_ENDPOINT_AUTH_METHOD) String tokenEndpointAuthenticationMethod(); + /** + * Token endpoint authentication signing algorithm string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.TOKEN_ENDPOINT_AUTH_SIGNING_ALG) String tokenEndpointAuthenticationSigningAlgorithm(); + /** + * Grant types list. + * + * @return the list + */ @JsonProperty(OidcClientMetadataClaimNames.GRANT_TYPES) List grantTypes(); + /** + * Response type list. + * + * @return the list + */ @JsonProperty(OidcClientMetadataClaimNames.RESPONSE_TYPES) List responseType(); + /** + * Scopes string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.SCOPE) String scopes(); + /** + * Jwk set url string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.JWKS_URI) String jwkSetUrl(); + /** + * Id token signed response algorithm string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.ID_TOKEN_SIGNED_RESPONSE_ALG) String idTokenSignedResponseAlgorithm(); + /** + * Registration access token string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.REGISTRATION_ACCESS_TOKEN) String registrationAccessToken(); + /** + * Registration client url string. + * + * @return the string + */ @JsonProperty(OidcClientMetadataClaimNames.REGISTRATION_CLIENT_URI) String registrationClientUrl(); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcProviderConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcProviderConfiguration.java index 15f7f99c4..9cc97461a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcProviderConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcProviderConfiguration.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.configuration.oauth2; import java.util.List; @@ -11,56 +37,136 @@ /** * The type Spring doc OpenID Provider Configuration * - * @see OidcProviderConfiguration * @author yuta.saito + * @see OidcProviderConfiguration */ @Schema(name = "OidcProviderConfiguration") public interface SpringDocOidcProviderConfiguration { + /** + * Issuer string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.ISSUER) String issuer(); + /** + * Authorization endpoint string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.AUTHORIZATION_ENDPOINT) String authorizationEndpoint(); + /** + * Token endpoint string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.TOKEN_ENDPOINT) String tokenEndpoint(); + /** + * Token endpoint auth methods supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.TOKEN_ENDPOINT_AUTH_METHODS_SUPPORTED) List tokenEndpointAuthMethodsSupported(); + /** + * Jwks uri string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.JWKS_URI) String jwksUri(); + /** + * User info endpoint string. + * + * @return the string + */ @JsonProperty(OidcProviderMetadataClaimNames.USER_INFO_ENDPOINT) String userInfoEndpoint(); + /** + * Response types supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.RESPONSE_TYPES_SUPPORTED) List responseTypesSupported(); + /** + * Grant types supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.GRANT_TYPES_SUPPORTED) List grantTypesSupported(); + /** + * Revocation endpoint string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.REVOCATION_ENDPOINT) String revocationEndpoint(); + /** + * Revocation endpoint auth methods supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.REVOCATION_ENDPOINT_AUTH_METHODS_SUPPORTED) List revocationEndpointAuthMethodsSupported(); + /** + * Introspection endpoint string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.INTROSPECTION_ENDPOINT) String introspectionEndpoint(); + /** + * Introspection endpoint auth methods supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.INTROSPECTION_ENDPOINT_AUTH_METHODS_SUPPORTED) List introspectionEndpointAuthMethodsSupported(); + /** + * Subject types supported string. + * + * @return the string + */ @JsonProperty(OidcProviderMetadataClaimNames.SUBJECT_TYPES_SUPPORTED) String subjectTypesSupported(); + /** + * Id token signing alg values supported string. + * + * @return the string + */ @JsonProperty(OidcProviderMetadataClaimNames.ID_TOKEN_SIGNING_ALG_VALUES_SUPPORTED) String idTokenSigningAlgValuesSupported(); + /** + * Scope supported string. + * + * @return the string + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.SCOPES_SUPPORTED) String scopeSupported(); + /** + * Code challenge methods supported list. + * + * @return the list + */ @JsonProperty(OAuth2AuthorizationServerMetadataClaimNames.CODE_CHALLENGE_METHODS_SUPPORTED) List codeChallengeMethodsSupported(); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java index d78d8abc7..6e5294201 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configurer; @@ -46,6 +48,7 @@ /** * The type Springdoc bean factory configurer. + * * @author bnasslahsen */ public class SpringdocActuatorBeanFactoryConfigurer extends SpringdocBeanFactoryConfigurer { @@ -58,7 +61,7 @@ public class SpringdocActuatorBeanFactoryConfigurer extends SpringdocBeanFactory /** * Instantiates a new Springdoc actuator bean factory configurer. * - * @param groupedOpenApis the grouped open apis + * @param groupedOpenApis the grouped open apis */ public SpringdocActuatorBeanFactoryConfigurer(List groupedOpenApis) { this.groupedOpenApis = groupedOpenApis; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java index 6ed140f99..845b389f3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.configurer; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java index af8a63c0d..1e8b673dc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -41,6 +43,7 @@ /** * The type Additional models converter. + * * @author bnasslahsen */ public class AdditionalModelsConverter implements ModelConverter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java index 2b0fddb90..72adf3a81 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -46,8 +48,8 @@ * Override resolved schema as there is a custom serializer that converts the data to a map before serializing it. * * @author bnasslahsen - * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer - * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider) org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider) + * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer + * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider) org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalResourcesSerializer#serialize(Collection, JsonGenerator, SerializerProvider) */ public class CollectionModelContentConverter implements ModelConverter { @@ -85,7 +87,7 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iter /** * Gets entity type. * - * @param type the type + * @param type the type * @return the entity type */ private Class getEntityType(AnnotatedType type) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java index a7922e4db..247bc235e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java index 6ae2db5bc..8d5fce596 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -40,6 +42,7 @@ /** * The type File support converter. + * * @author bnasslahsen */ public class FileSupportConverter implements ModelConverter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java index c7a9f8dfa..b40659070 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -35,6 +37,7 @@ /** * The type Request type to ignore converter. + * * @author bnasslahsen */ public class JavaTypeToIgnoreConverter implements ModelConverter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java index 8436dd269..0cc94cb40 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -36,6 +38,7 @@ /** * Wrapper for model converters to only register converters once + * * @author bnasslahsen */ public class ModelConverterRegistrar { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java index 63aaca0a8..2799e5077 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java @@ -2,22 +2,26 @@ * * * * * * - * * * * Copyright 2019-2024 the original author or authors. * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. * * * * * - * + * */ package org.springdoc.core.converters; @@ -44,6 +48,9 @@ */ public class PageOpenAPIConverter implements ModelConverter { + /** + * The constant PAGE_TO_REPLACE. + */ private static final String PAGE_TO_REPLACE = "org.springframework.data.domain.Page"; /** @@ -55,6 +62,7 @@ public class PageOpenAPIConverter implements ModelConverter { * The Spring doc object mapper. */ private final ObjectMapperProvider springDocObjectMapper; + /** * Flag to replace Page with PagedModel or not. */ @@ -62,8 +70,9 @@ public class PageOpenAPIConverter implements ModelConverter { /** * Instantiates a new Page open api converter. + * * @param replacePageWithPagedModel flag to replace Page with PagedModel or not - * @param springDocObjectMapper the spring doc object mapper + * @param springDocObjectMapper the spring doc object mapper */ public PageOpenAPIConverter(boolean replacePageWithPagedModel, ObjectMapperProvider springDocObjectMapper) { this.replacePageWithPagedModel = replacePageWithPagedModel; @@ -92,6 +101,12 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; } + /** + * Resolve paged model type annotated type. + * + * @param type the type + * @return the annotated type + */ private AnnotatedType resolvePagedModelType(AnnotatedType type) { Type pageType = type.getType(); if (pageType instanceof ParameterizedType) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java index 163345c24..2faf74dd0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -37,6 +39,7 @@ /** * The Pageable Type models converter. + * * @author bnasslahsen */ public class PageableOpenAPIConverter implements ModelConverter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index fb49bec38..12cec2add 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -86,6 +88,13 @@ public static void addParentType(String... parentTypes) { PARENT_TYPES_TO_IGNORE.addAll(List.of(parentTypes)); } + /** + * Gets resolved schema. + * + * @param javaType the java type + * @param resolvedSchema the resolved schema + * @return the resolved schema + */ private Schema getResolvedSchema(JavaType javaType, Schema resolvedSchema) { if (resolvedSchema instanceof ObjectSchema && resolvedSchema.getProperties() != null) { if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getName())) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java index 020efa3a1..188f97537 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -36,6 +38,7 @@ /** * The type Property customizing converter. + * * @author bnasslahsen */ public class PropertyCustomizingConverter implements ModelConverter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java index 9628be23b..cfdc65127 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -32,6 +34,7 @@ /** * The type Representation model links oas mixin. + * * @author bnasslahsen */ public abstract class RepresentationModelLinksOASMixin extends RepresentationModelMixin { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java index 44c3b6bc1..b820589ef 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -43,6 +45,7 @@ /** * The type Response support converter. + * * @author bnasslahsen */ public class ResponseSupportConverter implements ModelConverter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java index 1a644b918..d08f6c7dd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -41,6 +43,7 @@ /** * The type Schema property deprecating converter. + * * @author bnasslahsen */ public class SchemaPropertyDeprecatingConverter implements ModelConverter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java index cb51bb9ac..5dc533013 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -42,6 +44,9 @@ */ public class SortOpenAPIConverter implements ModelConverter { + /** + * The constant SORT_TO_REPLACE. + */ private static final String SORT_TO_REPLACE = "org.springframework.data.domain.Sort"; /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java index 823e72483..434d8ff02 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -44,6 +46,7 @@ /** * The type Web flux support converter. + * * @author bnasslahsen */ public class WebFluxSupportConverter implements ModelConverter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java index 67fe3f87a..fa59c38b7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters.models; @@ -30,6 +32,7 @@ /** * The type Default pageable. + * * @author bnasslahsen */ @ParameterObject diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java index 9fc5b1564..2b63c3a14 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters.models; @@ -31,6 +33,7 @@ /** * The type Monetary amount. + * * @author bnasslahsen */ @Schema diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java index 5d238563d..cd5d5b601 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters.models; @@ -34,6 +36,7 @@ /** * The type Pageable. + * * @author bnasslahsen */ public class Pageable { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java index 451051900..ebd89348e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters.models; @@ -36,6 +38,7 @@ /** * The interface Pageable as query param. + * * @author bnasslahsen */ @Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE }) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java index 3e63067af..16ea63f3b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java @@ -2,22 +2,26 @@ * * * * * * - * * * * Copyright 2019-2024 the original author or authors. * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. * * * * * - * + * */ package org.springdoc.core.converters.models; @@ -31,7 +35,8 @@ /** * The Sort type. - * @author daniel-shuy + * + * @author daniel -shuy */ public class Sort { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java index 7190df2a1..131adef31 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.converters.models; @@ -29,6 +31,7 @@ /** * The type Sort response. + * * @author bnasslahsen */ @ArraySchema(arraySchema = @Schema(implementation = SortObject.class)) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java index 9ce0092c6..27d85889a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -39,9 +41,10 @@ /** * The type Actuator open api customizer. + * * @author bnasslahsen - * @deprecated as not anymore required, use your own {@link org.springdoc.core.customizers.GlobalOpenApiCustomizer} instead * @since 2.7.0 + * @deprecated as not anymore required, use your own {@link org.springdoc.core.customizers.GlobalOpenApiCustomizer} instead */ @Deprecated(since = "2.7.0") public class ActuatorOpenApiCustomizer implements GlobalOpenApiCustomizer { @@ -61,6 +64,13 @@ public ActuatorOpenApiCustomizer(WebEndpointProperties webEndpointProperties) { this.webEndpointProperties = webEndpointProperties; } + /** + * Actuator path entry stream stream. + * + * @param openApi the open api + * @param relativeSubPath the relative sub path + * @return the stream + */ private Stream> actuatorPathEntryStream(OpenAPI openApi, String relativeSubPath) { String pathPrefix = webEndpointProperties.getBasePath() + Optional.ofNullable(relativeSubPath).orElse(""); return Optional.ofNullable(openApi.getPaths()) @@ -70,6 +80,11 @@ private Stream> actuatorPathEntryStream(OpenAPI openApi, .orElse(Stream.empty()); } + /** + * Handle actuator operation id uniqueness. + * + * @param openApi the open api + */ private void handleActuatorOperationIdUniqueness(OpenAPI openApi) { Set usedOperationIds = new HashSet<>(); actuatorPathEntryStream(openApi, null) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java index 2a85043aa..8843ac3b5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -111,7 +113,7 @@ public Operation customize(Operation operation, HandlerMethod handlerMethod) { private boolean operationHasValidTag(Operation operation) { return operation.getTags() != null && operation.getTags().contains(getTag().getName()); } - + /** * Process operation field. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java index 7b90c781d..6aea22f12 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java @@ -2,22 +2,26 @@ * * * * * * - * * * * Copyright 2019-2024 the original author or authors. * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. * * * * * - * + * */ package org.springdoc.core.customizers; @@ -84,7 +88,7 @@ public class DataRestDelegatingMethodParameterCustomizer implements DelegatingMe /** * Instantiates a new Data rest delegating method parameter customizer. * - * @param optionalSpringDataWebPropertiesProvider the optional spring data web properties provider + * @param optionalSpringDataWebPropertiesProvider the optional spring data web properties provider * @param optionalRepositoryRestConfigurationProvider the optional repository rest configuration provider */ public DataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfigurationProvider) { @@ -123,6 +127,7 @@ public void customize(MethodParameter originalParameter, MethodParameter methodP * * @param methodParameter the method parameter * @param pageableDefault the pageable default + * @param sortDefault the sort default * @return the new parameter annotation for field */ private Optional getNewParameterAnnotationForField(MethodParameter methodParameter, PageableDefault pageableDefault, SortDefault sortDefault) { @@ -1034,7 +1039,7 @@ public String ref() { * Gets name. * * @param parameterName the parameter name - * @param originalName the original name + * @param originalName the original name * @return the name */ private String getName(String parameterName, String originalName) { @@ -1079,7 +1084,7 @@ else if (isSpringDataWebPropertiesPresent()) /** * Gets description. * - * @param parameterName the parameter name + * @param parameterName the parameter name * @param originalDescription the original description * @return the description */ @@ -1093,8 +1098,8 @@ private String getDescription(String parameterName, String originalDescription) /** * Gets default value. * - * @param parameterName the parameter name - * @param pageableDefault the pageable default + * @param parameterName the parameter name + * @param pageableDefault the pageable default * @param defaultSchemaVal the default schema val * @return the default value */ @@ -1143,9 +1148,9 @@ else if (isSpringDataWebPropertiesPresent() && optionalSpringDataWebPropertiesPr /** * Gets default value. * - * @param parameterName the parameter name - * @param pageableDefault the pageable default - * @param sortDefault the sort default + * @param parameterName the parameter name + * @param pageableDefault the pageable default + * @param sortDefault the sort default * @param defaultSchemaVal the default schema val * @return the default value */ @@ -1170,7 +1175,7 @@ private String getArrayDefaultValue(String parameterName, PageableDefault pageab * Gets default sort. * * @param pageableDefault the pageable default - * @param sortDefault the sort default + * @param sortDefault the sort default * @return the default sort */ private DefaultSort getDefaultSort(PageableDefault pageableDefault, SortDefault sortDefault) { @@ -1225,23 +1230,52 @@ private boolean isRepositoryRestConfigurationPresent() { return optionalRepositoryRestConfigurationProvider.isPresent() && optionalRepositoryRestConfigurationProvider.get().isRepositoryRestConfigurationPresent(); } + /** + * The type Default sort. + */ private static class DefaultSort { + /** + * The constant DIRECTION_GROUP. + */ private static final String DIRECTION_GROUP = Arrays.stream(Sort.Direction.values()).map(Enum::name).collect(Collectors.joining("|")); + /** + * The constant DIRECTED_REGEXP. + */ private static final String DIRECTED_REGEXP = "\\w+(\\.\\w+)*,\\s*(" + DIRECTION_GROUP + ')'; + /** + * The constant DIRECTED_PATTERN. + */ private static final Pattern DIRECTED_PATTERN = Pattern.compile(DIRECTED_REGEXP, Pattern.CASE_INSENSITIVE); + /** + * The Direction. + */ private final Sort.Direction direction; + /** + * The Properties. + */ private final String[] properties; + /** + * Instantiates a new Default sort. + * + * @param direction the direction + * @param properties the properties + */ DefaultSort(Sort.Direction direction, String... properties) { this.direction = direction; this.properties = properties; } + /** + * Gets effective properties. + * + * @return the effective properties + */ List getEffectiveProperties() { return Arrays.stream(properties) .map(p -> { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestRouterOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestRouterOperationCustomizer.java index b9f968a4d..51a79aaec 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestRouterOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestRouterOperationCustomizer.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.customizers; import org.springdoc.core.fn.RouterOperation; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java index 5aca346cf..0c1cc5cb4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -36,7 +38,7 @@ public interface DelegatingMethodParameterCustomizer { * Customize. * * @param originalParameter the original parameter - * @param methodParameter the method parameter + * @param methodParameter the method parameter */ void customize(MethodParameter originalParameter, MethodParameter methodParameter); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java index 8d7d1dae0..134fc371c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -29,7 +31,7 @@ * customize Open api on default OpenAPI description and groups. * * @author christophejan - * @see OpenApiCustomizer customize default OpenAPI description but not groups + * @see OpenApiCustomizercustomize default OpenAPI description but not groups */ public interface GlobalOpenApiCustomizer extends OpenApiCustomizer { } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java index 0c6292dba..256241631 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -30,7 +32,7 @@ * description and groups * * @author christophejan - * @see OperationCustomizer customize operations on default OpenAPI description but not groups + * @see OperationCustomizercustomize operations on default OpenAPI description but not groups */ public interface GlobalOperationCustomizer extends OperationCustomizer { } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java index 7e92ec5fb..fd76c76a4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2023 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -65,6 +67,9 @@ public record JavadocPropertyCustomizer(JavadocProvider javadocProvider, ObjectMapperProvider objectMapperProvider) implements ModelConverter { + /** + * The constant LOGGER. + */ private static final Logger LOGGER = LoggerFactory.getLogger(DelegatingMethodParameter.class); /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java index 5d5e73b5b..b1b673a25 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -28,6 +30,7 @@ /** * The interface Open api builder customizer. + * * @author bnasslahsen */ @FunctionalInterface diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java index 7dc5d1d0f..3f78c286d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -31,7 +33,7 @@ * Open api on default OpenAPI description but not on groups * * @author bnasslahsen - * @see GlobalOpenApiCustomizer customize default OpenAPI description and groups + * @see GlobalOpenApiCustomizercustomize default OpenAPI description and groups */ @FunctionalInterface public interface OpenApiCustomizer { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java index f968dd408..bb77dab38 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -39,6 +41,7 @@ /** * The type Open api hateoas links customiser. + * * @author bnasslahsen */ public class OpenApiHateoasLinksCustomizer extends SpecFilter implements GlobalOpenApiCustomizer { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java index 2e1cb4aa3..4ee54f1fd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -30,6 +32,7 @@ /** * The interface Open api locale customizer. + * * @author bnasslahsen */ @FunctionalInterface @@ -39,7 +42,7 @@ public interface OpenApiLocaleCustomizer { * Customise. * * @param openApi the open api - * @param locale the locale + * @param locale the locale */ void customise(OpenAPI openApi, Locale locale); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java index 3db7b105d..c4f7026d1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -34,7 +36,7 @@ * groups * * @author bnasslahsen - * @see GlobalOperationCustomizer customize operations on default OpenAPI description and groups + * @see GlobalOperationCustomizercustomize operations on default OpenAPI description and groups */ @FunctionalInterface public interface OperationCustomizer { @@ -42,7 +44,7 @@ public interface OperationCustomizer { /** * Customize operation. * - * @param operation input operation + * @param operation input operation * @param handlerMethod original handler method * @return customized operation */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java index 488fac57c..58bf1a162 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -31,6 +33,8 @@ import io.swagger.v3.oas.models.PathItem; /** + * The type Operation id customizer. + * * @author bnasslahsen */ public class OperationIdCustomizer implements GlobalOpenApiCustomizer { @@ -56,7 +60,13 @@ public void customise(OpenAPI openApi) { } } - // Helper method to process each operation and handle duplicate operationId + /** + * Process operation. + * + * @param operation the operation + * @param operationIdCount the operation id count + */ +// Helper method to process each operation and handle duplicate operationId private void processOperation(Operation operation, Map operationIdCount) { if (operation != null) { String originalOperationId = operation.getOperationId(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java index 4eb65bd2f..61fc363cc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -31,6 +33,7 @@ /** * Implement and register a bean of type {@link ParameterCustomizer} to customize a parameter * based on the parameter and handler method input + * * @author bnasslahsen */ @FunctionalInterface @@ -38,7 +41,7 @@ public interface ParameterCustomizer { /** * Customize parameter. * - * @param parameterModel to be customized + * @param parameterModel to be customized * @param methodParameter original parameter from handler method * @return customized parameter */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java index f73f33e93..464dcef43 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java @@ -2,22 +2,26 @@ * * * * * * - * * * * Copyright 2019-2024 the original author or authors. * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. * * * * * - * + * */ package org.springdoc.core.customizers; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java index f9e50878d..ebbb9b3b5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -30,6 +32,7 @@ /** * Implement and register a bean of type {@link PropertyCustomizer} to customize a schema property * based on annotated type + * * @author bnasslahsen */ @FunctionalInterface @@ -39,7 +42,7 @@ public interface PropertyCustomizer { * Customize schema. * * @param property to be customized - * @param type form the model class + * @param type form the model class * @return customized property */ Schema customize(Schema property, AnnotatedType type); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java index 401f0d2e4..c06aee89d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -62,6 +64,7 @@ /** * The type Querydsl predicate operation customizer. + * * @author Gibah Joseph Email: gibahjoe@gmail.com Mar, 2020 */ @SuppressWarnings("unchecked") @@ -149,8 +152,8 @@ public Operation customize(Operation operation, HandlerMethod handlerMethod) { /** * Gets field value of boolean. * - * @param instance the instance - * @param fieldName the field name + * @param instance the instance + * @param fieldName the field name * @return the field value of boolean */ private boolean getFieldValueOfBoolean(QuerydslBindings instance, String fieldName) { @@ -165,7 +168,7 @@ private boolean getFieldValueOfBoolean(QuerydslBindings instance, String fieldNa /** * Extract qdsl bindings querydsl bindings. * - * @param predicate the predicate + * @param predicate the predicate * @return the querydsl bindings */ private QuerydslBindings extractQdslBindings(QuerydslPredicate predicate) { @@ -184,9 +187,9 @@ private QuerydslBindings extractQdslBindings(QuerydslPredicate predicate) { /** * Gets field values. * - * @param instance the instance - * @param fieldName the field name - * @param alternativeFieldName the alternative field name + * @param instance the instance + * @param fieldName the field name + * @param alternativeFieldName the alternative field name * @return the field values */ private Set getFieldValues(QuerydslBindings instance, String fieldName, String alternativeFieldName) { @@ -206,8 +209,8 @@ private Set getFieldValues(QuerydslBindings instance, String fieldName, /** * Gets path spec. * - * @param instance the instance - * @param fieldName the field name + * @param instance the instance + * @param fieldName the field name * @return the path spec */ private Map getPathSpec(QuerydslBindings instance, String fieldName) { @@ -223,7 +226,7 @@ private Map getPathSpec(QuerydslBindings instance, String fieldN /** * Gets path from path spec. * - * @param instance the instance + * @param instance the instance * @return the path from path spec */ private Optional> getPathFromPathSpec(Object instance) { @@ -241,9 +244,9 @@ private Optional> getPathFromPathSpec(Object instance) { /*** * Tries to figure out the Type of the field. It first checks the Qdsl pathSpecMap before checking the root class. Defaults to String.class - * @param fieldName The name of the field used as reference to get the type - * @param pathSpecMap The Qdsl path specifications as defined in the resolved bindings - * @param root The root type where the paths are gotten + * @param fieldName The name of the field used as reference to get the type + * @param pathSpecMap The Qdsl path specifications as defined in the resolved bindings + * @param root The root type where the paths are gotten * @return The type of the field. Returns */ private Type getFieldType(String fieldName, Map pathSpecMap, Class root) { @@ -268,8 +271,8 @@ private Type getFieldType(String fieldName, Map pathSpecMap, Cla /*** * Constructs the parameter - * @param type The type of the parameter - * @param name The name of the parameter + * @param type The type of the parameter + * @param name The name of the parameter * @return The swagger parameter */ private Parameter buildParam(Type type, String name) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/RouterOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/RouterOperationCustomizer.java index 2bf93dc60..196e2ef7d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/RouterOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/RouterOperationCustomizer.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.customizers; import org.springdoc.core.fn.RouterOperation; @@ -17,7 +43,7 @@ public interface RouterOperationCustomizer { * Customize router operation. * * @param routerOperation input operation - * @param handlerMethod original handler method + * @param handlerMethod original handler method * @return customized router operation */ RouterOperation customize(RouterOperation routerOperation, HandlerMethod handlerMethod); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java index 96155704b..229427559 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -28,6 +30,7 @@ /** * The interface Server Base URL customiser. + * * @author skylar -stark */ @FunctionalInterface @@ -37,7 +40,7 @@ public interface ServerBaseUrlCustomizer { * Customise. * * @param serverBaseUrl the serverBaseUrl. - * @param request the request. + * @param request the request. * @return the customised serverBaseUrl */ String customize(String serverBaseUrl, HttpRequest request); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java index 09f385d40..a25957473 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java index 70c4e72d8..286c331cc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -96,14 +98,14 @@ public class SpringDocCustomizers implements ApplicationContextAware, Initializi /** * Instantiates a new Spring doc customizers. * - * @param openApiCustomizers the open api customizers - * @param operationCustomizers the operation customizers - * @param routerOperationCustomizers the router operation customizers + * @param openApiCustomizers the open api customizers + * @param operationCustomizers the operation customizers + * @param routerOperationCustomizers the router operation customizers * @param dataRestRouterOperationCustomizers the data rest router operation customizers - * @param methodFilters the method filters - * @param globalOpenApiCustomizers the global open api customizers - * @param globalOperationCustomizers the global operation customizers - * @param globalOpenApiMethodFilters the global open api method filters + * @param methodFilters the method filters + * @param globalOpenApiCustomizers the global open api customizers + * @param globalOperationCustomizers the global operation customizers + * @param globalOpenApiMethodFilters the global open api method filters */ public SpringDocCustomizers(Optional> openApiCustomizers, Optional> operationCustomizers, @@ -126,10 +128,10 @@ public SpringDocCustomizers(Optional> openApiCustomizers, /** * Instantiates a new Spring doc customizers. * - * @param openApiCustomizers the open api customizers - * @param operationCustomizers the operation customizers + * @param openApiCustomizers the open api customizers + * @param operationCustomizers the operation customizers * @param routerOperationCustomizers the router operation customizers - * @param openApiMethodFilters the open api method filters + * @param openApiMethodFilters the open api method filters */ public SpringDocCustomizers(Optional> openApiCustomizers, Optional> operationCustomizers, Optional> routerOperationCustomizers, Optional> openApiMethodFilters) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java index 86beecf4c..c23d148ce 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java @@ -3,50 +3,53 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.data; /** * The enum Controller type. + * * @author bnasslahsen */ public enum ControllerType { /** - *Entity controller type. + * Entity controller type. */ ENTITY, /** - *Search controller type. + * Search controller type. */ SEARCH, /** - *Schema controller type. + * Schema controller type. */ SCHEMA, /** - *PROPERTY controller type. + * PROPERTY controller type. */ PROPERTY, /** - *GENERAL controller type. + * GENERAL controller type. */ GENERAL } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java index b8fce96f4..71f93b67b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.data; @@ -59,6 +61,7 @@ /** * The type Data rest operation builder. + * * @author bnasslahsen */ public class DataRestOperationService { @@ -96,10 +99,10 @@ public class DataRestOperationService { /** * Instantiates a new Data rest operation builder. * - * @param dataRestRequestService the data rest request builder - * @param tagsBuilder the tags builder + * @param dataRestRequestService the data rest request builder + * @param tagsBuilder the tags builder * @param dataRestResponseService the data rest response builder - * @param operationService the operation service + * @param operationService the operation service */ public DataRestOperationService(DataRestRequestService dataRestRequestService, DataRestTagsService tagsBuilder, DataRestResponseService dataRestResponseService, OperationService operationService) { @@ -112,15 +115,15 @@ public DataRestOperationService(DataRestRequestService dataRestRequestService, D /** * Build operation. * - * @param handlerMethod the handler method - * @param dataRestRepository the repository data rest - * @param openAPI the open api - * @param requestMethod the request method - * @param operationPath the operation path - * @param methodAttributes the method attributes - * @param resourceMetadata the resource metadata + * @param handlerMethod the handler method + * @param dataRestRepository the repository data rest + * @param openAPI the open api + * @param requestMethod the request method + * @param operationPath the operation path + * @param methodAttributes the method attributes + * @param resourceMetadata the resource metadata * @param methodResourceMapping the method resource mapping - * @param controllerType the controller type + * @param controllerType the controller type * @return the operation */ public Operation buildOperation(HandlerMethod handlerMethod, DataRestRepository dataRestRepository, @@ -143,13 +146,13 @@ else if (ControllerType.SEARCH.equals(controllerType)) { /** * Build entity operation. * - * @param handlerMethod the handler method + * @param handlerMethod the handler method * @param dataRestRepository the repository data rest - * @param openAPI the open api - * @param requestMethod the request method - * @param operationPath the operation path - * @param methodAttributes the method attributes - * @param resourceMetadata the resource metadata + * @param openAPI the open api + * @param requestMethod the request method + * @param operationPath the operation path + * @param methodAttributes the method attributes + * @param resourceMetadata the resource metadata * @return the operation */ private Operation buildEntityOperation(HandlerMethod handlerMethod, DataRestRepository dataRestRepository, @@ -170,13 +173,13 @@ private Operation buildEntityOperation(HandlerMethod handlerMethod, DataRestRepo /** * Build search operation. * - * @param handlerMethod the handler method - * @param dataRestRepository the repository data rest - * @param openAPI the open api - * @param requestMethod the request method - * @param methodAttributes the method attributes + * @param handlerMethod the handler method + * @param dataRestRepository the repository data rest + * @param openAPI the open api + * @param requestMethod the request method + * @param methodAttributes the method attributes * @param methodResourceMapping the method resource mapping - * @param resourceMetadata the resource metadata + * @param resourceMetadata the resource metadata * @return the operation */ private Operation buildSearchOperation(HandlerMethod handlerMethod, DataRestRepository dataRestRepository, @@ -235,8 +238,8 @@ else if (CollectionUtils.isEmpty(operation.getParameters())) /** * Gets parameter type. * - * @param pName the p name - * @param method the method + * @param pName the p name + * @param method the method * @param description the description * @return the parameter type */ @@ -268,10 +271,10 @@ private Type getParameterType(String pName, Method method, ResourceDescription d /** * Update parameter from annotations parameter. * - * @param openAPI the open api + * @param openAPI the open api * @param methodAttributes the method attributes - * @param method the method - * @param pName the p name + * @param method the method + * @param pName the p name * @return the parameter */ private Parameter getParameterFromAnnotations(OpenAPI openAPI, MethodAttributes methodAttributes, Method method, String pName) { @@ -295,7 +298,7 @@ private Parameter getParameterFromAnnotations(OpenAPI openAPI, MethodAttributes * Init operation. * * @param handlerMethod the handler method - * @param domainType the domain type + * @param domainType the domain type * @param requestMethod the request method * @return the operation */ @@ -313,9 +316,10 @@ private Operation initOperation(HandlerMethod handlerMethod, Class domainType /** * Add operation description. - * @param operation the operation - * @param requestMethod the request method - * @param entity the entity + * + * @param operation the operation + * @param requestMethod the request method + * @param entity the entity * @param dataRestRepository the data rest repository */ private void addOperationDescription(Operation operation, RequestMethod requestMethod, String entity, DataRestRepository dataRestRepository) { @@ -343,8 +347,8 @@ private void addOperationDescription(Operation operation, RequestMethod requestM /** * Create description. * - * @param action the action - * @param entity the entity + * @param action the action + * @param entity the entity * @param dataRestRepository the data rest repository * @return the string */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java index df5fd874a..87874be1e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.data; @@ -30,6 +32,7 @@ /** * The type Data rest repository. + * * @author bnasslahsen */ public class DataRestRepository { @@ -82,9 +85,9 @@ public class DataRestRepository { /** * Instantiates a new Data rest repository. * - * @param domainType the domain type + * @param domainType the domain type * @param repositoryType the repository type - * @param locale the locale + * @param locale the locale */ public DataRestRepository(Class domainType, Class repositoryType, Locale locale) { this.domainType = domainType; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java index 0a4203d75..9c24ca739 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.data; @@ -65,6 +67,7 @@ /** * The type Data rest request builder. + * * @author bnasslahsen */ public class DataRestRequestService { @@ -98,10 +101,10 @@ public class DataRestRequestService { * Instantiates a new Data rest request builder. * * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer - * @param parameterBuilder the parameter builder - * @param requestBodyService the request body builder - * @param requestBuilder the request builder - * @param springDocDataRestUtils the spring doc data rest utils + * @param parameterBuilder the parameter builder + * @param requestBodyService the request body builder + * @param requestBuilder the request builder + * @param springDocDataRestUtils the spring doc data rest utils */ public DataRestRequestService(SpringDocParameterNameDiscoverer localSpringDocParameterNameDiscoverer, GenericParameterService parameterBuilder, RequestBodyService requestBodyService, AbstractRequestService requestBuilder, SpringDocDataRestUtils springDocDataRestUtils) { @@ -115,12 +118,12 @@ public DataRestRequestService(SpringDocParameterNameDiscoverer localSpringDocPar /** * Build parameters. * - * @param openAPI the open api - * @param handlerMethod the handler method - * @param requestMethod the request method - * @param methodAttributes the method attributes - * @param operation the operation - * @param resourceMetadata the resource metadata + * @param openAPI the open api + * @param handlerMethod the handler method + * @param requestMethod the request method + * @param methodAttributes the method attributes + * @param operation the operation + * @param resourceMetadata the resource metadata * @param dataRestRepository the data rest repository */ public void buildParameters(OpenAPI openAPI, HandlerMethod handlerMethod, RequestMethod requestMethod, MethodAttributes methodAttributes, @@ -141,12 +144,12 @@ public void buildParameters(OpenAPI openAPI, HandlerMethod handlerMethod, Reques /** * Build common parameters. * - * @param openAPI the open api - * @param requestMethod the request method - * @param methodAttributes the method attributes - * @param operation the operation - * @param pNames the p names - * @param parameters the parameters + * @param openAPI the open api + * @param requestMethod the request method + * @param methodAttributes the method attributes + * @param operation the operation + * @param pNames the p names + * @param parameters the parameters * @param dataRestRepository the data rest repository */ public void buildCommonParameters(OpenAPI openAPI, RequestMethod requestMethod, MethodAttributes methodAttributes, Operation operation, String[] pNames, MethodParameter[] parameters, @@ -185,10 +188,10 @@ else if (methodParameter.getParameterAnnotation(BackendId.class) != null) { /** * Build parameter from doc parameter. * - * @param parameterDoc the parameter doc - * @param components the components + * @param parameterDoc the parameter doc + * @param components the components * @param jsonViewAnnotation the json view annotation - * @param locale the locale + * @param locale the locale * @return the parameter */ public Parameter buildParameterFromDoc(io.swagger.v3.oas.annotations.Parameter parameterDoc, Components components, JsonView jsonViewAnnotation, Locale locale) { @@ -210,13 +213,13 @@ private boolean isParamToIgnore(MethodParameter methodParameter) { /** * Add parameters. * - * @param openAPI the open api - * @param requestMethod the request method + * @param openAPI the open api + * @param requestMethod the request method * @param methodAttributes the method attributes - * @param operation the operation - * @param methodParameter the method parameter - * @param parameterInfo the parameter info - * @param parameter the parameter + * @param operation the operation + * @param methodParameter the method parameter + * @param parameterInfo the parameter info + * @param parameter the parameter */ private void addParameters(OpenAPI openAPI, RequestMethod requestMethod, MethodAttributes methodAttributes, Operation operation, MethodParameter methodParameter, ParameterInfo parameterInfo, Parameter parameter) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java index 409e5b76c..7f5d7af35 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.data; @@ -62,6 +64,7 @@ /** * The type Data rest response builder. + * * @author bnasslahsen */ public class DataRestResponseService { @@ -94,14 +97,15 @@ public DataRestResponseService(GenericResponseService genericResponseService, Sp /** * Build search response. - * @param operation the operation - * @param handlerMethod the handler method - * @param openAPI the open api + * + * @param operation the operation + * @param handlerMethod the handler method + * @param openAPI the open api * @param methodResourceMapping the method resource mapping - * @param domainType the domain type - * @param methodAttributes the method attributes - * @param resourceMetadata the resource metadata - * @param dataRestRepository the data rest repository + * @param domainType the domain type + * @param methodAttributes the method attributes + * @param resourceMetadata the resource metadata + * @param dataRestRepository the data rest repository */ public void buildSearchResponse(Operation operation, HandlerMethod handlerMethod, OpenAPI openAPI, MethodResourceMapping methodResourceMapping, Class domainType, MethodAttributes methodAttributes, ResourceMetadata resourceMetadata, @@ -130,14 +134,15 @@ public void buildSearchResponse(Operation operation, HandlerMethod handlerMethod /** * Build entity response. - * @param operation the operation - * @param handlerMethod the handler method - * @param openAPI the open api - * @param requestMethod the request method - * @param operationPath the operation path - * @param methodAttributes the method attributes + * + * @param operation the operation + * @param handlerMethod the handler method + * @param openAPI the open api + * @param requestMethod the request method + * @param operationPath the operation path + * @param methodAttributes the method attributes * @param dataRestRepository the data rest repository - * @param resourceMetadata the resource metadata + * @param resourceMetadata the resource metadata */ public void buildEntityResponse(Operation operation, HandlerMethod handlerMethod, OpenAPI openAPI, RequestMethod requestMethod, String operationPath, MethodAttributes methodAttributes, DataRestRepository dataRestRepository, ResourceMetadata resourceMetadata) { @@ -157,8 +162,8 @@ public void buildEntityResponse(Operation operation, HandlerMethod handlerMethod * * @param requestMethod the request method * @param operationPath the operation path - * @param apiResponses the api responses - * @param apiResponse the api response + * @param apiResponses the api responses + * @param apiResponse the api response */ private void addResponse(RequestMethod requestMethod, String operationPath, ApiResponses apiResponses, ApiResponse apiResponse) { switch (requestMethod) { @@ -192,7 +197,7 @@ private void addResponse(RequestMethod requestMethod, String operationPath, ApiR * Find search return type. * * @param methodResourceMapping the method resource mapping - * @param domainType the domain type + * @param domainType the domain type * @return the type */ private Type findSearchReturnType(MethodResourceMapping methodResourceMapping, Class domainType) { @@ -218,9 +223,9 @@ else if (ClassUtils.isPrimitiveOrWrapper(methodResourceMapping.getReturnedDomain * Gets type. * * @param methodParameterReturn the method parameter return - * @param requestMethod the request method - * @param dataRestRepository the data rest repository - * @param resourceMetadata the resource metadata + * @param requestMethod the request method + * @param dataRestRepository the data rest repository + * @param resourceMetadata the resource metadata * @return the type */ private Type getType(MethodParameter methodParameterReturn, RequestMethod requestMethod, DataRestRepository dataRestRepository, ResourceMetadata resourceMetadata) { @@ -248,10 +253,10 @@ else if ((CollectionModel.class.equals(parameterizedType.getRawType()) /** * Gets type for response entity. * - * @param requestMethod the request method + * @param requestMethod the request method * @param dataRestRepository the data rest repository * @param returnedEntityType the returned entity type - * @param parameterizedType the parameterized type + * @param parameterizedType the parameterized type * @return the type for response entity */ private Type getTypeForResponseEntity(RequestMethod requestMethod, DataRestRepository dataRestRepository, Class returnedEntityType, ParameterizedType parameterizedType) { @@ -271,7 +276,7 @@ else if (parameterizedType.getActualTypeArguments()[0] instanceof WildcardType) * Gets type for collection model. * * @param returnedEntityType the returned entity type - * @param pagingResource the paging resource + * @param pagingResource the paging resource * @return the type for collection model */ private Type getTypeForCollectionModel(Class returnedEntityType, boolean pagingResource) { @@ -284,10 +289,10 @@ private Type getTypeForCollectionModel(Class returnedEntityType, boolean pagingR /** * Gets type for wildcard type. * - * @param requestMethod the request method + * @param requestMethod the request method * @param dataRestRepository the data rest repository * @param returnedEntityType the returned entity type - * @param parameterizedType the parameterized type + * @param parameterizedType the parameterized type * @return the type for wildcard type */ private Type getTypeForWildcardType(RequestMethod requestMethod, DataRestRepository dataRestRepository, Class returnedEntityType, ParameterizedType parameterizedType) { @@ -307,10 +312,10 @@ private Type getTypeForWildcardType(RequestMethod requestMethod, DataRestReposit /** * Gets type. * - * @param requestMethod the request method + * @param requestMethod the request method * @param dataRestRepository the data rest repository * @param returnedEntityType the returned entity type - * @param parameterizedType the parameterized type + * @param parameterizedType the parameterized type * @return the type */ private Type getTypeForParameterizedType(RequestMethod requestMethod, DataRestRepository dataRestRepository, Class returnedEntityType, ParameterizedType parameterizedType) { @@ -332,7 +337,7 @@ else if (EntityModel.class.equals(parameterizedType1.getRawType())) { /** * Find type class. * - * @param requestMethod the request method + * @param requestMethod the request method * @param dataRestRepository the data rest repository * @return the class */ @@ -355,8 +360,8 @@ else if (dataRestRepository.isMap()) /** * Resolve generic type type. * - * @param container the container - * @param generic the generic + * @param container the container + * @param generic the generic * @param domainType the domain type * @return the type */ @@ -369,7 +374,7 @@ private Type resolveGenericType(Class container, Class generic, Class d * Add response 200. * * @param apiResponses the api responses - * @param apiResponse the api response + * @param apiResponse the api response */ private void addResponse200(ApiResponses apiResponses, ApiResponse apiResponse) { apiResponses.put(String.valueOf(HttpStatus.OK.value()), apiResponse.description(HttpStatus.OK.getReasonPhrase())); @@ -395,6 +400,7 @@ private void addResponse404(ApiResponses apiResponses) { /** * The type Map model. + * * @author bnasslashen */ private static class MapModel extends RepresentationModel { @@ -407,7 +413,7 @@ private static class MapModel extends RepresentationModel { * Instantiates a new Map model. * * @param content the content - * @param links the links + * @param links the links */ public MapModel(Map content, Link... links) { super(Arrays.asList(links)); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java index 9627bb445..85cd00e74 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.data; @@ -59,6 +61,7 @@ /** * The type Data rest router operation builder. + * * @author bnasslahsen */ public class DataRestRouterOperationService { @@ -96,10 +99,10 @@ public class DataRestRouterOperationService { /** * Instantiates a new Data rest router operation builder. * - * @param dataRestOperationService the data rest operation builder - * @param springDocConfigProperties the spring doc config properties + * @param dataRestOperationService the data rest operation builder + * @param springDocConfigProperties the spring doc config properties * @param repositoryRestConfiguration the repository rest configuration - * @param dataRestHalProvider the data rest hal provider + * @param dataRestHalProvider the data rest hal provider */ public DataRestRouterOperationService(DataRestOperationService dataRestOperationService, SpringDocConfigProperties springDocConfigProperties, RepositoryRestConfiguration repositoryRestConfiguration, DataRestHalProvider dataRestHalProvider) { @@ -113,10 +116,10 @@ public DataRestRouterOperationService(DataRestOperationService dataRestOperation * Build entity router operation list. * * @param routerOperationList the router operation list - * @param handlerMethodMap the handler method map - * @param resourceMetadata the resource metadata - * @param dataRestRepository the repository data rest - * @param openAPI the open api + * @param handlerMethodMap the handler method map + * @param resourceMetadata the resource metadata + * @param dataRestRepository the repository data rest + * @param openAPI the open api */ public void buildEntityRouterOperationList(List routerOperationList, Map handlerMethodMap, ResourceMetadata resourceMetadata, @@ -131,11 +134,11 @@ public void buildEntityRouterOperationList(List routerOperation /** * Build search router operation list. * - * @param routerOperationList the router operation list - * @param handlerMethodMap the handler method map - * @param resourceMetadata the resource metadata - * @param dataRestRepository the repository data rest - * @param openAPI the open api + * @param routerOperationList the router operation list + * @param handlerMethodMap the handler method map + * @param resourceMetadata the resource metadata + * @param dataRestRepository the repository data rest + * @param openAPI the open api * @param methodResourceMapping the method resource mapping */ public void buildSearchRouterOperationList(List routerOperationList, @@ -153,14 +156,14 @@ public void buildSearchRouterOperationList(List routerOperation /** * Build router operation list. * - * @param routerOperationList the router operation list - * @param resourceMetadata the resource metadata - * @param dataRestRepository the repository data rest - * @param openAPI the open api - * @param path the path - * @param entry the entry - * @param subPath the sub path - * @param controllerType the controllerType + * @param routerOperationList the router operation list + * @param resourceMetadata the resource metadata + * @param dataRestRepository the repository data rest + * @param openAPI the open api + * @param path the path + * @param entry the entry + * @param subPath the sub path + * @param controllerType the controllerType * @param methodResourceMapping the method resource mapping */ private void buildRouterOperationList(List routerOperationList, ResourceMetadata resourceMetadata, @@ -200,18 +203,18 @@ private void buildRouterOperationList(List routerOperationList, /** * Build router operation. * - * @param routerOperationList the router operation list - * @param resourceMetadata the resource metadata - * @param dataRestRepository the data rest repository - * @param openAPI the open api - * @param path the path - * @param subPath the sub path - * @param controllerType the controller type - * @param methodResourceMapping the method resource mapping - * @param requestMappingInfo the request mapping info - * @param handlerMethod the handler method + * @param routerOperationList the router operation list + * @param resourceMetadata the resource metadata + * @param dataRestRepository the data rest repository + * @param openAPI the open api + * @param path the path + * @param subPath the sub path + * @param controllerType the controller type + * @param methodResourceMapping the method resource mapping + * @param requestMappingInfo the request mapping info + * @param handlerMethod the handler method * @param requestMethodsCollection the request methods collection - * @param collection the collection + * @param collection the collection */ private void buildRouterOperation(List routerOperationList, ResourceMetadata resourceMetadata, DataRestRepository dataRestRepository, OpenAPI openAPI, String path, String subPath, ControllerType controllerType, MethodResourceMapping methodResourceMapping, RequestMappingInfo requestMappingInfo, @@ -235,13 +238,13 @@ private void buildRouterOperation(List routerOperationList, Res /** * Calculate operation path string. * - * @param path the path - * @param subPath the sub path - * @param patterns the patterns - * @param regexMap the regex map + * @param path the path + * @param subPath the sub path + * @param patterns the patterns + * @param regexMap the regex map * @param controllerType the controller type - * @param relationName the relation name - * @param resourceType the resource type + * @param relationName the relation name + * @param resourceType the resource type * @return the string */ private String calculateOperationPath(String path, String subPath, Set patterns, @@ -265,15 +268,15 @@ else if (ControllerType.PROPERTY.equals(controllerType)) /** * Build router operation. * - * @param routerOperationList the router operation list - * @param dataRestRepository the repository data rest - * @param openAPI the open api + * @param routerOperationList the router operation list + * @param dataRestRepository the repository data rest + * @param openAPI the open api * @param methodResourceMapping the method resource mapping - * @param handlerMethod the handler method - * @param requestMethod the request method - * @param resourceMetadata the resource metadata - * @param operationPath the operation path - * @param controllerType the controller type + * @param handlerMethod the handler method + * @param requestMethod the request method + * @param resourceMetadata the resource metadata + * @param operationPath the operation path + * @param controllerType the controller type */ private void buildRouterOperation (List routerOperationList, DataRestRepository @@ -297,7 +300,7 @@ else if (ControllerType.PROPERTY.equals(controllerType)) * Gets search entry. * * @param handlerMethodMap the handler method map - * @param locale the locale + * @param locale the locale * @return the search entry */ private Optional> getSearchEntry @@ -319,9 +322,9 @@ else if (ControllerType.PROPERTY.equals(controllerType)) * Is search controller present boolean. * * @param requestMappingInfo the request mapping info - * @param handlerMethod the handler method - * @param requestMethod the request method - * @param locale the locale + * @param handlerMethod the handler method + * @param requestMethod the request method + * @param locale the locale * @return the boolean */ private boolean isSearchControllerPresent(RequestMappingInfo requestMappingInfo, HandlerMethod handlerMethod, RequestMethod requestMethod, Locale locale) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java index 990b1aa2a..f6e1797fc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.data; @@ -41,6 +43,7 @@ /** * The type Data rest tags builder. + * * @author bnasslahsen */ public class DataRestTagsService { @@ -62,10 +65,10 @@ public DataRestTagsService(OpenAPIService openAPIService) { /** * Build search tags. * - * @param operation the operation - * @param handlerMethod the handler method + * @param operation the operation + * @param handlerMethod the handler method * @param dataRestRepository the repository data rest - * @param method the method + * @param method the method */ public void buildSearchTags(Operation operation, HandlerMethod handlerMethod, DataRestRepository dataRestRepository, Method method) { @@ -75,8 +78,8 @@ public void buildSearchTags(Operation operation, HandlerMethod handlerMethod, /** * Build entity tags. * - * @param operation the operation - * @param handlerMethod the handler method + * @param operation the operation + * @param handlerMethod the handler method * @param dataRestRepository the repository data rest */ public void buildEntityTags(Operation operation, HandlerMethod handlerMethod, @@ -86,10 +89,11 @@ public void buildEntityTags(Operation operation, HandlerMethod handlerMethod, /** * Build tags. - * @param operation the operation - * @param handlerMethod the handler method + * + * @param operation the operation + * @param handlerMethod the handler method * @param dataRestRepository the repository data rest - * @param method + * @param method the method */ private void buildTags(Operation operation, HandlerMethod handlerMethod, DataRestRepository dataRestRepository, Method method) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/discoverer/SpringDocParameterNameDiscoverer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/discoverer/SpringDocParameterNameDiscoverer.java index db57f082f..10344c6d9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/discoverer/SpringDocParameterNameDiscoverer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/discoverer/SpringDocParameterNameDiscoverer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2023 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.discoverer; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java index 2029e617e..1d308bb07 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2023 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.extractor; @@ -56,6 +58,7 @@ /** * The type Delegating method parameter. + * * @author zarebski.m */ public class DelegatingMethodParameter extends MethodParameter { @@ -93,11 +96,11 @@ public class DelegatingMethodParameter extends MethodParameter { /** * Instantiates a new Delegating method parameter. * - * @param delegate the delegate - * @param parameterName the parameter name + * @param delegate the delegate + * @param parameterName the parameter name * @param additionalParameterAnnotations the additional parameter annotations - * @param isParameterObject the is parameter object - * @param isNotRequired the is required + * @param isParameterObject the is parameter object + * @param isNotRequired the is required */ DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, boolean isParameterObject, boolean isNotRequired) { super(delegate); @@ -111,10 +114,10 @@ public class DelegatingMethodParameter extends MethodParameter { /** * Customize method parameter [ ]. * - * @param pNames the p names - * @param parameters the parameters + * @param pNames the p names + * @param parameters the parameters * @param optionalDelegatingMethodParameterCustomizers the optional list delegating method parameter customizer - * @param defaultFlatParamObject the default flat param object + * @param defaultFlatParamObject the default flat param object * @return the method parameter [ ] */ public static MethodParameter[] customize(String[] pNames, MethodParameter[] parameters, @@ -145,10 +148,11 @@ public static MethodParameter[] customize(String[] pNames, MethodParameter[] par /** * Return a variant of this {@code MethodParameter} which refers to the * given containing class. + * * @param methodParameter the method parameter * @param containingClass a specific containing class (potentially a subclass of the declaring class, e.g. substituting a type variable) A copy of spring withContainingClass, to keep compatibility with older spring versions * @return the method parameter - * @see #getParameterType() #getParameterType() + * @see #getParameterType() #getParameterType()#getParameterType() */ public static MethodParameter changeContainingClass(MethodParameter methodParameter, @Nullable Class containingClass) { MethodParameter result = methodParameter.clone(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index b5c2bac73..a82197010 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.extractor; @@ -60,6 +62,7 @@ /** * The type Method parameter pojo extractor. + * * @author bnasslahsen */ public class MethodParameterPojoExtractor { @@ -116,7 +119,7 @@ static Stream extractFrom(Class clazz) { /** * Extract from stream. * - * @param clazz the clazz + * @param clazz the clazz * @param fieldNamePrefix the field name prefix * @return the stream */ @@ -130,8 +133,8 @@ private static Stream extractFrom(Class clazz, String fieldN /** * From getter of field stream. * - * @param paramClass the param class - * @param field the field + * @param paramClass the param class + * @param field the field * @param fieldNamePrefix the field name prefix * @return the stream */ @@ -151,8 +154,9 @@ private static Stream fromGetterOfField(Class paramClass, Fi /** * Extract the type - * @param paramClass - * @param field + * + * @param paramClass the param class + * @param field the field * @return The revoled type or null if it was not a reifiable type */ private static Class extractType(Class paramClass, Field field) { @@ -172,8 +176,8 @@ private static Class extractType(Class paramClass, Field field) { /** * From simple class stream. * - * @param paramClass the param class - * @param field the field + * @param paramClass the param class + * @param field the field * @param fieldNamePrefix the field name prefix * @return the stream */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java index 6a9b7381a..fedb93502 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.filters; @@ -30,7 +32,7 @@ * and groups. * * @author michael.clarke - * @see OpenApiMethodFilter filter methods in default OpenAPI description but not groups + * @see OpenApiMethodFilterfilter methods in default OpenAPI description but not groups */ @FunctionalInterface public interface GlobalOpenApiMethodFilter extends OpenApiMethodFilter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java index 86e65775f..1aaaa0229 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.filters; @@ -32,7 +34,7 @@ * but not groups * * @author michael.clarke - * @see GlobalOpenApiMethodFilter filter methods in default OpenAPI description and groups + * @see GlobalOpenApiMethodFilterfilter methods in default OpenAPI description and groups */ @FunctionalInterface public interface OpenApiMethodFilter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java index aeaf793fd..5f10fc44b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn; @@ -39,6 +41,7 @@ /** * The type Abstract router function visitor. + * * @author bnasslahsen */ public class AbstractRouterFunctionVisitor { @@ -141,7 +144,7 @@ else if (this.level > 0) { /** * Header. * - * @param name the name + * @param name the name * @param value the value */ public void header(String name, String value) { @@ -165,7 +168,7 @@ public List getRouterFunctionDatas() { /** * Query param. * - * @param name the name + * @param name the name * @param value the value */ public void queryParam(String name, String value) { @@ -187,7 +190,7 @@ public void pathExtension(String extension) { /** * Param. * - * @param name the name + * @param name the name * @param value the value */ public void param(String name, String value) { @@ -287,9 +290,9 @@ protected void commonRoute() { /** * Calculate header. * - * @param value the value + * @param value the value * @param headers the headers - * @param header the header + * @param header the header */ private void calculateHeader(String value, List headers, String header) { if (value.contains(",")) { @@ -326,8 +329,8 @@ private void createRouterFunctionData(String path) { /** * Add header. * - * @param mediaType the media type - * @param header the header + * @param mediaType the media type + * @param header the header * @param routerFunctionData the router function data */ private void addHeader(String mediaType, String header, RouterFunctionData routerFunctionData) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java index 70abb947b..a19283c2a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn; @@ -30,6 +32,7 @@ /** * The type Abstract springdoc route builder. + * * @author bnasslahsen */ public abstract class AbstractSpringdocRouteBuilder { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java index 2f83d8a6a..fb9e03425 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn; @@ -40,6 +42,7 @@ /** * The type Router function data. + * * @author bnasslahsen */ public class RouterFunctionData { @@ -138,7 +141,7 @@ public Map getQueryParams() { /** * Add query params. * - * @param name the name + * @param name the name * @param value the value */ public void addQueryParams(String name, String value) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java index ebd7a3d9e..0d70c08ee 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn; @@ -40,6 +42,7 @@ /** * The type Router operation. + * * @author bnasslahsen */ public class RouterOperation implements Comparable { @@ -132,7 +135,7 @@ public RouterOperation(org.springdoc.core.annotations.RouterOperation routerOper * Instantiates a new Router operation. * * @param routerOperationAnnotation the router operation annotation - * @param routerFunctionData the router function data + * @param routerFunctionData the router function data */ public RouterOperation(org.springdoc.core.annotations.RouterOperation routerOperationAnnotation, RouterFunctionData routerFunctionData) { this.path = StringUtils.isBlank(routerOperationAnnotation.path()) ? routerFunctionData.getPath() : routerOperationAnnotation.path(); @@ -151,11 +154,12 @@ public RouterOperation(org.springdoc.core.annotations.RouterOperation routerOper /** * Instantiates a new Router operation. * - * @param path the path - * @param methods the methods + * @param path the path + * @param methods the methods * @param consumes the consumes * @param produces the produces - * @param headers the headers + * @param headers the headers + * @param params the params */ public RouterOperation(String path, RequestMethod[] methods, String[] consumes, String[] produces, String[] headers, String[] params) { this.path = path; @@ -195,7 +199,7 @@ public RouterOperation(RouterFunctionData routerFunctionData) { * Instantiates a new Router operation. * * @param routerOperation the router operation - * @param requestMethod the request method + * @param requestMethod the request method */ public RouterOperation(org.springdoc.core.annotations.RouterOperation routerOperation, RequestMethod requestMethod) { this(routerOperation); @@ -394,7 +398,7 @@ public String[] getParams() { /** * Sets params. * - * @param params + * @param params the params */ public void setParams(String[] params) { this.params = params; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java index b8d259370..7a8c8f8c4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.apiresponse; @@ -35,6 +37,7 @@ /** * The type Api response builder. + * * @author bnasslahsen */ public class Builder { @@ -46,37 +49,31 @@ public class Builder { /** * A short description of the response. - * */ private String description = ""; /** * The HTTP response code, or 'default', for the supplied response. May only have 1 default entry. - * */ private String responseCode = "default"; /** * An array of response headers. Allows additional information to be included with response. - * */ private Header[] headers = {}; /** * An array of operation links that can be followed from the response. - * */ private Link[] links = {}; /** * An array containing descriptions of potential response payloads, for different media types. - * */ private Content[] content = {}; /** * The list of optional extensions - * */ private Extension[] extensions = {}; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java index 61751f1b0..278b276d4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.arrayschema; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java index db5e2e81a..92ac322a1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.content; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java index b4e2e835c..0944436e1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.discriminatormapping; @@ -31,19 +33,18 @@ /** * The type Discriminator mapping builder. + * * @author bnasslahsen */ public class Builder { /** * The property value that will be mapped to a Schema - * */ private String value = ""; /** * The schema that is being mapped to a property value - * */ private Class schema = Void.class; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java index 15d854830..04f94375f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.encoding; @@ -33,6 +35,7 @@ /** * The type Encoding builder. + * * @author bnasslahsen */ public class Builder { @@ -41,45 +44,38 @@ public class Builder { * The name of this encoding object instance. * This property is a key in encoding map of MediaType object and * MUST exist in a schema as a property. - * */ private String name = ""; /** * The Content-Type for encoding a specific property. - * */ private String contentType = ""; /** * Describes how a specific property value will be serialized depending on its type - * */ private String style = ""; /** * When this is true, property values of type array or object generate separate parameters for each value of the array, * or key-value-pair of the map. - * */ private boolean explode; /** * Determines whether the parameter value SHOULD allow reserved characters, * as defined by RFC3986 to be included without percent-encoding. - * */ private boolean allowReserved; /** * An array of header objects - * */ private Header[] headers = {}; /** * The list of optional extensions - * */ private Extension[] extensions = {}; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java index 243560478..3d41d0cda 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.exampleobject; @@ -32,6 +34,7 @@ /** * The type Example object builder. + * * @author bnasslahsen */ public class Builder { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java index 94b0d42bd..be3bd437d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.extension; @@ -32,19 +34,18 @@ /** * The type Extension builder. + * * @author bnasslahsen */ public class Builder { /** * An option name for these extensions. - * */ private String name = ""; /** * The extension properties. - * */ private ExtensionProperty[] properties; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java index df4a743ce..28365ceb9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.extensionproperty; @@ -30,25 +32,23 @@ /** * The type Extension property builder. + * * @author bnasslahsen */ public class Builder { /** * The name of the property. - * */ private String name; /** * The value of the property. - * */ private String value; /** * If set to true, field `value` will be parsed and serialized as JSON/YAML - * */ private boolean parseValue; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java index e0a533e1c..96aa0d096 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.externaldocumentation; @@ -32,25 +34,23 @@ /** * The type External documentation builder. + * * @author bnasslahsen */ public class Builder { /** * A short description of the target documentation. - * */ private String description = ""; /** * The URL for the target documentation. Value must be in the format of a URL. - * */ private String url = ""; /** * The list of optional extensions - * */ private Extension[] extensions = {}; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java index ce343d5ad..86950dcd7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.header; @@ -220,7 +222,7 @@ public Builder examples(ExampleObject[] val) { examples = val; return this; } - + /** * Build header. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java index 7b67785c9..dc2d9d3ae 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.link; @@ -34,54 +36,47 @@ /** * The type Link builder. + * * @author bnasslahsen */ public class Builder { /** * The name of this link. - * */ private String name = ""; /** * A relative or absolute reference to an OAS operation. This field is mutually exclusive of the operationId field, and must point to an Operation Object. Relative operationRef values may be used to locate an existing Operation Object in the OpenAPI definition. Ignored if the operationId property is specified. - * */ private String operationRef = ""; /** * The name of an existing, resolvable OAS operation, as defined with a unique operationId. This field is mutually exclusive of the operationRef field. - * */ private String operationId = ""; /** * Array of parameters to pass to an operation as specified with operationId or identified via operationRef. - * */ private LinkParameter[] parameters = {}; /** * A description of the link. CommonMark syntax may be used for rich text representation. - * */ private String description = ""; /** * A literal value or {expression} to use as a request body when calling the target operation. - * */ private String requestBody = ""; /** * An alternative server to service this operation. - * */ private Server server = org.springdoc.core.fn.builders.server.Builder.serverBuilder().build(); /** * The list of optional extensions - * */ private Extension[] extensions = {}; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java index cd0e60184..c59fdb181 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.linkparameter; @@ -30,18 +32,17 @@ /** * The type Link parameter builder. + * * @author bnasslahsen */ public class Builder { /** * The name of this link parameter. - * */ private String name = ""; /** * A constant or an expression to be evaluated and passed to the linked operation. - * */ private String expression = ""; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java index 24671fb31..d17b65d74 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.operation; @@ -40,6 +42,7 @@ /** * The type Operation builder. + * * @author bnasslahsen */ public class Builder { @@ -62,91 +65,76 @@ public class Builder { /** * The HTTP method for this operation. - * */ private String method = ""; /** * Tags can be used for logical grouping of operations by resources or any other qualifier. - * */ private String[] tags = {}; /** * Provides a brief description of this operation. Should be 120 characters or less for proper visibility in Swagger-UI. - * */ private String summary = ""; /** * A verbose description of the operation. - * */ private String description = ""; /** * Request body associated to the operation. - * */ private RequestBody requestBody = org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder().build(); /** * Additional external documentation for this operation. - * */ private ExternalDocumentation externalDocs = org.springdoc.core.fn.builders.externaldocumentation.Builder.externalDocumentationBuilder().build(); /** * The operationId is used by third-party tools to uniquely identify this operation. - * */ private String operationId = ""; /** * An optional array of parameters which will be added to any automatically detected parameters in the method itself. - * */ private Parameter[] parameters = {}; /** * The list of possible responses as they are returned from executing this operation. - * */ private ApiResponse[] responses = {}; /** * Allows an operation to be marked as deprecated. Alternatively use the @Deprecated annotation - * */ private boolean deprecated; /** * A declaration of which security mechanisms can be used for this operation. - * */ private SecurityRequirement[] security = {}; /** * An alternative server array to service this operation. - * */ private Server[] servers = {}; /** * The list of optional extensions - * */ private Extension[] extensions = {}; /** * Allows this operation to be marked as hidden - * */ private boolean hidden; /** * Ignores JsonView annotations while resolving operations and types. - * */ private boolean ignoreJsonView; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java index 9e976045d..780e28d6f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.parameter; @@ -39,102 +41,87 @@ /** * The type Parameter builder. + * * @author bnasslahsen */ public class Builder { /** * The name of the parameter. - * */ private String name = ""; /** * The location of the parameter. Possible values are "query", "header", "path" or "cookie". Ignored when empty string. - * */ private ParameterIn in = ParameterIn.DEFAULT; /** * Additional description data to provide on the purpose of the parameter - * */ private String description = ""; /** * Determines whether this parameter is mandatory. If the parameter location is "path", this property is required and its value must be true. Otherwise, the property may be included and its default value is false. - * */ private boolean required; /** * Specifies that a parameter is deprecated and should be transitioned out of usage. - * */ private boolean deprecated; /** * When true, allows sending an empty value. If false, the parameter will be considered \"null\" if no value is present. This may create validation errors when the parameter is required. - * */ private boolean allowEmptyValue; /** * Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form. Ignored if the properties content or array are specified. - * */ private ParameterStyle style = ParameterStyle.DEFAULT; /** * When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When style is form, the default value is true. For all other styles, the default value is false. Ignored if the properties content or array are specified. - * */ private Explode explode = Explode.DEFAULT; /** * Determines whether the parameter value should allow reserved characters, as defined by RFC3986. This property only applies to parameters with an in value of query. The default value is false. Ignored if the properties content or array are specified. - * */ private boolean allowReserved; /** * The schema defining the type used for the parameter. Ignored if the properties content or array are specified. - * */ private Schema schema = org.springdoc.core.fn.builders.schema.Builder.schemaBuilder().build(); /** * The schema of the array that defines this parameter. Ignored if the property content is specified. - * */ private ArraySchema array = org.springdoc.core.fn.builders.arrayschema.Builder.arraySchemaBuilder().build(); /** * The representation of this parameter, for different media types. - * */ private Content[] content = {}; /** * Allows this parameter to be marked as hidden - * */ private boolean hidden; /** * An array of examples of the schema used to show the use of the associated schema. - * */ private ExampleObject[] examples = {}; /** * Provides an example of the schema. When associated with a specific media type, the example string shall be parsed by the consumer to be treated as an object or an array. Ignored if the properties examples, content or array are specified. - * */ private String example = ""; /** * The list of optional extensions - * */ private Extension[] extensions = {}; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java index 5aa9cd4d0..1dad234d3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.requestbody; @@ -33,31 +35,28 @@ /** * The type Request body builder. + * * @author bnasslahsen */ public class Builder { /** * A brief description of the request body. - * */ private String description = ""; /** * The content of the request body. - * */ private Content[] content = {}; /** * Determines if the request body is required in the request. Defaults to false. - * */ private boolean required; /** * The list of optional extensions - * */ private Extension[] extensions = {}; @@ -68,6 +67,9 @@ public class Builder { */ private String ref = ""; + /** + * The Use parameter type schema. + */ private boolean useParameterTypeSchema = false; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java index 692b85eef..a326d22b5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.schema; @@ -834,7 +836,7 @@ public Builder schemaResolution(SchemaResolution schemaResolution) { this.schemaResolution = schemaResolution; return this; } - + /** * Additional properties builder. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java index 4a37cb158..823f49b88 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.securityrequirement; @@ -30,19 +32,18 @@ /** * The type Security requirement builder. + * * @author bnasslahsen */ public class Builder { /** * This name must correspond to a declared SecurityRequirement. - * */ private String name; /** * If the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names required for the execution. * For other security scheme types, the array must be empty. - * */ private String[] scopes = {}; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java index 0218598eb..ae981c420 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.server; @@ -33,6 +35,7 @@ /** * The type Server builder. + * * @author bnasslahsen */ public class Builder { @@ -40,25 +43,21 @@ public class Builder { * Required. A URL to the target host. * This URL supports Server Variables and may be relative, to indicate that the host location is relative to the location where the * OpenAPI definition is being served. Variable substitutions will be made when a variable is named in {brackets}. - * */ private String url = ""; /** * An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation. - * */ private String description = ""; /** * An array of variables used for substitution in the server's URL template. - * */ private ServerVariable[] variables = {}; /** * The list of optional extensions - * */ private Extension[] extensions = {}; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java index 986247162..ae54dc2bd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.fn.builders.servervariable; @@ -32,37 +34,32 @@ /** * The type Server variable builder. + * * @author bnasslahsen */ public class Builder { /** * Required. The name of this variable. - * */ private String name; /** * An array of allowable values for this variable. This field map to the enum property in the OAS schema. - * - * @return String array of allowableValues */ private String[] allowableValues = {}; /** * Required. The default value of this variable. - * */ private String defaultValue; /** * An optional description for the server variable. - * */ private String description = ""; /** * The list of optional extensions - * */ private Extension[] extensions = {}; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java index db78ae162..a9e8bd3cf 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.mixins; @@ -37,6 +39,7 @@ /** * The interface Sorted open api mixin. + * * @author bnasslashen */ @JsonPropertyOrder(value = { "openapi", "info", "externalDocs", "servers", "security", "tags", "paths", "components" }, alphabetic = true) @@ -55,7 +58,7 @@ public interface SortedOpenAPIMixin { /** * Add extension. * - * @param name the name + * @param name the name * @param value the value */ @JsonAnySetter diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java index 3110f8e15..d1f9392f3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.mixins; @@ -37,6 +39,7 @@ /** * The interface Sorted open api mixin 31. + * * @author bnasslashen */ @JsonPropertyOrder(value = { "openapi", "info", "externalDocs", "servers", "security", "tags", "paths", "components", "webhooks" }, alphabetic = true) @@ -55,7 +58,7 @@ public interface SortedOpenAPIMixin31 { /** * Add extension. * - * @param name the name + * @param name the name * @param value the value */ @JsonAnySetter diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java index 2366d4d04..38f3aba05 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.mixins; @@ -37,6 +39,7 @@ /** * The interface Sorted schema mixin. + * * @author bnasslashen */ @JsonPropertyOrder(value = { "type", "format" }, alphabetic = true) @@ -54,7 +57,7 @@ public interface SortedSchemaMixin { /** * Add extension. * - * @param name the name + * @param name the name * @param value the value */ @JsonAnySetter diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java index d5dffe7c8..f7775f55a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.mixins; @@ -37,6 +39,7 @@ /** * The interface Sorted schema mixin 31. + * * @author bnasslashen */ @JsonPropertyOrder(value = { "type", "format" }, alphabetic = true) @@ -118,7 +121,7 @@ public interface SortedSchemaMixin31 { /** * Add extension. * - * @param name the name + * @param name the name * @param value the value */ @JsonAnySetter diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java index ea1ec5a57..3008aa98a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.models; @@ -81,10 +83,20 @@ public Map getApiResponseMap() { return apiResponseMap; } + /** + * Gets method advice infos. + * + * @return the method advice infos + */ public List getMethodAdviceInfos() { return methodAdviceInfos; } + /** + * Add method advice infos. + * + * @param methodAdviceInfo the method advice info + */ public void addMethodAdviceInfos(MethodAdviceInfo methodAdviceInfo) { this.methodAdviceInfos.add(methodAdviceInfo); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java index 014df19ec..1fce141de 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.models; @@ -44,6 +46,7 @@ /** * The type Grouped open api. + * * @author bnasslahsen */ public class GroupedOpenApi { @@ -316,6 +319,7 @@ public GroupedOpenApi addAllOpenApiMethodFilter(Collection genericMapResponse, Locale locale) { this.methodProduces = methodProducesNew; @@ -151,9 +155,10 @@ public MethodAttributes(String[] methodProducesNew, String defaultConsumesMediaT /** * Instantiates a new Method attributes. + * * @param defaultConsumesMediaType the default consumes media type * @param defaultProducesMediaType the default produces media type - * @param locale the locale + * @param locale the locale */ public MethodAttributes(String defaultConsumesMediaType, String defaultProducesMediaType, Locale locale) { this.defaultConsumesMediaType = defaultConsumesMediaType; @@ -163,12 +168,13 @@ public MethodAttributes(String defaultConsumesMediaType, String defaultProducesM /** * Instantiates a new Method attributes. + * * @param defaultConsumesMediaType the default consumes media type * @param defaultProducesMediaType the default produces media type - * @param methodConsumes the method consumes - * @param methodProduces the method produces - * @param headers the headers - * @param locale the locale + * @param methodConsumes the method consumes + * @param methodProduces the method produces + * @param headers the headers + * @param locale the locale */ public MethodAttributes(String defaultConsumesMediaType, String defaultProducesMediaType, String[] methodConsumes, String[] methodProduces, String[] headers, Locale locale) { this.defaultConsumesMediaType = defaultConsumesMediaType; @@ -281,7 +287,7 @@ else if (reqMappingClass != null) { * * @param produces the produces * @param consumes the consumes - * @param headers the headers + * @param headers the headers */ private void fillMethods(String[] produces, String[] consumes, String[] headers) { if (ArrayUtils.isNotEmpty(produces)) { @@ -303,14 +309,14 @@ private void fillMethods(String[] produces, String[] consumes, String[] headers) setHeaders(headers); } - /** + /** * Merge string arrays into one array with unique values * * @param array1 the array1 * @param array2 the array2 * @return the string [ ] */ - private String[] mergeArrays(@Nullable String[] array1, String[] array2) { + private String[] mergeArrays(@Nullable String[] array1, String[] array2) { Set uniqueValues = array1 == null ? new LinkedHashSet<>() : Arrays.stream(array1).collect(Collectors.toCollection(LinkedHashSet::new)); uniqueValues.addAll(Arrays.asList(array2)); return uniqueValues.toArray(new String[0]); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java index 8a868682a..132b1c158 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java @@ -2,22 +2,26 @@ * * * * * * - * * * * Copyright 2019-2024 the original author or authors. * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. * * * * * - * + * */ package org.springdoc.core.models; @@ -29,6 +33,7 @@ /** * The type Parameter Id. + * * @author bnasslahsen */ public class ParameterId { @@ -73,7 +78,7 @@ public ParameterId(io.swagger.v3.oas.annotations.Parameter parameter) { /** * Instantiates a new Parameter id. * - * @param pName the p name + * @param pName the p name * @param paramType the param type */ public ParameterId(String pName, String paramType) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java index 7d885729b..22191ffb7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.models; @@ -41,6 +43,7 @@ /** * The type Parameter info. + * * @author bnasslahsen */ public class ParameterInfo { @@ -92,10 +95,11 @@ public class ParameterInfo { /** * Instantiates a new Parameter info. - * @param pName the parameter name - * @param methodParameter the method parameter + * + * @param pName the parameter name + * @param methodParameter the method parameter * @param genericParameterService the parameter builder - * @param parameterAnnotation the parameter annotation + * @param parameterAnnotation the parameter annotation */ public ParameterInfo(String pName, MethodParameter methodParameter, GenericParameterService genericParameterService, Parameter parameterAnnotation) { RequestHeader requestHeader = methodParameter.getParameterAnnotation(RequestHeader.class); @@ -273,7 +277,7 @@ private void calculateParams(PathVariable pathVar) { * Calculate params. * * @param requestParam the request param - * @param isFile the is file + * @param isFile the is file */ private void calculateParams(RequestParam requestParam, boolean isFile) { if (StringUtils.isNotEmpty(requestParam.value())) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java index 6f99e4f78..ee1b2f763 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.models; @@ -30,6 +32,7 @@ /** * The type Request body info. + * * @author bnasslahsen */ @SuppressWarnings("rawtypes") @@ -85,7 +88,7 @@ public void setMergedSchema(Schema mergedSchema) { * Add properties. * * @param paramName the param name - * @param schemaN the schema n + * @param schemaN the schema n */ public void addProperties(String paramName, Schema schemaN) { if (mergedSchema == null) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java index 7cfb44a05..b9b64f549 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.properties; @@ -40,6 +42,7 @@ * Please refer to the swagger * configuration.md * to get the idea what each parameter does. + * * @author bnasslahsen */ public abstract class AbstractSwaggerUiConfigProperties { @@ -83,7 +86,7 @@ public abstract class AbstractSwaggerUiConfigProperties { /** * Enables or disables deep linking for tags and operations. * - * @see deep-linking.md + * @see deep-linking.md */ protected Boolean deepLinking; @@ -220,6 +223,7 @@ public void setQueryConfigEnabled(Boolean queryConfigEnabled) { /** * Gets try it out enabled + * * @return try it out enabled */ public Boolean getTryItOutEnabled() { @@ -228,6 +232,7 @@ public Boolean getTryItOutEnabled() { /** * Sets try it out enabled + * * @param tryItOutEnabled try it out enabled */ public void setTryItOutEnabled(Boolean tryItOutEnabled) { @@ -672,11 +677,11 @@ public void setUrlsPrimaryName(String urlsPrimaryName) { */ enum Direction { /** - *Asc direction. + * Asc direction. */ ASC, /** - *Desc direction. + * Desc direction. */ DESC; @@ -721,8 +726,8 @@ public SwaggerUrl() { /** * Instantiates a new Swagger url. * - * @param group the group - * @param url the url + * @param group the group + * @param url the url * @param displayName the display name */ public SwaggerUrl(String group, String url, String displayName) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java index 9d332271b..8365100af 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2023 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.properties; @@ -1568,7 +1570,7 @@ public static class GroupConfig { */ private OpenAPI openApi; - + /** * Instantiates a new Group config. */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java index 4f2468a42..f25c1ccc1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.properties; @@ -43,6 +45,7 @@ /** * The type Swagger ui config parameters. + * * @author bnasslahsen */ public class SwaggerUiConfigParameters extends AbstractSwaggerUiConfigProperties { @@ -191,7 +194,7 @@ public SwaggerUiConfigParameters(SwaggerUiConfigProperties swaggerUiConfig) { /** * Add group. * - * @param group the group + * @param group the group * @param displayName the display name */ public void addGroup(String group, String displayName) { @@ -299,9 +302,9 @@ public Map getConfigParameters() { /** * Put. * - * @param urls the urls + * @param urls the urls * @param swaggerUrls the swagger urls - * @param params the params + * @param params the params */ private void put(String urls, Set swaggerUrls, Map params) { Comparator swaggerUrlComparator; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java index 6d76995f9..6d93fdd9b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.properties; @@ -42,6 +44,7 @@ /** * The type Swagger ui config properties. + * * @author bnasslahsen */ @Lazy(false) @@ -210,6 +213,7 @@ public Set cloneUrls() { /** * The type Csrf. + * * @author bnasslashen */ public static class Csrf { @@ -378,6 +382,7 @@ public void setHeaderName(String headerName) { /** * The type Syntax highlight. + * * @author bnasslashen */ public static class SyntaxHighlight { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java index 64a3074b0..a4aae30de 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.properties; @@ -45,6 +47,7 @@ * Please refer to the swagger * configuration.md * to get the idea what each parameter does. + * * @author bnasslahsen */ @Lazy(false) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java index 87eb58c4a..1a006aaab 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -49,6 +51,7 @@ /** * The type Actuator provider. + * * @author bnasslahsen */ public abstract class ActuatorProvider implements ApplicationListener { @@ -92,9 +95,9 @@ public abstract class ActuatorProvider implements ApplicationListener managementServerProperties, Optional webEndpointProperties, diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java index 76701ea5a..2ca549581 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -30,6 +32,7 @@ /** * The interface Spring cloud function provider. + * * @author bnasslahsen */ public interface CloudFunctionProvider { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java index c659c668a..42d8f837d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -34,6 +36,7 @@ /** * The type Data rest hal provider. + * * @author bnasslahsen */ public class DataRestHalProvider extends HateoasHalProvider { @@ -45,9 +48,10 @@ public class DataRestHalProvider extends HateoasHalProvider { /** * Instantiates a new Data rest hal provider. + * * @param repositoryRestConfigurationOptional the repository rest configuration optional - * @param hateoasPropertiesOptional the hateoas properties optional - * @param objectMapperProvider the object mapper provider + * @param hateoasPropertiesOptional the hateoas properties optional + * @param objectMapperProvider the object mapper provider */ public DataRestHalProvider(Optional repositoryRestConfigurationOptional, Optional hateoasPropertiesOptional, ObjectMapperProvider objectMapperProvider) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java index b29553ddf..19c499e74 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -33,6 +35,7 @@ /** * The type Hateoas hal provider. + * * @author bnasslahsen */ public class HateoasHalProvider { @@ -51,7 +54,7 @@ public class HateoasHalProvider { * Instantiates a new Hateoas hal provider. * * @param hateoasPropertiesOptional the hateoas properties optional - * @param objectMapperProvider the object mapper provider + * @param objectMapperProvider the object mapper provider */ public HateoasHalProvider(Optional hateoasPropertiesOptional, ObjectMapperProvider objectMapperProvider) { this.hateoasPropertiesOptional = hateoasPropertiesOptional; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java index a53d58728..f878d4ed7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2023 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -30,6 +32,7 @@ /** * The interface Javadoc provider. + * * @author bnasslashen */ public interface JavadocProvider { @@ -78,7 +81,7 @@ public interface JavadocProvider { * Gets param javadoc. * * @param method the method - * @param name the name + * @param name the name * @return the param javadoc */ String getParamJavadoc(Method method, String name); @@ -94,6 +97,7 @@ public interface JavadocProvider { /** * Returns the first sentence of a javadoc comment. + * * @param text the javadoc comment's text * @return the first sentence based on javadoc guidelines */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java index 30d8df82e..a1284006f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -96,7 +98,8 @@ public static ObjectMapper createJson(SpringDocConfigProperties springDocConfigP /** * Sort output. * - * @param objectMapper the object mapper + * @param objectMapper the object mapper + * @param springDocConfigProperties the spring doc config properties */ public static void sortOutput(ObjectMapper objectMapper, SpringDocConfigProperties springDocConfigProperties) { objectMapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java index 73d4025d4..033ff14f4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -29,6 +31,7 @@ /** * The type Repository rest configuration provider. + * * @author bnasslahsen */ public class RepositoryRestConfigurationProvider { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java index 602eb4cde..edd93cc95 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -33,6 +35,7 @@ /** * The interface Repository rest resource provider. + * * @author bnasslahsen */ public interface RepositoryRestResourceProvider { @@ -41,7 +44,7 @@ public interface RepositoryRestResourceProvider { * Gets router operations. * * @param openAPI the open api - * @param locale the locale + * @param locale the locale * @return the router operations */ List getRouterOperations(OpenAPI openAPI, Locale locale); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java index 67f015c3b..89597e8c3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -30,6 +32,7 @@ /** * The interface Router function provider. + * * @author bnasslahsen */ public interface RouterFunctionProvider { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java index d76fb52f6..1598d7124 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -28,6 +30,7 @@ /** * The interface Security o auth 2 provider. + * * @author bnasslahsen */ public interface SecurityOAuth2Provider { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java index b9db4c50a..e9d56c9a0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -66,6 +68,7 @@ /** * The type Spring cloud function provider. + * * @author bnasslahsen */ public class SpringCloudFunctionProvider implements CloudFunctionProvider, ApplicationContextAware { @@ -113,7 +116,8 @@ public class SpringCloudFunctionProvider implements CloudFunctionProvider, Appli /** * Instantiates a new Spring cloud function provider. - * @param functionCatalogOptional the function catalog + * + * @param functionCatalogOptional the function catalog * @param springDocConfigProperties the spring doc config properties */ public SpringCloudFunctionProvider(Optional functionCatalogOptional, SpringDocConfigProperties springDocConfigProperties) { @@ -183,10 +187,10 @@ else if (function.isSupplier()) { /** * Gets router operation common. * - * @param name the name - * @param requestMethod the request method + * @param name the name + * @param requestMethod the request method * @param routerOperation the router operation - * @param apiResponses the api responses + * @param apiResponses the api responses */ private void getRouterOperationsCommon(String name, RequestMethod requestMethod, RouterOperation routerOperation, ApiResponses apiResponses) { routerOperation.getOperationModel().responses(apiResponses); @@ -202,10 +206,10 @@ private void getRouterOperationsCommon(String name, RequestMethod requestMethod, /** * Build request. * - * @param openAPI the open api - * @param name the name - * @param function the function - * @param requestMethod the request method + * @param openAPI the open api + * @param name the name + * @param function the function + * @param requestMethod the request method * @param routerOperation the router operation */ private void buildRequest(OpenAPI openAPI, String name, FunctionInvocationWrapper function, RequestMethod requestMethod, RouterOperation routerOperation) { @@ -229,9 +233,9 @@ private void buildRequest(OpenAPI openAPI, String name, FunctionInvocationWrappe /** * Build router operation. * - * @param name the name - * @param type the type - * @param requestMethod the request method + * @param name the name + * @param type the type + * @param requestMethod the request method * @param routerOperationList the router operation list * @return the router operation */ @@ -250,9 +254,9 @@ private RouterOperation buildRouterOperation(String name, String type, RequestMe /** * Build responses api responses. * - * @param openAPI the open api - * @param function the function - * @param mediaTypes the media types + * @param openAPI the open api + * @param function the function + * @param mediaTypes the media types * @param genericResponseService the generic response service * @return the api responses */ @@ -270,7 +274,7 @@ private ApiResponses buildResponses(OpenAPI openAPI, FunctionInvocationWrapper f /** * Gets router function paths. * - * @param beanName the bean name + * @param beanName the bean name * @param requestMethod the request method * @return the router function paths */ @@ -302,7 +306,7 @@ protected RouterOperation getRouterFunctionPaths(String beanName, RequestMethod /** * Fill router operation. * - * @param routerOperation the router operation + * @param routerOperation the router operation * @param userRouterOperation the user router operation */ private void mergeRouterOperation(RouterOperation routerOperation, RouterOperation userRouterOperation) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java index f95fca286..6ac657382 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -29,6 +31,7 @@ /** * The type Spring data web properties provider. + * * @author bnasslahsen */ public class SpringDataWebPropertiesProvider { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java index 8ebfc1905..a781b5b0e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2023 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -44,6 +46,7 @@ /** * The type Spring doc javadoc provider. + * * @author bnasslahsen */ public class SpringDocJavadocProvider implements JavadocProvider { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java index 8b3702ee1..e9a05117f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -29,6 +31,7 @@ /** * The type Spring doc providers. + * * @author bnasslahsen */ public class SpringDocProviders { @@ -70,13 +73,14 @@ public class SpringDocProviders { /** * Instantiates a new Spring doc providers. - * @param actuatorProvider the actuator provider - * @param springCloudFunctionProvider the spring cloud function provider - * @param springSecurityOAuth2Provider the spring security o auth 2 provider + * + * @param actuatorProvider the actuator provider + * @param springCloudFunctionProvider the spring cloud function provider + * @param springSecurityOAuth2Provider the spring security o auth 2 provider * @param repositoryRestResourceProvider the repository rest resource provider - * @param routerFunctionProvider the router function provider - * @param springWebProvider the spring web provider - * @param objectMapperProvider the object mapper provider + * @param routerFunctionProvider the router function provider + * @param springWebProvider the spring web provider + * @param objectMapperProvider the object mapper provider */ public SpringDocProviders(Optional actuatorProvider, Optional springCloudFunctionProvider, Optional springSecurityOAuth2Provider, Optional repositoryRestResourceProvider, diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java index 46ae707cc..e199dc7e1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -70,6 +72,7 @@ /** * The type Spring repository rest resource provider. + * * @author bnasslahsen */ public class SpringRepositoryRestResourceProvider implements RepositoryRestResourceProvider { @@ -181,14 +184,14 @@ public class SpringRepositoryRestResourceProvider implements RepositoryRestResou /** * Instantiates a new Spring repository rest resource provider. * - * @param mappings the mappings - * @param repositories the repositories - * @param associations the associations - * @param applicationContext the application context + * @param mappings the mappings + * @param repositories the repositories + * @param associations the associations + * @param applicationContext the application context * @param dataRestRouterOperationService the data rest router operation builder - * @param persistentEntities the persistent entities - * @param mapper the mapper - * @param springDocDataRestUtils the spring doc data rest utils + * @param persistentEntities the persistent entities + * @param mapper the mapper + * @param springDocDataRestUtils the spring doc data rest utils */ public SpringRepositoryRestResourceProvider(ResourceMappings mappings, Repositories repositories, Associations associations, ApplicationContext applicationContext, DataRestRouterOperationService dataRestRouterOperationService, @@ -338,11 +341,11 @@ private List getHandlerMappingList() { /** * Find search resource mappings. * - * @param openAPI the open api + * @param openAPI the open api * @param routerOperationList the router operation list - * @param handlerMappingList the handler mapping list - * @param dataRestRepository the repository data rest - * @param resourceMetadata the resource metadata + * @param handlerMappingList the handler mapping list + * @param dataRestRepository the repository data rest + * @param resourceMetadata the resource metadata */ private void findSearchResourceMappings(OpenAPI openAPI, List routerOperationList, List handlerMappingList, DataRestRepository dataRestRepository, ResourceMetadata resourceMetadata) { @@ -367,11 +370,11 @@ private void findSearchResourceMappings(OpenAPI openAPI, List r /** * Find search controllers list. * - * @param routerOperationList the router operation list - * @param handlerMethodMap the handler method map - * @param resourceMetadata the resource metadata - * @param dataRestRepository the repository data rest - * @param openAPI the open api + * @param routerOperationList the router operation list + * @param handlerMethodMap the handler method map + * @param resourceMetadata the resource metadata + * @param dataRestRepository the repository data rest + * @param openAPI the open api * @param searchResourceMappings the search resource mappings * @return the list */ @@ -389,10 +392,10 @@ private List findSearchControllers(List router * Find controllers list. * * @param routerOperationList the router operation list - * @param handlerMethodMap the handler method map - * @param resourceMetadata the resource metadata - * @param dataRestRepository the repository data rest - * @param openAPI the open api + * @param handlerMethodMap the handler method map + * @param resourceMetadata the resource metadata + * @param dataRestRepository the repository data rest + * @param openAPI the open api * @return the list */ private List findControllers(List routerOperationList, diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java index 740afd38e..8def461bb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -34,6 +36,7 @@ /** * The type Spring web provider. + * * @author bnasslahsen */ public abstract class SpringWebProvider implements ApplicationContextAware { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java index 86c4e2c94..81de30b7f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.providers; @@ -48,6 +50,7 @@ /** * The type Web conversion service provider. + * * @author bnasslashen */ public class WebConversionServiceProvider implements InitializingBean, ApplicationContextAware { @@ -97,7 +100,7 @@ else if (isAssignable(REACTIVE_APPLICATION_CONTEXT_CLASS, this.applicationContex /** * Attempts to convert {@code source} into the target type as described by {@code targetTypeDescriptor}. * - * @param source the source + * @param source the source * @param targetTypeDescriptor the target type descriptor * @return the converted source */ @@ -139,7 +142,7 @@ public Class getSpringConvertedType(Class clazz) { * Is assignable boolean. * * @param target the target - * @param type the type + * @param type the type * @return the boolean */ private boolean isAssignable(String target, Class type) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 6f7543182..4aa5d0a0c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.service; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index 1c94d12d5..5263e8d80 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -89,6 +91,7 @@ /** * The type Generic parameter builder. + * * @author bnasslahsen, coutin */ @SuppressWarnings("rawtypes") @@ -147,11 +150,12 @@ public class GenericParameterService { /** * Instantiates a new Generic parameter builder. - * @param propertyResolverUtils the property resolver utils + * + * @param propertyResolverUtils the property resolver utils * @param optionalDelegatingMethodParameterCustomizers the optional list delegating method parameter customizer - * @param optionalWebConversionServiceProvider the optional web conversion service provider - * @param objectMapperProvider the object mapper provider - * @param javadocProviderOptional the javadoc provider + * @param optionalWebConversionServiceProvider the optional web conversion service provider + * @param objectMapperProvider the object mapper provider + * @param javadocProviderOptional the javadoc provider */ public GenericParameterService(PropertyResolverUtils propertyResolverUtils, Optional> optionalDelegatingMethodParameterCustomizers, Optional optionalWebConversionServiceProvider, ObjectMapperProvider objectMapperProvider, Optional javadocProviderOptional) { @@ -187,7 +191,7 @@ public static boolean isFile(Class type) { * Merge parameter parameter. * * @param existingParamDoc the existing param doc - * @param paramCalcul the param calcul + * @param paramCalcul the param calcul * @return the parameter */ public static Parameter mergeParameter(List existingParamDoc, Parameter paramCalcul) { @@ -214,7 +218,7 @@ public static Parameter mergeParameter(List existingParamDoc, Paramet * Merge parameter. * * @param paramCalcul the param calcul - * @param paramDoc the param doc + * @param paramDoc the param doc */ public static void mergeParameter(Parameter paramCalcul, Parameter paramDoc) { if (StringUtils.isBlank(paramDoc.getDescription())) @@ -261,9 +265,9 @@ public static void mergeParameter(Parameter paramCalcul, Parameter paramDoc) { * Build parameter from doc parameter. * * @param parameterDoc the parameter doc - * @param components the components - * @param jsonView the json view - * @param locale the locale + * @param components the components + * @param jsonView the json view + * @param locale the locale * @return the parameter */ public Parameter buildParameterFromDoc(io.swagger.v3.oas.annotations.Parameter parameterDoc, @@ -311,9 +315,9 @@ public Parameter buildParameterFromDoc(io.swagger.v3.oas.annotations.Parameter p * Sets schema. * * @param parameterDoc the parameter doc - * @param components the components - * @param jsonView the json view - * @param parameter the parameter + * @param components the components + * @param jsonView the json view + * @param parameter the parameter */ private void setSchema(io.swagger.v3.oas.annotations.Parameter parameterDoc, Components components, JsonView jsonView, Parameter parameter) { if (StringUtils.isNotBlank(parameterDoc.ref())) @@ -352,10 +356,10 @@ private void setSchema(io.swagger.v3.oas.annotations.Parameter parameterDoc, Com /** * Calculate schema schema. * - * @param components the components - * @param parameterInfo the parameter info + * @param components the components + * @param parameterInfo the parameter info * @param requestBodyInfo the request body info - * @param jsonView the json view + * @param jsonView the json view * @return the schema */ Schema calculateSchema(Components components, ParameterInfo parameterInfo, RequestBodyInfo requestBodyInfo, JsonView jsonView) { @@ -398,11 +402,11 @@ Schema calculateSchema(Components components, ParameterInfo parameterInfo, Reque /** * Calculate request body schema schema. * - * @param components the components - * @param parameterInfo the parameter info + * @param components the components + * @param parameterInfo the parameter info * @param requestBodyInfo the request body info - * @param schemaN the schema n - * @param paramName the param name + * @param schemaN the schema n + * @param paramName the param name * @return the schema */ private Schema calculateRequestBodySchema(Components components, ParameterInfo parameterInfo, RequestBodyInfo requestBodyInfo, Schema schemaN, String paramName) { @@ -439,7 +443,7 @@ else if (parameterInfo.isRequestPart() || schemaN instanceof FileSchema || schem * Sets examples. * * @param parameterDoc the parameter doc - * @param parameter the parameter + * @param parameter the parameter */ private void setExamples(io.swagger.v3.oas.annotations.Parameter parameterDoc, Parameter parameter) { Map exampleMap = new HashMap<>(); @@ -482,7 +486,7 @@ private void setExtensions(io.swagger.v3.oas.annotations.Parameter parameterDoc, * Sets parameter explode. * * @param parameter the parameter - * @param p the p + * @param p the p */ private void setParameterExplode(Parameter parameter, io.swagger.v3.oas.annotations.Parameter p) { if (isExplodable(p)) { @@ -499,7 +503,7 @@ else if (Explode.FALSE.equals(p.explode())) { * Sets parameter style. * * @param parameter the parameter - * @param p the p + * @param p the p */ private void setParameterStyle(Parameter parameter, io.swagger.v3.oas.annotations.Parameter p) { if (StringUtils.isNotBlank(p.style().toString())) { @@ -590,6 +594,7 @@ public Optional getOptionalWebConversionServicePro /** * Resolve the given annotation-specified value, * potentially containing placeholders and expressions. + * * @param value the value * @return the object */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index 29c03f9b4..5c462847b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2023 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -145,7 +147,7 @@ public class GenericResponseService implements ApplicationContextAware { * The Context. */ private ApplicationContext applicationContext; - + /** * The constant LOGGER. */ @@ -661,13 +663,21 @@ else if (returnType instanceof ParameterizedType parameterizedType) { return result; } - + + /** + * Gets controller advice bean. + * + * @param controllerAdviceBeans the controller advice beans + * @param controllerAdvice the controller advice + * @return the controller advice bean + */ private ControllerAdviceBean getControllerAdviceBean(List controllerAdviceBeans, Object controllerAdvice) { return controllerAdviceBeans.stream() .filter(controllerAdviceBean -> (controllerAdviceBean.getBeanType()!=null && controllerAdviceBean.getBeanType().isAssignableFrom(controllerAdvice.getClass()))) .findFirst() .orElse(null); } + /** * Gets generic map response. * @@ -743,7 +753,7 @@ private Map getGenericMapResponse(HandlerMethod handlerMeth reentrantLock.unlock(); } } - + /** * Is valid http code boolean. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java index 218acd757..fef081a29 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -491,6 +493,7 @@ public Schema resolveProperties(Schema schema, Locale locale) { * Sets server base url. * * @param serverBaseUrl the server base url + * @param httpRequest the http request */ public void setServerBaseUrl(String serverBaseUrl, HttpRequest httpRequest) { String customServerBaseUrl = serverBaseUrl; @@ -594,7 +597,7 @@ public Webhooks[] getWebhooks() { // Convert the list of Webhooks annotations to an array and return return allWebhooks.toArray(new Webhooks[0]); } - + /** * Build open api with open api definition. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java index 511327a91..625fbe490 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -401,8 +403,8 @@ private void setLinks(io.swagger.v3.oas.annotations.responses.ApiResponse respon * Sets description. * * @param response the response - * @param response the javadocReturn * @param apiResponseObject the api response object + * @param javadocReturn the javadoc return */ private void setDescription(io.swagger.v3.oas.annotations.responses.ApiResponse response, ApiResponse apiResponseObject, String javadocReturn) { @@ -557,7 +559,8 @@ public JavadocProvider getJavadocProvider() { /** * Gets propertyResolverUtils - * @return propertyResolverUtils + * + * @return propertyResolverUtils property resolver utils */ public PropertyResolverUtils getPropertyResolverUtils(){ return parameterBuilder.getPropertyResolverUtils(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java index a563e651e..4f4b4fea6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -51,6 +53,7 @@ /** * The type Request body builder. + * * @author bnasslahsen */ public class RequestBodyService { @@ -68,7 +71,7 @@ public class RequestBodyService { /** * Instantiates a new Request body builder. * - * @param parameterBuilder the parameter builder + * @param parameterBuilder the parameter builder * @param propertyResolverUtils the property resolver utils */ public RequestBodyService(GenericParameterService parameterBuilder, PropertyResolverUtils propertyResolverUtils) { @@ -80,12 +83,12 @@ public RequestBodyService(GenericParameterService parameterBuilder, PropertyReso /** * Build request body from doc optional. * - * @param requestBody the request body - * @param requestBodyOp the request body op - * @param methodAttributes the method attributes - * @param components the components + * @param requestBody the request body + * @param requestBodyOp the request body op + * @param methodAttributes the method attributes + * @param components the components * @param jsonViewAnnotation the json view annotation - * @param locale the locale + * @param locale the locale * @return the optional */ public Optional buildRequestBodyFromDoc( @@ -133,14 +136,14 @@ public Optional buildRequestBodyFromDoc( /** * Build resquest body content. * - * @param requestBody the request body - * @param requestBodyOp the request body op - * @param methodAttributes the method attributes - * @param components the components + * @param requestBody the request body + * @param requestBodyOp the request body op + * @param methodAttributes the method attributes + * @param components the components * @param jsonViewAnnotation the json view annotation - * @param classConsumes the class consumes - * @param methodConsumes the method consumes - * @param requestBodyObject the request body object + * @param classConsumes the class consumes + * @param methodConsumes the method consumes + * @param requestBodyObject the request body object */ private void buildResquestBodyContent(io.swagger.v3.oas.annotations.parameters.RequestBody requestBody, RequestBody requestBodyOp, MethodAttributes methodAttributes, Components components, JsonView jsonViewAnnotation, String[] classConsumes, String[] methodConsumes, RequestBody requestBodyObject) { Optional optionalContent = SpringDocAnnotationsUtils @@ -194,9 +197,9 @@ private String[] getConsumes(String[] classConsumes) { /** * Build request body from doc optional. * - * @param requestBody the request body + * @param requestBody the request body * @param methodAttributes the method attributes - * @param components the components + * @param components the components * @return the optional */ public Optional buildRequestBodyFromDoc(io.swagger.v3.oas.annotations.parameters.RequestBody requestBody, @@ -207,11 +210,11 @@ public Optional buildRequestBodyFromDoc(io.swagger.v3.oas.annotatio /** * Build request body from doc optional. * - * @param requestBody the request body - * @param methodAttributes the method attributes - * @param components the components + * @param requestBody the request body + * @param methodAttributes the method attributes + * @param components the components * @param jsonViewAnnotation the json view annotation - * @param locale the locale + * @param locale the locale * @return the optional */ public Optional buildRequestBodyFromDoc(io.swagger.v3.oas.annotations.parameters.RequestBody requestBody, @@ -223,10 +226,11 @@ public Optional buildRequestBodyFromDoc(io.swagger.v3.oas.annotatio /** * Build request body from doc optional. * - * @param requestBody the request body - * @param requestBodyOp the request body op + * @param requestBody the request body + * @param requestBodyOp the request body op * @param methodAttributes the method attributes - * @param components the components + * @param components the components + * @param locale the locale * @return the optional */ public Optional buildRequestBodyFromDoc( @@ -238,10 +242,10 @@ public Optional buildRequestBodyFromDoc( /** * Calculate request body info. * - * @param components the components + * @param components the components * @param methodAttributes the method attributes - * @param parameterInfo the parameter info - * @param requestBodyInfo the request body info + * @param parameterInfo the parameter info + * @param requestBodyInfo the request body info */ public void calculateRequestBodyInfo(Components components, MethodAttributes methodAttributes, ParameterInfo parameterInfo, RequestBodyInfo requestBodyInfo) { @@ -271,11 +275,11 @@ public void calculateRequestBodyInfo(Components components, MethodAttributes met /** * Build request body. * - * @param requestBody the request body - * @param components the components + * @param requestBody the request body + * @param components the components * @param methodAttributes the method attributes - * @param parameterInfo the parameter info - * @param requestBodyInfo the request body info + * @param parameterInfo the parameter info + * @param requestBodyInfo the request body info * @return the request body */ private RequestBody buildRequestBody(RequestBody requestBody, Components components, @@ -311,9 +315,9 @@ else if (!methodAttributes.isWithResponseBodySchemaDoc()) { /** * Merge content. * - * @param requestBody the request body + * @param requestBody the request body * @param methodAttributes the method attributes - * @param schema the schema + * @param schema the schema */ private void mergeContent(RequestBody requestBody, MethodAttributes methodAttributes, Schema schema) { Content content = requestBody.getContent(); @@ -323,9 +327,9 @@ private void mergeContent(RequestBody requestBody, MethodAttributes methodAttrib /** * Build content. * - * @param requestBody the request body + * @param requestBody the request body * @param methodAttributes the method attributes - * @param schema the schema + * @param schema the schema */ private void buildContent(RequestBody requestBody, MethodAttributes methodAttributes, Schema schema) { Content content = new Content(); @@ -335,10 +339,10 @@ private void buildContent(RequestBody requestBody, MethodAttributes methodAttrib /** * Build content. * - * @param requestBody the request body + * @param requestBody the request body * @param methodAttributes the method attributes - * @param schema the schema - * @param content the content + * @param schema the schema + * @param content the content */ private void buildContent(RequestBody requestBody, MethodAttributes methodAttributes, Schema schema, Content content) { for (String value : methodAttributes.getMethodConsumes()) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java index baf785889..a4be06409 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -28,6 +30,7 @@ /** * The type Security scheme pair. + * * @author bnasslahsen */ record SecuritySchemePair(String key, SecurityScheme securityScheme) {} diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java index 5212600e0..b80c7b555 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -52,6 +54,7 @@ /** * The type Security parser. + * * @author bnasslahsen */ public class SecurityService { @@ -134,7 +137,7 @@ public io.swagger.v3.oas.annotations.security.SecurityRequirement[] getSecurityR /** * Gets security requirements for method. * - * @param method the method + * @param method the method * @param allSecurityTags the all security tags * @return the security requirements for method */ @@ -177,7 +180,7 @@ public Set getSecuri /** * Add security requirements set. * - * @param allSecurityTags the all security tags + * @param allSecurityTags the all security tags * @param securityRequirementsClassList the security requirements class list * @return the set */ @@ -218,10 +221,10 @@ public Optional> getSecurityRequirements( * Gets security scheme. * * @param securityScheme the security scheme - * @param locale the locale + * @param locale the locale * @return the security scheme */ - Optional getSecurityScheme( + Optional getSecurityScheme( io.swagger.v3.oas.annotations.security.SecurityScheme securityScheme, Locale locale) { if (securityScheme == null) return Optional.empty(); @@ -278,7 +281,7 @@ Optional getSecurityScheme( * Build security requirement. * * @param securityRequirements the security requirements - * @param operation the operation + * @param operation the operation */ public void buildSecurityRequirement( io.swagger.v3.oas.annotations.security.SecurityRequirement[] securityRequirements, Operation operation) { @@ -292,7 +295,7 @@ public void buildSecurityRequirement( * Gets o auth flows. * * @param oAuthFlows the o auth flows - * @param locale the locale + * @param locale the locale * @return the o auth flows */ private Optional getOAuthFlows(io.swagger.v3.oas.annotations.security.OAuthFlows oAuthFlows, Locale locale) { @@ -321,7 +324,7 @@ private Optional getOAuthFlows(io.swagger.v3.oas.annotations.securit * Gets o auth flow. * * @param oAuthFlow the o auth flow - * @param locale the locale + * @param locale the locale * @return the o auth flow */ private Optional getOAuthFlow(io.swagger.v3.oas.annotations.security.OAuthFlow oAuthFlow, Locale locale) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java index 3869e5d9f..117f61227 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.utils; @@ -30,6 +32,7 @@ /** * The type Constants. + * * @author bnasslahsen */ public final class Constants { @@ -410,6 +413,7 @@ public final class Constants { * The constant SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED. */ public static final String SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED = "springdoc.nullable-request-parameter-enabled"; + /** * Instantiates a new Constants. */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java index 9f00c4e4b..2eb485792 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.utils; @@ -29,6 +31,7 @@ /** * The type Entity info. + * * @author bnasslashen */ public class EntityInfo { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java index 781c58037..fc0a580a8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.utils; @@ -134,6 +136,12 @@ public String trimIndent(String text) { } } + /** + * Resolve min indent int. + * + * @param lines the lines + * @return the int + */ private int resolveMinIndent(String[] lines) { return Arrays.stream(lines) .filter(line -> !line.trim().isEmpty()) @@ -142,6 +150,12 @@ private int resolveMinIndent(String[] lines) { .orElse(0); } + /** + * Count leading spaces int. + * + * @param line the line + * @return the int + */ private int countLeadingSpaces(String line) { int count = 0; for (char ch : line.toCharArray()) { @@ -195,6 +209,7 @@ public boolean isOpenapi31() { public boolean isResolveExtensionsProperties() { return springDocConfigProperties.getApiDocs().isResolveExtensionsProperties(); } + /** * Resolve extensions map. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java index 7ca39726a..a22cabc44 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.utils; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java index 22cde4283..193ef097a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.utils; @@ -65,6 +67,7 @@ /** * The class Spring doc data rest utils. + * * @author bnasslashen */ public class SpringDocDataRestUtils { @@ -102,7 +105,7 @@ public class SpringDocDataRestUtils { /** * Instantiates a new Spring doc data rest utils. * - * @param linkRelationProvider the link relation provider + * @param linkRelationProvider the link relation provider * @param repositoryRestConfiguration the repository rest configuration */ public SpringDocDataRestUtils(LinkRelationProvider linkRelationProvider, RepositoryRestConfiguration repositoryRestConfiguration) { @@ -113,8 +116,8 @@ public SpringDocDataRestUtils(LinkRelationProvider linkRelationProvider, Reposit /** * Customise. * - * @param openAPI the open api - * @param mappings the mappings + * @param openAPI the open api + * @param mappings the mappings * @param persistentEntities the persistent entities */ public void customise(OpenAPI openAPI, ResourceMappings mappings, PersistentEntities persistentEntities) { @@ -227,6 +230,13 @@ private void updateRequestBodySchema(String className, Schema schema, Components } } + /** + * Update request body schema properties. + * + * @param key the key + * @param referencedSchema the referenced schema + * @param properties the properties + */ private void updateRequestBodySchemaProperties(String key, Schema referencedSchema, Map properties) { if (!CollectionUtils.isEmpty(referencedSchema.getProperties())) { Iterator> it = properties.entrySet().iterator(); @@ -409,7 +419,7 @@ private void updateSingleKey(String suffix, Components components, Schema allSch * Gets associations fields. * * @param resourceMetadata the resource metadata - * @param entity the entity + * @param entity the entity * @return the associations fields */ private List getAssociationsFields(ResourceMetadata @@ -430,7 +440,7 @@ private List getAssociationsFields(ResourceMetadata * Gets ignored fields. * * @param resourceMetadata the resource metadata - * @param entity the entity + * @param entity the entity * @return the ignored fields */ private List getIgnoredFields(ResourceMetadata diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java index c2d162050..ac40d0f56 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.utils; @@ -33,6 +35,7 @@ /** * The interface Spring doc properties utils. + * * @author bnasslahsen */ public interface SpringDocPropertiesUtils { @@ -40,8 +43,8 @@ public interface SpringDocPropertiesUtils { /** * Put. * - * @param name the name - * @param value the value + * @param name the name + * @param value the value * @param params the params */ static void put(String name, List value, Map params) { @@ -51,8 +54,8 @@ static void put(String name, List value, Map params) { /** * Put. * - * @param name the name - * @param value the value + * @param name the name + * @param value the value * @param params the params */ static void put(final String name, final Integer value, final Map params) { @@ -64,8 +67,8 @@ static void put(final String name, final Integer value, final Map params) { @@ -77,8 +80,8 @@ static void put(final String name, final Boolean value, final Map params) { @@ -90,8 +93,8 @@ static void put(final String name, final String value, final Map /** * Put. * - * @param name the name - * @param value the value + * @param name the name + * @param value the value * @param params the params */ static void put(String name, Map value, Map params) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java index bead59140..4a40b5880 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.core.utils; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java index 361b659eb..4f7e3cf32 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.ui; @@ -47,6 +49,7 @@ /** * The type Abstract swagger index transformer. + * * @author bnasslahsen */ public class AbstractSwaggerIndexTransformer { @@ -74,9 +77,9 @@ public class AbstractSwaggerIndexTransformer { /** * Instantiates a new Abstract swagger index transformer. * - * @param swaggerUiConfig the swagger ui config + * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param objectMapperProvider the object mapper provider + * @param objectMapperProvider the object mapper provider */ public AbstractSwaggerIndexTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, ObjectMapperProvider objectMapperProvider) { this.swaggerUiConfig = swaggerUiConfig; @@ -131,7 +134,7 @@ protected String overwriteSwaggerDefaultUrl(String html) { /** * Setting the url configured with swagger ui properties * - * @param html + * @param html the html * @return modifed html */ protected String setConfiguredApiDocsUrl(String html){ @@ -181,7 +184,8 @@ else if (swaggerUiConfig.getCsrf().isUseSessionStorage()) /** * Add parameters string. * - * @param html the html + * @param html the html + * @param swaggerUiConfigParameters the swagger ui config parameters * @return the string * @throws JsonProcessingException the json processing exception */ @@ -208,6 +212,14 @@ protected String addParameters(String html, SwaggerUiConfigParameters swaggerUiC return html; } + /** + * Add parameter string. + * + * @param html the html + * @param key the key + * @param value the value + * @return the string + */ private String addParameter(String html, String key, String value) { StringBuilder stringBuilder = new StringBuilder("window.ui = SwaggerUIBundle({\n"); stringBuilder.append(key + ": \"" + value + "\","); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java index da9d944f5..da2f279d3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.ui; @@ -60,7 +62,7 @@ public abstract class AbstractSwaggerWelcome { /** * Instantiates a new Abstract swagger welcome. * - * @param swaggerUiConfig the swagger ui config + * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties */ protected AbstractSwaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { @@ -70,6 +72,8 @@ protected AbstractSwaggerWelcome(SwaggerUiConfigProperties swaggerUiConfig, Spri /** * Init. + * + * @param swaggerUiConfigParameters the swagger ui config parameters */ protected void init(SwaggerUiConfigParameters swaggerUiConfigParameters) { springDocConfigProperties.getGroupConfigs().forEach(groupConfig -> swaggerUiConfigParameters.addGroup(groupConfig.getGroup(), groupConfig.getDisplayName())); @@ -80,7 +84,7 @@ protected void init(SwaggerUiConfigParameters swaggerUiConfigParameters) { * Build url string. * * @param contextPath the context path - * @param docsUrl the docs url + * @param docsUrl the docs url * @return the string */ protected String buildUrl(String contextPath, String docsUrl) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java index 721c289fe..9472d387d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java @@ -3,29 +3,32 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.ui; /** * The type Spring doc ui exception. + * * @author bnasslahsen */ public class SpringDocUIException extends RuntimeException { @@ -34,7 +37,7 @@ public class SpringDocUIException extends RuntimeException { * Instantiates a new Spring doc ui exception. * * @param message the message - * @param cause the cause + * @param cause the cause */ public SpringDocUIException(String message, Throwable cause) { super(message, cause); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java index b0a1aa3ac..41e85934c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.ui; import java.nio.file.Path; diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/extractor/MethodParameterPojoExtractorTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/extractor/MethodParameterPojoExtractorTest.java index 771195751..220b2f821 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/extractor/MethodParameterPojoExtractorTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/extractor/MethodParameterPojoExtractorTest.java @@ -42,6 +42,9 @@ class MethodParameterPojoExtractorTest { */ @Nested class extractFrom { + /** + * If record object should get field. + */ @Test void ifRecordObjectShouldGetField() { Stream actual = MethodParameterPojoExtractor.extractFrom(RecordObject.class); @@ -51,6 +54,9 @@ void ifRecordObjectShouldGetField() { .containsOnlyOnce("email", "firstName", "lastName"); } + /** + * If class object should get method. + */ @Test void ifClassObjectShouldGetMethod() { Stream actual = MethodParameterPojoExtractor.extractFrom(ClassObject.class); @@ -60,29 +66,66 @@ void ifClassObjectShouldGetMethod() { .containsOnlyOnce("getEmail", "getFirstName", "getLastName"); } + /** + * The type Record object. + */ public record RecordObject(String email, String firstName, String lastName) {} + /** + * The type Class object. + */ public class ClassObject { + /** + * The Email. + */ private String email; + /** + * The First name. + */ private String firstName; + /** + * The Last name. + */ private String lastName; + /** + * Instantiates a new Class object. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ public ClassObject(String email, String firstName, String lastName) { this.email = email; this.firstName = firstName; this.lastName = lastName; } + /** + * Gets email. + * + * @return the email + */ public String getEmail() { return email; } + /** + * Gets first name. + * + * @return the first name + */ public String getFirstName() { return firstName; } + /** + * Gets last name. + * + * @return the last name + */ public String getLastName() { return lastName; } diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java index dc43333c3..73592319c 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.api; @@ -55,6 +57,7 @@ /** * The type Multiple open api actuator resource. + * * @author bnasslashen */ @RestControllerEndpoint(id = DEFAULT_API_DOCS_ACTUATOR_URL) @@ -63,14 +66,14 @@ public class MultipleOpenApiActuatorResource extends MultipleOpenApiResource { /** * Instantiates a new Multiple open api resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public MultipleOpenApiActuatorResource(List groupedOpenApis, ObjectFactory defaultOpenAPIBuilder, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, @@ -82,9 +85,9 @@ public MultipleOpenApiActuatorResource(List groupedOpenApis, Obj * Openapi json mono. * * @param serverHttpRequest the server http request - * @param apiDocsUrl the api docs url - * @param group the group - * @param locale the locale + * @param apiDocsUrl the api docs url + * @param group the group + * @param locale the locale * @return the mono * @throws JsonProcessingException the json processing exception */ @@ -101,9 +104,9 @@ public Mono openapiJson(ServerHttpRequest * Openapi yaml mono. * * @param serverHttpRequest the server http request - * @param apiDocsUrl the api docs url - * @param group the group - * @param locale the locale + * @param apiDocsUrl the api docs url + * @param group the group + * @param locale the locale * @return the mono * @throws JsonProcessingException the json processing exception */ diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java index 1637fa3ef..fb9edd391 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.api; @@ -101,14 +103,14 @@ public abstract class MultipleOpenApiResource implements InitializingBean { /** * Instantiates a new Multiple open api resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ protected MultipleOpenApiResource(List groupedOpenApis, ObjectFactory defaultOpenAPIBuilder, AbstractRequestService requestBuilder, diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java index a54de415e..b73ace89a 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.api; @@ -54,6 +56,7 @@ /** * The type Multiple open api resource. + * * @author bnasslahsen */ @RestController @@ -62,14 +65,14 @@ public class MultipleOpenApiWebFluxResource extends MultipleOpenApiResource { /** * Instantiates a new Multiple open api resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public MultipleOpenApiWebFluxResource(List groupedOpenApis, ObjectFactory defaultOpenAPIBuilder, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, @@ -81,9 +84,9 @@ public MultipleOpenApiWebFluxResource(List groupedOpenApis, Obje * Openapi json mono. * * @param serverHttpRequest the server http request - * @param apiDocsUrl the api docs url - * @param group the group - * @param locale the locale + * @param apiDocsUrl the api docs url + * @param group the group + * @param locale the locale * @return the mono * @throws JsonProcessingException the json processing exception */ @@ -99,9 +102,9 @@ public Mono openapiJson(ServerHttpRequest * Openapi yaml mono. * * @param serverHttpRequest the server http request - * @param apiDocsUrl the api docs url - * @param group the group - * @param locale the locale + * @param apiDocsUrl the api docs url + * @param group the group + * @param locale the locale * @return the mono * @throws JsonProcessingException the json processing exception */ diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java index 3bee371a5..7bb6230ab 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2022 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.api; @@ -55,6 +57,7 @@ /** * The type Open api actuator resource. + * * @author bnasslashen */ @RestControllerEndpoint(id = DEFAULT_API_DOCS_ACTUATOR_URL) @@ -64,14 +67,14 @@ public class OpenApiActuatorResource extends OpenApiResource { /** * Instantiates a new Open api actuator resource. * - * @param groupName the group name + * @param groupName the group name * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public OpenApiActuatorResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, @@ -83,12 +86,12 @@ public OpenApiActuatorResource(String groupName, ObjectFactory o * Instantiates a new Open api actuator resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public OpenApiActuatorResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, @@ -100,7 +103,7 @@ public OpenApiActuatorResource(ObjectFactory openAPIBuilderObjec * Openapi json mono. * * @param serverHttpRequest the server http request - * @param locale the locale + * @param locale the locale * @return the mono * @throws JsonProcessingException the json processing exception */ @@ -116,7 +119,7 @@ public Mono openapiJson(ServerHttpRequest serverHttpRequest, Locale loca * Openapi yaml mono. * * @param serverHttpRequest the server http request - * @param locale the locale + * @param locale the locale * @return the mono * @throws JsonProcessingException the json processing exception */ diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java index bf4bc8758..8a2ab23f7 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.api; @@ -63,6 +65,7 @@ /** * The type Open api resource. + * * @author bnasslahsen, Azige */ public abstract class OpenApiResource extends AbstractOpenApiResource { @@ -70,14 +73,14 @@ public abstract class OpenApiResource extends AbstractOpenApiResource { /** * Instantiates a new Open api resource. * - * @param groupName the group name + * @param groupName the group name * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ protected OpenApiResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, @@ -90,11 +93,12 @@ protected OpenApiResource(String groupName, ObjectFactory openAP * Instantiates a new Open api resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ protected OpenApiResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, @@ -108,8 +112,8 @@ protected OpenApiResource(ObjectFactory openAPIBuilderObjectFact * Openapi json mono. * * @param serverHttpRequest the server http request - * @param apiDocsUrl the api docs url - * @param locale the locale + * @param apiDocsUrl the api docs url + * @param locale the locale * @return the mono * @throws JsonProcessingException the json processing exception */ @@ -124,8 +128,8 @@ protected Mono openapiJson(ServerHttpRequest serverHttpRequest, String a * Openapi yaml mono. * * @param serverHttpRequest the server http request - * @param apiDocsUrl the api docs url - * @param locale the locale + * @param apiDocsUrl the api docs url + * @param locale the locale * @return the mono * @throws JsonProcessingException the json processing exception */ @@ -163,8 +167,9 @@ protected void getPaths(Map restControllers, Locale locale, Open * Calculate path. * * @param restControllers the rest controllers - * @param map the map - * @param locale the locale + * @param map the map + * @param locale the locale + * @param openAPI the open api */ protected void calculatePath(Map restControllers, Map map, Locale locale, OpenAPI openAPI) { TreeMap methodTreeMap = new TreeMap<>(byReversedRequestMappingInfos()); @@ -206,7 +211,9 @@ private Comparator byReversedRequestMappingInfos() { /** * Gets web flux router function paths. - * @param locale the locale + * + * @param locale the locale + * @param openAPI the open api */ protected void getWebFluxRouterFunctionPaths(Locale locale, OpenAPI openAPI) { Map routerBeans = Objects.requireNonNull(openAPIService.getContext()).getBeansOfType(RouterFunction.class); @@ -223,8 +230,8 @@ protected void getWebFluxRouterFunctionPaths(Locale locale, OpenAPI openAPI) { * Calculate server url. * * @param serverHttpRequest the server http request - * @param apiDocsUrl the api docs url - * @param locale the locale + * @param apiDocsUrl the api docs url + * @param locale the locale */ protected void calculateServerUrl(ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) { initOpenAPIBuilder(locale); @@ -236,7 +243,7 @@ protected void calculateServerUrl(ServerHttpRequest serverHttpRequest, String ap * Gets server url. * * @param serverHttpRequest the server http request - * @param apiDocsUrl the api docs url + * @param apiDocsUrl the api docs url * @return the server url */ protected abstract String getServerUrl(ServerHttpRequest serverHttpRequest, String apiDocsUrl); diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java index 5122754be..6a5410f39 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.api; @@ -67,14 +69,14 @@ public class OpenApiWebfluxResource extends OpenApiResource { /** * Instantiates a new Open api webflux resource. * - * @param groupName the group name + * @param groupName the group name * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public OpenApiWebfluxResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, @@ -86,12 +88,12 @@ public OpenApiWebfluxResource(String groupName, ObjectFactory op * Instantiates a new Open api webflux resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ @Autowired public OpenApiWebfluxResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java index 60b7625eb..b5133bb62 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.core.configuration; @@ -59,6 +61,7 @@ /** * The type Multiple open api web flux configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -72,14 +75,14 @@ public class MultipleOpenApiSupportConfiguration { /** * Multiple open api resource multiple open api resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers * @return the multiple open api resource */ @Bean @@ -100,6 +103,7 @@ MultipleOpenApiWebFluxResource multipleOpenApiResource(List grou /** * The type Spring doc web mvc actuator different configuration. + * * @author bnasslashen */ @ConditionalOnClass(WebFluxEndpointHandlerMapping.class) @@ -109,14 +113,14 @@ static class SpringDocWebMvcActuatorDifferentConfiguration { /** * Multiple open api actuator resource multiple open api actuator resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers * @return the multiple open api actuator resource */ @Bean diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java index bf6d21ebc..0b46d7a31 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.core.configuration; @@ -84,12 +86,12 @@ public class SpringDocWebFluxConfiguration { * Open api resource open api resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers * @return the open api resource */ @Bean @@ -107,9 +109,9 @@ OpenApiWebfluxResource openApiResource(ObjectFactory openAPIBuil /** * Request builder request builder. * - * @param parameterBuilder the parameter builder - * @param requestBodyService the request body builder - * @param parameterCustomizers the parameter customizers + * @param parameterBuilder the parameter builder + * @param requestBodyService the request body builder + * @param parameterCustomizers the parameter customizers * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer * @return the request builder */ @@ -126,9 +128,9 @@ RequestService requestBuilder(GenericParameterService parameterBuilder, RequestB /** * Response builder generic response builder. * - * @param operationService the operation builder + * @param operationService the operation builder * @param springDocConfigProperties the spring doc config properties - * @param propertyResolverUtils the property resolver utils + * @param propertyResolverUtils the property resolver utils * @return the generic response builder */ @Bean @@ -161,11 +163,11 @@ static class SpringDocWebFluxActuatorConfiguration { /** * Actuator provider actuator provider. * - * @param serverProperties the server properties - * @param springDocConfigProperties the spring doc config properties - * @param managementServerProperties the management server properties - * @param webEndpointProperties the web endpoint properties - * @param webFluxEndpointHandlerMapping the web flux endpoint handler mapping + * @param serverProperties the server properties + * @param springDocConfigProperties the spring doc config properties + * @param managementServerProperties the management server properties + * @param webEndpointProperties the web endpoint properties + * @param webFluxEndpointHandlerMapping the web flux endpoint handler mapping * @param controllerEndpointHandlerMapping the controller endpoint handler mapping * @return the actuator provider */ @@ -191,11 +193,12 @@ ActuatorProvider actuatorProvider(ServerProperties serverProperties, * Actuator open api resource open api actuator resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers * @return the open api actuator resource */ @Bean diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java index 6c997efc1..118a443d3 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.core.fn; @@ -49,6 +51,7 @@ /** * The type Springdoc route builder. + * * @author bnasslahsen */ public class SpringdocRouteBuilder extends AbstractSpringdocRouteBuilder { @@ -85,8 +88,8 @@ public RouterFunction build() { /** * Get springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -100,7 +103,7 @@ public SpringdocRouteBuilder GET(String pattern, HandlerFunction /** * Get springdoc route builder. * - * @param handlerFunction the handler function + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -114,8 +117,8 @@ public SpringdocRouteBuilder GET(HandlerFunction handlerFunction /** * Get springdoc route builder. * - * @param predicate the predicate - * @param handlerFunction the handler function + * @param predicate the predicate + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -129,9 +132,9 @@ public SpringdocRouteBuilder GET(RequestPredicate predicate, HandlerFunction handlerFunctio /** * Head springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -174,8 +177,8 @@ public SpringdocRouteBuilder HEAD(String pattern, HandlerFunction handlerFunctio /** * Post springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -234,8 +237,8 @@ public SpringdocRouteBuilder POST(String pattern, HandlerFunction handlerFunction /** * Put springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -294,8 +297,8 @@ public SpringdocRouteBuilder PUT(String pattern, HandlerFunction /** * Put springdoc route builder. * - * @param predicate the predicate - * @param handlerFunction the handler function + * @param predicate the predicate + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -309,9 +312,9 @@ public SpringdocRouteBuilder PUT(RequestPredicate predicate, HandlerFunction handlerFuncti /** * Patch springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -354,8 +357,8 @@ public SpringdocRouteBuilder PATCH(String pattern, HandlerFunction handlerFunct /** * Delete springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -414,8 +417,8 @@ public SpringdocRouteBuilder DELETE(String pattern, HandlerFunction handlerFunc /** * Options springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -474,8 +477,8 @@ public SpringdocRouteBuilder OPTIONS(String pattern, HandlerFunction routerFunction, /** * Resources springdoc route builder. * - * @param pattern the pattern - * @param location the location + * @param pattern the pattern + * @param location the location * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -533,7 +536,7 @@ public SpringdocRouteBuilder resources(String pattern, Resource location, Consum /** * Resources springdoc route builder. * - * @param lookupFunction the lookup function + * @param lookupFunction the lookup function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -547,9 +550,9 @@ public SpringdocRouteBuilder resources(Function> l /** * Nest springdoc route builder. * - * @param predicate the predicate + * @param predicate the predicate * @param routerFunctionSupplier the router function supplier - * @param operationsConsumer the operations consumer + * @param operationsConsumer the operations consumer * @return the springdoc route builder */ public SpringdocRouteBuilder nest(RequestPredicate predicate, Supplier> routerFunctionSupplier, Consumer operationsConsumer) { @@ -562,8 +565,8 @@ public SpringdocRouteBuilder nest(RequestPredicate predicate, Supplier> routerFunctionSupplier, Consumer operationsConsumer) { @@ -592,8 +595,8 @@ public SpringdocRouteBuilder path(String pattern, Supplier requestProcesso /** * After springdoc route builder. * - * @param responseProcessor the response processor + * @param responseProcessor the response processor * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -649,7 +652,7 @@ public SpringdocRouteBuilder after(BiFunction predicate, BiF /** * On error springdoc route builder. * - * @param the type parameter - * @param exceptionType the exception type + * @param the type parameter + * @param exceptionType the exception type * @param responseProvider the response provider * @return the springdoc route builder */ diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java index f9a73446e..975d5dbf7 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.core.providers; @@ -42,6 +44,7 @@ /** * The type Web flux actuator provider. + * * @author bnasslahsen */ public class ActuatorWebFluxProvider extends ActuatorProvider { @@ -59,11 +62,11 @@ public class ActuatorWebFluxProvider extends ActuatorProvider { /** * Instantiates a new Actuator web flux provider. * - * @param serverProperties the server properties - * @param springDocConfigProperties the spring doc config properties - * @param managementServerProperties the management server properties - * @param webEndpointProperties the web endpoint properties - * @param webFluxEndpointHandlerMapping the web flux endpoint handler mapping + * @param serverProperties the server properties + * @param springDocConfigProperties the spring doc config properties + * @param managementServerProperties the management server properties + * @param webEndpointProperties the web endpoint properties + * @param webFluxEndpointHandlerMapping the web flux endpoint handler mapping * @param controllerEndpointHandlerMapping the controller endpoint handler mapping */ public ActuatorWebFluxProvider(ServerProperties serverProperties, diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java index 651c7ee9b..564ce5bc3 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.core.providers; @@ -45,6 +47,7 @@ /** * The type Spring webflux provider. + * * @author bnasslahsen */ public class SpringWebFluxProvider extends SpringWebProvider { diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java index 2f5f49bd7..796d6ef29 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.core.service; @@ -43,6 +45,7 @@ /** * The type Request builder. + * * @author bnasslahsen */ public class RequestService extends AbstractRequestService { @@ -57,9 +60,9 @@ public class RequestService extends AbstractRequestService { /** * Instantiates a new Request builder. * - * @param parameterBuilder the parameter builder - * @param requestBodyService the request body builder - * @param parameterCustomizers the parameter customizers + * @param parameterBuilder the parameter builder + * @param requestBodyService the request body builder + * @param parameterCustomizers the parameter customizers * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer */ public RequestService(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java index dce9ae224..995bba1e6 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.core.visitor; @@ -40,6 +42,7 @@ /** * The type Router function visitor. + * * @author bnasslahsen */ public class RouterFunctionVisitor extends AbstractRouterFunctionVisitor implements RouterFunctions.Visitor, RequestPredicates.Visitor { diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java index 9b88ba2e4..5c1c4d734 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; @@ -59,6 +61,7 @@ /** * The type Swagger config. + * * @author bnasslahsen */ @Lazy(false) @@ -71,9 +74,9 @@ public class SwaggerConfig implements WebFluxConfigurer { /** * Swagger welcome swagger welcome web flux. * - * @param swaggerUiConfig the swagger ui config + * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param springWebProvider the spring web provider + * @param springWebProvider the spring web provider * @return the swagger welcome web flux */ @Bean @@ -117,9 +120,9 @@ SwaggerUiHome swaggerUiHome(Optional optionalWebFluxPropertie * * @param swaggerUiConfigProperties the swagger ui calculated config * @param springDocConfigProperties the spring doc config properties - * @param swaggerIndexTransformer the swagger index transformer - * @param actuatorProvider the actuator provider - * @param swaggerResourceResolver the swagger resource resolver + * @param swaggerIndexTransformer the swagger index transformer + * @param actuatorProvider the actuator provider + * @param swaggerResourceResolver the swagger resource resolver * @return the swagger web flux configurer */ @Bean @@ -134,10 +137,10 @@ SwaggerWebFluxConfigurer swaggerWebFluxConfigurer(SwaggerUiConfigProperties swag /** * Index page transformer swagger index transformer. * - * @param swaggerUiConfig the swagger ui config + * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param swaggerWelcomeCommon the swagger welcome common - * @param objectMapperProvider the object mapper provider + * @param swaggerWelcomeCommon the swagger welcome common + * @param objectMapperProvider the object mapper provider * @return the swagger index transformer */ @Bean @@ -182,6 +185,7 @@ SwaggerResourceResolver swaggerResourceResolver(SwaggerUiConfigProperties swagge /** * The type Swagger actuator welcome configuration. + * * @author bnasslashen */ @ConditionalOnProperty(SPRINGDOC_USE_MANAGEMENT_PORT) @@ -192,9 +196,9 @@ static class SwaggerActuatorWelcomeConfiguration { /** * Swagger actuator welcome swagger welcome actuator. * - * @param swaggerUiConfig the swagger ui config - * @param springDocConfigProperties the spring doc config properties - * @param webEndpointProperties the web endpoint properties + * @param swaggerUiConfig the swagger ui config + * @param springDocConfigProperties the spring doc config properties + * @param webEndpointProperties the web endpoint properties * @param managementServerProperties the management server properties * @return the swagger welcome actuator */ diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java index e0dc89b03..486a483c8 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; @@ -36,6 +38,7 @@ /** * The type Swagger config resource. + * * @author bnasslahsen */ @RestController diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java index 54dd14133..bb8c54171 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; @@ -44,6 +46,7 @@ /** * The type Swagger index transformer. + * * @author bnasslahsen */ public class SwaggerIndexPageTransformer extends AbstractSwaggerIndexTransformer implements SwaggerIndexTransformer { @@ -55,10 +58,11 @@ public class SwaggerIndexPageTransformer extends AbstractSwaggerIndexTransformer /** * Instantiates a new Swagger index transformer. - * @param swaggerUiConfig the swagger ui config + * + * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param swaggerWelcomeCommon the swagger welcome common - * @param objectMapperProvider the object mapper provider + * @param swaggerWelcomeCommon the swagger welcome common + * @param objectMapperProvider the object mapper provider */ public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java index 109fc4ff2..eaa4df112 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; @@ -28,6 +30,7 @@ /** * The type Swagger index transformer. + * * @author pverdage */ public interface SwaggerIndexTransformer extends ResourceTransformer { diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java index 0b1b8750e..7e9ee7507 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.webflux.ui; import org.springdoc.core.properties.SwaggerUiConfigProperties; @@ -19,7 +45,7 @@ public class SwaggerResourceResolver extends LiteWebJarsResourceResolver { * The Swagger ui config properties. */ private final SwaggerUiConfigProperties swaggerUiConfigProperties; - + /** * Instantiates a new Web jars version resource resolver. * diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java index 01d8c1ced..343355c91 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; @@ -44,6 +46,7 @@ /** * Home redirection to swagger api documentation + * * @author bnasslahsen */ @Controller diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java index a0bdc8e6b..9dd9e675d 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; @@ -40,6 +42,7 @@ /** * The type Swagger web flux configurer. + * * @author bnasslahsen */ public class SwaggerWebFluxConfigurer implements WebFluxConfigurer { @@ -68,15 +71,15 @@ public class SwaggerWebFluxConfigurer implements WebFluxConfigurer { * The Spring doc config properties. */ private final SpringDocConfigProperties springDocConfigProperties; - + /** * Instantiates a new Swagger web flux configurer. * * @param swaggerUiConfigProperties the swagger ui calculated config * @param springDocConfigProperties the spring doc config properties - * @param swaggerIndexTransformer the swagger index transformer - * @param actuatorProvider the actuator provider - * @param swaggerResourceResolver the swagger resource resolver + * @param swaggerIndexTransformer the swagger index transformer + * @param actuatorProvider the actuator provider + * @param swaggerResourceResolver the swagger resource resolver */ public SwaggerWebFluxConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, SpringDocConfigProperties springDocConfigProperties, diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java index e8e9688f6..af191383d 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; @@ -50,6 +52,7 @@ /** * The type Swagger actuator welcome. + * * @author bnasslashen */ @ControllerEndpoint(id = DEFAULT_SWAGGER_UI_ACTUATOR_PATH) @@ -73,9 +76,9 @@ public class SwaggerWelcomeActuator extends SwaggerWelcomeCommon { /** * Instantiates a new Swagger welcome. * - * @param swaggerUiConfig the swagger ui config - * @param springDocConfigProperties the spring doc config properties - * @param webEndpointProperties the web endpoint properties + * @param swaggerUiConfig the swagger ui config + * @param springDocConfigProperties the spring doc config properties + * @param webEndpointProperties the web endpoint properties * @param managementServerProperties the management server properties */ public SwaggerWelcomeActuator(SwaggerUiConfigProperties swaggerUiConfig diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java index 5661959bc..bf8d0defb 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; @@ -41,6 +43,7 @@ /** * The type Swagger welcome common. + * * @author bnasslashen */ public abstract class SwaggerWelcomeCommon extends AbstractSwaggerWelcome { @@ -49,11 +52,12 @@ public abstract class SwaggerWelcomeCommon extends AbstractSwaggerWelcome { * The Web jars prefix url. */ protected String webJarsPrefixUrl; - + /** * Instantiates a new Abstract swagger welcome. - * @param swaggerUiConfig the swagger ui config + * + * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties */ protected SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { @@ -64,7 +68,7 @@ protected SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, Spring /** * Redirect to ui mono. * - * @param request the request + * @param request the request * @param response the response * @return the mono */ @@ -93,7 +97,8 @@ protected Map getSwaggerUiConfig(ServerHttpRequest request) { /** * From current context path string. * - * @param request the request + * @param swaggerUiConfigParameters the swagger ui config parameters + * @param request the request * @return the string */ void buildFromCurrentContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, ServerHttpRequest request) { diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java index 54003c0de..5ad06aa28 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; @@ -44,6 +46,7 @@ /** * The type Swagger welcome. + * * @author bnasslahsen */ @Controller @@ -53,13 +56,13 @@ public class SwaggerWelcomeWebFlux extends SwaggerWelcomeCommon { * The Spring web provider. */ private final SpringWebProvider springWebProvider; - + /** * Instantiates a new Swagger welcome web flux. * - * @param swaggerUiConfig the swagger ui config + * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param springWebProvider the spring web provider + * @param springWebProvider the spring web provider */ public SwaggerWelcomeWebFlux(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SpringWebProvider springWebProvider) { super(swaggerUiConfig, springDocConfigProperties); diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java index b66e7b5aa..8a4dc6203 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.api; @@ -51,6 +53,7 @@ /** * The type Multiple open api actuator resource. + * * @author bnasslashen */ @RestControllerEndpoint(id = DEFAULT_API_DOCS_ACTUATOR_URL) @@ -60,14 +63,14 @@ public class MultipleOpenApiActuatorResource extends MultipleOpenApiResource { /** * Instantiates a new Multiple open api resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public MultipleOpenApiActuatorResource(List groupedOpenApis, ObjectFactory defaultOpenAPIBuilder, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers) { @@ -79,8 +82,8 @@ public MultipleOpenApiActuatorResource(List groupedOpenApis, Obj * Openapi json string. * * @param request the request - * @param group the group - * @param locale the locale + * @param group the group + * @param locale the locale * @return the string * @throws JsonProcessingException the json processing exception */ @@ -95,8 +98,8 @@ public byte[] openapiJson(HttpServletRequest request, @PathVariable String group * Openapi yaml string. * * @param request the request - * @param group the group - * @param locale the locale + * @param group the group + * @param locale the locale * @return the string * @throws JsonProcessingException the json processing exception */ diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java index dee0d9d86..3c6f44a95 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.api; @@ -100,14 +102,14 @@ public abstract class MultipleOpenApiResource implements InitializingBean { /** * Instantiates a new Multiple open api resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ protected MultipleOpenApiResource(List groupedOpenApis, ObjectFactory defaultOpenAPIBuilder, AbstractRequestService requestBuilder, diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java index 6d25f3f11..8b3d559b8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.api; @@ -62,14 +64,14 @@ public class MultipleOpenApiWebMvcResource extends MultipleOpenApiResource { /** * Instantiates a new Multiple open api resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public MultipleOpenApiWebMvcResource(List groupedOpenApis, ObjectFactory defaultOpenAPIBuilder, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, @@ -80,10 +82,10 @@ public MultipleOpenApiWebMvcResource(List groupedOpenApis, Objec /** * Openapi json string. * - * @param request the request + * @param request the request * @param apiDocsUrl the api docs url - * @param group the group - * @param locale the locale + * @param group the group + * @param locale the locale * @return the string * @throws JsonProcessingException the json processing exception */ @@ -98,10 +100,10 @@ public byte[] openapiJson(HttpServletRequest request, @Value(API_DOCS_URL) Strin /** * Openapi yaml string. * - * @param request the request + * @param request the request * @param apiDocsUrl the api docs url - * @param group the group - * @param locale the locale + * @param group the group + * @param locale the locale * @return the string * @throws JsonProcessingException the json processing exception */ diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java index 871d7de48..7a0d08c38 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.api; @@ -53,6 +55,7 @@ /** * The type Open api actuator resource. + * * @author bnasslashen */ @RestControllerEndpoint(id = DEFAULT_API_DOCS_ACTUATOR_URL) @@ -63,12 +66,12 @@ public class OpenApiActuatorResource extends OpenApiResource { * Instantiates a new Open api actuator resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public OpenApiActuatorResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, @@ -81,14 +84,14 @@ public OpenApiActuatorResource(ObjectFactory openAPIBuilderObjec /** * Instantiates a new Open api actuator resource. * - * @param groupName the group name + * @param groupName the group name * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public OpenApiActuatorResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, @@ -102,7 +105,7 @@ public OpenApiActuatorResource(String groupName, ObjectFactory o * Openapi json string. * * @param request the request - * @param locale the locale + * @param locale the locale * @return the string * @throws JsonProcessingException the json processing exception */ @@ -118,7 +121,7 @@ public byte[] openapiJson(HttpServletRequest request, Locale locale) * Openapi yaml string. * * @param request the request - * @param locale the locale + * @param locale the locale * @return the string * @throws JsonProcessingException the json processing exception */ diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java index fd2519bcb..20d040628 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.api; @@ -75,14 +77,14 @@ public abstract class OpenApiResource extends AbstractOpenApiResource { /** * Instantiates a new Open api resource. * - * @param groupName the group name + * @param groupName the group name * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ protected OpenApiResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, @@ -95,12 +97,12 @@ protected OpenApiResource(String groupName, ObjectFactory openAP * Instantiates a new Open api resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ protected OpenApiResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, @@ -112,9 +114,9 @@ protected OpenApiResource(ObjectFactory openAPIBuilderObjectFact /** * Openapi json string. * - * @param request the request + * @param request the request * @param apiDocsUrl the api docs url - * @param locale the locale + * @param locale the locale * @return the string * @throws JsonProcessingException the json processing exception */ @@ -129,9 +131,9 @@ public byte[] openapiJson(HttpServletRequest request, /** * Openapi yaml string. * - * @param request the request + * @param request the request * @param apiDocsUrl the api docs url - * @param locale the locale + * @param locale the locale * @return the string * @throws JsonProcessingException the json processing exception */ @@ -190,9 +192,9 @@ protected void getPaths(Map restControllers, Locale locale, Open * Calculate path. * * @param restControllers the rest controllers - * @param map the map - * @param locale the locale - * @param openAPI the open api + * @param map the map + * @param locale the locale + * @param openAPI the open api */ protected void calculatePath(Map restControllers, Map map, Locale locale, OpenAPI openAPI) { TreeMap methodTreeMap = new TreeMap<>(byReversedRequestMappingInfos()); @@ -238,9 +240,9 @@ private Comparator byReversedRequestMappingInfos() { /** * Calculate server url. * - * @param request the request + * @param request the request * @param apiDocsUrl the api docs url - * @param locale the locale + * @param locale the locale */ protected void calculateServerUrl(HttpServletRequest request, String apiDocsUrl, Locale locale) { super.initOpenAPIBuilder(locale); @@ -252,7 +254,7 @@ protected void calculateServerUrl(HttpServletRequest request, String apiDocsUrl, /** * Gets server url. * - * @param request the request + * @param request the request * @param apiDocsUrl the api docs url * @return the server url */ diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java index 2fabe8833..b6dae47d3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.api; @@ -55,6 +57,7 @@ /** * The type Open api resource. + * * @author bnasslahsen */ @RestController @@ -64,14 +67,14 @@ public class OpenApiWebMvcResource extends OpenApiResource { /** * Instantiates a new Open api web mvc resource. * - * @param groupName the group name + * @param groupName the group name * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ public OpenApiWebMvcResource(String groupName, ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, @@ -84,12 +87,12 @@ public OpenApiWebMvcResource(String groupName, ObjectFactory ope * Instantiates a new Open api web mvc resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers */ @Autowired public OpenApiWebMvcResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java index 52c88ce2c..fd227250a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.core.configuration; @@ -57,6 +59,7 @@ /** * The type Multiple open api support configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -69,14 +72,14 @@ public class MultipleOpenApiSupportConfiguration { /** * Multiple open api resource multiple open api resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers * @return the multiple open api resource */ @Bean @@ -97,6 +100,7 @@ MultipleOpenApiWebMvcResource multipleOpenApiResource(List group /** * The type Spring doc web mvc actuator different configuration. + * * @author bnasslashen */ @ConditionalOnClass(WebMvcEndpointHandlerMapping.class) @@ -106,14 +110,14 @@ static class SpringDocWebMvcActuatorDifferentConfiguration { /** * Multiple open api actuator resource multiple open api actuator resource. * - * @param groupedOpenApis the grouped open apis - * @param defaultOpenAPIBuilder the default open api builder - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser + * @param groupedOpenApis the grouped open apis + * @param defaultOpenAPIBuilder the default open api builder + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers * @return the multiple open api actuator resource */ @Bean diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java index 6ed7a4b4f..98e41d328 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.core.configuration; @@ -75,6 +77,7 @@ /** * The type Spring doc web mvc configuration. + * * @author bnasslahsen */ @Lazy(false) @@ -93,12 +96,12 @@ public class SpringDocWebMvcConfiguration { * Open api resource open api resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers * @return the open api resource */ @Bean @@ -116,9 +119,9 @@ OpenApiWebMvcResource openApiResource(ObjectFactory openAPIBuild /** * Request builder request builder. * - * @param parameterBuilder the parameter builder - * @param requestBodyService the request body builder - * @param parameterCustomizers the parameter customizers + * @param parameterBuilder the parameter builder + * @param requestBodyService the request body builder + * @param parameterCustomizers the parameter customizers * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer * @return the request builder */ @@ -147,9 +150,9 @@ SpringWebProvider springWebProvider() { /** * Response builder generic response builder. * - * @param operationService the operation builder + * @param operationService the operation builder * @param springDocConfigProperties the spring doc config properties - * @param propertyResolverUtils the property resolver utils + * @param propertyResolverUtils the property resolver utils * @return the generic response builder */ @Bean @@ -161,6 +164,7 @@ GenericResponseService responseBuilder(OperationService operationService, Spring /** * The type Spring doc web mvc router configuration. + * * @author bnasslahsen */ @ConditionalOnClass(RouterFunction.class) @@ -181,6 +185,7 @@ RouterFunctionWebMvcProvider routerFunctionProvider() { /** * The type Spring doc web mvc actuator configuration. + * * @author bnasslashen */ @ConditionalOnClass(WebMvcEndpointHandlerMapping.class) @@ -189,11 +194,11 @@ static class SpringDocWebMvcActuatorConfiguration { /** * Actuator provider actuator provider. * - * @param serverProperties the server properties - * @param springDocConfigProperties the spring doc config properties - * @param managementServerProperties the management server properties - * @param webEndpointProperties the web endpoint properties - * @param webMvcEndpointHandlerMapping the web mvc endpoint handler mapping + * @param serverProperties the server properties + * @param springDocConfigProperties the spring doc config properties + * @param managementServerProperties the management server properties + * @param webEndpointProperties the web endpoint properties + * @param webMvcEndpointHandlerMapping the web mvc endpoint handler mapping * @param controllerEndpointHandlerMapping the controller endpoint handler mapping * @return the actuator provider */ @@ -219,12 +224,12 @@ ActuatorProvider actuatorProvider(ServerProperties serverProperties, * Open api actuator resource open api actuator resource. * * @param openAPIBuilderObjectFactory the open api builder object factory - * @param requestBuilder the request builder - * @param responseBuilder the response builder - * @param operationParser the operation parser - * @param springDocConfigProperties the spring doc config properties - * @param springDocProviders the spring doc providers - * @param springDocCustomizers the spring doc customizers + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers * @return the open api actuator resource */ @Bean diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java index 235fb3663..fbdd6c86f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.core.fn; @@ -49,6 +51,7 @@ /** * The type Springdoc route builder. + * * @author bnasslahsen */ public class SpringdocRouteBuilder extends AbstractSpringdocRouteBuilder { @@ -85,8 +88,8 @@ public RouterFunction build() { /** * Get springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -100,7 +103,7 @@ public SpringdocRouteBuilder GET(String pattern, HandlerFunction /** * Get springdoc route builder. * - * @param handlerFunction the handler function + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -114,8 +117,8 @@ public SpringdocRouteBuilder GET(HandlerFunction handlerFunction /** * Get springdoc route builder. * - * @param predicate the predicate - * @param handlerFunction the handler function + * @param predicate the predicate + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -129,9 +132,9 @@ public SpringdocRouteBuilder GET(RequestPredicate predicate, HandlerFunction handlerFunctio /** * Head springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -174,8 +177,8 @@ public SpringdocRouteBuilder HEAD(String pattern, HandlerFunction handlerFunctio /** * Post springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -234,8 +237,8 @@ public SpringdocRouteBuilder POST(String pattern, HandlerFunction handlerFunction /** * Put springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -294,8 +297,8 @@ public SpringdocRouteBuilder PUT(String pattern, HandlerFunction /** * Put springdoc route builder. * - * @param predicate the predicate - * @param handlerFunction the handler function + * @param predicate the predicate + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -309,9 +312,9 @@ public SpringdocRouteBuilder PUT(RequestPredicate predicate, HandlerFunction handlerFuncti /** * Patch springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -354,8 +357,8 @@ public SpringdocRouteBuilder PATCH(String pattern, HandlerFunction handlerFunct /** * Delete springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -414,8 +417,8 @@ public SpringdocRouteBuilder DELETE(String pattern, HandlerFunction handlerFunc /** * Options springdoc route builder. * - * @param pattern the pattern - * @param handlerFunction the handler function + * @param pattern the pattern + * @param handlerFunction the handler function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -474,8 +477,8 @@ public SpringdocRouteBuilder OPTIONS(String pattern, HandlerFunction routerFunction, /** * Resources springdoc route builder. * - * @param pattern the pattern - * @param location the location + * @param pattern the pattern + * @param location the location * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -533,7 +536,7 @@ public SpringdocRouteBuilder resources(String pattern, Resource location, Consum /** * Resources springdoc route builder. * - * @param lookupFunction the lookup function + * @param lookupFunction the lookup function * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -547,9 +550,9 @@ public SpringdocRouteBuilder resources(Function> routerFunctionSupplier, Consumer operationsConsumer) { @@ -562,8 +565,8 @@ public SpringdocRouteBuilder nest(RequestPredicate predicate, Supplier> routerFunctionSupplier, Consumer operationsConsumer) { @@ -592,8 +595,8 @@ public SpringdocRouteBuilder path(String pattern, Supplier requestProcesso /** * After springdoc route builder. * - * @param responseProcessor the response processor + * @param responseProcessor the response processor * @param operationsConsumer the operations consumer * @return the springdoc route builder */ @@ -649,7 +652,7 @@ public SpringdocRouteBuilder after(BiFunction predicate, BiFunction< /** * On error springdoc route builder. * - * @param the type parameter - * @param exceptionType the exception type + * @param the type parameter + * @param exceptionType the exception type * @param responseProvider the response provider * @return the springdoc route builder */ diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java index d94298c76..7ac56543b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.core.providers; @@ -44,6 +46,7 @@ /** * The type Web mvc actuator provider. + * * @author bnasslahsen */ public class ActuatorWebMvcProvider extends ActuatorProvider { @@ -61,11 +64,11 @@ public class ActuatorWebMvcProvider extends ActuatorProvider { /** * Instantiates a new Actuator web mvc provider. * - * @param serverProperties the server properties - * @param springDocConfigProperties the spring doc config properties - * @param managementServerProperties the management server properties - * @param webEndpointProperties the web endpoint properties - * @param webMvcEndpointHandlerMapping the web mvc endpoint handler mapping + * @param serverProperties the server properties + * @param springDocConfigProperties the spring doc config properties + * @param managementServerProperties the management server properties + * @param webEndpointProperties the web endpoint properties + * @param webMvcEndpointHandlerMapping the web mvc endpoint handler mapping * @param controllerEndpointHandlerMapping the controller endpoint handler mapping */ public ActuatorWebMvcProvider(ServerProperties serverProperties, diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java index 104ce30d3..2cda7a700 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.core.providers; @@ -47,6 +49,7 @@ /** * The type Router function provider. + * * @author bnasslahsen */ //To keep compatiblity with spring-boot 1 @@ -83,6 +86,7 @@ public void setApplicationContext(ApplicationContext applicationContext) throws /** * The type Router function visitor. + * * @author bnasslahsen */ private class RouterFunctionVisitor extends AbstractRouterFunctionVisitor implements RouterFunctions.Visitor, RequestPredicates.Visitor { diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java index 22b0ca818..c4eb5b441 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.core.providers; @@ -44,6 +46,7 @@ /** * The type Spring web mvc provider. + * * @author bnasslahsen */ public class SpringWebMvcProvider extends SpringWebProvider { diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java index 6a25793be..c9fe37d7c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.core.service; @@ -37,6 +39,7 @@ /** * The type Request builder. + * * @author bnasslahsen */ public class RequestService extends AbstractRequestService { @@ -53,9 +56,9 @@ public class RequestService extends AbstractRequestService { /** * Instantiates a new Request builder. * - * @param parameterBuilder the parameter builder - * @param requestBodyService the request body builder - * @param parameterCustomizers the parameter customizers + * @param parameterBuilder the parameter builder + * @param requestBodyService the request body builder + * @param parameterCustomizers the parameter customizers * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer */ public RequestService(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java index 62968d649..00985a5ff 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.ui; @@ -56,6 +58,7 @@ /** * The type Swagger config. + * * @author bnasslahsen */ @Lazy(false) @@ -68,9 +71,9 @@ public class SwaggerConfig { /** * Swagger welcome swagger welcome web mvc. * - * @param swaggerUiConfig the swagger ui config + * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param springWebProvider the spring web provider + * @param springWebProvider the spring web provider * @return the swagger welcome web mvc */ @Bean @@ -123,10 +126,10 @@ SwaggerUiHome swaggerUiHome() { /** * Index page transformer swagger index transformer. * - * @param swaggerUiConfig the swagger ui config + * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param swaggerWelcomeCommon the swagger welcome common - * @param objectMapperProvider the object mapper provider + * @param swaggerWelcomeCommon the swagger welcome common + * @param objectMapperProvider the object mapper provider * @return the swagger index transformer */ @Bean @@ -141,9 +144,9 @@ SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUi * Swagger web mvc configurer swagger web mvc configurer. * * @param swaggerUiConfigProperties the swagger ui calculated config - * @param swaggerIndexTransformer the swagger index transformer - * @param actuatorProvider the actuator provider - * @param swaggerResourceResolver the swagger resource resolver + * @param swaggerIndexTransformer the swagger index transformer + * @param actuatorProvider the actuator provider + * @param swaggerResourceResolver the swagger resource resolver * @return the swagger web mvc configurer */ @Bean @@ -153,7 +156,7 @@ SwaggerWebMvcConfigurer swaggerWebMvcConfigurer(SwaggerUiConfigProperties swagge SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { return new SwaggerWebMvcConfigurer(swaggerUiConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); } - + /** * Swagger resource resolver swagger resource resolver. * @@ -178,9 +181,9 @@ static class SwaggerActuatorWelcomeConfiguration { /** * Swagger actuator welcome swagger welcome actuator. * - * @param swaggerUiConfig the swagger ui config + * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param webEndpointProperties the web endpoint properties + * @param webEndpointProperties the web endpoint properties * @return the swagger welcome actuator */ @Bean diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java index 6a5b93b6f..b4a84c1ce 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.ui; @@ -36,6 +38,7 @@ /** * The type Swagger config resource. + * * @author bnasslahsen */ @RestController diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java index ce618a270..bc328d551 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.ui; @@ -43,6 +45,7 @@ /** * The type Swagger index transformer. + * * @author bnasslahsen */ public class SwaggerIndexPageTransformer extends AbstractSwaggerIndexTransformer implements SwaggerIndexTransformer { @@ -54,10 +57,11 @@ public class SwaggerIndexPageTransformer extends AbstractSwaggerIndexTransformer /** * Instantiates a new Swagger index transformer. - * @param swaggerUiConfig the swagger ui config + * + * @param swaggerUiConfig the swagger ui config * @param swaggerUiOAuthProperties the swagger ui o auth properties - * @param swaggerWelcomeCommon the swagger welcome common - * @param objectMapperProvider the object mapper provider + * @param swaggerWelcomeCommon the swagger welcome common + * @param objectMapperProvider the object mapper provider */ public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerWelcomeCommon swaggerWelcomeCommon, ObjectMapperProvider objectMapperProvider) { diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java index 5e74efdd6..442aaf01c 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.ui; @@ -28,6 +30,7 @@ /** * The type Swagger index page transformer. + * * @author pverdage */ public interface SwaggerIndexTransformer extends ResourceTransformer { diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java index 3938b1a4c..2135654ea 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.webmvc.ui; import org.springdoc.core.properties.SwaggerUiConfigProperties; @@ -18,7 +44,7 @@ public class SwaggerResourceResolver extends LiteWebJarsResourceResolver { * The Swagger ui config properties. */ private final SwaggerUiConfigProperties swaggerUiConfigProperties; - + /** * Instantiates a new Web jars version resource resolver. * diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java index 535a6c234..c17c55fe9 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.ui; @@ -42,9 +44,15 @@ @Controller public class SwaggerUiHome { + /** + * The Swagger ui path. + */ @Value(SWAGGER_UI_PATH) private String swaggerUiPath; + /** + * The Mvc servlet path. + */ @Value(MVC_SERVLET_PATH) private String mvcServletPath; diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java index 3566d9276..7fb695971 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.ui; @@ -57,6 +59,7 @@ /** * The type Swagger web mvc configurer. + * * @author bnasslahsen */ public class SwaggerWebMvcConfigurer implements WebMvcConfigurer { @@ -85,9 +88,9 @@ public class SwaggerWebMvcConfigurer implements WebMvcConfigurer { * Instantiates a new Swagger web mvc configurer. * * @param swaggerUiConfigProperties the swagger ui calculated config - * @param swaggerIndexTransformer the swagger index transformer - * @param actuatorProvider the actuator provider - * @param swaggerResourceResolver the swagger resource resolver + * @param swaggerIndexTransformer the swagger index transformer + * @param actuatorProvider the actuator provider + * @param swaggerResourceResolver the swagger resource resolver */ public SwaggerWebMvcConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java index e725b78ce..567f385a0 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.ui; @@ -50,6 +52,9 @@ @ControllerEndpoint(id = DEFAULT_SWAGGER_UI_ACTUATOR_PATH) public class SwaggerWelcomeActuator extends SwaggerWelcomeCommon { + /** + * The constant SWAGGER_CONFIG_ACTUATOR_URL. + */ private static final String SWAGGER_CONFIG_ACTUATOR_URL = DEFAULT_PATH_SEPARATOR + SWAGGER_CONFIG_FILE; /** @@ -59,9 +64,10 @@ public class SwaggerWelcomeActuator extends SwaggerWelcomeCommon { /** * Instantiates a new Swagger welcome. - * @param swaggerUiConfig the swagger ui config + * + * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the swagger ui config parameters - * @param webEndpointProperties the web endpoint properties + * @param webEndpointProperties the web endpoint properties */ public SwaggerWelcomeActuator(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties,WebEndpointProperties webEndpointProperties) { super(swaggerUiConfig, springDocConfigProperties); diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java index 4b829a25b..a417ffa39 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.ui; @@ -40,12 +42,14 @@ /** * The type Swagger welcome common. + * * @author bnasslashen */ public abstract class SwaggerWelcomeCommon extends AbstractSwaggerWelcome { /** * Instantiates a new Abstract swagger welcome. - * @param swaggerUiConfig the swagger ui config + * + * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties */ protected SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { @@ -95,7 +99,8 @@ protected void calculateOauth2RedirectUrl(SwaggerUiConfigParameters swaggerUiCon /** * From current context path. * - * @param request the request + * @param swaggerUiConfigParameters the swagger ui config parameters + * @param request the request */ void buildFromCurrentContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, HttpServletRequest request) { super.init(swaggerUiConfigParameters); diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java index 2bb6d3795..e6aa41c6a 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java @@ -3,23 +3,25 @@ * * * * * * * * * - * * * * * Copyright 2019-2024 the original author or authors. * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. * * * * * * * * * - * + * */ package org.springdoc.webmvc.ui; @@ -44,6 +46,7 @@ /** * The type Swagger welcome. + * * @author bnasslahsen */ @Controller @@ -63,9 +66,10 @@ public class SwaggerWelcomeWebMvc extends SwaggerWelcomeCommon { /** * Instantiates a new Swagger welcome web mvc. - * @param swaggerUiConfig the swagger ui config + * + * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties - * @param springWebProvider the spring web provider + * @param springWebProvider the spring web provider */ public SwaggerWelcomeWebMvc(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, SpringWebProvider springWebProvider) { super(swaggerUiConfig, springDocConfigProperties); From a6c23fbd4b0a1a6d0352644cd5475949fdcde423 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 6 Oct 2024 15:00:51 +0200 Subject: [PATCH 093/226] Javadoc update --- .../org/springdoc/core/customizers/GlobalOpenApiCustomizer.java | 2 +- .../springdoc/core/customizers/GlobalOperationCustomizer.java | 2 +- .../java/org/springdoc/core/customizers/OpenApiCustomizer.java | 2 +- .../org/springdoc/core/customizers/OperationCustomizer.java | 2 +- .../org/springdoc/core/filters/GlobalOpenApiMethodFilter.java | 2 +- .../java/org/springdoc/core/filters/OpenApiMethodFilter.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java index 134fc371c..a095e05f9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java @@ -31,7 +31,7 @@ * customize Open api on default OpenAPI description and groups. * * @author christophejan - * @see OpenApiCustomizercustomize default OpenAPI description but not groups + * @see OpenApiCustomizer default OpenAPI description but not groups */ public interface GlobalOpenApiCustomizer extends OpenApiCustomizer { } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java index 256241631..ed9ab472c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java @@ -32,7 +32,7 @@ * description and groups * * @author christophejan - * @see OperationCustomizercustomize operations on default OpenAPI description but not groups + * @see OperationCustomizer operations on default OpenAPI description but not groups */ public interface GlobalOperationCustomizer extends OperationCustomizer { } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java index 3f78c286d..122a34d42 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java @@ -33,7 +33,7 @@ * Open api on default OpenAPI description but not on groups * * @author bnasslahsen - * @see GlobalOpenApiCustomizercustomize default OpenAPI description and groups + * @see GlobalOpenApiCustomizer default OpenAPI description and groups */ @FunctionalInterface public interface OpenApiCustomizer { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java index c4f7026d1..d0016c9ef 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java @@ -36,7 +36,7 @@ * groups * * @author bnasslahsen - * @see GlobalOperationCustomizercustomize operations on default OpenAPI description and groups + * @see GlobalOperationCustomizer operations on default OpenAPI description and groups */ @FunctionalInterface public interface OperationCustomizer { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java index fedb93502..df86a27de 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java @@ -32,7 +32,7 @@ * and groups. * * @author michael.clarke - * @see OpenApiMethodFilterfilter methods in default OpenAPI description but not groups + * @see OpenApiMethodFilter methods in default OpenAPI description but not groups */ @FunctionalInterface public interface GlobalOpenApiMethodFilter extends OpenApiMethodFilter { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java index 1aaaa0229..edbccd7de 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java @@ -34,7 +34,7 @@ * but not groups * * @author michael.clarke - * @see GlobalOpenApiMethodFilterfilter methods in default OpenAPI description and groups + * @see GlobalOpenApiMethodFilter methods in default OpenAPI description and groups */ @FunctionalInterface public interface OpenApiMethodFilter { From 428702b2d72726881327a8b154d6baf42da00d96 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 8 Oct 2024 20:48:48 +0200 Subject: [PATCH 094/226] Swagger doesn't work after custom annotation replacing request parameters. Fixes #2752 --- .../core/service/AbstractRequestService.java | 41 +++++++++- .../springdoc/api/v30/app229/LocaleParam.java | 66 +++++++++++++++ .../api/v30/app229/SpringDocApp229Test.java | 37 +++++++++ .../springdoc/api/v30/app229/XController.java | 47 +++++++++++ .../test/resources/results/3.0.1/app229.json | 81 +++++++++++++++++++ 5 files changed, 268 insertions(+), 4 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/LocaleParam.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/SpringDocApp229Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/XController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app229.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 4aa5d0a0c..96ea06f39 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -63,7 +63,9 @@ import jakarta.validation.constraints.Min; import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Size; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; import org.springdoc.core.customizers.ParameterCustomizer; import org.springdoc.core.discoverer.SpringDocParameterNameDiscoverer; import org.springdoc.core.extractor.DelegatingMethodParameter; @@ -188,7 +190,7 @@ public abstract class AbstractRequestService { * @param localSpringDocParameterNameDiscoverer the local spring doc parameter name discoverer */ protected AbstractRequestService(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, - Optional> parameterCustomizers, + Optional> parameterCustomizers, SpringDocParameterNameDiscoverer localSpringDocParameterNameDiscoverer) { super(); this.parameterBuilder = parameterBuilder; @@ -272,7 +274,7 @@ public static Collection getHeaders(MethodAttributes methodAttributes public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, Operation operation, MethodAttributes methodAttributes, OpenAPI openAPI) { // Documentation - String operationId = operation.getOperationId()!=null ? operation.getOperationId() : handlerMethod.getMethod().getName(); + String operationId = operation.getOperationId() != null ? operation.getOperationId() : handlerMethod.getMethod().getName(); operation.setOperationId(operationId); // requests String[] pNames = this.localSpringDocParameterNameDiscoverer.getParameterNames(handlerMethod.getMethod()); @@ -322,7 +324,9 @@ public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, parameter = buildParams(parameterInfo, components, requestMethod, methodAttributes, openAPI.getOpenapi()); // Merge with the operation parameters parameter = GenericParameterService.mergeParameter(operationParameters, parameter); - List parameterAnnotations = Arrays.asList(methodParameter.getParameterAnnotations()); + + List parameterAnnotations = getParameterAnnotations(methodParameter); + if (isValidParameter(parameter)) { // Add param javadoc if (StringUtils.isBlank(parameter.getDescription()) && javadocProvider != null) { @@ -371,6 +375,35 @@ else if (!RequestMethod.GET.equals(requestMethod) || OpenApiVersion.OPENAPI_3_1. return operation; } + /** + * Gets parameter annotations. + * + * @param methodParameter the method parameter + * @return the parameter annotations + */ + @NotNull + private static List getParameterAnnotations(MethodParameter methodParameter) { + // Initialize the list for parameter annotations + List parameterAnnotations = new ArrayList<>(); + // Add the parameter annotations (direct annotations) + if (ArrayUtils.isNotEmpty(methodParameter.getParameterAnnotations())) { + parameterAnnotations.addAll(Arrays.asList(methodParameter.getParameterAnnotations())); + } + // Separate list to store meta-annotations + List metaAnnotationsList = new ArrayList<>(); + // Iterate over the direct annotations and collect meta-annotations + for (Annotation parameterAnnotation : parameterAnnotations) { + Annotation[] metaAnnotations = parameterAnnotation.annotationType().getAnnotations(); + + if (ArrayUtils.isNotEmpty(metaAnnotations)) { + metaAnnotationsList.addAll(Arrays.asList(metaAnnotations)); + } + } + // Add all the collected meta-annotations to the main list + parameterAnnotations.addAll(metaAnnotationsList); + return parameterAnnotations; + } + /** * Gets parameter linked hash map. * diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/LocaleParam.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/LocaleParam.java new file mode 100644 index 000000000..ad3b8d826 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/LocaleParam.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app229; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +/** + * @author bnasslahsen + */ +@Target({PARAMETER, METHOD, FIELD, ANNOTATION_TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Parameter( + examples = { + @ExampleObject(name = "ar-ae"), + @ExampleObject(name = "bg-bg"), + @ExampleObject(name = "cs-cz"), + @ExampleObject(name = "de-de"), + @ExampleObject(name = "el-gr"), + @ExampleObject(name = "en-us.src"), + @ExampleObject(name = "hu-hu"), + @ExampleObject(name = "pl-pl"), + @ExampleObject(name = "ro-ro"), + @ExampleObject(name = "sk-sk") + } +) +@Size(min = 2, max = 16) +@Pattern(regexp = "\\w+([-.]?\\w+)*") +@Valid +@interface LocaleParam {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/SpringDocApp229Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/SpringDocApp229Test.java new file mode 100644 index 000000000..c252428bb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/SpringDocApp229Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app229; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp229Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/XController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/XController.java new file mode 100644 index 000000000..617338a42 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app229/XController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app229; + + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +public class XController { + + + @GetMapping("/") + public ResponseEntity manualTranslationUpdateRun( + @LocaleParam String locale) { + //..... + return ResponseEntity.accepted().build(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app229.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app229.json new file mode 100644 index 000000000..98ae4950b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app229.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "x-controller" + ], + "operationId": "manualTranslationUpdateRun", + "parameters": [ + { + "name": "locale", + "in": "query", + "required": true, + "schema": { + "maxLength": 16, + "minLength": 2, + "pattern": "\\w+([-.]?\\w+)*", + "type": "string" + }, + "examples": { + "el-gr": { + "description": "el-gr" + }, + "pl-pl": { + "description": "pl-pl" + }, + "de-de": { + "description": "de-de" + }, + "hu-hu": { + "description": "hu-hu" + }, + "en-us.src": { + "description": "en-us.src" + }, + "ro-ro": { + "description": "ro-ro" + }, + "sk-sk": { + "description": "sk-sk" + }, + "bg-bg": { + "description": "bg-bg" + }, + "ar-ae": { + "description": "ar-ae" + }, + "cs-cz": { + "description": "cs-cz" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} From cc96c717055a7075d3e0cfaf102e6496d0319c96 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 8 Oct 2024 21:43:15 +0200 Subject: [PATCH 095/226] Swagger doesn't work after custom annotation replacing request parameters. Fixes #2752 --- .../core/data/DataRestRequestService.java | 6 ++- .../core/service/AbstractRequestService.java | 34 +--------------- .../core/service/GenericParameterService.java | 3 +- .../core/service/GenericResponseService.java | 5 ++- .../springdoc/core/utils/SpringDocUtils.java | 40 +++++++++++++++++++ 5 files changed, 51 insertions(+), 37 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java index 9c24ca739..a00aad09e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java @@ -65,6 +65,8 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.method.HandlerMethod; +import static org.springdoc.core.utils.SpringDocUtils.getParameterAnnotations; + /** * The type Data rest request builder. * @@ -164,7 +166,7 @@ public void buildCommonParameters(OpenAPI openAPI, RequestMethod requestMethod, ParameterInfo parameterInfo = new ParameterInfo(pName, methodParameter, parameterBuilder, parameterDoc); if (isParamToIgnore(methodParameter)) { if (PersistentEntityResource.class.equals(methodParameter.getParameterType())) { - Schema schema = SpringDocAnnotationsUtils.resolveSchemaFromType(domainType, openAPI.getComponents(), null, methodParameter.getParameterAnnotations(), openAPI.getSpecVersion()); + Schema schema = SpringDocAnnotationsUtils.resolveSchemaFromType(domainType, openAPI.getComponents(), null, getParameterAnnotations(methodParameter), openAPI.getSpecVersion()); parameterInfo.setParameterModel(new Parameter().schema(schema)); } else if (methodParameter.getParameterAnnotation(BackendId.class) != null) { @@ -223,7 +225,7 @@ private boolean isParamToIgnore(MethodParameter methodParameter) { */ private void addParameters(OpenAPI openAPI, RequestMethod requestMethod, MethodAttributes methodAttributes, Operation operation, MethodParameter methodParameter, ParameterInfo parameterInfo, Parameter parameter) { - List parameterAnnotations = Arrays.asList(methodParameter.getParameterAnnotations()); + List parameterAnnotations = Arrays.asList(getParameterAnnotations(methodParameter)); if (requestBuilder.isValidParameter(parameter)) { requestBuilder.applyBeanValidatorAnnotations(parameter, parameterAnnotations); operation.addParametersItem(parameter); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 96ea06f39..3313f65fc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -63,9 +63,7 @@ import jakarta.validation.constraints.Min; import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Size; -import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; -import org.jetbrains.annotations.NotNull; import org.springdoc.core.customizers.ParameterCustomizer; import org.springdoc.core.discoverer.SpringDocParameterNameDiscoverer; import org.springdoc.core.extractor.DelegatingMethodParameter; @@ -98,6 +96,7 @@ import static org.springdoc.core.service.GenericParameterService.isFile; import static org.springdoc.core.utils.Constants.OPENAPI_ARRAY_TYPE; import static org.springdoc.core.utils.Constants.OPENAPI_STRING_TYPE; +import static org.springdoc.core.utils.SpringDocUtils.getParameterAnnotations; import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE; /** @@ -325,7 +324,7 @@ public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, // Merge with the operation parameters parameter = GenericParameterService.mergeParameter(operationParameters, parameter); - List parameterAnnotations = getParameterAnnotations(methodParameter); + List parameterAnnotations = List.of(getParameterAnnotations(methodParameter)); if (isValidParameter(parameter)) { // Add param javadoc @@ -375,35 +374,6 @@ else if (!RequestMethod.GET.equals(requestMethod) || OpenApiVersion.OPENAPI_3_1. return operation; } - /** - * Gets parameter annotations. - * - * @param methodParameter the method parameter - * @return the parameter annotations - */ - @NotNull - private static List getParameterAnnotations(MethodParameter methodParameter) { - // Initialize the list for parameter annotations - List parameterAnnotations = new ArrayList<>(); - // Add the parameter annotations (direct annotations) - if (ArrayUtils.isNotEmpty(methodParameter.getParameterAnnotations())) { - parameterAnnotations.addAll(Arrays.asList(methodParameter.getParameterAnnotations())); - } - // Separate list to store meta-annotations - List metaAnnotationsList = new ArrayList<>(); - // Iterate over the direct annotations and collect meta-annotations - for (Annotation parameterAnnotation : parameterAnnotations) { - Annotation[] metaAnnotations = parameterAnnotation.annotationType().getAnnotations(); - - if (ArrayUtils.isNotEmpty(metaAnnotations)) { - metaAnnotationsList.addAll(Arrays.asList(metaAnnotations)); - } - } - // Add all the collected meta-annotations to the main list - parameterAnnotations.addAll(metaAnnotationsList); - return parameterAnnotations; - } - /** * Gets parameter linked hash map. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index 5263e8d80..40ddbe55a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -88,6 +88,7 @@ import org.springframework.web.multipart.MultipartRequest; import static org.springdoc.core.utils.Constants.DOT; +import static org.springdoc.core.utils.SpringDocUtils.getParameterAnnotations; /** * The type Generic parameter builder. @@ -377,7 +378,7 @@ Schema calculateSchema(Components components, ParameterInfo parameterInfo, Reque type = springConvertedType; } } - schemaN = SpringDocAnnotationsUtils.extractSchema(components, type, jsonView, methodParameter.getParameterAnnotations(), propertyResolverUtils.getSpecVersion()); + schemaN = SpringDocAnnotationsUtils.extractSchema(components, type, jsonView, getParameterAnnotations(methodParameter), propertyResolverUtils.getSpecVersion()); } else schemaN = parameterInfo.getParameterModel().getSchema(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index 5c462847b..7d8994c3c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -94,6 +94,7 @@ import static org.springdoc.core.utils.SpringDocAnnotationsUtils.extractSchema; import static org.springdoc.core.utils.SpringDocAnnotationsUtils.getContent; import static org.springdoc.core.utils.SpringDocAnnotationsUtils.mergeSchema; +import static org.springdoc.core.utils.SpringDocUtils.getParameterAnnotations; /** * The type Generic response builder. @@ -518,7 +519,7 @@ public Set getApiResponses( */ private Content buildContent(Components components, MethodParameter methodParameter, String[] methodProduces, JsonView jsonView) { Type returnType = GenericTypeResolver.resolveType(methodParameter.getGenericParameterType(), methodParameter.getContainingClass()); - return buildContent(components, methodParameter.getParameterAnnotations(), methodProduces, jsonView, returnType); + return buildContent(components, getParameterAnnotations(methodParameter), methodProduces, jsonView, returnType); } /** @@ -611,7 +612,7 @@ else if (CollectionUtils.isEmpty(apiResponse.getContent())) Content existingContent = apiResponse.getContent(); Type type = GenericTypeResolver.resolveType( methodParameter.getGenericParameterType(), methodParameter.getContainingClass()); Schema schemaN = calculateSchema(components, type, - methodAttributes.getJsonViewAnnotation(), methodParameter.getParameterAnnotations()); + methodAttributes.getJsonViewAnnotation(), getParameterAnnotations(methodParameter)); if (schemaN != null && ArrayUtils.isNotEmpty(methodAttributes.getMethodProduces())) Arrays.stream(methodAttributes.getMethodProduces()).forEach(mediaTypeStr -> mergeSchema(existingContent, schemaN, mediaTypeStr)); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java index 4a40b5880..d5a793f77 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java @@ -27,10 +27,14 @@ package org.springdoc.core.utils; import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.List; import java.util.function.Predicate; import io.swagger.v3.oas.models.media.Schema; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; import org.springdoc.api.AbstractOpenApiResource; import org.springdoc.core.converters.AdditionalModelsConverter; import org.springdoc.core.converters.ConverterUtils; @@ -41,6 +45,8 @@ import org.springdoc.core.service.GenericParameterService; import org.springdoc.core.service.GenericResponseService; +import org.springframework.core.MethodParameter; + /** * The type Spring doc utils. * @@ -402,5 +408,39 @@ public SpringDocUtils addParentType(String ...parentTypes) { PolymorphicModelConverter.addParentType(parentTypes); return this; } + + /** + * Gets parameter annotations. + * + * @param methodParameter the method parameter + * @return the parameter annotations + */ + @NotNull + public static Annotation[] getParameterAnnotations(MethodParameter methodParameter) { + // Get the parameter annotations directly as an array + Annotation[] annotations = methodParameter.getParameterAnnotations(); + // Return early if no annotations are found, avoiding unnecessary processing + if (ArrayUtils.isEmpty(annotations)) { + return new Annotation[0]; + } + // Create a list that can contain both parameter and meta-annotations + List resultAnnotations = new ArrayList<>(annotations.length); + + // Add all direct annotations + resultAnnotations.addAll(List.of(annotations)); + + // Process each direct annotation to collect its meta-annotations + for (Annotation annotation : annotations) { + // Fetch meta-annotations + Annotation[] metaAnnotations = annotation.annotationType().getAnnotations(); + + // Only add meta-annotations if they exist + if (ArrayUtils.isNotEmpty(metaAnnotations)) { + resultAnnotations.addAll(List.of(metaAnnotations)); + } + } + // Convert the list to an array and return + return resultAnnotations.toArray(new Annotation[0]); + } } From 6fda03889d6391bc8d18b5350735ecdb14946380 Mon Sep 17 00:00:00 2001 From: Eduard Dudar Date: Fri, 11 Oct 2024 15:48:15 -0700 Subject: [PATCH 096/226] Added support for RequestBody as a meta-annotation The change uses advanced `AnnotatedElementUtils` to find annotation instead of simple `getParameterAnnotation`. Resolves #2759 --- .../core/service/AbstractRequestService.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 3313f65fc..cb565f353 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -766,14 +766,24 @@ private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo pa return (isBodyAllowed && (parameterInfo.getParameterModel() == null || parameterInfo.getParameterModel().getIn() == null) && !delegatingMethodParameter.isParameterObject()) && - ((methodParameter.getParameterAnnotation(io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null - || methodParameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class) != null - || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null) + (checkRequestBodyAnnotation(methodParameter) || checkOperationRequestBody(methodParameter) || checkFile(methodParameter) || Arrays.asList(methodAttributes.getMethodConsumes()).contains(MULTIPART_FORM_DATA_VALUE)); } + /** + * Checks whether Swagger's or Spring's RequestBody annotation is present on a parameter or method + * + * @param methodParameter the method parameter + * @return the boolean + */ + private boolean checkRequestBodyAnnotation(MethodParameter methodParamater) { + return methodParameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class) != null + || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getParameter()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null + || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null + } + /** * Check file boolean. * From 3dee57718522abac19e11d3ef251d729e5c70ee8 Mon Sep 17 00:00:00 2001 From: Eduard Dudar Date: Mon, 14 Oct 2024 16:06:36 -0700 Subject: [PATCH 097/226] semi was missing at the end --- .../java/org/springdoc/core/service/AbstractRequestService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index cb565f353..0bb80fb93 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -781,7 +781,7 @@ private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo pa private boolean checkRequestBodyAnnotation(MethodParameter methodParamater) { return methodParameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class) != null || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getParameter()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null - || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null + || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null; } /** From d593752dafa5a77e27708b2605407c6b160c4195 Mon Sep 17 00:00:00 2001 From: Eduard Dudar Date: Mon, 14 Oct 2024 17:11:12 -0700 Subject: [PATCH 098/226] Fixed parameter name --- .../java/org/springdoc/core/service/AbstractRequestService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 0bb80fb93..aac2ba08d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -778,7 +778,7 @@ private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo pa * @param methodParameter the method parameter * @return the boolean */ - private boolean checkRequestBodyAnnotation(MethodParameter methodParamater) { + private boolean checkRequestBodyAnnotation(MethodParameter methodParameter) { return methodParameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class) != null || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getParameter()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null; From e2aa741d4f62a3557e47a4b39c2808adc0a15e23 Mon Sep 17 00:00:00 2001 From: Eduard Dudar Date: Mon, 14 Oct 2024 17:44:49 -0700 Subject: [PATCH 099/226] Brought back getParameterAnnotation ... for reactive cases where method is an implementation and does not carry any annotations but delegate/interface has one --- .../java/org/springdoc/core/service/AbstractRequestService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index aac2ba08d..82f7a8a2e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -780,6 +780,7 @@ private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo pa */ private boolean checkRequestBodyAnnotation(MethodParameter methodParameter) { return methodParameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class) != null + || methodParameter.getParameterAnnotation(io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getParameter()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null; } From 5c917818bc1ec4d0565d8e18256bec711adeae9f Mon Sep 17 00:00:00 2001 From: Eduard Dudar Date: Mon, 14 Oct 2024 18:43:28 -0700 Subject: [PATCH 100/226] Added tests; added required attribute check; simplified annotation lookups --- .../core/service/AbstractRequestService.java | 14 +++-- .../api/v30/app230/App230Controller.java | 22 +++++++ .../api/v30/app230/App230RequestBody.java | 21 +++++++ .../api/v30/app230/SpringDocApp230Test.java | 40 +++++++++++++ .../test/resources/results/3.0.1/app230.json | 58 +++++++++++++++++++ 5 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/App230Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/App230RequestBody.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/SpringDocApp230Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app230.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 82f7a8a2e..ef84071dd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -618,16 +618,20 @@ public void applyBeanValidatorAnnotations(final Parameter parameter, final List< */ public void applyBeanValidatorAnnotations(final RequestBody requestBody, final List annotations, boolean isOptional) { Map annos = new HashMap<>(); - boolean requestBodyRequired = false; + boolean springRequestBodyRequired = false; + boolean swaggerRequestBodyRequired = false; if (!CollectionUtils.isEmpty(annotations)) { annotations.forEach(annotation -> annos.put(annotation.annotationType().getSimpleName(), annotation)); - requestBodyRequired = annotations.stream() + springRequestBodyRequired = annotations.stream() .filter(annotation -> org.springframework.web.bind.annotation.RequestBody.class.equals(annotation.annotationType())) .anyMatch(annotation -> ((org.springframework.web.bind.annotation.RequestBody) annotation).required()); + swaggerRequestBodyRequired = annotations.stream() + .filter(annotation -> io.swagger.v3.oas.annotations.parameters.RequestBody.class.equals(annotation.annotationType())) + .anyMatch(annotation -> ((io.swagger.v3.oas.annotations.parameters.RequestBody) annotation).required()); } boolean validationExists = Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annos::containsKey); - if (validationExists || (!isOptional && requestBodyRequired)) + if (validationExists || (!isOptional && (springRequestBodyRequired || swaggerRequestBodyRequired))) requestBody.setRequired(true); Content content = requestBody.getContent(); for (MediaType mediaType : content.values()) { @@ -781,8 +785,8 @@ private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo pa private boolean checkRequestBodyAnnotation(MethodParameter methodParameter) { return methodParameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class) != null || methodParameter.getParameterAnnotation(io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null - || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getParameter()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null - || AnnotatedElementUtils.findMergedAnnotation(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null; + || AnnotatedElementUtils.isAnnotated(Objects.requireNonNull(methodParameter.getParameter()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) + || AnnotatedElementUtils.isAnnotated(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class); } /** diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/App230Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/App230Controller.java new file mode 100644 index 000000000..de37d116f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/App230Controller.java @@ -0,0 +1,22 @@ +package test.org.springdoc.api.v30.app230; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author edudar + */ +@RestController +@RequestMapping +public class App230Controller { + + @PostMapping("/") + public String swaggerTest(@App230RequestBody MyRequest myRequest) { + return null; + } + + public record MyRequest(int id) { + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/App230RequestBody.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/App230RequestBody.java new file mode 100644 index 000000000..a275a0a7b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/App230RequestBody.java @@ -0,0 +1,21 @@ +package test.org.springdoc.api.v30.app230; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +/** + * @author edudar + */ +@Target({PARAMETER, METHOD, ANNOTATION_TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@RequestBody(required = true) +@interface App230RequestBody { + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/SpringDocApp230Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/SpringDocApp230Test.java new file mode 100644 index 000000000..981e3e664 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app230/SpringDocApp230Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app230; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author edudar + */ +public class SpringDocApp230Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app230.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app230.json new file mode 100644 index 000000000..5d328c26d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app230.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "app-230-controller" + ], + "operationId": "swaggerTest", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MyRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "MyRequest": { + "properties": { + "id": { + "format": "int32", + "type": "integer" + } + }, + "type": "object" + } + } + } +} From 2d4f84eb6e819c8233b1d22a1cc02fc8c6aad3eb Mon Sep 17 00:00:00 2001 From: Eduard Dudar Date: Mon, 14 Oct 2024 18:45:37 -0700 Subject: [PATCH 101/226] Switched from 'not null' to 'has' --- .../org/springdoc/core/service/AbstractRequestService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index ef84071dd..a2a7d9b45 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -783,8 +783,8 @@ private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo pa * @return the boolean */ private boolean checkRequestBodyAnnotation(MethodParameter methodParameter) { - return methodParameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class) != null - || methodParameter.getParameterAnnotation(io.swagger.v3.oas.annotations.parameters.RequestBody.class) != null + return methodParameter.hasParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class) + || methodParameter.hasParameterAnnotation(io.swagger.v3.oas.annotations.parameters.RequestBody.class) || AnnotatedElementUtils.isAnnotated(Objects.requireNonNull(methodParameter.getParameter()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) || AnnotatedElementUtils.isAnnotated(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class); } From 8702fdafa9690e8fad8ef88f70efcaacd2066f76 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Wed, 6 Nov 2024 22:17:06 +0100 Subject: [PATCH 102/226] Upgrade spring to 3.4.0-RC1 Upgrade swagger-ui to 5.18.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 20e72385f..cee77f9c1 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.0-M3 + 3.4.0-RC1 @@ -61,7 +61,7 @@ 2.5.3 1.6.8 2.2.25 - 5.17.14 + 5.18.0 1.13.1 0.9.1 0.15.0 From 2ba7055c398931a5bb1833d3f49af790c0e77237 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Wed, 6 Nov 2024 22:22:17 +0100 Subject: [PATCH 103/226] Upgrade swagger-ui to 5.18.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cee77f9c1..ff9435f0c 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.5.3 1.6.8 2.2.25 - 5.18.0 + 5.18.1 1.13.1 0.9.1 0.15.0 From bb0359f12c15d868186480097f09b317a0dd03e5 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Wed, 6 Nov 2024 23:00:32 +0100 Subject: [PATCH 104/226] CHANGELOG.md update --- CHANGELOG.md | 55 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e00dfa30..6e16c661f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,54 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.6.0] - 2024-06-30 +## [2.7.0-RC1] - 2024-11-06 ### Added +- #2649 - Add Encoding to multiple files and JSON payloads request test case +- #2653 - Trim indent apply schema description +- #2664 - Refactor Replace hardcoded schema prefix length +- #2509, #2668 - Replace swagger urls in org.springdoc.core.properties.AbstractSwaggerUiConfigProperties#urls only if url is changed +- #2727 - Display nullable request body with map type +- #2746 - Readme.md add gradle import +- #2760 - Added support for RequestBody as a meta-annotation +- #2703 - Display nullable request body with map type +- #2657 - Add support for OAS v3.1 webhooks + +### Changed +- Upgrade spring-boot to 3.4.0-RC1 +- Upgrade swagger-core to 2.2.25 +- Upgrade swagger-ui to 5.18.1 +- Upgrade spring-cloud-function to 4.2.0-M1 +- Upgrade spring-security-oauth2-authorization-server to 1.4.0-M2 + +### Fixed +- #2752 - Swagger doesn't work after custom annotation replacing request parameters +- #2747 - Move to webjars-locator-lite, in preparation for spring-boot 3.4 GA +- #2705 - @Schema oneOf config is ignored when generate the api-docs +- #2744 - SpringDocUI doest add Javadoc into swagger from abstract class +- #2708 - Spring Boot (Webflux) - Swagger UI - redirect URI does not include Gateway Prefix +- #2725 - Serialization to openapi of org.springframework.data.domain.Sort is wrong for Spring Boot >2.x +- #2740 - Swagger-ui ignores property springdoc.swagger-ui.supported-submit-methods +- #2733 - Bad schema return type when created a generic wrapper class for response entity +- #2687 - Failed to load api definition after spring boot 3.4.0-M2 +- #2642 - Calling Swagger UI via different context paths fails +- #2709 - Annotation @Hidden on rest controller class level doesn't work due to spring default proxying mechanism CGLIB +- #2642 - Calling Swagger UI via different context paths fails +- #2663 - Content definition in @ApiResponse remove schema generated based on the returned value +- #2646 - The operationId is unnecessarily deduplicated for a requestBody with multiple content types +- #2643 - UpperSnakeCaseStrategy is not working with spring boot and ParameterObject +- #2640 - @JsonUnwrapped is ignored when PolymorphicConverter is enabled +- #2638 - Boolean Parameter with @Schema Annotation Changes Type to string in OpenAPI Documentation +- #2659 - Fix typo in SpringSecurityLoginEndpointCustomizer method name +- #2660 - Update Response Code +- #2442, #2669 - Fix SpringDocApp193Test for Java 21 and above +- #2671 - Ensure default media type order is preserved using LinkedHashSet in mergeArrays +- #2711 - Missing descriptions on Kotlin ByteArray fields +- #2733 - Bad schema return type when created a generic wrapper class for response entity +## [2.6.0] - 2024-06-30 + +### Added - #2561 - NPE occurs when outputting an OpenAPI document since 2.5.0 - #2579 - Add support for leading tab characters with trim-kotlin-indent. - #2589 - Pass HttpRequest to ServerBaseUrlCustomizer @@ -39,13 +83,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.5.0] - 2024-04-01 ### Added - - #2318 - Add Info to GroupedOpenAPI properties - #2554 - Remove duplicate words from comments - #2418 - Improve support for externalizing strings in generated openapi - #2535 - Add 'springdoc.trim-kotlin-indent' property to handle Kotlin multiline string indentation -### Changed +### Changed - Upgrade spring-boot to 3.2.4 - Upgrade swagger-core to 2.2.21 - Upgrade swagger-ui to 5.13.0 @@ -59,19 +102,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.4.0] - 2024-03-12 ### Added - - #2443 - Respect schema annotations when using spring mvc with kotlin - #2492, #2488 - Support dynamic evaluation of description field in the RequestBody - #2510 - Option to disable root api-docs path when using groups ### Changed - - Upgrade spring-boot to 3.2.3 - Upgrade swagger-core to 2.2.20 - Upgrade swagger-ui to 5.11.8 ### Fixed - - #2453 - Fix CODE_OF_CONDUCT.md links - #2454 - Fix typo in SwaggerWelcomeWebMvc - #2507 - Fix typo in Constants @@ -94,7 +134,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.3.0] - 2023-12-03 ### Added - - #2340 - Add support OIDC with Spring Authorization Server - #2345 - Support Schema added in OpenAPI Specification v3.1 - #2387 - Support get javadoc description from getter method @@ -104,7 +143,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - #2438, #2315 - Support for @JsonProperty with Javadoc Change in springdoc-openapi ### Changed - - Upgrade spring-boot to 3.2.0 - Upgrade swagger-core to 2.2.19 - Upgrade swagger-ui to 5.10.3 @@ -123,7 +161,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.2.0] - 2023-08-06 ### Added - - #2189 - Add support for swagger-ui.url property - #2200 - Support schema.requiredMode() on ParameterObject - #2309 - Added function to preload by specifying locale From 54278b868486f30fcec5fb7219f9c65563555a21 Mon Sep 17 00:00:00 2001 From: jenkins Date: Wed, 6 Nov 2024 22:04:14 +0000 Subject: [PATCH 105/226] [maven-release-plugin] prepare release v2.7.0-RC1 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index ff9435f0c..dabbd4351 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.6.1-SNAPSHOT + 2.7.0-RC1 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.7.0-RC1 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 57c44e272..b02a8185c 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.1-SNAPSHOT + 2.7.0-RC1 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 562ec249e..a7154405a 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.1-SNAPSHOT + 2.7.0-RC1 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 83b20885c..cd533a38d 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.1-SNAPSHOT + 2.7.0-RC1 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index f5de73f8d..04c83f532 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.1-SNAPSHOT + 2.7.0-RC1 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index d3b0ae01a..97acab056 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.6.1-SNAPSHOT + 2.7.0-RC1 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 440bc47ea..ed9a8e1fe 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.6.1-SNAPSHOT + 2.7.0-RC1 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 74161a620..ad98ea64f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.1-SNAPSHOT + 2.7.0-RC1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 918854210..932c6006f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.1-SNAPSHOT + 2.7.0-RC1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index e301b3a62..d423ada6a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.1-SNAPSHOT + 2.7.0-RC1 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 0e568d48e..3758d0dc8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.1-SNAPSHOT + 2.7.0-RC1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index 958f81f36..a1063a496 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.1-SNAPSHOT + 2.7.0-RC1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index 0f449016a..f37e796a6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.6.1-SNAPSHOT + 2.7.0-RC1 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 502e88fd4..49023fff7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.1-SNAPSHOT + 2.7.0-RC1 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 7fc945b12..f47d50383 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.6.1-SNAPSHOT + 2.7.0-RC1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index e683450e5..d3ca8e185 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.1-SNAPSHOT + 2.7.0-RC1 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 17ec9557c..fc6aa8490 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.6.1-SNAPSHOT + 2.7.0-RC1 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 06b551c15..223b55faf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.6.1-SNAPSHOT + 2.7.0-RC1 springdoc-openapi-security-tests From 1fdddf6bc37476473f6e83dd83245f1cf51caee2 Mon Sep 17 00:00:00 2001 From: jenkins Date: Wed, 6 Nov 2024 22:04:17 +0000 Subject: [PATCH 106/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index dabbd4351..9683ff090 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.7.0-RC1 + 2.7.0-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.7.0-RC1 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index b02a8185c..724f4f4d7 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-RC1 + 2.7.0-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index a7154405a..3b7992d81 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-RC1 + 2.7.0-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index cd533a38d..16bf89932 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-RC1 + 2.7.0-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 04c83f532..a8ff8f0c8 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-RC1 + 2.7.0-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 97acab056..b1cfd7476 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-RC1 + 2.7.0-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index ed9a8e1fe..c46beff4b 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.7.0-RC1 + 2.7.0-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index ad98ea64f..8c06dd471 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-RC1 + 2.7.0-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 932c6006f..3489280e9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-RC1 + 2.7.0-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index d423ada6a..b03e1c3db 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-RC1 + 2.7.0-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 3758d0dc8..f4e69abc9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-RC1 + 2.7.0-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index a1063a496..a4c7c4626 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-RC1 + 2.7.0-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index f37e796a6..15d902f1d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.7.0-RC1 + 2.7.0-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 49023fff7..d2350fb32 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-RC1 + 2.7.0-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index f47d50383..771104ca4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.7.0-RC1 + 2.7.0-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index d3ca8e185..1cdd43b95 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-RC1 + 2.7.0-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index fc6aa8490..fd54b9a22 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-RC1 + 2.7.0-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 223b55faf..5f4974f75 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.7.0-RC1 + 2.7.0-SNAPSHOT springdoc-openapi-security-tests From f8c22affb7ec83d24bd6395d31fff6d82b8f99c9 Mon Sep 17 00:00:00 2001 From: Ondrej Krpec Date: Fri, 8 Nov 2024 19:42:34 +0100 Subject: [PATCH 107/226] Add SortAsQueryParam annotation --- .../converters/models/SortAsQueryParam.java | 26 +++++++++++++++ .../springdoc/api/app3/HelloController.java | 7 ++++ .../src/test/resources/results/app3.json | 33 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortAsQueryParam.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortAsQueryParam.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortAsQueryParam.java new file mode 100644 index 000000000..b1eaf3dfd --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortAsQueryParam.java @@ -0,0 +1,26 @@ +package org.springdoc.core.converters.models; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The Sort class as query param. + * + * @author ondrejkrpec + */ +@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Parameter(in = ParameterIn.QUERY + , description = "Sorting criteria in the format: property,(asc|desc). " + + "Default sort order is ascending. " + "Multiple sort criteria are supported." + , name = "sort" + , array = @ArraySchema(schema = @Schema(type = "string")) +) +public @interface SortAsQueryParam {} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java index 69de12da8..fa4e73631 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java @@ -20,6 +20,7 @@ import org.springdoc.core.converters.models.PageableAsQueryParam; +import org.springdoc.core.converters.models.SortAsQueryParam; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -36,4 +37,10 @@ public String operation4() { return "operation4"; } + @GetMapping("operation5") + @SortAsQueryParam + public String operation5() { + return "operation5"; + } + } \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app3.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app3.json index 86b1ab4c4..74ca10337 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app3.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app3.json @@ -11,6 +11,39 @@ } ], "paths": { + "/demo/operation5": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "operation5", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/demo/operation4": { "get": { "tags": [ From b04a2c06aa190debc68b6d1524bb6c55a03d42d7 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 23 Nov 2024 15:11:10 +0100 Subject: [PATCH 108/226] - Upgrade spring-boot to 3.4.0 - Upgrade swagger-core to 2.2.26 - Upgrade swagger-ui to 5.18.2 - Upgrade spring-security-oauth2-authorization-server to 1.4.0 --- CHANGELOG.md | 11 +++++++++++ pom.xml | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e16c661f..570d35274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.7.0] - 2024-23-11 + +### Added +- #2777 - Add SortAsQueryParam annotation + +### Changed +- Upgrade spring-boot to 3.4.0 +- Upgrade swagger-core to 2.2.26 +- Upgrade swagger-ui to 5.18.2 +- Upgrade spring-security-oauth2-authorization-server to 1.4.0 + ## [2.7.0-RC1] - 2024-11-06 ### Added diff --git a/pom.xml b/pom.xml index 9683ff090..8ed072595 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.0-RC1 + 3.4.0 @@ -60,13 +60,13 @@ 1.6 2.5.3 1.6.8 - 2.2.25 - 5.18.1 + 2.2.26 + 5.18.2 1.13.1 0.9.1 0.15.0 4.2.0-M1 - 1.4.0-M2 + 1.4.0 From 7e2991c6e9e9bf203d9fc3a4107112fcf2daa3d1 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 23 Nov 2024 21:04:51 +0100 Subject: [PATCH 109/226] When using ParameterObject, description is taken from superclass instead of subclass. Fixes #2784 --- .../extractor/DelegatingMethodParameter.java | 14 +++- .../MethodParameterPojoExtractor.java | 4 +- .../src/test/resources/results/app102.json | 4 +- .../app231/ApplicationsRestController.java | 25 ++++++ .../api/v30/app231/SpringDocApp231Test.java | 40 ++++++++++ .../springdoc/api/v30/app231/SubClass.java | 17 ++++ .../springdoc/api/v30/app231/SuperClass.java | 18 +++++ .../test/resources/results/3.0.1/app102.json | 2 + .../test/resources/results/3.0.1/app121.json | 2 + .../test/resources/results/3.0.1/app231.json | 77 +++++++++++++++++++ .../src/test/resources/results/app102.json | 6 +- .../src/test/resources/results/app121.json | 6 +- 12 files changed, 203 insertions(+), 12 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/ApplicationsRestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SpringDocApp231Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SubClass.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SuperClass.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app231.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java index 1d308bb07..e704d51a4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java @@ -88,6 +88,11 @@ public class DelegatingMethodParameter extends MethodParameter { */ private final boolean isParameterObject; + /** + * The Method annotations. + */ + private final Annotation[] methodAnnotations; + /** * The Is not required. */ @@ -99,16 +104,18 @@ public class DelegatingMethodParameter extends MethodParameter { * @param delegate the delegate * @param parameterName the parameter name * @param additionalParameterAnnotations the additional parameter annotations + * @param methodAnnotations the method annotations * @param isParameterObject the is parameter object * @param isNotRequired the is required */ - DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, boolean isParameterObject, boolean isNotRequired) { + DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, Annotation[] methodAnnotations, boolean isParameterObject, boolean isNotRequired) { super(delegate); this.delegate = delegate; this.additionalParameterAnnotations = additionalParameterAnnotations; this.parameterName = parameterName; this.isParameterObject = isParameterObject; this.isNotRequired = isNotRequired; + this.methodAnnotations =methodAnnotations; } /** @@ -139,7 +146,7 @@ public static MethodParameter[] customize(String[] pNames, MethodParameter[] par } else { String name = pNames != null ? pNames[i] : p.getParameterName(); - explodedParameters.add(new DelegatingMethodParameter(p, name, null, false, false)); + explodedParameters.add(new DelegatingMethodParameter(p, name, null, null, false, false)); } } return explodedParameters.toArray(new MethodParameter[0]); @@ -171,7 +178,8 @@ public static MethodParameter changeContainingClass(MethodParameter methodParame @Override @NonNull public Annotation[] getParameterAnnotations() { - return ArrayUtils.addAll(delegate.getParameterAnnotations(), additionalParameterAnnotations); + Annotation[] methodAnnotations = ArrayUtils.addAll(delegate.getParameterAnnotations(), this.methodAnnotations); + return ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); } @Override diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index a82197010..837c79b29 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -192,7 +192,7 @@ private static Stream fromSimpleClass(Class paramClass, Fiel .map(RecordComponent::getAccessor) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, true, isNotRequired)); + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); } else @@ -202,7 +202,7 @@ private static Stream fromSimpleClass(Class paramClass, Fiel .filter(Objects::nonNull) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, true, isNotRequired)); + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); } catch (IntrospectionException e) { return Stream.of(); diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app102.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app102.json index 1d4abd05d..d7479b41b 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app102.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/app102.json @@ -91,6 +91,7 @@ { "name": "nested.param1", "in": "query", + "description": "nested string parameter", "required": false, "schema": { "type": "string" @@ -99,6 +100,7 @@ { "name": "nested.param2", "in": "query", + "description": "nested BigInteger parameter", "required": false, "schema": { "type": "integer" @@ -139,4 +141,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/ApplicationsRestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/ApplicationsRestController.java new file mode 100644 index 000000000..11afc6089 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/ApplicationsRestController.java @@ -0,0 +1,25 @@ +package test.org.springdoc.api.v30.app231; + +import io.swagger.v3.oas.annotations.Operation; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontProperties.Application; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(value = "/applications", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) +public class ApplicationsRestController { + + @Operation(summary = "Parameter object") + @PostMapping("/parameter-object") + public Application createWithParameterObject( + @RequestBody @ParameterObject SubClass request + ) { + return new Application(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SpringDocApp231Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SpringDocApp231Test.java new file mode 100644 index 000000000..05bdd1c28 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SpringDocApp231Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app231; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author bnasslahsen + */ +public class SpringDocApp231Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SubClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SubClass.java new file mode 100644 index 000000000..c37a37f26 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SubClass.java @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v30.app231; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "Used to create a new application") +public class SubClass extends SuperClass { + + public SubClass(String name) { + super(name); + } + + @Override + @Schema(description = "Overriding the description in sub class") + public String getName() { + return super.getName(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SuperClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SuperClass.java new file mode 100644 index 000000000..586435cb8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app231/SuperClass.java @@ -0,0 +1,18 @@ +package test.org.springdoc.api.v30.app231; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.Size; + +public class SuperClass { + @Size(min = 1, max = 30) + @Schema(description = "Description from the super class") + private String name; + + public SuperClass(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app102.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app102.json index 4d105d418..0f17e72f0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app102.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app102.json @@ -82,6 +82,7 @@ { "name": "nested.param1", "in": "query", + "description": "nested string parameter", "required": false, "schema": { "type": "string" @@ -90,6 +91,7 @@ { "name": "nested.param2", "in": "query", + "description": "nested BigInteger parameter", "required": false, "schema": { "type": "integer" diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app121.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app121.json index 176bb8823..9375efe11 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app121.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app121.json @@ -91,6 +91,7 @@ { "name": "nested.param1", "in": "query", + "description": "nested string parameter", "required": false, "schema": { "type": "string" @@ -99,6 +100,7 @@ { "name": "nested.param2", "in": "query", + "description": "nested BigInteger parameter", "required": false, "schema": { "type": "integer" diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app231.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app231.json new file mode 100644 index 000000000..9912b0e7f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app231.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/applications/parameter-object": { + "post": { + "tags": [ + "applications-rest-controller" + ], + "summary": "Parameter object", + "operationId": "createWithParameterObject", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Overriding the description in sub class", + "required": false, + "schema": { + "maxLength": 30, + "minLength": 1, + "type": "string", + "description": "Overriding the description in sub class" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Application" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Application": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "clusterName": { + "type": "string" + }, + "shardName": { + "type": "string" + }, + "customTags": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app102.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app102.json index 7dbbdae94..83c8687ea 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app102.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app102.json @@ -103,7 +103,7 @@ { "name": "nested.param1", "in": "query", - "description": "The Param 1.", + "description": "nested string parameter", "required": false, "schema": { "type": "string" @@ -112,7 +112,7 @@ { "name": "nested.param2", "in": "query", - "description": "The Param 2.", + "description": "nested BigInteger parameter", "required": false, "schema": { "type": "integer" @@ -157,4 +157,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app121.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app121.json index 5af5df52e..c315da65e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app121.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app121.json @@ -103,7 +103,7 @@ { "name": "nested.param1", "in": "query", - "description": "The Param 1.", + "description": "nested string parameter", "required": false, "schema": { "type": "string" @@ -112,7 +112,7 @@ { "name": "nested.param2", "in": "query", - "description": "The Param 2.", + "description": "nested BigInteger parameter", "required": false, "schema": { "type": "integer" @@ -213,4 +213,4 @@ } } } -} \ No newline at end of file +} From 7226c4589338c14b1701a9a48943766f5a875085 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 23 Nov 2024 21:14:33 +0100 Subject: [PATCH 110/226] revert back to version of swagger-core 2.2.25 Jackson-databind reflection problem with swagger-core --- CHANGELOG.md | 1 - pom.xml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 570d35274..1a6a50d9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Upgrade spring-boot to 3.4.0 -- Upgrade swagger-core to 2.2.26 - Upgrade swagger-ui to 5.18.2 - Upgrade spring-security-oauth2-authorization-server to 1.4.0 diff --git a/pom.xml b/pom.xml index 8ed072595..df77860c5 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.6 2.5.3 1.6.8 - 2.2.26 + 2.2.25 5.18.2 1.13.1 0.9.1 From 92d82dad9084c4c781add19960393502acba391e Mon Sep 17 00:00:00 2001 From: jenkins Date: Sat, 23 Nov 2024 21:36:12 +0000 Subject: [PATCH 111/226] [maven-release-plugin] prepare release v2.7.0 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index df77860c5..68f3029b2 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.7.0-SNAPSHOT + 2.7.0 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.7.0 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 724f4f4d7..d70197f4c 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-SNAPSHOT + 2.7.0 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 3b7992d81..5e0bd2b85 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-SNAPSHOT + 2.7.0 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 16bf89932..1fc5e765f 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-SNAPSHOT + 2.7.0 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index a8ff8f0c8..27744758c 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-SNAPSHOT + 2.7.0 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index b1cfd7476..eb73f019d 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0-SNAPSHOT + 2.7.0 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index c46beff4b..c09f8dcc0 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.7.0-SNAPSHOT + 2.7.0 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 8c06dd471..a8904a35d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-SNAPSHOT + 2.7.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 3489280e9..22d1b09cc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-SNAPSHOT + 2.7.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index b03e1c3db..6c579b3e6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-SNAPSHOT + 2.7.0 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index f4e69abc9..7cf7b5ac5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-SNAPSHOT + 2.7.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index a4c7c4626..8c31ec49b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-SNAPSHOT + 2.7.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index 15d902f1d..750c9e014 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.7.0-SNAPSHOT + 2.7.0 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index d2350fb32..f76664ca3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-SNAPSHOT + 2.7.0 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 771104ca4..9d8224c82 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.7.0-SNAPSHOT + 2.7.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 1cdd43b95..b00a52bb8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-SNAPSHOT + 2.7.0 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index fd54b9a22..8e4d8077e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0-SNAPSHOT + 2.7.0 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 5f4974f75..38d1a47eb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.7.0-SNAPSHOT + 2.7.0 springdoc-openapi-security-tests From 2e514f14d40dc477ccc7c9ad707528cd5da2adfa Mon Sep 17 00:00:00 2001 From: jenkins Date: Sat, 23 Nov 2024 21:36:15 +0000 Subject: [PATCH 112/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 68f3029b2..2f92713cd 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.7.0 + 2.7.1-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.7.0 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index d70197f4c..78beac435 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0 + 2.7.1-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 5e0bd2b85..42a789769 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0 + 2.7.1-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 1fc5e765f..1cf059eac 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0 + 2.7.1-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 27744758c..5f3fbe0a3 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0 + 2.7.1-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index eb73f019d..7cc45360d 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.0 + 2.7.1-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index c09f8dcc0..8dfe685b0 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.7.0 + 2.7.1-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index a8904a35d..dcc2f5211 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0 + 2.7.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 22d1b09cc..90c4fd377 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0 + 2.7.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 6c579b3e6..9baac1d7f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0 + 2.7.1-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 7cf7b5ac5..aa6723e1e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0 + 2.7.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index 8c31ec49b..96a41e1c1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0 + 2.7.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index 750c9e014..d0069a0fc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.7.0 + 2.7.1-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index f76664ca3..59adbf0f4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0 + 2.7.1-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 9d8224c82..9fb6c1a2c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.7.0 + 2.7.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index b00a52bb8..ff103b883 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0 + 2.7.1-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 8e4d8077e..164f2eb0a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.0 + 2.7.1-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 38d1a47eb..dcc65d823 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.7.0 + 2.7.1-SNAPSHOT springdoc-openapi-security-tests From e8de90ee6b33cfb9a1c8539294a645b82d00a51d Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 23 Nov 2024 23:01:06 +0100 Subject: [PATCH 113/226] Fixes #2785 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a6a50d9a..3f0a9c514 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.7.0] - 2024-23-11 ### Added -- #2777 - Add SortAsQueryParam annotation +- #2777 - Add SortAsQueryParam annotation +- #2786 - No static resource swagger-ui/index.html error after migration to 2.7.0-RC1 ### Changed - Upgrade spring-boot to 3.4.0 From 197f7b438cbfbd1f7e9cd5fca31808c387adc8d7 Mon Sep 17 00:00:00 2001 From: Michael Clarke Date: Sun, 24 Nov 2024 15:16:22 +0000 Subject: [PATCH 114/226] Obey annotations when flattening ParameterObject fields. Fixes #2787 When creating the flattened parameter definitions for an item annotated with `@ParameterObject`, the `@Schema` and `@Property` annotations on any fields prior to the final child-node of each branch of the parameter tree are not taken into consideration. This results in the field name in the code being used even where annotations may override that, prevents the fields being hidden where one of the parent fields is marked as hidden but the child field isn't hidden, and marks a field as mandatory even where the field would only be mandatory if the parent object had been declared through a sibling of the target field being set. To overcome this, whilst the flattened parameter map is being built, each field is now being inspected for a `@Parameter` annotation or - where the `@Parameter` annotation isn't found - a `@Schema` annotation. Where a custom name is included in either of those annotations then the overridden field name is used in the flattened definition. If either annotation declares the field as hidden then the field and all child fields are removed from the resulting definition, and a field is no longer set as mandatory unless the parent field was also declared as mandatory, or resolved as non-null and was set in an automatic state. To ensure that the post-processing steps don't re-apply `required` properties on parameters that have purposefully had them removed, the delegate now tracks any annotations what should not be shown as being on the parameter, and excludes them from the annotation list during subsequent calls. --- .../extractor/DelegatingMethodParameter.java | 23 +++- .../MethodParameterPojoExtractor.java | 115 +++++++++++++++-- .../core/service/AbstractRequestService.java | 17 ++- .../api/v30/app232/ParameterController.java | 86 +++++++++++++ .../api/v30/app232/SpringDocApp232Test.java | 29 +++++ .../test/resources/results/3.0.1/app232.json | 117 ++++++++++++++++++ 6 files changed, 369 insertions(+), 18 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/ParameterController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/SpringDocApp232Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app232.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java index e704d51a4..a04958218 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java @@ -93,6 +93,11 @@ public class DelegatingMethodParameter extends MethodParameter { */ private final Annotation[] methodAnnotations; + /** + * The annotations to mask from the list of annotations on this method parameter. + */ + private final Annotation[] maskedAnnotations; + /** * The Is not required. */ @@ -105,17 +110,19 @@ public class DelegatingMethodParameter extends MethodParameter { * @param parameterName the parameter name * @param additionalParameterAnnotations the additional parameter annotations * @param methodAnnotations the method annotations + * @param maskedAnnotations any annotations that should not be included in the final list of annotations * @param isParameterObject the is parameter object * @param isNotRequired the is required */ - DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, Annotation[] methodAnnotations, boolean isParameterObject, boolean isNotRequired) { + DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, Annotation[] methodAnnotations, Annotation[] maskedAnnotations, boolean isParameterObject, boolean isNotRequired) { super(delegate); this.delegate = delegate; this.additionalParameterAnnotations = additionalParameterAnnotations; this.parameterName = parameterName; this.isParameterObject = isParameterObject; this.isNotRequired = isNotRequired; - this.methodAnnotations =methodAnnotations; + this.methodAnnotations = methodAnnotations; + this.maskedAnnotations = maskedAnnotations; } /** @@ -146,7 +153,7 @@ public static MethodParameter[] customize(String[] pNames, MethodParameter[] par } else { String name = pNames != null ? pNames[i] : p.getParameterName(); - explodedParameters.add(new DelegatingMethodParameter(p, name, null, null, false, false)); + explodedParameters.add(new DelegatingMethodParameter(p, name, null, null, null, false, false)); } } return explodedParameters.toArray(new MethodParameter[0]); @@ -179,7 +186,15 @@ public static MethodParameter changeContainingClass(MethodParameter methodParame @NonNull public Annotation[] getParameterAnnotations() { Annotation[] methodAnnotations = ArrayUtils.addAll(delegate.getParameterAnnotations(), this.methodAnnotations); - return ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); + methodAnnotations = ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); + if (maskedAnnotations == null) { + return methodAnnotations; + } else { + List maskedAnnotationList = List.of(maskedAnnotations); + return Arrays.stream(methodAnnotations) + .filter(annotation -> !maskedAnnotationList.contains(annotation)) + .toArray(Annotation[]::new); + } } @Override diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index 837c79b29..c0390e883 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -50,10 +50,13 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Predicate; +import java.util.stream.Collectors; import java.util.stream.Stream; import io.swagger.v3.core.util.PrimitiveType; import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springdoc.core.service.AbstractRequestService; import org.springframework.core.GenericTypeResolver; import org.springframework.core.MethodParameter; @@ -63,7 +66,7 @@ /** * The type Method parameter pojo extractor. * - * @author bnasslahsen + * @author bnasslahsen, michael.clarke */ public class MethodParameterPojoExtractor { @@ -113,7 +116,7 @@ private MethodParameterPojoExtractor() { * @return the stream */ static Stream extractFrom(Class clazz) { - return extractFrom(clazz, ""); + return extractFrom(clazz, "", true); } /** @@ -121,12 +124,13 @@ static Stream extractFrom(Class clazz) { * * @param clazz the clazz * @param fieldNamePrefix the field name prefix + * @param parentRequired whether the field that hold the class currently being inspected was required or optional * @return the stream */ - private static Stream extractFrom(Class clazz, String fieldNamePrefix) { + private static Stream extractFrom(Class clazz, String fieldNamePrefix, boolean parentRequired) { return allFieldsOf(clazz).stream() .filter(field -> !field.getType().equals(clazz)) - .flatMap(f -> fromGetterOfField(clazz, f, fieldNamePrefix)) + .flatMap(f -> fromGetterOfField(clazz, f, fieldNamePrefix, parentRequired)) .filter(Objects::nonNull); } @@ -136,20 +140,95 @@ private static Stream extractFrom(Class clazz, String fieldN * @param paramClass the param class * @param field the field * @param fieldNamePrefix the field name prefix + * @param parentRequired whether the field that holds the class currently being examined was required or optional * @return the stream */ - private static Stream fromGetterOfField(Class paramClass, Field field, String fieldNamePrefix) { + private static Stream fromGetterOfField(Class paramClass, Field field, String fieldNamePrefix, boolean parentRequired) { Class type = extractType(paramClass, field); if (Objects.isNull(type)) return Stream.empty(); if (isSimpleType(type)) - return fromSimpleClass(paramClass, field, fieldNamePrefix); + return fromSimpleClass(paramClass, field, fieldNamePrefix, parentRequired); else { - String prefix = fieldNamePrefix + field.getName() + DOT; - return extractFrom(type, prefix); + Parameter parameter = field.getAnnotation(Parameter.class); + Schema schema = field.getAnnotation(Schema.class); + boolean visible = resolveVisible(parameter, schema); + if (!visible) { + return Stream.empty(); + } + String prefix = fieldNamePrefix + resolveName(parameter, schema).orElse(field.getName()) + DOT; + boolean notNullAnnotationsPresent = AbstractRequestService.hasNotNullAnnotation(Arrays.stream(field.getDeclaredAnnotations()) + .map(Annotation::annotationType) + .map(Class::getSimpleName) + .collect(Collectors.toSet())); + return extractFrom(type, prefix, parentRequired && resolveRequired(schema, parameter, !notNullAnnotationsPresent)); + } + } + + private static Optional resolveName(Parameter parameter, Schema schema) { + if (parameter != null) { + return resolveNameFromParameter(parameter); + } + if (schema != null) { + return resolveNameFromSchema(schema); + } + return Optional.empty(); + } + + private static Optional resolveNameFromParameter(Parameter parameter) { + if (parameter.name().isEmpty()) { + return Optional.empty(); + } + return Optional.of(parameter.name()); + } + + private static Optional resolveNameFromSchema(Schema schema) { + if (schema.name().isEmpty()) { + return Optional.empty(); + } + return Optional.of(schema.name()); + } + + private static boolean resolveVisible(Parameter parameter, Schema schema) { + if (parameter != null) { + return !parameter.hidden(); } + if (schema != null) { + return !schema.hidden(); + } + return true; + } + + private static boolean resolveRequired(Schema schema, Parameter parameter, boolean nullable) { + if (parameter != null) { + return resolveRequiredFromParameter(parameter, nullable); + } + if (schema != null) { + return resolveRequiredFromSchema(schema, nullable); + } + return !nullable; + } + + private static boolean resolveRequiredFromParameter(Parameter parameter, boolean nullable) { + if (parameter.required()) { + return true; + } + return !nullable; + } + + private static boolean resolveRequiredFromSchema(Schema schema, boolean nullable) { + if (schema.required()) { + return true; + } + else if (schema.requiredMode() == Schema.RequiredMode.REQUIRED) { + return true; + } + else if (schema.requiredMode() == Schema.RequiredMode.NOT_REQUIRED) { + return false; + } + return !nullable; } /** @@ -181,18 +260,30 @@ private static Class extractType(Class paramClass, Field field) { * @param fieldNamePrefix the field name prefix * @return the stream */ - private static Stream fromSimpleClass(Class paramClass, Field field, String fieldNamePrefix) { + private static Stream fromSimpleClass(Class paramClass, Field field, String fieldNamePrefix, boolean isParentRequired) { Annotation[] fieldAnnotations = field.getDeclaredAnnotations(); try { Parameter parameter = field.getAnnotation(Parameter.class); - boolean isNotRequired = parameter == null || !parameter.required(); + Schema schema = field.getAnnotation(Schema.class); + boolean visible = resolveVisible(parameter, schema); + if (!visible) { + return Stream.empty(); + } + + boolean isNotRequired = !(isParentRequired && resolveRequired(schema, parameter, !AbstractRequestService.hasNotNullAnnotation(Arrays.stream(fieldAnnotations) + .map(Annotation::annotationType) + .map(Class::getSimpleName) + .collect(Collectors.toSet())))); + Annotation[] notNullFieldAnnotations = Arrays.stream(fieldAnnotations) + .filter(annotation -> AbstractRequestService.hasNotNullAnnotation(List.of(annotation.annotationType().getSimpleName()))) + .toArray(Annotation[]::new); if (paramClass.getSuperclass() != null && paramClass.isRecord()) { return Stream.of(paramClass.getRecordComponents()) .filter(d -> d.getName().equals(field.getName())) .map(RecordComponent::getAccessor) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), notNullFieldAnnotations, true, isNotRequired)); } else @@ -202,7 +293,7 @@ private static Stream fromSimpleClass(Class paramClass, Fiel .filter(Objects::nonNull) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), notNullFieldAnnotations, true, isNotRequired)); } catch (IntrospectionException e) { return Stream.of(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index a2a7d9b45..5f704b77c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -570,6 +570,9 @@ public Parameter buildParam(ParameterInfo parameterInfo, Components components, if (parameter.getRequired() == null) parameter.setRequired(parameterInfo.isRequired()); + if (Boolean.TRUE.equals(parameter.getRequired()) && parameterInfo.getMethodParameter() instanceof DelegatingMethodParameter delegatingMethodParameter && delegatingMethodParameter.isNotRequired()) + parameter.setRequired(false); + if (containsDeprecatedAnnotation(parameterInfo.getMethodParameter().getParameterAnnotations())) parameter.setDeprecated(true); @@ -602,7 +605,7 @@ public void applyBeanValidatorAnnotations(final Parameter parameter, final List< Map annos = new HashMap<>(); if (annotations != null) annotations.forEach(annotation -> annos.put(annotation.annotationType().getSimpleName(), annotation)); - boolean annotationExists = Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annos::containsKey); + boolean annotationExists = hasNotNullAnnotation(annos.keySet()); if (annotationExists) parameter.setRequired(true); Schema schema = parameter.getSchema(); @@ -629,7 +632,7 @@ public void applyBeanValidatorAnnotations(final RequestBody requestBody, final L .filter(annotation -> io.swagger.v3.oas.annotations.parameters.RequestBody.class.equals(annotation.annotationType())) .anyMatch(annotation -> ((io.swagger.v3.oas.annotations.parameters.RequestBody) annotation).required()); } - boolean validationExists = Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annos::containsKey); + boolean validationExists = hasNotNullAnnotation(annos.keySet()); if (validationExists || (!isOptional && (springRequestBodyRequired || swaggerRequestBodyRequired))) requestBody.setRequired(true); @@ -831,4 +834,14 @@ else if (requestBody.content().length > 0) } return false; } + + /** + * Check if the parameter has any of the annotations that make it non-optional + * + * @param annotationSimpleNames the annotation simple class named, e.g. NotNull + * @return whether any of the known NotNull annotations are present + */ + public static boolean hasNotNullAnnotation(Collection annotationSimpleNames) { + return Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annotationSimpleNames::contains); + } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/ParameterController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/ParameterController.java new file mode 100644 index 000000000..2f6e14588 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/ParameterController.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app232; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ParameterController { + + @GetMapping("/hidden-parent") + public void nestedParameterObjectWithHiddenParentField(@ParameterObject ParameterObjectWithHiddenField parameters) { + + } + + public record ParameterObjectWithHiddenField( + @Schema(hidden = true) NestedParameterObject schemaHiddenNestedParameterObject, + @Parameter(hidden = true) NestedParameterObject parameterHiddenNestedParameterObject, + NestedParameterObject visibleNestedParameterObject + ) { + + } + + public record NestedParameterObject( + String parameterField) { + } + + @GetMapping("/renamed-parent") + public void nestedParameterObjectWithRenamedParentField(@ParameterObject ParameterObjectWithRenamedField parameters) { + + } + + public record ParameterObjectWithRenamedField( + @Schema(name = "schemaRenamed") NestedParameterObject schemaRenamedNestedParameterObject, + @Parameter(name = "parameterRenamed") NestedParameterObject parameterRenamedNestedParameterObject, + NestedParameterObject originalNameNestedParameterObject + ) { + + } + + @GetMapping("/optional-parent") + public void nestedParameterObjectWithOptionalParentField(@ParameterObject ParameterObjectWithOptionalField parameters) { + + } + + public record ParameterObjectWithOptionalField( + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) NestedRequiredParameterObject schemaNotRequiredNestedParameterObject, + @Parameter NestedRequiredParameterObject parameterNotRequiredNestedParameterObject, + @Parameter(required = true) NestedRequiredParameterObject requiredNestedParameterObject + ) { + + } + + public record NestedRequiredParameterObject( + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @NotNull String requiredParameterField) { + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/SpringDocApp232Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/SpringDocApp232Test.java new file mode 100644 index 000000000..73d5d7109 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/SpringDocApp232Test.java @@ -0,0 +1,29 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ +package test.org.springdoc.api.v30.app232; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +class SpringDocApp232Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app232.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app232.json new file mode 100644 index 000000000..be5d0d307 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app232.json @@ -0,0 +1,117 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/renamed-parent": { + "get": { + "tags": [ + "parameter-controller" + ], + "operationId": "nestedParameterObjectWithRenamedParentField", + "parameters": [ + { + "name": "schemaRenamed.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "parameterRenamed.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "originalNameNestedParameterObject.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/optional-parent": { + "get": { + "tags": [ + "parameter-controller" + ], + "operationId": "nestedParameterObjectWithOptionalParentField", + "parameters": [ + { + "name": "schemaNotRequiredNestedParameterObject.requiredParameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "parameterNotRequiredNestedParameterObject.requiredParameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNestedParameterObject.requiredParameterField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/hidden-parent": { + "get": { + "tags": [ + "parameter-controller" + ], + "operationId": "nestedParameterObjectWithHiddenParentField", + "parameters": [ + { + "name": "visibleNestedParameterObject.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} From e121892adbcae967e6a8c20884c2b5fcbfdee15d Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 28 Nov 2024 21:35:44 +0100 Subject: [PATCH 115/226] Update with LVM sponsor --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 65257d011..45687a318 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,10 @@ This project is sponsored by + + + +

# Table of Contents From 674b0b57661d82167c1fbd054f7e5fc30adcddf2 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 28 Nov 2024 21:50:03 +0100 Subject: [PATCH 116/226] Update with LVM sponsor --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45687a318..180f3d560 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ This project is sponsored by - +

From 591c16aa4b91876a56a69c6873227def39c6b6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20H=C3=A9ritier?= Date: Fri, 6 Dec 2024 16:21:15 +0100 Subject: [PATCH 117/226] Upgrade spring-cloud-function from 4.2.0-M1 to 4.2.0 A stable release should never depend on a milestone --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2f92713cd..f2f01bdb1 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 1.13.1 0.9.1 0.15.0 - 4.2.0-M1 + 4.2.0 1.4.0
From 3708d7ae97701babb6c5f00ba2eaa105d5ea21d9 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 8 Dec 2024 18:10:47 +0100 Subject: [PATCH 118/226] Removing operationId via customizer does not work anymore. Fixes #2797 --- pom.xml | 2 +- .../customizers/OperationIdCustomizer.java | 2 +- .../api/v30/app232/HelloController.java | 19 +++ .../api/v30/app232/SpringDocApp232Test.java | 50 +++++++ .../test/resources/results/3.0.1/app232.json | 137 ++++++++++++++++++ 5 files changed, 208 insertions(+), 2 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/SpringDocApp232Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app232.json diff --git a/pom.xml b/pom.xml index f2f01bdb1..2f92713cd 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 1.13.1 0.9.1 0.15.0 - 4.2.0 + 4.2.0-M1 1.4.0 diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java index 58bf1a162..4a446a246 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java @@ -72,7 +72,7 @@ private void processOperation(Operation operation, Map operatio String originalOperationId = operation.getOperationId(); // Check if operationId already exists - if (operationIdCount.containsKey(originalOperationId)) { + if ( originalOperationId!=null && operationIdCount.containsKey(originalOperationId)) { // Get the count for the current operationId and increment int count = operationIdCount.get(originalOperationId); count++; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/HelloController.java new file mode 100644 index 000000000..f61f41c36 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/HelloController.java @@ -0,0 +1,19 @@ +package test.org.springdoc.api.v30.app232; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping +public class HelloController { + + + @RequestMapping("/") + public String sayHello() { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/SpringDocApp232Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/SpringDocApp232Test.java new file mode 100644 index 000000000..0028c1d92 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app232/SpringDocApp232Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app232; + +import org.springdoc.core.customizers.OperationCustomizer; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * @author bnasslahsen + */ +public class SpringDocApp232Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OperationCustomizer operationIdCustomizer() { + return (operation, handlerMethod) -> { + operation.setOperationId(null); + return operation; + }; + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app232.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app232.json new file mode 100644 index 000000000..d446ea199 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app232.json @@ -0,0 +1,137 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "options": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "head": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "patch": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} From de8a7eca2a51b9c741ab1671d918750303d7d781 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 8 Dec 2024 19:08:48 +0100 Subject: [PATCH 119/226] Add Security Schema by AutoConfigure. Fixes #2780 --- .../customizers/SpecPropertiesCustomizer.java | 92 +++++++++++++++++++ .../src/test/resources/application-212.yml | 7 ++ .../results/3.0.1/app212-grouped.json | 12 +++ .../test/resources/results/3.0.1/app212.json | 12 +++ 4 files changed, 123 insertions(+) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java index a25957473..1a7ba9877 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java @@ -41,6 +41,11 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.security.OAuthFlows; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.security.SecurityScheme.In; +import io.swagger.v3.oas.models.security.SecurityScheme.Type; import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; @@ -134,6 +139,31 @@ private void customizeOpenApi(OpenAPI openApi, OpenAPI openApiProperties) { Paths pathsProperties = openApiProperties.getPaths(); if (pathsProperties != null) customizePaths(openApi, pathsProperties); + + List securityRequirementsProperties = openApiProperties.getSecurity(); + if (!CollectionUtils.isEmpty(securityRequirementsProperties)) { + customizeSecurity(openApi, securityRequirementsProperties); + } + } + } + + /** + * Customize security. + * + * @param openApi the open api + * @param securityRequirementsProperties the security requirements + */ + private void customizeSecurity(OpenAPI openApi, List securityRequirementsProperties) { + List securityRequirements = openApi.getSecurity(); + if (CollectionUtils.isEmpty(securityRequirements)) { + openApi.setSecurity(securityRequirementsProperties); + } + else { + securityRequirementsProperties.forEach(securityRequirement -> { + if (!securityRequirements.contains(securityRequirement)) { + securityRequirements.add(securityRequirement); + } + }); } } @@ -204,6 +234,28 @@ private void customizeComponents(OpenAPI openApi, Components componentsPropertie }); } }); + + + Map securitySchemeMap = components.getSecuritySchemes(); + if (CollectionUtils.isEmpty(securitySchemeMap)) { + components.setSecuritySchemes(componentsProperties.getSecuritySchemes()); + } + else { + securitySchemeMap.forEach((key, securityScheme) -> { + SecurityScheme securitySchemeToCustomize = components.getSecuritySchemes().get(key); + if (securitySchemeToCustomize != null) { + resolveString(securitySchemeToCustomize::description, securityScheme::getDescription); + resolveString(securitySchemeToCustomize::name, securityScheme::getName); + resolveType(securitySchemeToCustomize::type, securityScheme::getType); + resolveIn(securitySchemeToCustomize::in, securityScheme::getIn); + resolveString(securitySchemeToCustomize::scheme, securityScheme::getScheme); + resolveString(securitySchemeToCustomize::bearerFormat, securityScheme::getBearerFormat); + resolveString(securitySchemeToCustomize::openIdConnectUrl, securityScheme::getOpenIdConnectUrl); + resolveOAuthFlows(securitySchemeToCustomize::flows, securityScheme::getFlows); + resolveString(securitySchemeToCustomize::$ref, securityScheme::get$ref); + } + }); + } } } @@ -259,6 +311,46 @@ private void resolveString(Consumer setter, Supplier getter) { } } + /** + * Resolve type. + * + * @param setter the setter + * @param getter the getter + */ + private void resolveType(Consumer setter, Supplier getter) { + Type value = (Type) getter.get(); + if (value!=null) { + setter.accept(value); + } + } + + /** + * Resolve in. + * + * @param setter the setter + * @param getter the getter + */ + private void resolveIn(Consumer setter, Supplier getter) { + In value = (In) getter.get(); + if (value!=null) { + setter.accept(value); + } + } + + /** + * Resolve o auth flows. + * + * @param setter the setter + * @param getter the getter + */ + private void resolveOAuthFlows(Consumer setter, Supplier getter) { + OAuthFlows value = (OAuthFlows) getter.get(); + if (value!=null) { + setter.accept(value); + } + } + + /** * Resolve set. * diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/application-212.yml b/springdoc-openapi-starter-webmvc-api/src/test/resources/application-212.yml index 36ac27be3..4160fe61a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/application-212.yml +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/application-212.yml @@ -4,7 +4,14 @@ springdoc: title: Api info title description: Api info description version: Api info version + security: + - basicScheme: [ ] components: + securitySchemes: + basicScheme: + type: http + scheme: bearer + bearerFormat: JWT schemas: PersonDTO: description: Description for PersonDTO component diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app212-grouped.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app212-grouped.json index 88f9546e8..3021de061 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app212-grouped.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app212-grouped.json @@ -11,6 +11,11 @@ "description": "Generated server url" } ], + "security": [ + { + "basicScheme": [] + } + ], "paths": { "/persons3": { "get": { @@ -110,6 +115,13 @@ }, "description": "Description for PersonDTO component in ApiGroupName" } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app212.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app212.json index 457a8edbd..12339f3e8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app212.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app212.json @@ -11,6 +11,11 @@ "description": "Generated server url" } ], + "security": [ + { + "basicScheme": [] + } + ], "paths": { "/persons3": { "get": { @@ -108,6 +113,13 @@ }, "description": "Description for PersonDTO component" } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } } } } From 5c3627398952dbcf4e4324e3562d1acb92ffcf1e Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 8 Dec 2024 19:23:05 +0100 Subject: [PATCH 120/226] code review --- .../api/v30/{app234 => app233}/ParameterController.java | 2 +- .../SpringDocApp233Test.java} | 4 ++-- .../test/resources/results/3.0.1/{app234.json => app233.json} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/{app234 => app233}/ParameterController.java (98%) rename springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/{app234/SpringDocApp234Test.java => app233/SpringDocApp233Test.java} (91%) rename springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/{app234.json => app233.json} (100%) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/ParameterController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java similarity index 98% rename from springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/ParameterController.java rename to springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java index bf68d1934..3f0651c7b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/ParameterController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java @@ -23,7 +23,7 @@ * * * */ -package test.org.springdoc.api.v30.app234; +package test.org.springdoc.api.v30.app233; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/SpringDocApp234Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java similarity index 91% rename from springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/SpringDocApp234Test.java rename to springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java index 3a023aa3d..9ad5ae92a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/SpringDocApp234Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java @@ -24,7 +24,7 @@ * */ -package test.org.springdoc.api.v30.app234; +package test.org.springdoc.api.v30.app233; import test.org.springdoc.api.v30.AbstractSpringDocV30Test; @@ -33,7 +33,7 @@ /** * @author bnasslahsen */ -public class SpringDocApp234Test extends AbstractSpringDocV30Test { +public class SpringDocApp233Test extends AbstractSpringDocV30Test { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app234.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json similarity index 100% rename from springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app234.json rename to springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json From 19653f97f2de0aafed20e139c31e390e4c095990 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 10 Dec 2024 09:07:08 +0100 Subject: [PATCH 121/226] Testing with 4.2.1-SNAPSHOT, for spring-cloud-function. #2804 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2f92713cd..56f87d0ad 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 1.13.1 0.9.1 0.15.0 - 4.2.0-M1 + 4.2.1-SNAPSHOT 1.4.0 From faa329a25794133cbde50173f70c6e5d8b3ddd6c Mon Sep 17 00:00:00 2001 From: jochenberger Date: Thu, 12 Dec 2024 08:35:26 +0100 Subject: [PATCH 122/226] Upgrade Swagger to 2.2.27 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 56f87d0ad..acd50d6b3 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.6 2.5.3 1.6.8 - 2.2.25 + 2.2.27 5.18.2 1.13.1 0.9.1 From 3f755ac4dbbae980dc44d01ca3b6ed327a2537a6 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Dec 2024 13:34:35 +0100 Subject: [PATCH 123/226] Add support for deprecated fields. Fixes #2830 --- .../SpringDocKotlinConfiguration.kt | 8 ++ .../KotlinDeprecatedPropertyCustomizer.kt | 83 +++++++++++++ .../api/AbstractKotlinSpringDocTest.kt | 2 + .../springdoc/api/app11/SpringDocApp11Test.kt | 31 +++++ .../api/app11/SystemStatusController.kt | 61 +++++++++ .../src/test/resources/results/app11.json | 117 ++++++++++++++++++ 6 files changed, 302 insertions(+) create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/KotlinDeprecatedPropertyCustomizer.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app11.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt index dd0f423e8..b059e4dc6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt @@ -27,7 +27,9 @@ package org.springdoc.core.configuration import io.swagger.v3.oas.annotations.Parameter +import org.springdoc.core.customizers.KotlinDeprecatedPropertyCustomizer import org.springdoc.core.customizers.ParameterCustomizer +import org.springdoc.core.providers.ObjectMapperProvider import org.springdoc.core.utils.Constants import org.springdoc.core.utils.SpringDocUtils import org.springframework.boot.autoconfigure.condition.ConditionalOnBean @@ -125,4 +127,10 @@ class SpringDocKotlinConfiguration() { return kotlinFunction.parameters[parameterIndex + 1] } + @Bean + @Lazy(false) + @ConditionalOnMissingBean + fun kotlinDeprecatedPropertyCustomizer(objectMapperProvider: ObjectMapperProvider): KotlinDeprecatedPropertyCustomizer { + return KotlinDeprecatedPropertyCustomizer(objectMapperProvider) + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/KotlinDeprecatedPropertyCustomizer.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/KotlinDeprecatedPropertyCustomizer.kt new file mode 100644 index 000000000..23889b038 --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/KotlinDeprecatedPropertyCustomizer.kt @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package org.springdoc.core.customizers + +import com.fasterxml.jackson.databind.JavaType +import io.swagger.v3.core.converter.AnnotatedType +import io.swagger.v3.core.converter.ModelConverter +import io.swagger.v3.core.converter.ModelConverterContext +import io.swagger.v3.oas.models.Components +import io.swagger.v3.oas.models.media.Schema +import org.springdoc.core.providers.ObjectMapperProvider +import kotlin.reflect.full.findAnnotation +import kotlin.reflect.full.hasAnnotation +import kotlin.reflect.full.memberProperties + +/** + * Kotlin Deprecated PropertyCustomizer to handle Kotlin Deprecated annotations. + * @author bnasslahsen + */ +class KotlinDeprecatedPropertyCustomizer( + private val objectMapperProvider: ObjectMapperProvider +) : ModelConverter { + + override fun resolve( + type: AnnotatedType, + context: ModelConverterContext, + chain: Iterator + ): Schema<*>? { + if (!chain.hasNext()) return null + // Resolve the next model in the chain + val resolvedSchema = chain.next().resolve(type, context, chain) + + val javaType: JavaType = + objectMapperProvider.jsonMapper().constructType(type.type) + val kotlinClass = javaType.rawClass.kotlin + + // Check each property of the class + for (prop in kotlinClass.memberProperties) { + val deprecatedAnnotation = prop.findAnnotation() + prop.hasAnnotation() + if (deprecatedAnnotation != null) { + val fieldName = prop.name + if (resolvedSchema.`$ref` != null) { + val schema = + context.getDefinedModels()[resolvedSchema.`$ref`.substring( + Components.COMPONENTS_SCHEMAS_REF.length + )] + schema?.properties?.get(fieldName)?.deprecated = true + if (deprecatedAnnotation.message.isNotBlank()) { + schema?.properties?.get(fieldName)?.description = + schema?.properties?.get(fieldName)?.description?.takeIf { it.isNotBlank() } + ?: deprecatedAnnotation.message + } + } + } + } + return resolvedSchema + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt index d5419afd9..6e67f62e6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt @@ -23,6 +23,7 @@ import org.skyscreamer.jsonassert.JSONAssert import org.slf4j.LoggerFactory import org.springdoc.core.utils.Constants import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest import org.springframework.test.context.ActiveProfiles import org.springframework.test.web.reactive.server.WebTestClient @@ -32,6 +33,7 @@ import java.nio.file.Paths @WebFluxTest @ActiveProfiles("test") +@AutoConfigureWebTestClient(timeout = "3600000") abstract class AbstractKotlinSpringDocTest { @Autowired diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt new file mode 100644 index 000000000..f8f2b79ca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.app11 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.AbstractKotlinSpringDocTest + +class SpringDocApp11Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app11"]) + class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt new file mode 100644 index 000000000..b67d61cec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt @@ -0,0 +1,61 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.app11 + +import io.swagger.v3.oas.annotations.media.Schema +import kotlinx.coroutines.reactor.mono +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController +import kotlin.reflect.full.findAnnotation +import kotlin.reflect.full.memberProperties + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class PersonDTO( + @Deprecated ("no-email") val email: String, + val firstName: String, + val lastName: String +) + +data class SystemStatusResponse( + @Deprecated ("will be removed in next version") + val systemStatus: SystemStatus, + + @Deprecated ("") + val emptyTest:String, + + @Deprecated ("should be ignored") + @Schema(description = "nonEmptyDesc") + val nonEmptyDesc:String +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + suspend fun index() = SystemStatusResponse(SystemStatus.OK,"","") + + @GetMapping("/foo") + fun foo(personDTO: PersonDTO) = mono { + SystemStatusResponse(SystemStatus.OK,"","") + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app11.json new file mode 100644 index 000000000..5bfd5d99c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app11.json @@ -0,0 +1,117 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/status": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "index", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + }, + "/status/foo": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "foo", + "parameters": [ + { + "name": "personDTO", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SystemStatusResponse": { + "required": [ + "emptyTest", + "nonEmptyDesc", + "systemStatus" + ], + "type": "object", + "properties": { + "systemStatus": { + "type": "string", + "description": "will be removed in next version", + "deprecated": true, + "enum": [ + "OK" + ] + }, + "emptyTest": { + "type": "string", + "deprecated": true + }, + "nonEmptyDesc": { + "type": "string", + "description": "nonEmptyDesc", + "deprecated": true + } + } + }, + "PersonDTO": { + "required": [ + "email", + "firstName", + "lastName" + ], + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "no-email", + "deprecated": true + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} From 896471fde92bfe895510f8156778f3c2c59d39c1 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Dec 2024 13:53:57 +0100 Subject: [PATCH 124/226] Object schema generated for Unit Kotlin type. Fixes #2798 --- .../SpringDocKotlinConfiguration.kt | 2 ++ .../api/app2/SystemStatusController.kt | 15 ++++++++ .../src/test/resources/results/app2.json | 34 +++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt index b059e4dc6..457e5ed9c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt @@ -30,6 +30,7 @@ import io.swagger.v3.oas.annotations.Parameter import org.springdoc.core.customizers.KotlinDeprecatedPropertyCustomizer import org.springdoc.core.customizers.ParameterCustomizer import org.springdoc.core.providers.ObjectMapperProvider +import org.springdoc.core.service.AbstractRequestService.addRequestWrapperToIgnore import org.springdoc.core.utils.Constants import org.springdoc.core.utils.SpringDocUtils import org.springframework.boot.autoconfigure.condition.ConditionalOnBean @@ -69,6 +70,7 @@ class SpringDocKotlinConfiguration() { */ init { SpringDocUtils.getConfig() + .addResponseTypeToIgnore(Unit::class.java) .addRequestWrapperToIgnore(Continuation::class.java) .addDeprecatedType(Deprecated::class.java) } diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt index f52295077..8ff57bd4c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt @@ -18,9 +18,15 @@ package test.org.springdoc.api.app2 +import jakarta.validation.Valid import kotlinx.coroutines.reactor.mono +import org.springframework.http.HttpStatus import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController enum class SystemStatus(val status: String) { @@ -41,4 +47,13 @@ class SystemStatusController { fun foo() = mono { SystemStatusResponse(SystemStatus.OK) } + + @PostMapping("{token}/activate") + @ResponseStatus(HttpStatus.NO_CONTENT) + suspend fun activateUser( + @PathVariable token: String, + @RequestBody @Valid request: String + ) { + // do something + } } diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app2.json index 74eff814d..12270d80c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app2.json +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app2.json @@ -11,6 +11,40 @@ } ], "paths": { + "/status/{token}/activate": { + "post": { + "tags": [ + "system-status-controller" + ], + "operationId": "activateUser", + "parameters": [ + { + "name": "token", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "No Content", + "content": {} + } + } + } + }, "/status": { "get": { "tags": [ From 1461070eacf119f6add9c8de29e113f569e0ddb0 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Dec 2024 16:25:02 +0100 Subject: [PATCH 125/226] An unresolvable circular reference with management.endpoint.gateway.enabled=true. Fixes #2814 --- .../core/providers/ActuatorProvider.java | 13 +++++++- .../SpringDocWebFluxConfiguration.java | 11 ++----- .../providers/ActuatorWebFluxProvider.java | 26 +++++----------- .../SpringDocWebMvcConfiguration.java | 11 ++----- .../providers/ActuatorWebMvcProvider.java | 30 +++++-------------- 5 files changed, 31 insertions(+), 60 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java index 1a006aaab..98ac57385 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java @@ -35,6 +35,7 @@ import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.utils.Constants; +import org.springframework.beans.BeansException; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties; import org.springframework.boot.autoconfigure.web.ServerProperties; @@ -42,6 +43,7 @@ import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.boot.web.server.WebServer; import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationListener; import org.springframework.util.AntPathMatcher; import org.springframework.web.method.HandlerMethod; @@ -54,7 +56,7 @@ * * @author bnasslahsen */ -public abstract class ActuatorProvider implements ApplicationListener { +public abstract class ActuatorProvider implements ApplicationListener, ApplicationContextAware { /** * The Management server properties. @@ -91,6 +93,11 @@ public abstract class ActuatorProvider implements ApplicationListener managementServerProperties, - Optional webEndpointProperties, - Optional webFluxEndpointHandlerMapping, - Optional controllerEndpointHandlerMapping) { + Optional webEndpointProperties) { return new ActuatorWebFluxProvider(serverProperties, springDocConfigProperties, managementServerProperties, - webEndpointProperties, - webFluxEndpointHandlerMapping, - controllerEndpointHandlerMapping); + webEndpointProperties); } /** diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java index 975d5dbf7..786594527 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java @@ -38,6 +38,7 @@ import org.springframework.boot.actuate.endpoint.web.reactive.ControllerEndpointHandlerMapping; import org.springframework.boot.actuate.endpoint.web.reactive.WebFluxEndpointHandlerMapping; import org.springframework.boot.autoconfigure.web.ServerProperties; +import org.springframework.context.ApplicationContextAware; import org.springframework.web.method.HandlerMethod; import org.springframework.web.reactive.result.method.RequestMappingInfo; @@ -47,18 +48,9 @@ * * @author bnasslahsen */ -public class ActuatorWebFluxProvider extends ActuatorProvider { - - /** - * The Web flux endpoint handler mapping. - */ - private WebFluxEndpointHandlerMapping webFluxEndpointHandlerMapping; - - /** - * The Controller endpoint handler mapping. - */ - private ControllerEndpointHandlerMapping controllerEndpointHandlerMapping; +public class ActuatorWebFluxProvider extends ActuatorProvider implements ApplicationContextAware { + /** * Instantiates a new Actuator web flux provider. * @@ -66,27 +58,23 @@ public class ActuatorWebFluxProvider extends ActuatorProvider { * @param springDocConfigProperties the spring doc config properties * @param managementServerProperties the management server properties * @param webEndpointProperties the web endpoint properties - * @param webFluxEndpointHandlerMapping the web flux endpoint handler mapping - * @param controllerEndpointHandlerMapping the controller endpoint handler mapping */ public ActuatorWebFluxProvider(ServerProperties serverProperties, SpringDocConfigProperties springDocConfigProperties, Optional managementServerProperties, - Optional webEndpointProperties, - Optional webFluxEndpointHandlerMapping, - Optional controllerEndpointHandlerMapping) { + Optional webEndpointProperties) { super(managementServerProperties, webEndpointProperties, serverProperties, springDocConfigProperties); - webFluxEndpointHandlerMapping.ifPresent(webFluxEndpointHandlerMapping1 -> this.webFluxEndpointHandlerMapping = webFluxEndpointHandlerMapping1); - controllerEndpointHandlerMapping.ifPresent(controllerEndpointHandlerMapping1 -> this.controllerEndpointHandlerMapping = controllerEndpointHandlerMapping1); } - + public Map getMethods() { Map mappingInfoHandlerMethodMap = new HashMap<>(); + WebFluxEndpointHandlerMapping webFluxEndpointHandlerMapping = applicationContext.getBeansOfType(WebFluxEndpointHandlerMapping.class).values().stream().findFirst().orElse(null); if (webFluxEndpointHandlerMapping == null) webFluxEndpointHandlerMapping = managementApplicationContext.getBean(WebFluxEndpointHandlerMapping.class); mappingInfoHandlerMethodMap.putAll(webFluxEndpointHandlerMapping.getHandlerMethods()); + ControllerEndpointHandlerMapping controllerEndpointHandlerMapping = applicationContext.getBeansOfType(ControllerEndpointHandlerMapping.class).values().stream().findFirst().orElse(null); if (controllerEndpointHandlerMapping == null) controllerEndpointHandlerMapping = managementApplicationContext.getBean(ControllerEndpointHandlerMapping.class); mappingInfoHandlerMethodMap.putAll(controllerEndpointHandlerMapping.getHandlerMethods()); diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java index 98e41d328..bafc6ebb3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java @@ -56,7 +56,6 @@ import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties; -import org.springframework.boot.actuate.endpoint.web.servlet.ControllerEndpointHandlerMapping; import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -198,8 +197,6 @@ static class SpringDocWebMvcActuatorConfiguration { * @param springDocConfigProperties the spring doc config properties * @param managementServerProperties the management server properties * @param webEndpointProperties the web endpoint properties - * @param webMvcEndpointHandlerMapping the web mvc endpoint handler mapping - * @param controllerEndpointHandlerMapping the controller endpoint handler mapping * @return the actuator provider */ @Bean @@ -209,15 +206,11 @@ static class SpringDocWebMvcActuatorConfiguration { ActuatorProvider actuatorProvider(ServerProperties serverProperties, SpringDocConfigProperties springDocConfigProperties, Optional managementServerProperties, - Optional webEndpointProperties, - Optional webMvcEndpointHandlerMapping, - Optional controllerEndpointHandlerMapping) { + Optional webEndpointProperties) { return new ActuatorWebMvcProvider(serverProperties, springDocConfigProperties, managementServerProperties, - webEndpointProperties, - webMvcEndpointHandlerMapping, - controllerEndpointHandlerMapping); + webEndpointProperties); } /** diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java index 7ac56543b..58345a83d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java @@ -51,45 +51,31 @@ */ public class ActuatorWebMvcProvider extends ActuatorProvider { - /** - * The Web mvc endpoint handler mapping. - */ - private WebMvcEndpointHandlerMapping webMvcEndpointHandlerMapping; - - /** - * The Controller endpoint handler mapping. - */ - private ControllerEndpointHandlerMapping controllerEndpointHandlerMapping; - /** * Instantiates a new Actuator web mvc provider. * - * @param serverProperties the server properties - * @param springDocConfigProperties the spring doc config properties - * @param managementServerProperties the management server properties - * @param webEndpointProperties the web endpoint properties - * @param webMvcEndpointHandlerMapping the web mvc endpoint handler mapping - * @param controllerEndpointHandlerMapping the controller endpoint handler mapping + * @param serverProperties the server properties + * @param springDocConfigProperties the spring doc config properties + * @param managementServerProperties the management server properties + * @param webEndpointProperties the web endpoint properties */ public ActuatorWebMvcProvider(ServerProperties serverProperties, SpringDocConfigProperties springDocConfigProperties, Optional managementServerProperties, - Optional webEndpointProperties, - Optional webMvcEndpointHandlerMapping, - Optional controllerEndpointHandlerMapping) { + Optional webEndpointProperties) { super(managementServerProperties, webEndpointProperties, serverProperties, springDocConfigProperties); - webMvcEndpointHandlerMapping.ifPresent(webMvcEndpointHandlerMapping1 -> this.webMvcEndpointHandlerMapping = webMvcEndpointHandlerMapping1); - controllerEndpointHandlerMapping.ifPresent(controllerEndpointHandlerMapping1 -> this.controllerEndpointHandlerMapping = controllerEndpointHandlerMapping1); } @Override public Map getMethods() { Map mappingInfoHandlerMethodMap = new HashMap<>(); + WebMvcEndpointHandlerMapping webMvcEndpointHandlerMapping = applicationContext.getBeansOfType(WebMvcEndpointHandlerMapping.class).values().stream().findFirst().orElse(null); if (webMvcEndpointHandlerMapping == null) webMvcEndpointHandlerMapping = managementApplicationContext.getBean(WebMvcEndpointHandlerMapping.class); mappingInfoHandlerMethodMap.putAll(webMvcEndpointHandlerMapping.getHandlerMethods()); + ControllerEndpointHandlerMapping controllerEndpointHandlerMapping = applicationContext.getBeansOfType(ControllerEndpointHandlerMapping.class).values().stream().findFirst().orElse(null); if (controllerEndpointHandlerMapping == null) controllerEndpointHandlerMapping = managementApplicationContext.getBean(ControllerEndpointHandlerMapping.class); mappingInfoHandlerMethodMap.putAll(controllerEndpointHandlerMapping.getHandlerMethods()); @@ -102,4 +88,4 @@ public String getContextPath() { return StringUtils.defaultIfEmpty(serverProperties.getServlet().getContextPath(), EMPTY); } -} +} \ No newline at end of file From 39ef9f4121c4abcda26a12833b5467ac9720503f Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Dec 2024 17:58:31 +0100 Subject: [PATCH 126/226] Automatically add required if a field is @notNull or @NotBlank. Fixes #2817 --- .../MethodParameterPojoExtractor.java | 13 ++++++++----- .../api/v30/app233/ParameterController.java | 18 ++++++++++++++---- .../test/resources/results/3.0.1/app233.json | 10 +++++----- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index c0390e883..922fa8250 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -159,11 +159,12 @@ private static Stream fromGetterOfField(Class paramClass, Fi return Stream.empty(); } String prefix = fieldNamePrefix + resolveName(parameter, schema).orElse(field.getName()) + DOT; - boolean notNullAnnotationsPresent = AbstractRequestService.hasNotNullAnnotation(Arrays.stream(field.getDeclaredAnnotations()) + Set annotationSimpleNames = Arrays.stream(field.getDeclaredAnnotations()) .map(Annotation::annotationType) .map(Class::getSimpleName) - .collect(Collectors.toSet())); - return extractFrom(type, prefix, parentRequired && resolveRequired(schema, parameter, !notNullAnnotationsPresent)); + .collect(Collectors.toSet()); + boolean notNullAnnotationsPresent = AbstractRequestService.hasNotNullAnnotation(annotationSimpleNames); + return extractFrom(type, prefix, resolveRequired(schema, parameter, !notNullAnnotationsPresent)); } } @@ -270,10 +271,12 @@ private static Stream fromSimpleClass(Class paramClass, Fiel return Stream.empty(); } - boolean isNotRequired = !(isParentRequired && resolveRequired(schema, parameter, !AbstractRequestService.hasNotNullAnnotation(Arrays.stream(fieldAnnotations) + Set annotationSimpleNames = Arrays.stream(field.getDeclaredAnnotations()) .map(Annotation::annotationType) .map(Class::getSimpleName) - .collect(Collectors.toSet())))); + .collect(Collectors.toSet()); + + boolean isNotRequired = !resolveRequired(schema, parameter, !AbstractRequestService.hasNotNullAnnotation(annotationSimpleNames)); Annotation[] notNullFieldAnnotations = Arrays.stream(fieldAnnotations) .filter(annotation -> AbstractRequestService.hasNotNullAnnotation(List.of(annotation.annotationType().getSimpleName()))) .toArray(Annotation[]::new); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java index 3f0651c7b..91b86f740 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java @@ -27,6 +27,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import org.springdoc.core.annotations.ParameterObject; @@ -72,15 +73,24 @@ public void nestedParameterObjectWithOptionalParentField(@ParameterObject Parame } public record ParameterObjectWithOptionalField( - @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) NestedRequiredParameterObject schemaNotRequiredNestedParameterObject, - @Parameter NestedRequiredParameterObject parameterNotRequiredNestedParameterObject, - @Parameter(required = true) NestedRequiredParameterObject requiredNestedParameterObject + NestedRequiredParameterObject schemaNotRequiredNestedParameterObject, + NestedNonNullParameterObject nestedNonNullParameterObject, + NestedNotBlankParameterObject nestedNotBlankParameterObject ) { } public record NestedRequiredParameterObject( - @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @NotNull String requiredParameterField) { + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) String requiredParameterField) { } + public record NestedNonNullParameterObject( + @NotNull String requiredParameterField) { + } + + public record NestedNotBlankParameterObject( + @NotBlank String requiredParameterField) { + } + + } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json index 43d1d0440..4fa7b2ad0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json @@ -60,21 +60,21 @@ { "name": "schemaNotRequiredNestedParameterObject.requiredParameterField", "in": "query", - "required": false, + "required": true, "schema": { "type": "string" } }, { - "name": "parameterNotRequiredNestedParameterObject.requiredParameterField", + "name": "nestedNonNullParameterObject.requiredParameterField", "in": "query", - "required": false, + "required": true, "schema": { "type": "string" } }, { - "name": "requiredNestedParameterObject.requiredParameterField", + "name": "nestedNotBlankParameterObject.requiredParameterField", "in": "query", "required": true, "schema": { @@ -114,4 +114,4 @@ } }, "components": {} -} \ No newline at end of file +} From 915a071303ca2f8ffc9b85faa1e330490962843b Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Dec 2024 18:19:50 +0100 Subject: [PATCH 127/226] Support returning null in ParameterCustomizer/ Fixes #2822 --- .../core/service/AbstractRequestService.java | 16 ++++--- .../api/v30/app234/HelloController.java | 40 +++++++++++++++++ .../org/springdoc/api/v30/app234/MyObj.java | 44 +++++++++++++++++++ .../v30/app234/MyPathParameterCustomizer.java | 39 ++++++++++++++++ .../api/v30/app234/SpringDocApp234Test.java | 35 +++++++++++++++ .../test/resources/results/3.0.1/app234.json | 38 ++++++++++++++++ 6 files changed, 206 insertions(+), 6 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/MyObj.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/MyPathParameterCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/SpringDocApp234Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app234.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 5f704b77c..190cc516f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -434,8 +434,12 @@ protected void customiseParameter(Parameter parameter, ParameterInfo parameterIn int index = operationParameters.indexOf(parameter); for (ParameterCustomizer parameterCustomizer : parameterCustomizerList) parameter = parameterCustomizer.customize(parameter, parameterInfo.getMethodParameter()); - if (index != -1) - operationParameters.set(index, parameter); + if (index != -1) { + if (parameter == null) + operationParameters.remove(index); + else + operationParameters.set(index, parameter); + } } } @@ -780,18 +784,18 @@ private boolean isRequestBodyParam(RequestMethod requestMethod, ParameterInfo pa } /** - * Checks whether Swagger's or Spring's RequestBody annotation is present on a parameter or method - * + * Checks whether Swagger's or Spring's RequestBody annotation is present on a parameter or method + * * @param methodParameter the method parameter * @return the boolean - */ + */ private boolean checkRequestBodyAnnotation(MethodParameter methodParameter) { return methodParameter.hasParameterAnnotation(org.springframework.web.bind.annotation.RequestBody.class) || methodParameter.hasParameterAnnotation(io.swagger.v3.oas.annotations.parameters.RequestBody.class) || AnnotatedElementUtils.isAnnotated(Objects.requireNonNull(methodParameter.getParameter()), io.swagger.v3.oas.annotations.parameters.RequestBody.class) || AnnotatedElementUtils.isAnnotated(Objects.requireNonNull(methodParameter.getMethod()), io.swagger.v3.oas.annotations.parameters.RequestBody.class); } - + /** * Check file boolean. * diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/HelloController.java new file mode 100644 index 000000000..ee7d689b2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/HelloController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app234; + +import test.org.springdoc.api.v30.app179.MyObj; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + @GetMapping("/test") + String test(MyObj obj) { + return obj.getContent(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/MyObj.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/MyObj.java new file mode 100644 index 000000000..5b5eda51e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/MyObj.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app234; + +public class MyObj { + private final String id; + + private final String content; + + public MyObj(String id, String content) { + this.id = id; + this.content = content; + } + + public String getId() { + return id; + } + + public String getContent() { + return content; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/MyPathParameterCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/MyPathParameterCustomizer.java new file mode 100644 index 000000000..db9b059c2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/MyPathParameterCustomizer.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app234; + +import io.swagger.v3.oas.models.parameters.Parameter; +import org.springdoc.core.customizers.ParameterCustomizer; + +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; + +@Component +public class MyPathParameterCustomizer implements ParameterCustomizer { + @Override + public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/SpringDocApp234Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/SpringDocApp234Test.java new file mode 100644 index 000000000..00e32b058 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app234/SpringDocApp234Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app234; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp234Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app234.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app234.json new file mode 100644 index 000000000..6f6de2fcc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app234.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": {} + } +} From 280905bc82d42c99af0c19f7a560a92201fdbc01 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 29 Dec 2024 22:38:08 +0100 Subject: [PATCH 128/226] Capturing pattern in identical paths only renders the path element of one method. Fixes #2823 --- .../api/AbstractOpenApiResource.java | 23 ++- .../api/v30/app235/MyDebugController.java | 67 +++++++++ .../api/v30/app235/SpringDocApp235Test.java | 37 +++++ .../test/resources/results/3.0.1/app235.json | 132 ++++++++++++++++++ 4 files changed, 247 insertions(+), 12 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app235/MyDebugController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app235/SpringDocApp235Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app235.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index c1ce2781a..ef3643245 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.api; @@ -635,19 +635,18 @@ protected void calculatePath(HandlerMethod handlerMethod, RouterOperation router // allow for customisation operation = customizeOperation(operation, handlerMethod); - PathItem pathItemObject = buildPathItem(requestMethod, operation, operationPath, paths); - - if (!StringUtils.contains(operationPath, "**")) { - if(StringUtils.contains(operationPath,"*")){ - Matcher matcher = pathPattern.matcher(operationPath); - while (matcher.find()) { - String pathParam = matcher.group(1); - String newPathParam = pathParam.replace("*", ""); - operationPath = operationPath.replace("{" + pathParam + "}", "{" + newPathParam + "}"); - } + if (StringUtils.contains(operationPath, "*")) { + Matcher matcher = pathPattern.matcher(operationPath); + while (matcher.find()) { + String pathParam = matcher.group(1); + String newPathParam = pathParam.replace("*", ""); + operationPath = operationPath.replace("{" + pathParam + "}", "{" + newPathParam + "}"); } - paths.addPathItem(operationPath, pathItemObject); } + + PathItem pathItemObject = buildPathItem(requestMethod, operation, operationPath, paths); + if (!StringUtils.contains(operationPath, "**")) + paths.addPathItem(operationPath, pathItemObject); } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app235/MyDebugController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app235/MyDebugController.java new file mode 100644 index 000000000..0a1d37338 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app235/MyDebugController.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app235; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@Validated +@RestController +@RequestMapping("/api") +@Tag(name = "Lorem ipsum") +public class MyDebugController { + @GetMapping(value = "/debug/{*wildcard}") + public ResponseEntity getWildcard(String wildcard) { + return new ResponseEntity<>("", HttpStatus.NO_CONTENT); + } + + // THIS ONE IS MISSING + @PostMapping(value = "/debug/{*wildcard}") + public ResponseEntity postWildcard(String wildcard) { + return new ResponseEntity<>("", HttpStatus.NO_CONTENT); + } + + @GetMapping(value = "/debug/{simple}") + public ResponseEntity get(String simple) { + return new ResponseEntity<>("", HttpStatus.NO_CONTENT); + } + + @PostMapping(value = "/debug/{simple}") + public ResponseEntity post(String simple) { + return new ResponseEntity<>("", HttpStatus.NO_CONTENT); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app235/SpringDocApp235Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app235/SpringDocApp235Test.java new file mode 100644 index 000000000..50a4ce817 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app235/SpringDocApp235Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app235; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp235Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app235.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app235.json new file mode 100644 index 000000000..540724ce3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app235.json @@ -0,0 +1,132 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/debug/{simple}": { + "get": { + "tags": [ + "Lorem ipsum" + ], + "operationId": "get", + "parameters": [ + { + "name": "simple", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "Lorem ipsum" + ], + "operationId": "post", + "parameters": [ + { + "name": "simple", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/debug/{wildcard}": { + "get": { + "tags": [ + "Lorem ipsum" + ], + "operationId": "getWildcard", + "parameters": [ + { + "name": "wildcard", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "Lorem ipsum" + ], + "operationId": "postWildcard", + "parameters": [ + { + "name": "wildcard", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} From efd2f74e5f74853200762ffdf716519c342ec59c Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 30 Dec 2024 12:58:26 +0100 Subject: [PATCH 129/226] Make it possible to mark parameters with @RequestParam annotation to be sent in form instead of query. Fixes #2826 --- .../core/data/DataRestRequestService.java | 2 +- .../core/service/AbstractRequestService.java | 73 ++-- .../test/resources/results/3.0.1/app1.json | 41 +- .../resources/results/3.0.1/app105-3.json | 45 +- .../test/resources/results/3.0.1/app2.json | 37 +- .../test/resources/results/3.1.0/app1.json | 41 +- .../test/resources/results/3.1.0/app2.json | 61 +-- .../src/test/resources/results/app68-3.json | 37 +- .../src/test/resources/results/app1.json | 41 +- .../src/test/resources/results/app105-3.json | 413 +++++++++--------- .../src/test/resources/results/app2.json | 45 +- 11 files changed, 431 insertions(+), 405 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java index a00aad09e..72699bb43 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java @@ -226,7 +226,7 @@ private boolean isParamToIgnore(MethodParameter methodParameter) { private void addParameters(OpenAPI openAPI, RequestMethod requestMethod, MethodAttributes methodAttributes, Operation operation, MethodParameter methodParameter, ParameterInfo parameterInfo, Parameter parameter) { List parameterAnnotations = Arrays.asList(getParameterAnnotations(methodParameter)); - if (requestBuilder.isValidParameter(parameter)) { + if (requestBuilder.isValidParameter(parameter,methodAttributes)) { requestBuilder.applyBeanValidatorAnnotations(parameter, parameterAnnotations); operation.addParametersItem(parameter); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 190cc516f..197a7bb35 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -26,9 +26,15 @@ package org.springdoc.core.service; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.math.BigDecimal; +import java.security.Principal; +import java.time.ZoneId; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -37,22 +43,23 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.Objects; import java.util.Optional; import java.util.Set; +import java.util.TimeZone; import java.util.stream.Collectors; import java.util.stream.Stream; import com.fasterxml.jackson.annotation.JsonView; import io.swagger.v3.core.util.PrimitiveType; +import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.Content; -import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.parameters.Parameter; @@ -78,6 +85,8 @@ import org.springframework.core.MethodParameter; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.http.HttpMethod; +import org.springframework.ui.Model; +import org.springframework.ui.ModelMap; import org.springframework.util.CollectionUtils; import org.springframework.validation.BindingResult; import org.springframework.validation.Errors; @@ -85,6 +94,7 @@ import org.springframework.web.bind.annotation.RequestAttribute; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.ValueConstants; import org.springframework.web.bind.support.SessionStatus; import org.springframework.web.context.request.NativeWebRequest; @@ -97,6 +107,7 @@ import static org.springdoc.core.utils.Constants.OPENAPI_ARRAY_TYPE; import static org.springdoc.core.utils.Constants.OPENAPI_STRING_TYPE; import static org.springdoc.core.utils.SpringDocUtils.getParameterAnnotations; +import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE; import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE; /** @@ -130,18 +141,18 @@ public abstract class AbstractRequestService { static { PARAM_TYPES_TO_IGNORE.add(WebRequest.class); PARAM_TYPES_TO_IGNORE.add(NativeWebRequest.class); - PARAM_TYPES_TO_IGNORE.add(java.security.Principal.class); + PARAM_TYPES_TO_IGNORE.add(Principal.class); PARAM_TYPES_TO_IGNORE.add(HttpMethod.class); - PARAM_TYPES_TO_IGNORE.add(java.util.Locale.class); - PARAM_TYPES_TO_IGNORE.add(java.util.TimeZone.class); - PARAM_TYPES_TO_IGNORE.add(java.io.InputStream.class); - PARAM_TYPES_TO_IGNORE.add(java.time.ZoneId.class); - PARAM_TYPES_TO_IGNORE.add(java.io.Reader.class); - PARAM_TYPES_TO_IGNORE.add(java.io.OutputStream.class); - PARAM_TYPES_TO_IGNORE.add(java.io.Writer.class); - PARAM_TYPES_TO_IGNORE.add(java.util.Map.class); - PARAM_TYPES_TO_IGNORE.add(org.springframework.ui.Model.class); - PARAM_TYPES_TO_IGNORE.add(org.springframework.ui.ModelMap.class); + PARAM_TYPES_TO_IGNORE.add(Locale.class); + PARAM_TYPES_TO_IGNORE.add(TimeZone.class); + PARAM_TYPES_TO_IGNORE.add(InputStream.class); + PARAM_TYPES_TO_IGNORE.add(ZoneId.class); + PARAM_TYPES_TO_IGNORE.add(Reader.class); + PARAM_TYPES_TO_IGNORE.add(OutputStream.class); + PARAM_TYPES_TO_IGNORE.add(Writer.class); + PARAM_TYPES_TO_IGNORE.add(Map.class); + PARAM_TYPES_TO_IGNORE.add(Model.class); + PARAM_TYPES_TO_IGNORE.add(ModelMap.class); PARAM_TYPES_TO_IGNORE.add(Errors.class); PARAM_TYPES_TO_IGNORE.add(BindingResult.class); PARAM_TYPES_TO_IGNORE.add(SessionStatus.class); @@ -240,7 +251,7 @@ public static boolean isRequestTypeToIgnore(Class rawClass) { */ @SuppressWarnings("unchecked") public static Collection getHeaders(MethodAttributes methodAttributes, Map map) { - for (Map.Entry entry : methodAttributes.getHeaders().entrySet()) { + for (Entry entry : methodAttributes.getHeaders().entrySet()) { StringSchema schema = new StringSchema(); if (StringUtils.isNotEmpty(entry.getValue())) schema.addEnumItem(entry.getValue()); @@ -291,7 +302,7 @@ public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, for (MethodParameter methodParameter : parameters) { // check if query param - Parameter parameter; + Parameter parameter = null; io.swagger.v3.oas.annotations.Parameter parameterDoc = AnnotatedElementUtils.findMergedAnnotation( AnnotatedElementUtils.forAnnotations(methodParameter.getParameterAnnotations()), io.swagger.v3.oas.annotations.Parameter.class); @@ -321,12 +332,10 @@ public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, if (!isParamToIgnore(methodParameter)) { parameter = buildParams(parameterInfo, components, requestMethod, methodAttributes, openAPI.getOpenapi()); - // Merge with the operation parameters - parameter = GenericParameterService.mergeParameter(operationParameters, parameter); - List parameterAnnotations = List.of(getParameterAnnotations(methodParameter)); - - if (isValidParameter(parameter)) { + if (isValidParameter(parameter,methodAttributes)) { + // Merge with the operation parameters + parameter = GenericParameterService.mergeParameter(operationParameters, parameter); // Add param javadoc if (StringUtils.isBlank(parameter.getDescription()) && javadocProvider != null) { String paramJavadocDescription = parameterBuilder.getParamJavadoc(javadocProvider, methodParameter); @@ -359,7 +368,7 @@ else if (!RequestMethod.GET.equals(requestMethod) || OpenApiVersion.OPENAPI_3_1. Parameter parameter = entry.getValue(); if (!ParameterIn.PATH.toString().equals(parameter.getIn()) && !ParameterIn.HEADER.toString().equals(parameter.getIn()) && !ParameterIn.COOKIE.toString().equals(parameter.getIn())) { - io.swagger.v3.oas.models.media.Schema itemSchema = new io.swagger.v3.oas.models.media.Schema<>(); + Schema itemSchema = new Schema<>(); itemSchema.setName(entry.getKey().getpName()); itemSchema.setDescription(parameter.getDescription()); itemSchema.setDeprecated(parameter.getDeprecated()); @@ -388,7 +397,7 @@ private LinkedHashMap getParameterLinkedHashMap(Componen throw new IllegalStateException(String.format("Duplicate key %s", u)); }, LinkedHashMap::new)); - for (Map.Entry entry : parametersDocMap.entrySet()) { + for (Entry entry : parametersDocMap.entrySet()) { ParameterId parameterId = entry.getKey(); if (parameterId != null && !map.containsKey(parameterId) && !entry.getValue().hidden()) { Parameter parameter = parameterBuilder.buildParameterFromDoc(entry.getValue(), components, methodAttributes.getJsonViewAnnotation(), methodAttributes.getLocale()); @@ -512,11 +521,12 @@ private void setParams(Operation operation, List operationParameters, /** * Is valid parameter boolean. * - * @param parameter the parameter + * @param parameter the parameter + * @param methodAttributes the method attributes * @return the boolean */ - public boolean isValidParameter(Parameter parameter) { - return parameter != null && (parameter.getName() != null || parameter.get$ref() != null); + public boolean isValidParameter(Parameter parameter, MethodAttributes methodAttributes ) { + return parameter != null && (parameter.getName() != null || parameter.get$ref() != null) && !(Arrays.asList(methodAttributes.getMethodConsumes()).contains(APPLICATION_FORM_URLENCODED_VALUE) && ParameterIn.QUERY.toString().equals(parameter.getIn())); } /** @@ -640,11 +650,6 @@ public void applyBeanValidatorAnnotations(final RequestBody requestBody, final L if (validationExists || (!isOptional && (springRequestBodyRequired || swaggerRequestBodyRequired))) requestBody.setRequired(true); - Content content = requestBody.getContent(); - for (MediaType mediaType : content.values()) { - Schema schema = mediaType.getSchema(); - applyValidationsToSchema(annos, schema); - } } /** @@ -703,10 +708,10 @@ else if (OPENAPI_STRING_TYPE.equals(schema.getType())) { private Map getApiParameters(Method method) { Class declaringClass = method.getDeclaringClass(); - Set apiParametersDoc = AnnotatedElementUtils.findAllMergedAnnotations(method, io.swagger.v3.oas.annotations.Parameters.class); + Set apiParametersDoc = AnnotatedElementUtils.findAllMergedAnnotations(method, Parameters.class); LinkedHashMap apiParametersMap = apiParametersDoc.stream().flatMap(x -> Stream.of(x.value())).collect(Collectors.toMap(ParameterId::new, x -> x, (e1, e2) -> e2, LinkedHashMap::new)); - Set apiParametersDocDeclaringClass = AnnotatedElementUtils.findAllMergedAnnotations(declaringClass, io.swagger.v3.oas.annotations.Parameters.class); + Set apiParametersDocDeclaringClass = AnnotatedElementUtils.findAllMergedAnnotations(declaringClass, Parameters.class); LinkedHashMap apiParametersDocDeclaringClassMap = apiParametersDocDeclaringClass.stream().flatMap(x -> Stream.of(x.value())).collect(Collectors.toMap(ParameterId::new, x -> x, (e1, e2) -> e2, LinkedHashMap::new)); apiParametersMap.putAll(apiParametersDocDeclaringClassMap); @@ -803,9 +808,9 @@ private boolean checkRequestBodyAnnotation(MethodParameter methodParameter) { * @return the boolean */ private boolean checkFile(MethodParameter methodParameter) { - if (methodParameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestPart.class) != null) + if (methodParameter.getParameterAnnotation(RequestPart.class) != null) return true; - else if (methodParameter.getParameterAnnotation(org.springframework.web.bind.annotation.RequestParam.class) != null) { + else if (methodParameter.getParameterAnnotation(RequestParam.class) != null) { return isFile(methodParameter.getParameterType()); } return false; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app1.json index 15978f285..0acdee073 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app1.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app1.json @@ -81,26 +81,31 @@ "schema": { "type": "string" } - }, - { - "name": "firstName", - "in": "query", - "description": "First Name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "lastName", - "in": "query", - "description": "Last Name", - "required": true, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "required": [ + "firstName", + "lastName" + ], + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "First Name" + }, + "lastName": { + "type": "string", + "description": "Last Name" + } + } + } + } + } + }, "responses": { "500": { "description": "Internal Server Error", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app105-3.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app105-3.json index a52161db8..7afdca98e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app105-3.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app105-3.json @@ -160,8 +160,8 @@ } } }, - "404": { - "description": "Pet not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -175,8 +175,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "Pet not found", "content": { "application/xml": { "schema": { @@ -213,26 +213,27 @@ "type": "integer", "format": "int64" } - }, - { - "name": "name", - "in": "query", - "description": "Updated name of the pet", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "status", - "in": "query", - "description": "Updated status of the pet", - "required": false, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, "responses": { "400": { "description": "Bad Request", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app2.json index e822d3aea..bb1bcc74d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app2.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app2.json @@ -537,26 +537,27 @@ "type": "integer", "format": "int64" } - }, - { - "name": "name", - "in": "query", - "description": "Updated name of the pet", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "status", - "in": "query", - "description": "Updated status of the pet", - "required": false, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, "responses": { "400": { "description": "Bad Request", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json index b7829258b..72ec88a1f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json @@ -81,26 +81,31 @@ "schema": { "type": "string" } - }, - { - "name": "firstName", - "in": "query", - "description": "First Name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "lastName", - "in": "query", - "description": "Last Name", - "required": true, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "First Name" + }, + "lastName": { + "type": "string", + "description": "Last Name" + } + }, + "required": [ + "firstName", + "lastName" + ] + } + } + } + }, "responses": { "500": { "description": "Internal Server Error", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json index c431409f8..eb04abe53 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json @@ -61,8 +61,8 @@ } } }, - "404": { - "description": "User not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -76,8 +76,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "User not found", "content": { "application/xml": { "schema": { @@ -464,8 +464,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "Pet not found", "content": { "application/xml": { "schema": { @@ -479,8 +479,8 @@ } } }, - "404": { - "description": "Pet not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -517,26 +517,27 @@ "type": "integer", "format": "int64" } - }, - { - "name": "name", - "in": "query", - "description": "Updated name of the pet", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "status", - "in": "query", - "description": "Updated status of the pet", - "required": false, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, "responses": { "400": { "description": "Bad Request", @@ -809,8 +810,8 @@ } } }, - "404": { - "description": "Order not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -824,8 +825,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "Order not found", "content": { "application/xml": { "schema": { diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-3.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-3.json index fdd6c6a74..15beb7b99 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-3.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-3.json @@ -213,26 +213,27 @@ "type": "integer", "format": "int64" } - }, - { - "name": "name", - "in": "query", - "description": "Updated name of the pet", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "status", - "in": "query", - "description": "Updated status of the pet", - "required": false, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, "responses": { "400": { "description": "Bad Request", diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app1.json index 0d6c76824..dc32e813b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app1.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app1.json @@ -81,26 +81,31 @@ "schema": { "type": "string" } - }, - { - "name": "firstName", - "in": "query", - "description": "First Name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "lastName", - "in": "query", - "description": "Last Name", - "required": true, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "required": [ + "firstName", + "lastName" + ], + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "First Name" + }, + "lastName": { + "type": "string", + "description": "Last Name" + } + } + } + } + } + }, "responses": { "500": { "description": "the response entity", diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json index ff9c8392e..38c3b7b8f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json @@ -34,12 +34,12 @@ "requestBody": { "description": "Pet object that needs to be added to the store", "content": { - "application/xml": { + "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } @@ -87,12 +87,12 @@ "requestBody": { "description": "Pet object that needs to be added to the store", "content": { - "application/xml": { + "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } @@ -128,6 +128,142 @@ ] } }, + "/pet/findByStatus": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by status", + "description": "Multiple status values can be provided with comma separated strings", + "operationId": "findPetsByStatus", + "parameters": [ + { + "name": "status", + "in": "query", + "description": "Status values that need to be considered for filter", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + }, + "400": { + "description": "Invalid status value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByTags": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by tags", + "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId": "findPetsByTags", + "parameters": [ + { + "name": "tags", + "in": "query", + "description": "Tags to filter by", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + }, + "400": { + "description": "Invalid tag value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, "/pet/{petId}": { "get": { "tags": [ @@ -149,6 +285,21 @@ } ], "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, "400": { "description": "Invalid ID supplied", "content": { @@ -165,27 +316,12 @@ "404": { "description": "Pet not found", "content": { - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } - } - } - }, - "200": { - "description": "successful operation", - "content": { - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Pet" - } }, - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } @@ -216,26 +352,27 @@ "type": "integer", "format": "int64" } - }, - { - "name": "name", - "in": "query", - "description": "Updated name of the pet", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "status", - "in": "query", - "description": "Updated status of the pet", - "required": false, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, "responses": { "400": { "description": "the map", @@ -368,19 +505,6 @@ } }, "responses": { - "400": { - "description": "the map", - "content": { - "*/*": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - }, "200": { "description": "successful operation", "content": { @@ -390,111 +514,9 @@ } } } - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] - } - }, - "/pet/findByTags": { - "get": { - "tags": [ - "pet" - ], - "summary": "Finds Pets by tags", - "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - "operationId": "findPetsByTags", - "parameters": [ - { - "name": "tags", - "in": "query", - "description": "Tags to filter by", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "400": { - "description": "Invalid tag value", - "content": { - "*/*": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } }, - "200": { - "description": "successful operation", - "content": { - "application/xml": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - } - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "pet" - ], - "summary": "Finds Pets by status", - "description": "Multiple status values can be provided with comma separated strings", - "operationId": "findPetsByStatus", - "parameters": [ - { - "name": "status", - "in": "query", - "description": "Status values that need to be considered for filter", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { "400": { - "description": "Invalid status value", + "description": "the map", "content": { "*/*": { "schema": { @@ -505,27 +527,6 @@ } } } - }, - "200": { - "description": "successful operation", - "content": { - "application/xml": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - } } }, "security": [ @@ -556,6 +557,25 @@ }, "description": "The type Category." }, + "ModelApiResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "The Code.", + "format": "int32" + }, + "message": { + "type": "string", + "description": "The Message." + }, + "type": { + "type": "string", + "description": "The Type." + } + }, + "description": "The type Model api response." + }, "Pet": { "required": [ "name", @@ -563,14 +583,14 @@ ], "type": "object", "properties": { + "category": { + "$ref": "#/components/schemas/Category" + }, "id": { "type": "integer", "description": "The Id.", "format": "int64" }, - "category": { - "$ref": "#/components/schemas/Category" - }, "name": { "type": "string", "description": "The Name.", @@ -583,13 +603,6 @@ "type": "string" } }, - "tags": { - "type": "array", - "description": "The Tags.", - "items": { - "$ref": "#/components/schemas/Tag" - } - }, "status": { "type": "string", "description": "pet status in the store", @@ -598,6 +611,13 @@ "pending", "sold" ] + }, + "tags": { + "type": "array", + "description": "The Tags.", + "items": { + "$ref": "#/components/schemas/Tag" + } } }, "description": "The type Pet." @@ -616,25 +636,6 @@ } }, "description": "The type Tag." - }, - "ModelApiResponse": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "description": "The Code.", - "format": "int32" - }, - "type": { - "type": "string", - "description": "The Type." - }, - "message": { - "type": "string", - "description": "The Message." - } - }, - "description": "The type Model api response." } }, "securitySchemes": { @@ -648,8 +649,8 @@ "implicit": { "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", "scopes": { - "write:pets": "modify pets in your account", - "read:pets": "read your pets" + "read:pets": "read your pets", + "write:pets": "modify pets in your account" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json index 3a0de8a56..e83132cfb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json @@ -193,12 +193,12 @@ "requestBody": { "description": "Pet object that needs to be added to the store", "content": { - "application/xml": { + "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } @@ -246,12 +246,12 @@ "requestBody": { "description": "Pet object that needs to be added to the store", "content": { - "application/xml": { + "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } @@ -549,26 +549,27 @@ "type": "integer", "format": "int64" } - }, - { - "name": "name", - "in": "query", - "description": "Updated name of the pet", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "status", - "in": "query", - "description": "Updated status of the pet", - "required": false, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, "responses": { "400": { "description": "the map", From 48415f8d44a842c344995fa7e7aa1dc128224421 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 30 Dec 2024 19:28:58 +0100 Subject: [PATCH 130/226] Required a bean of type 'org.springframework.data.rest.webmvc.mapping.Associations' that could not be found. Fixes #2828 --- .../SpringDocDataRestConfiguration.java | 21 ++----- .../SpringRepositoryRestResourceProvider.java | 56 +++++++------------ 2 files changed, 24 insertions(+), 53 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java index eca9faf04..ef382aa25 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java @@ -55,21 +55,16 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.hateoas.HateoasProperties; -import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportRuntimeHints; import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Primary; import org.springframework.data.domain.Sort; -import org.springframework.data.mapping.context.PersistentEntities; -import org.springframework.data.repository.support.Repositories; import org.springframework.data.rest.core.config.RepositoryRestConfiguration; -import org.springframework.data.rest.core.mapping.ResourceMappings; import org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler; import org.springframework.data.rest.webmvc.RepositoryRestHandlerMapping; import org.springframework.data.rest.webmvc.RootResourceInformation; -import org.springframework.data.rest.webmvc.mapping.Associations; import org.springframework.data.rest.webmvc.support.DefaultedPageable; import org.springframework.data.rest.webmvc.support.ETag; import org.springframework.hateoas.server.LinkRelationProvider; @@ -125,12 +120,7 @@ static class SpringRepositoryRestResourceProviderConfiguration { /** * Spring repository rest resource provider spring repository rest resource provider. * - * @param mappings the mappings - * @param repositories the repositories - * @param associations the associations - * @param applicationContext the application context * @param dataRestRouterOperationService the data rest router operation service - * @param persistentEntities the persistent entities * @param mapper the mapper * @param springDocDataRestUtils the spring doc data rest utils * @return the spring repository rest resource provider @@ -138,12 +128,11 @@ static class SpringRepositoryRestResourceProviderConfiguration { @Bean @ConditionalOnMissingBean @Lazy(false) - SpringRepositoryRestResourceProvider springRepositoryRestResourceProvider(ResourceMappings mappings, - Repositories repositories, Associations associations, ApplicationContext applicationContext, - DataRestRouterOperationService dataRestRouterOperationService, PersistentEntities persistentEntities, - ObjectMapper mapper, SpringDocDataRestUtils springDocDataRestUtils) { - return new SpringRepositoryRestResourceProvider(mappings, repositories, associations, applicationContext, - dataRestRouterOperationService, persistentEntities, mapper, springDocDataRestUtils); + SpringRepositoryRestResourceProvider springRepositoryRestResourceProvider(DataRestRouterOperationService dataRestRouterOperationService, + ObjectMapper mapper, + SpringDocDataRestUtils springDocDataRestUtils) { + return new SpringRepositoryRestResourceProvider( + dataRestRouterOperationService, mapper, springDocDataRestUtils); } /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java index e199dc7e1..7975b21dd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java @@ -46,7 +46,9 @@ import org.springdoc.core.fn.RouterOperation; import org.springdoc.core.utils.SpringDocDataRestUtils; +import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.data.mapping.PersistentEntity; @@ -75,7 +77,7 @@ * * @author bnasslahsen */ -public class SpringRepositoryRestResourceProvider implements RepositoryRestResourceProvider { +public class SpringRepositoryRestResourceProvider implements RepositoryRestResourceProvider, ApplicationContextAware { /** * The constant SPRING_DATA_REST_PACKAGE. @@ -136,31 +138,11 @@ public class SpringRepositoryRestResourceProvider implements RepositoryRestResou } } - /** - * The Mappings. - */ - private final ResourceMappings mappings; - - /** - * The Repositories. - */ - private final Repositories repositories; - - /** - * The Associations. - */ - private final Associations associations; - /** * The Data rest router operation builder. */ private final DataRestRouterOperationService dataRestRouterOperationService; - /** - * The Persistent entities. - */ - private final PersistentEntities persistentEntities; - /** * The Mapper. */ @@ -169,7 +151,7 @@ public class SpringRepositoryRestResourceProvider implements RepositoryRestResou /** * The Application context. */ - private final ApplicationContext applicationContext; + private ApplicationContext applicationContext; /** * The Spring doc data rest utils. @@ -184,24 +166,13 @@ public class SpringRepositoryRestResourceProvider implements RepositoryRestResou /** * Instantiates a new Spring repository rest resource provider. * - * @param mappings the mappings - * @param repositories the repositories - * @param associations the associations - * @param applicationContext the application context * @param dataRestRouterOperationService the data rest router operation builder - * @param persistentEntities the persistent entities * @param mapper the mapper * @param springDocDataRestUtils the spring doc data rest utils */ - public SpringRepositoryRestResourceProvider(ResourceMappings mappings, Repositories repositories, - Associations associations, ApplicationContext applicationContext, DataRestRouterOperationService dataRestRouterOperationService, - PersistentEntities persistentEntities, ObjectMapper mapper, SpringDocDataRestUtils springDocDataRestUtils) { - this.mappings = mappings; - this.repositories = repositories; - this.associations = associations; - this.applicationContext = applicationContext; + public SpringRepositoryRestResourceProvider(DataRestRouterOperationService dataRestRouterOperationService, + ObjectMapper mapper, SpringDocDataRestUtils springDocDataRestUtils) { this.dataRestRouterOperationService = dataRestRouterOperationService; - this.persistentEntities = persistentEntities; this.mapper = mapper; this.springDocDataRestUtils = springDocDataRestUtils; } @@ -217,6 +188,10 @@ public SpringRepositoryRestResourceProvider(ResourceMappings mappings, Repositor public List getRouterOperations(OpenAPI openAPI, Locale locale) { List routerOperationList = new ArrayList<>(); handlerMappingList = getHandlerMappingList(); + Associations associations = applicationContext.getBean(Associations.class); + ResourceMappings mappings = applicationContext.getBean(ResourceMappings.class); + PersistentEntities persistentEntities = applicationContext.getBean(PersistentEntities.class); + Repositories repositories = applicationContext.getBean(Repositories.class); for (Class domainType : repositories) { Class repository = repositories.getRequiredRepositoryInformation(domainType).getRepositoryInterface(); DataRestRepository dataRestRepository = new DataRestRepository(domainType, repository, locale); @@ -274,7 +249,7 @@ else if (handlerMapping instanceof BasePathAwareHandlerMapping beanBasePathAware } } // search - findSearchResourceMappings(openAPI, routerOperationList, handlerMappingList, dataRestRepository, resourceMetadata); + findSearchResourceMappings(openAPI, routerOperationList, handlerMappingList, dataRestRepository, resourceMetadata, associations); } } return routerOperationList; @@ -312,6 +287,8 @@ public Map getHandlerMethods() { */ @Override public void customize(OpenAPI openAPI) { + ResourceMappings mappings = applicationContext.getBean(ResourceMappings.class); + PersistentEntities persistentEntities = applicationContext.getBean(PersistentEntities.class); springDocDataRestUtils.customise(openAPI, mappings, persistentEntities); } @@ -346,9 +323,10 @@ private List getHandlerMappingList() { * @param handlerMappingList the handler mapping list * @param dataRestRepository the repository data rest * @param resourceMetadata the resource metadata + * @param associations the associations */ private void findSearchResourceMappings(OpenAPI openAPI, List routerOperationList, List handlerMappingList, - DataRestRepository dataRestRepository, ResourceMetadata resourceMetadata) { + DataRestRepository dataRestRepository, ResourceMetadata resourceMetadata, Associations associations) { for (HandlerMapping handlerMapping : handlerMappingList) { if (handlerMapping instanceof RepositoryRestHandlerMapping repositoryRestHandlerMapping) { Map handlerMethodMap = repositoryRestHandlerMapping.getHandlerMethods(); @@ -406,4 +384,8 @@ private List findControllers(List routerOperat return routerOperationList; } + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } } \ No newline at end of file From 1c61353d2d8c06739e237ee842392629d77c0be4 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 30 Dec 2024 19:32:08 +0100 Subject: [PATCH 131/226] upgrade to spring-boot 3.4.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index acd50d6b3..f7f9ace05 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.0 + 3.4.1 From e490ad3afe633a4439af8811e9bb9176d6ced1bb Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 30 Dec 2024 23:42:18 +0100 Subject: [PATCH 132/226] reverting changes from PR #2788 --- .../api/v30/app233/ParameterController.java | 96 ------------------- .../api/v30/app233/SpringDocApp233Test.java | 41 -------- 2 files changed, 137 deletions(-) delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java deleted file mode 100644 index 91b86f740..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. - * * * * * * - * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * * you may not use this file except in compliance with the License. - * * * * * * You may obtain a copy of the License at - * * * * * * - * * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * * - * * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * * See the License for the specific language governing permissions and - * * * * * * limitations under the License. - * * * * * - * * * * - * * * - * * - * - */ -package test.org.springdoc.api.v30.app233; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class ParameterController { - - @GetMapping("/hidden-parent") - public void nestedParameterObjectWithHiddenParentField(@ParameterObject ParameterObjectWithHiddenField parameters) { - - } - - public record ParameterObjectWithHiddenField( - @Schema(hidden = true) NestedParameterObject schemaHiddenNestedParameterObject, - @Parameter(hidden = true) NestedParameterObject parameterHiddenNestedParameterObject, - NestedParameterObject visibleNestedParameterObject - ) { - - } - - public record NestedParameterObject( - String parameterField) { - } - - @GetMapping("/renamed-parent") - public void nestedParameterObjectWithRenamedParentField(@ParameterObject ParameterObjectWithRenamedField parameters) { - - } - - public record ParameterObjectWithRenamedField( - @Schema(name = "schemaRenamed") NestedParameterObject schemaRenamedNestedParameterObject, - @Parameter(name = "parameterRenamed") NestedParameterObject parameterRenamedNestedParameterObject, - NestedParameterObject originalNameNestedParameterObject - ) { - - } - - @GetMapping("/optional-parent") - public void nestedParameterObjectWithOptionalParentField(@ParameterObject ParameterObjectWithOptionalField parameters) { - - } - - public record ParameterObjectWithOptionalField( - NestedRequiredParameterObject schemaNotRequiredNestedParameterObject, - NestedNonNullParameterObject nestedNonNullParameterObject, - NestedNotBlankParameterObject nestedNotBlankParameterObject - ) { - - } - - public record NestedRequiredParameterObject( - @Schema(requiredMode = Schema.RequiredMode.REQUIRED) String requiredParameterField) { - } - - public record NestedNonNullParameterObject( - @NotNull String requiredParameterField) { - } - - public record NestedNotBlankParameterObject( - @NotBlank String requiredParameterField) { - } - - -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java deleted file mode 100644 index 9ad5ae92a..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. - * * * * * * - * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * * you may not use this file except in compliance with the License. - * * * * * * You may obtain a copy of the License at - * * * * * * - * * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * * - * * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * * See the License for the specific language governing permissions and - * * * * * * limitations under the License. - * * * * * - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v30.app233; - -import test.org.springdoc.api.v30.AbstractSpringDocV30Test; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * @author bnasslahsen - */ -public class SpringDocApp233Test extends AbstractSpringDocV30Test { - - @SpringBootApplication - static class SpringDocTestApp { - } -} \ No newline at end of file From e29ec31a35d8214679215f268487a2fe0a42c99b Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 30 Dec 2024 23:42:27 +0100 Subject: [PATCH 133/226] reverting changes from PR #2788 --- .../extractor/DelegatingMethodParameter.java | 27 +--- .../MethodParameterPojoExtractor.java | 120 ++---------------- .../core/service/AbstractRequestService.java | 18 +-- 3 files changed, 22 insertions(+), 143 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java index a04958218..bfd4b031b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.extractor; @@ -93,11 +93,6 @@ public class DelegatingMethodParameter extends MethodParameter { */ private final Annotation[] methodAnnotations; - /** - * The annotations to mask from the list of annotations on this method parameter. - */ - private final Annotation[] maskedAnnotations; - /** * The Is not required. */ @@ -110,19 +105,17 @@ public class DelegatingMethodParameter extends MethodParameter { * @param parameterName the parameter name * @param additionalParameterAnnotations the additional parameter annotations * @param methodAnnotations the method annotations - * @param maskedAnnotations any annotations that should not be included in the final list of annotations * @param isParameterObject the is parameter object * @param isNotRequired the is required */ - DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, Annotation[] methodAnnotations, Annotation[] maskedAnnotations, boolean isParameterObject, boolean isNotRequired) { + DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, Annotation[] methodAnnotations, boolean isParameterObject, boolean isNotRequired) { super(delegate); this.delegate = delegate; this.additionalParameterAnnotations = additionalParameterAnnotations; this.parameterName = parameterName; this.isParameterObject = isParameterObject; this.isNotRequired = isNotRequired; - this.methodAnnotations = methodAnnotations; - this.maskedAnnotations = maskedAnnotations; + this.methodAnnotations =methodAnnotations; } /** @@ -145,7 +138,7 @@ public static MethodParameter[] customize(String[] pNames, MethodParameter[] par boolean hasNotFlatAnnotation = Arrays.stream(p.getParameterAnnotations()) .anyMatch(annotation -> Arrays.asList(RequestBody.class, RequestPart.class).contains(annotation.annotationType())); if (!MethodParameterPojoExtractor.isSimpleType(paramClass) - && (hasFlatAnnotation || (defaultFlatParamObject && !hasNotFlatAnnotation && !AbstractRequestService.isRequestTypeToIgnore(paramClass)))) { + && (hasFlatAnnotation || (defaultFlatParamObject && !hasNotFlatAnnotation && !AbstractRequestService.isRequestTypeToIgnore(paramClass)))) { MethodParameterPojoExtractor.extractFrom(paramClass).forEach(methodParameter -> { optionalDelegatingMethodParameterCustomizers.ifPresent(delegatingMethodParameterCustomizers -> delegatingMethodParameterCustomizers.forEach(customizer -> customizer.customize(p, methodParameter))); explodedParameters.add(methodParameter); @@ -153,7 +146,7 @@ public static MethodParameter[] customize(String[] pNames, MethodParameter[] par } else { String name = pNames != null ? pNames[i] : p.getParameterName(); - explodedParameters.add(new DelegatingMethodParameter(p, name, null, null, null, false, false)); + explodedParameters.add(new DelegatingMethodParameter(p, name, null, null, false, false)); } } return explodedParameters.toArray(new MethodParameter[0]); @@ -186,15 +179,7 @@ public static MethodParameter changeContainingClass(MethodParameter methodParame @NonNull public Annotation[] getParameterAnnotations() { Annotation[] methodAnnotations = ArrayUtils.addAll(delegate.getParameterAnnotations(), this.methodAnnotations); - methodAnnotations = ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); - if (maskedAnnotations == null) { - return methodAnnotations; - } else { - List maskedAnnotationList = List.of(maskedAnnotations); - return Arrays.stream(methodAnnotations) - .filter(annotation -> !maskedAnnotationList.contains(annotation)) - .toArray(Annotation[]::new); - } + return ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); } @Override diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index 922fa8250..3b7033e43 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.extractor; @@ -50,13 +50,10 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Predicate; -import java.util.stream.Collectors; import java.util.stream.Stream; import io.swagger.v3.core.util.PrimitiveType; import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; -import org.springdoc.core.service.AbstractRequestService; import org.springframework.core.GenericTypeResolver; import org.springframework.core.MethodParameter; @@ -66,7 +63,7 @@ /** * The type Method parameter pojo extractor. * - * @author bnasslahsen, michael.clarke + * @author bnasslahsen */ public class MethodParameterPojoExtractor { @@ -116,7 +113,7 @@ private MethodParameterPojoExtractor() { * @return the stream */ static Stream extractFrom(Class clazz) { - return extractFrom(clazz, "", true); + return extractFrom(clazz, ""); } /** @@ -124,13 +121,12 @@ static Stream extractFrom(Class clazz) { * * @param clazz the clazz * @param fieldNamePrefix the field name prefix - * @param parentRequired whether the field that hold the class currently being inspected was required or optional * @return the stream */ - private static Stream extractFrom(Class clazz, String fieldNamePrefix, boolean parentRequired) { + private static Stream extractFrom(Class clazz, String fieldNamePrefix) { return allFieldsOf(clazz).stream() .filter(field -> !field.getType().equals(clazz)) - .flatMap(f -> fromGetterOfField(clazz, f, fieldNamePrefix, parentRequired)) + .flatMap(f -> fromGetterOfField(clazz, f, fieldNamePrefix)) .filter(Objects::nonNull); } @@ -140,96 +136,20 @@ private static Stream extractFrom(Class clazz, String fieldN * @param paramClass the param class * @param field the field * @param fieldNamePrefix the field name prefix - * @param parentRequired whether the field that holds the class currently being examined was required or optional * @return the stream */ - private static Stream fromGetterOfField(Class paramClass, Field field, String fieldNamePrefix, boolean parentRequired) { + private static Stream fromGetterOfField(Class paramClass, Field field, String fieldNamePrefix) { Class type = extractType(paramClass, field); if (Objects.isNull(type)) return Stream.empty(); if (isSimpleType(type)) - return fromSimpleClass(paramClass, field, fieldNamePrefix, parentRequired); + return fromSimpleClass(paramClass, field, fieldNamePrefix); else { - Parameter parameter = field.getAnnotation(Parameter.class); - Schema schema = field.getAnnotation(Schema.class); - boolean visible = resolveVisible(parameter, schema); - if (!visible) { - return Stream.empty(); - } - String prefix = fieldNamePrefix + resolveName(parameter, schema).orElse(field.getName()) + DOT; - Set annotationSimpleNames = Arrays.stream(field.getDeclaredAnnotations()) - .map(Annotation::annotationType) - .map(Class::getSimpleName) - .collect(Collectors.toSet()); - boolean notNullAnnotationsPresent = AbstractRequestService.hasNotNullAnnotation(annotationSimpleNames); - return extractFrom(type, prefix, resolveRequired(schema, parameter, !notNullAnnotationsPresent)); - } - } - - private static Optional resolveName(Parameter parameter, Schema schema) { - if (parameter != null) { - return resolveNameFromParameter(parameter); - } - if (schema != null) { - return resolveNameFromSchema(schema); - } - return Optional.empty(); - } - - private static Optional resolveNameFromParameter(Parameter parameter) { - if (parameter.name().isEmpty()) { - return Optional.empty(); - } - return Optional.of(parameter.name()); - } - - private static Optional resolveNameFromSchema(Schema schema) { - if (schema.name().isEmpty()) { - return Optional.empty(); + String prefix = fieldNamePrefix + field.getName() + DOT; + return extractFrom(type, prefix); } - return Optional.of(schema.name()); - } - - private static boolean resolveVisible(Parameter parameter, Schema schema) { - if (parameter != null) { - return !parameter.hidden(); - } - if (schema != null) { - return !schema.hidden(); - } - return true; - } - - private static boolean resolveRequired(Schema schema, Parameter parameter, boolean nullable) { - if (parameter != null) { - return resolveRequiredFromParameter(parameter, nullable); - } - if (schema != null) { - return resolveRequiredFromSchema(schema, nullable); - } - return !nullable; - } - - private static boolean resolveRequiredFromParameter(Parameter parameter, boolean nullable) { - if (parameter.required()) { - return true; - } - return !nullable; - } - - private static boolean resolveRequiredFromSchema(Schema schema, boolean nullable) { - if (schema.required()) { - return true; - } - else if (schema.requiredMode() == Schema.RequiredMode.REQUIRED) { - return true; - } - else if (schema.requiredMode() == Schema.RequiredMode.NOT_REQUIRED) { - return false; - } - return !nullable; } /** @@ -261,32 +181,18 @@ private static Class extractType(Class paramClass, Field field) { * @param fieldNamePrefix the field name prefix * @return the stream */ - private static Stream fromSimpleClass(Class paramClass, Field field, String fieldNamePrefix, boolean isParentRequired) { + private static Stream fromSimpleClass(Class paramClass, Field field, String fieldNamePrefix) { Annotation[] fieldAnnotations = field.getDeclaredAnnotations(); try { Parameter parameter = field.getAnnotation(Parameter.class); - Schema schema = field.getAnnotation(Schema.class); - boolean visible = resolveVisible(parameter, schema); - if (!visible) { - return Stream.empty(); - } - - Set annotationSimpleNames = Arrays.stream(field.getDeclaredAnnotations()) - .map(Annotation::annotationType) - .map(Class::getSimpleName) - .collect(Collectors.toSet()); - - boolean isNotRequired = !resolveRequired(schema, parameter, !AbstractRequestService.hasNotNullAnnotation(annotationSimpleNames)); - Annotation[] notNullFieldAnnotations = Arrays.stream(fieldAnnotations) - .filter(annotation -> AbstractRequestService.hasNotNullAnnotation(List.of(annotation.annotationType().getSimpleName()))) - .toArray(Annotation[]::new); + boolean isNotRequired = parameter == null || !parameter.required(); if (paramClass.getSuperclass() != null && paramClass.isRecord()) { return Stream.of(paramClass.getRecordComponents()) .filter(d -> d.getName().equals(field.getName())) .map(RecordComponent::getAccessor) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), notNullFieldAnnotations, true, isNotRequired)); + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); } else @@ -296,7 +202,7 @@ private static Stream fromSimpleClass(Class paramClass, Fiel .filter(Objects::nonNull) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), notNullFieldAnnotations, true, isNotRequired)); + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); } catch (IntrospectionException e) { return Stream.of(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 197a7bb35..0ac771b04 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -584,9 +584,6 @@ public Parameter buildParam(ParameterInfo parameterInfo, Components components, if (parameter.getRequired() == null) parameter.setRequired(parameterInfo.isRequired()); - if (Boolean.TRUE.equals(parameter.getRequired()) && parameterInfo.getMethodParameter() instanceof DelegatingMethodParameter delegatingMethodParameter && delegatingMethodParameter.isNotRequired()) - parameter.setRequired(false); - if (containsDeprecatedAnnotation(parameterInfo.getMethodParameter().getParameterAnnotations())) parameter.setDeprecated(true); @@ -619,7 +616,7 @@ public void applyBeanValidatorAnnotations(final Parameter parameter, final List< Map annos = new HashMap<>(); if (annotations != null) annotations.forEach(annotation -> annos.put(annotation.annotationType().getSimpleName(), annotation)); - boolean annotationExists = hasNotNullAnnotation(annos.keySet()); + boolean annotationExists = Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annos::containsKey); if (annotationExists) parameter.setRequired(true); Schema schema = parameter.getSchema(); @@ -646,7 +643,7 @@ public void applyBeanValidatorAnnotations(final RequestBody requestBody, final L .filter(annotation -> io.swagger.v3.oas.annotations.parameters.RequestBody.class.equals(annotation.annotationType())) .anyMatch(annotation -> ((io.swagger.v3.oas.annotations.parameters.RequestBody) annotation).required()); } - boolean validationExists = hasNotNullAnnotation(annos.keySet()); + boolean validationExists = Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annos::containsKey); if (validationExists || (!isOptional && (springRequestBodyRequired || swaggerRequestBodyRequired))) requestBody.setRequired(true); @@ -843,14 +840,5 @@ else if (requestBody.content().length > 0) } return false; } - - /** - * Check if the parameter has any of the annotations that make it non-optional - * - * @param annotationSimpleNames the annotation simple class named, e.g. NotNull - * @return whether any of the known NotNull annotations are present - */ - public static boolean hasNotNullAnnotation(Collection annotationSimpleNames) { - return Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annotationSimpleNames::contains); - } + } From a16c096a5ff83663185066fa31c780e00d93f7f5 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 31 Dec 2024 00:48:28 +0100 Subject: [PATCH 134/226] reverting changes from PR #2788 --- .../test/resources/results/3.0.1/app233.json | 117 ------------------ 1 file changed, 117 deletions(-) delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json deleted file mode 100644 index 4fa7b2ad0..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "OpenAPI definition", - "version": "v0" - }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "paths": { - "/renamed-parent": { - "get": { - "tags": [ - "parameter-controller" - ], - "operationId": "nestedParameterObjectWithRenamedParentField", - "parameters": [ - { - "name": "schemaRenamed.parameterField", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "parameterRenamed.parameterField", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "originalNameNestedParameterObject.parameterField", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - } - } - }, - "/optional-parent": { - "get": { - "tags": [ - "parameter-controller" - ], - "operationId": "nestedParameterObjectWithOptionalParentField", - "parameters": [ - { - "name": "schemaNotRequiredNestedParameterObject.requiredParameterField", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "nestedNonNullParameterObject.requiredParameterField", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "nestedNotBlankParameterObject.requiredParameterField", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - } - } - }, - "/hidden-parent": { - "get": { - "tags": [ - "parameter-controller" - ], - "operationId": "nestedParameterObjectWithHiddenParentField", - "parameters": [ - { - "name": "visibleNestedParameterObject.parameterField", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - } - } - } - }, - "components": {} -} From 34a468a3aa5fe1d3fa055a53be2ecad8085d9cbd Mon Sep 17 00:00:00 2001 From: Michael Clarke Date: Tue, 31 Dec 2024 16:15:20 +0000 Subject: [PATCH 135/226] Obey annotations when flattening ParameterObject fields. Fixes #2817 When creating the flattened parameter definitions for an item annotated with @ParameterObject, the @Schema and @Property annotations on any fields prior to the final child-node of each branch of the parameter tree are not taken into consideration. This results in the field name in the code being used even where annotations may override that, prevents the fields being hidden where one of the parent fields is marked as hidden but the child field isn't hidden, and marks a field as mandatory even where the field would only be mandatory if the parent object had been declared through a sibling of the target field being set. To overcome this, whilst the flattened parameter map is being built, each field is now being inspected for a @Parameter annotation or - where the @Parameter annotation isn't found - a @Schema annotation. Where a custom name is included in either of those annotations then the overridden field name is used in the flattened definition. If either annotation declares the field as hidden then the field and all child fields are removed from the resulting definition, and a field is no longer set as mandatory unless the parent field was also declared as mandatory, or resolved as non-null and was set in an automatic state, or the child field is specifically set as required in the Schema or Parameter annotation. --- .../extractor/DelegatingMethodParameter.java | 23 +- .../MethodParameterPojoExtractor.java | 117 +++++- .../core/service/AbstractRequestService.java | 17 +- .../api/v30/app233/ParameterController.java | 95 +++++ .../api/v30/app233/SpringDocApp233Test.java | 185 +++++++++ .../test/resources/results/3.0.1/app233.json | 381 ++++++++++++++++++ 6 files changed, 800 insertions(+), 18 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java index bfd4b031b..94b744912 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java @@ -93,6 +93,11 @@ public class DelegatingMethodParameter extends MethodParameter { */ private final Annotation[] methodAnnotations; + /** + * The annotations to mask from the list of annotations on this method parameter. + */ + private final Annotation[] maskedAnnotations; + /** * The Is not required. */ @@ -105,17 +110,19 @@ public class DelegatingMethodParameter extends MethodParameter { * @param parameterName the parameter name * @param additionalParameterAnnotations the additional parameter annotations * @param methodAnnotations the method annotations + * @param maskedAnnotations any annotations that should not be included in the final list of annotations * @param isParameterObject the is parameter object * @param isNotRequired the is required */ - DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, Annotation[] methodAnnotations, boolean isParameterObject, boolean isNotRequired) { + DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, Annotation[] methodAnnotations, Annotation[] maskedAnnotations, boolean isParameterObject, boolean isNotRequired) { super(delegate); this.delegate = delegate; this.additionalParameterAnnotations = additionalParameterAnnotations; this.parameterName = parameterName; this.isParameterObject = isParameterObject; this.isNotRequired = isNotRequired; - this.methodAnnotations =methodAnnotations; + this.methodAnnotations = methodAnnotations; + this.maskedAnnotations = maskedAnnotations; } /** @@ -146,7 +153,7 @@ public static MethodParameter[] customize(String[] pNames, MethodParameter[] par } else { String name = pNames != null ? pNames[i] : p.getParameterName(); - explodedParameters.add(new DelegatingMethodParameter(p, name, null, null, false, false)); + explodedParameters.add(new DelegatingMethodParameter(p, name, null, null, null, false, false)); } } return explodedParameters.toArray(new MethodParameter[0]); @@ -179,7 +186,15 @@ public static MethodParameter changeContainingClass(MethodParameter methodParame @NonNull public Annotation[] getParameterAnnotations() { Annotation[] methodAnnotations = ArrayUtils.addAll(delegate.getParameterAnnotations(), this.methodAnnotations); - return ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); + methodAnnotations = ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); + if (maskedAnnotations == null) { + return methodAnnotations; + } else { + List maskedAnnotationList = List.of(maskedAnnotations); + return Arrays.stream(methodAnnotations) + .filter(annotation -> !maskedAnnotationList.contains(annotation)) + .toArray(Annotation[]::new); + } } @Override diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index 3b7033e43..04123a705 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -50,10 +50,13 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Predicate; +import java.util.stream.Collectors; import java.util.stream.Stream; import io.swagger.v3.core.util.PrimitiveType; import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springdoc.core.service.AbstractRequestService; import org.springframework.core.GenericTypeResolver; import org.springframework.core.MethodParameter; @@ -63,7 +66,7 @@ /** * The type Method parameter pojo extractor. * - * @author bnasslahsen + * @author bnasslahsen, michael.clarke */ public class MethodParameterPojoExtractor { @@ -113,7 +116,7 @@ private MethodParameterPojoExtractor() { * @return the stream */ static Stream extractFrom(Class clazz) { - return extractFrom(clazz, ""); + return extractFrom(clazz, "", true); } /** @@ -121,12 +124,13 @@ static Stream extractFrom(Class clazz) { * * @param clazz the clazz * @param fieldNamePrefix the field name prefix + * @param parentRequired whether the field that hold the class currently being inspected was required or optional * @return the stream */ - private static Stream extractFrom(Class clazz, String fieldNamePrefix) { + private static Stream extractFrom(Class clazz, String fieldNamePrefix, boolean parentRequired) { return allFieldsOf(clazz).stream() .filter(field -> !field.getType().equals(clazz)) - .flatMap(f -> fromGetterOfField(clazz, f, fieldNamePrefix)) + .flatMap(f -> fromGetterOfField(clazz, f, fieldNamePrefix, parentRequired)) .filter(Objects::nonNull); } @@ -136,20 +140,95 @@ private static Stream extractFrom(Class clazz, String fieldN * @param paramClass the param class * @param field the field * @param fieldNamePrefix the field name prefix + * @param parentRequired whether the field that holds the class currently being examined was required or optional * @return the stream */ - private static Stream fromGetterOfField(Class paramClass, Field field, String fieldNamePrefix) { + private static Stream fromGetterOfField(Class paramClass, Field field, String fieldNamePrefix, boolean parentRequired) { Class type = extractType(paramClass, field); if (Objects.isNull(type)) return Stream.empty(); if (isSimpleType(type)) - return fromSimpleClass(paramClass, field, fieldNamePrefix); + return fromSimpleClass(paramClass, field, fieldNamePrefix, parentRequired); else { - String prefix = fieldNamePrefix + field.getName() + DOT; - return extractFrom(type, prefix); + Parameter parameter = field.getAnnotation(Parameter.class); + Schema schema = field.getAnnotation(Schema.class); + boolean visible = resolveVisible(parameter, schema); + if (!visible) { + return Stream.empty(); + } + String prefix = fieldNamePrefix + resolveName(parameter, schema).orElse(field.getName()) + DOT; + boolean notNullAnnotationsPresent = AbstractRequestService.hasNotNullAnnotation(Arrays.stream(field.getDeclaredAnnotations()) + .map(Annotation::annotationType) + .map(Class::getSimpleName) + .collect(Collectors.toSet())); + return extractFrom(type, prefix, parentRequired && resolveRequired(schema, parameter, !notNullAnnotationsPresent)); + } + } + + private static Optional resolveName(Parameter parameter, Schema schema) { + if (parameter != null) { + return resolveNameFromParameter(parameter); + } + if (schema != null) { + return resolveNameFromSchema(schema); + } + return Optional.empty(); + } + + private static Optional resolveNameFromParameter(Parameter parameter) { + if (parameter.name().isEmpty()) { + return Optional.empty(); + } + return Optional.of(parameter.name()); + } + + private static Optional resolveNameFromSchema(Schema schema) { + if (schema.name().isEmpty()) { + return Optional.empty(); + } + return Optional.of(schema.name()); + } + + private static boolean resolveVisible(Parameter parameter, Schema schema) { + if (parameter != null) { + return !parameter.hidden(); + } + if (schema != null) { + return !schema.hidden(); } + return true; + } + + private static boolean resolveRequired(Schema schema, Parameter parameter, boolean nullable) { + if (parameter != null) { + return resolveRequiredFromParameter(parameter, nullable); + } + if (schema != null) { + return resolveRequiredFromSchema(schema, nullable); + } + return !nullable; + } + + private static boolean resolveRequiredFromParameter(Parameter parameter, boolean nullable) { + if (parameter.required()) { + return true; + } + return !nullable; + } + + private static boolean resolveRequiredFromSchema(Schema schema, boolean nullable) { + if (schema.required()) { + return true; + } + else if (schema.requiredMode() == Schema.RequiredMode.REQUIRED) { + return true; + } + else if (schema.requiredMode() == Schema.RequiredMode.NOT_REQUIRED) { + return false; + } + return !nullable; } /** @@ -181,18 +260,32 @@ private static Class extractType(Class paramClass, Field field) { * @param fieldNamePrefix the field name prefix * @return the stream */ - private static Stream fromSimpleClass(Class paramClass, Field field, String fieldNamePrefix) { + private static Stream fromSimpleClass(Class paramClass, Field field, String fieldNamePrefix, boolean isParentRequired) { Annotation[] fieldAnnotations = field.getDeclaredAnnotations(); try { Parameter parameter = field.getAnnotation(Parameter.class); - boolean isNotRequired = parameter == null || !parameter.required(); + Schema schema = field.getAnnotation(Schema.class); + boolean visible = resolveVisible(parameter, schema); + if (!visible) { + return Stream.empty(); + } + + boolean forcedRequired = resolveRequired(schema, parameter, true); + + boolean isNotRequired = !((isParentRequired || forcedRequired) && resolveRequired(schema, parameter, !AbstractRequestService.hasNotNullAnnotation(Arrays.stream(fieldAnnotations) + .map(Annotation::annotationType) + .map(Class::getSimpleName) + .collect(Collectors.toSet())))); + Annotation[] notNullFieldAnnotations = Arrays.stream(fieldAnnotations) + .filter(annotation -> AbstractRequestService.hasNotNullAnnotation(List.of(annotation.annotationType().getSimpleName()))) + .toArray(Annotation[]::new); if (paramClass.getSuperclass() != null && paramClass.isRecord()) { return Stream.of(paramClass.getRecordComponents()) .filter(d -> d.getName().equals(field.getName())) .map(RecordComponent::getAccessor) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), notNullFieldAnnotations, true, isNotRequired)); } else @@ -202,7 +295,7 @@ private static Stream fromSimpleClass(Class paramClass, Fiel .filter(Objects::nonNull) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), notNullFieldAnnotations, true, isNotRequired)); } catch (IntrospectionException e) { return Stream.of(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 0ac771b04..60ec6963f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -584,6 +584,9 @@ public Parameter buildParam(ParameterInfo parameterInfo, Components components, if (parameter.getRequired() == null) parameter.setRequired(parameterInfo.isRequired()); + if (Boolean.TRUE.equals(parameter.getRequired()) && parameterInfo.getMethodParameter() instanceof DelegatingMethodParameter delegatingMethodParameter && delegatingMethodParameter.isNotRequired()) + parameter.setRequired(false); + if (containsDeprecatedAnnotation(parameterInfo.getMethodParameter().getParameterAnnotations())) parameter.setDeprecated(true); @@ -616,7 +619,7 @@ public void applyBeanValidatorAnnotations(final Parameter parameter, final List< Map annos = new HashMap<>(); if (annotations != null) annotations.forEach(annotation -> annos.put(annotation.annotationType().getSimpleName(), annotation)); - boolean annotationExists = Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annos::containsKey); + boolean annotationExists = hasNotNullAnnotation(annos.keySet()); if (annotationExists) parameter.setRequired(true); Schema schema = parameter.getSchema(); @@ -643,7 +646,7 @@ public void applyBeanValidatorAnnotations(final RequestBody requestBody, final L .filter(annotation -> io.swagger.v3.oas.annotations.parameters.RequestBody.class.equals(annotation.annotationType())) .anyMatch(annotation -> ((io.swagger.v3.oas.annotations.parameters.RequestBody) annotation).required()); } - boolean validationExists = Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annos::containsKey); + boolean validationExists = hasNotNullAnnotation(annos.keySet()); if (validationExists || (!isOptional && (springRequestBodyRequired || swaggerRequestBodyRequired))) requestBody.setRequired(true); @@ -840,5 +843,15 @@ else if (requestBody.content().length > 0) } return false; } + + /** + * Check if the parameter has any of the annotations that make it non-optional + * + * @param annotationSimpleNames the annotation simple class named, e.g. NotNull + * @return whether any of the known NotNull annotations are present + */ + public static boolean hasNotNullAnnotation(Collection annotationSimpleNames) { + return Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annotationSimpleNames::contains); + } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java new file mode 100644 index 000000000..c891b3a90 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/ParameterController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app233; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ParameterController { + + @GetMapping("/hidden-parent") + public void nestedParameterObjectWithHiddenParentField(@ParameterObject ParameterObjectWithHiddenField parameters) { + + } + + public record ParameterObjectWithHiddenField( + @Schema(hidden = true) NestedParameterObject schemaHiddenNestedParameterObject, + @Parameter(hidden = true) NestedParameterObject parameterHiddenNestedParameterObject, + NestedParameterObject visibleNestedParameterObject + ) { + + } + + public record NestedParameterObject( + String parameterField) { + } + + @GetMapping("/renamed-parent") + public void nestedParameterObjectWithRenamedParentField(@ParameterObject ParameterObjectWithRenamedField parameters) { + + } + + public record ParameterObjectWithRenamedField( + @Schema(name = "schemaRenamed") NestedParameterObject schemaRenamedNestedParameterObject, + @Parameter(name = "parameterRenamed") NestedParameterObject parameterRenamedNestedParameterObject, + NestedParameterObject originalNameNestedParameterObject + ) { + + } + + @GetMapping("/optional-parent") + public void nestedParameterObjectWithOptionalParentField(@Valid @ParameterObject MultiFieldParameterObject parameters) { + + } + + public record MultiFieldParameterObject( + @Valid @Schema(requiredMode = RequiredMode.REQUIRED) @NotNull MultiFieldNestedParameterObject requiredNotNullParameterObject, + @Valid @Schema(requiredMode = RequiredMode.REQUIRED) MultiFieldNestedParameterObject requiredNoValidationParameterObject, + @Valid @Schema(requiredMode = RequiredMode.NOT_REQUIRED) @NotNull MultiFieldNestedParameterObject notRequiredNotNullParameterObject, + @Valid @Schema(requiredMode = RequiredMode.NOT_REQUIRED) MultiFieldNestedParameterObject notRequiredNoValidationParameterObject, + @Valid @NotNull MultiFieldNestedParameterObject noSchemaNotNullParameterObject, + @Valid MultiFieldNestedParameterObject noSchemaNoValidationParameterObject) { + + } + + public record MultiFieldNestedParameterObject ( + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @NotNull String requiredNotNullField, + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) String requiredNoValidationField, + @Schema(requiredMode = RequiredMode.NOT_REQUIRED) @NotNull String notRequiredNotNullField, + @Schema(requiredMode = RequiredMode.NOT_REQUIRED) String notRequiredNoValidationField, + @NotNull String noSchemaNotNullField, + String noSchemaNoValidationField) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java new file mode 100644 index 000000000..4480482d1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java @@ -0,0 +1,185 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app233; + +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.jayway.jsonpath.JsonPath; +import net.minidev.json.JSONArray; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.MethodArgumentNotValidException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * @author bnasslahsen, michael.clarke + */ +class SpringDocApp233Test extends AbstractSpringDocV30Test { + + @CsvSource({"requiredNotNullParameterObject.requiredNotNullField, true", + "requiredNotNullParameterObject.requiredNoValidationField, true", + "requiredNotNullParameterObject.notRequiredNotNullField, false", + "requiredNotNullParameterObject.notRequiredNoValidationField, false", + "requiredNotNullParameterObject.noSchemaNotNullField, true", + "requiredNotNullParameterObject.noSchemaNoValidationField, false", + "requiredNoValidationParameterObject.requiredNotNullField, true", + "requiredNoValidationParameterObject.requiredNoValidationField, true", + "requiredNoValidationParameterObject.notRequiredNotNullField, false", + "requiredNoValidationParameterObject.notRequiredNoValidationField, false", + "requiredNoValidationParameterObject.noSchemaNotNullField, true", + "requiredNoValidationParameterObject.noSchemaNoValidationField, false", + "notRequiredNotNullParameterObject.requiredNotNullField, true", + "notRequiredNotNullParameterObject.requiredNoValidationField, true", + "notRequiredNotNullParameterObject.notRequiredNotNullField, false", + "notRequiredNotNullParameterObject.notRequiredNoValidationField, false", + "notRequiredNotNullParameterObject.noSchemaNotNullField, false", + "notRequiredNotNullParameterObject.noSchemaNoValidationField, false", + "notRequiredNoValidationParameterObject.requiredNotNullField, true", + "notRequiredNoValidationParameterObject.requiredNoValidationField, true", + "notRequiredNoValidationParameterObject.notRequiredNotNullField, false", + "notRequiredNoValidationParameterObject.notRequiredNoValidationField, false", + "notRequiredNoValidationParameterObject.noSchemaNotNullField, false", + "notRequiredNoValidationParameterObject.noSchemaNoValidationField, false", + "noSchemaNotNullParameterObject.requiredNotNullField, true", + "noSchemaNotNullParameterObject.requiredNoValidationField, true", + "noSchemaNotNullParameterObject.notRequiredNotNullField, false", + "noSchemaNotNullParameterObject.notRequiredNoValidationField, false", + "noSchemaNotNullParameterObject.noSchemaNotNullField, true", + "noSchemaNotNullParameterObject.noSchemaNoValidationField, false", + "noSchemaNoValidationParameterObject.requiredNotNullField, true", + "noSchemaNoValidationParameterObject.requiredNoValidationField, true", + "noSchemaNoValidationParameterObject.notRequiredNotNullField, false", + "noSchemaNoValidationParameterObject.notRequiredNoValidationField, false", + "noSchemaNoValidationParameterObject.noSchemaNotNullField, false", + "noSchemaNoValidationParameterObject.noSchemaNoValidationField, false"}) + @ParameterizedTest + void shouldHaveCorrectRequireStatus(String field, String required) throws Exception { + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + + String requiredMode = ((JSONArray) JsonPath.parse(result).read("$.paths.['/optional-parent'].get.parameters[?(@.name == '" + field + "')].required")).get(0).toString(); + assertThat(requiredMode).isEqualTo(required); + } + + @Test + void shouldMatchSwaggerFieldRequirementsMatchJavaValidation() throws Exception { + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + + JSONArray allFieldsJsonArray = JsonPath.parse(result).read("$.paths.['/optional-parent'].get.parameters[*].name"); + List allFields = allFieldsJsonArray.stream().map(Object::toString).toList(); + + // check we get no validation failures when all mandatory fields are present + verifySwaggerFieldRequirementsMatchJavaValidation(allFields, List.of()); + + JSONArray mandatoryFieldsJsonArray = JsonPath.parse(result).read("$.paths.['/optional-parent'].get.parameters[?(@.required == true)].name"); + List mandatoryFields = mandatoryFieldsJsonArray.stream().map(Object::toString).toList(); + + // check validation failures when each individual mandatory field is missing + for (String mandatoryField : mandatoryFields) { + List filteredFields = allFields.stream() + .filter(field -> !field.equals(mandatoryField)) + .toList(); + + List expectedErrors = Stream.of(mandatoryField) + // Fields using Swagger annotations to drive required status but not using Java validation to enforce it so don't cause validation errors + .filter(field -> !field.endsWith("requiredNullableField")) + .filter(field -> !field.endsWith("requiredNoValidationField")) + // the error is returned prefixed with the query parameter name, so add it to the expected error message + .map(field -> "multiFieldParameterObject." + field) + .toList(); + verifySwaggerFieldRequirementsMatchJavaValidation(filteredFields, expectedErrors); + } + + + JSONArray nonMandatoryFieldsJsonArray = JsonPath.parse(result).read("$.paths.['/optional-parent'].get.parameters[?(@.required == false)].name"); + List nonMandatoryFields = nonMandatoryFieldsJsonArray.stream().map(Object::toString).toList(); + + // check validation failures for any individual non-mandatory fields being missed + for (String nonMandatoryField : nonMandatoryFields) { + List filteredFields = allFields.stream() + .filter(field -> !field.equals(nonMandatoryField)) + .toList(); + + List expectedErrors = Stream.of(nonMandatoryField) + // Fields that are mandatory but either have nullable parent fields so are excluded in swagger or are marked as not required so do cause validation errors + .filter(field -> field.endsWith("NotNullField")) + // the error is returned prefixed with the query parameter name, so add it to the expected error message + .map(field -> "multiFieldParameterObject." + field) + .toList(); + verifySwaggerFieldRequirementsMatchJavaValidation(filteredFields, expectedErrors); + } + } + + private void verifySwaggerFieldRequirementsMatchJavaValidation(Collection requestFields, Collection expectedErrorFields) throws Exception { + MockHttpServletRequestBuilder request = get("/optional-parent"); + for (String mandatoryField : requestFields) { + request.queryParam(mandatoryField, mandatoryField + ".value"); + } + + mockMvc.perform(request) + .andExpect(result -> { + + Set errorFields = Optional.ofNullable(result.getResolvedException()) + .map(MethodArgumentNotValidException.class::cast) + .map(MethodArgumentNotValidException::getBindingResult) + .map(BindingResult::getFieldErrors) + .stream() + .flatMap(Collection::stream) + .map(field -> field.getObjectName() + "." + field.getField()) + .collect(Collectors.toSet()); + + + assertThat(errorFields).containsExactlyElementsOf(expectedErrorFields); + + assertThat(result.getResponse().getStatus()).isEqualTo(expectedErrorFields.isEmpty() ? 200 : 400); + }); + } + + + @SpringBootApplication + static class SpringDocTestApp { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json new file mode 100644 index 000000000..d0cb5bfd5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app233.json @@ -0,0 +1,381 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/renamed-parent": { + "get": { + "tags": [ + "parameter-controller" + ], + "operationId": "nestedParameterObjectWithRenamedParentField", + "parameters": [ + { + "name": "schemaRenamed.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "parameterRenamed.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "originalNameNestedParameterObject.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/optional-parent": { + "get": { + "tags": [ + "parameter-controller" + ], + "operationId": "nestedParameterObjectWithOptionalParentField", + "parameters": [ + { + "name": "requiredNotNullParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.noSchemaNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.noSchemaNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.noSchemaNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.noSchemaNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.noSchemaNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.noSchemaNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/hidden-parent": { + "get": { + "tags": [ + "parameter-controller" + ], + "operationId": "nestedParameterObjectWithHiddenParentField", + "parameters": [ + { + "name": "visibleNestedParameterObject.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file From ddf718ebdc21f447d1232acd8ba9d03e0c79b3f4 Mon Sep 17 00:00:00 2001 From: Martin Rueckl Date: Thu, 2 Jan 2025 11:17:09 +0100 Subject: [PATCH 136/226] add testcase to reproduce error --- .../springdoc/api/app13/SpringDocApp13Test.kt | 29 ++++++++ .../org/springdoc/api/app13/TestController.kt | 49 +++++++++++++ .../src/test/resources/results/app13.json | 71 +++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt new file mode 100644 index 000000000..61da07022 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt @@ -0,0 +1,29 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.app13 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest + +class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt new file mode 100644 index 000000000..7fe6d28cb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt @@ -0,0 +1,49 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.app13 + + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@Schema(description = "Generic description") +data class KeyValue( + val key: String, + val value: String, +) + +@Schema +data class SomeDTO( + @Schema(description = "Description A", allOf = [KeyValue::class]) val fieldA: KeyValue, + @Schema(description = "Description B", allOf = [KeyValue::class]) val fieldB: KeyValue, +) + + +@RestController +@RequestMapping("/test") +class TestController { + @PostMapping("/test") + fun create(@RequestBody some: SomeDTO) { + + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json new file mode 100644 index 000000000..840177b22 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json @@ -0,0 +1,71 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "OpenAPI definition", + "version" : "v0" + }, + "servers" : [ { + "url" : "http://localhost", + "description" : "Generated server url" + } ], + "paths" : { + "/test/test" : { + "post" : { + "tags" : [ "test-controller" ], + "operationId" : "create", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SomeDTO" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + }, + "components" : { + "schemas" : { + "KeyValue" : { + "required" : [ "key", "value" ], + "type" : "object", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" + } + }, + "description" : "Generic description" + }, + "SomeDTO" : { + "required" : [ "fieldA", "fieldB" ], + "type" : "object", + "properties" : { + "fieldA" : { + "type" : "object", + "description" : "Description A", + "allOf" : [ { + "$ref" : "#/components/schemas/KeyValue" + } ] + }, + "fieldB" : { + "type" : "object", + "description" : "Description B", + "allOf" : [ { + "$ref" : "#/components/schemas/KeyValue" + } ] + } + } + } + } + } +} \ No newline at end of file From 77ff9002c93984ebd5d6333a82eaf0d3a042f01e Mon Sep 17 00:00:00 2001 From: Martin Rueckl Date: Thu, 2 Jan 2025 14:09:25 +0100 Subject: [PATCH 137/226] small refactor of schema resolution for polymorphic models --- .../converters/PolymorphicModelConverter.java | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 12cec2add..9eb237e20 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -110,32 +110,35 @@ else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSi @Override public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator chain) { JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); - if (javaType != null) { - for (Field field : FieldUtils.getAllFields(javaType.getRawClass())) { - if (field.isAnnotationPresent(JsonUnwrapped.class)) { - PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); - } + + if (javaType == null || !chain.hasNext()) { + return null; + } + + for (Field field : FieldUtils.getAllFields(javaType.getRawClass())) { + if (field.isAnnotationPresent(JsonUnwrapped.class)) { + PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); } - if (chain.hasNext()) { - if (!type.isResolveAsRef() && type.getParent() != null - && PARENT_TYPES_TO_IGNORE.stream().noneMatch(ignore -> type.getParent().getName().startsWith(ignore))) - type.resolveAsRef(true); - Schema resolvedSchema = chain.next().resolve(type, context, chain); - resolvedSchema = getResolvedSchema(javaType, resolvedSchema); - if (resolvedSchema == null || resolvedSchema.get$ref() == null) { - return resolvedSchema; - } - if(resolvedSchema.get$ref().contains(Components.COMPONENTS_SCHEMAS_REF)) { - String schemaName = resolvedSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); - Schema existingSchema = context.getDefinedModels().get(schemaName); - if (existingSchema != null && existingSchema.getOneOf() != null) { - return resolvedSchema; - } - } - return composePolymorphicSchema(type, resolvedSchema, context.getDefinedModels().values()); + } + + String parentName = type.getParent() == null ? null : type.getParent().getName(); + if (parentName != null && PARENT_TYPES_TO_IGNORE.stream().noneMatch(parentName::startsWith)){ + type.resolveAsRef(true); + } + + Schema resolvedSchema = getResolvedSchema(javaType, chain.next().resolve(type, context, chain)); + if (resolvedSchema == null || resolvedSchema.get$ref() == null) { + return resolvedSchema; + } + + if(resolvedSchema.get$ref().contains(Components.COMPONENTS_SCHEMAS_REF)) { + String schemaName = resolvedSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); + Schema existingSchema = context.getDefinedModels().get(schemaName); + if (existingSchema != null && existingSchema.getOneOf() != null) { + return resolvedSchema; } } - return null; + return composePolymorphicSchema(type, resolvedSchema, context.getDefinedModels().values()); } /** From fbd8bcd1b53e3e04bf8cadb4e8c530a279b6b5f2 Mon Sep 17 00:00:00 2001 From: Martin Rueckl Date: Thu, 2 Jan 2025 14:42:43 +0100 Subject: [PATCH 138/226] resolve infinite recursion --- .../converters/PolymorphicModelConverter.java | 2 +- .../src/test/resources/results/app13.json | 33 +++++++++---------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 9eb237e20..1673ce8a1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -134,7 +134,7 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if(resolvedSchema.get$ref().contains(Components.COMPONENTS_SCHEMAS_REF)) { String schemaName = resolvedSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); Schema existingSchema = context.getDefinedModels().get(schemaName); - if (existingSchema != null && existingSchema.getOneOf() != null) { + if (existingSchema != null && (existingSchema.getOneOf() != null || existingSchema.getAllOf() != null || existingSchema.getAnyOf() != null)) { return resolvedSchema; } } diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json index 840177b22..473e9bb2f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json @@ -36,33 +36,30 @@ "KeyValue" : { "required" : [ "key", "value" ], "type" : "object", - "properties" : { - "key" : { - "type" : "string" - }, - "value" : { - "type" : "string" + "description" : "Generic description", + "allOf" : [ { + "$ref" : "#/components/schemas/KeyValue" + }, { + "type" : "object", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" + } } - }, - "description" : "Generic description" + } ] }, "SomeDTO" : { "required" : [ "fieldA", "fieldB" ], "type" : "object", "properties" : { "fieldA" : { - "type" : "object", - "description" : "Description A", - "allOf" : [ { - "$ref" : "#/components/schemas/KeyValue" - } ] + "$ref" : "#/components/schemas/KeyValue" }, "fieldB" : { - "type" : "object", - "description" : "Description B", - "allOf" : [ { - "$ref" : "#/components/schemas/KeyValue" - } ] + "$ref" : "#/components/schemas/KeyValue" } } } From a9148f4ad244edc5b300c35e21300c703639c50f Mon Sep 17 00:00:00 2001 From: Martin Rueckl Date: Thu, 2 Jan 2025 16:27:19 +0100 Subject: [PATCH 139/226] changed to OpenAPI v3.1 --- .../springdoc/api/app13/SpringDocApp13Test.kt | 20 +++++++++++++ .../org/springdoc/api/app13/TestController.kt | 2 ++ .../src/test/resources/results/app13.json | 29 ++++++++++++++----- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt index 61da07022..1f2f41145 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt @@ -18,11 +18,31 @@ package test.org.springdoc.api.app13 +import org.springdoc.core.properties.SpringDocConfigProperties +import org.springdoc.core.properties.SpringDocConfigProperties.ApiDocs.OpenApiVersion import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.test.context.SpringBootTest +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest + +@SpringBootTest//(classes = [Config::class]) class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest() { + + @Configuration + class Config{ + @Bean + fun springDocConfigProperties():SpringDocConfigProperties{ + val x= SpringDocConfigProperties() + x.apiDocs.version = OpenApiVersion.OPENAPI_3_1 + return x + } + + } + + @SpringBootApplication class DemoApplication diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt index 7fe6d28cb..8c4805e53 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt @@ -19,6 +19,7 @@ package test.org.springdoc.api.app13 +import io.swagger.v3.oas.annotations.OpenAPI31 import io.swagger.v3.oas.annotations.media.Schema import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody @@ -38,6 +39,7 @@ data class SomeDTO( ) + @RestController @RequestMapping("/test") class TestController { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json index 473e9bb2f..932813b1e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json @@ -52,14 +52,29 @@ } ] }, "SomeDTO" : { - "required" : [ "fieldA", "fieldB" ], - "type" : "object", - "properties" : { - "fieldA" : { - "$ref" : "#/components/schemas/KeyValue" + "required": [ + "fieldA", + "fieldB" + ], + "type": "object", + "properties": { + "fieldA": { + "type": "object", + "description": "Description A", + "allOf": [ + { + "$ref": "#/components/schemas/KeyValue" + } + ] }, - "fieldB" : { - "$ref" : "#/components/schemas/KeyValue" + "fieldB": { + "type": "object", + "description": "Description B", + "allOf": [ + { + "$ref": "#/components/schemas/KeyValue" + } + ] } } } From c4d207810919d904d857c65aa30eabba3aa6fa8f Mon Sep 17 00:00:00 2001 From: Martin Rueckl Date: Thu, 2 Jan 2025 16:30:56 +0100 Subject: [PATCH 140/226] working test case --- .../org/springdoc/api/app13/TestController.kt | 4 +-- .../src/test/resources/results/app13.json | 35 ++++++------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt index 8c4805e53..7ec21bac8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt @@ -34,8 +34,8 @@ data class KeyValue( @Schema data class SomeDTO( - @Schema(description = "Description A", allOf = [KeyValue::class]) val fieldA: KeyValue, - @Schema(description = "Description B", allOf = [KeyValue::class]) val fieldB: KeyValue, + @Schema(description = "Description A") val fieldA: KeyValue, + @Schema(description = "Description B") val fieldB: KeyValue, ) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json index 932813b1e..6bf07eb5b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.1.0", "info" : { "title" : "OpenAPI definition", "version" : "v0" @@ -37,19 +37,14 @@ "required" : [ "key", "value" ], "type" : "object", "description" : "Generic description", - "allOf" : [ { - "$ref" : "#/components/schemas/KeyValue" - }, { - "type" : "object", - "properties" : { - "key" : { - "type" : "string" - }, - "value" : { - "type" : "string" - } + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" } - } ] + } }, "SomeDTO" : { "required": [ @@ -59,22 +54,12 @@ "type": "object", "properties": { "fieldA": { - "type": "object", "description": "Description A", - "allOf": [ - { - "$ref": "#/components/schemas/KeyValue" - } - ] + "$ref": "#/components/schemas/KeyValue" }, "fieldB": { - "type": "object", "description": "Description B", - "allOf": [ - { - "$ref": "#/components/schemas/KeyValue" - } - ] + "$ref": "#/components/schemas/KeyValue" } } } From 8c073067a52622a63e4f1014d19cd996fd67b661 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 2 Jan 2025 21:10:32 +0100 Subject: [PATCH 141/226] code review --- .../core/data/DataRestRequestService.java | 2 +- .../extractor/DelegatingMethodParameter.java | 23 +---- .../MethodParameterPojoExtractor.java | 44 ++++----- .../springdoc/core/models/ParameterInfo.java | 11 +++ .../core/service/AbstractRequestService.java | 14 ++- .../springdoc/api/v30/app236/ClassOne.java | 18 ++++ .../springdoc/api/v30/app236/ClassTwo.java | 20 ++++ .../api/v30/app236/HelloController.java | 24 +++++ .../api/v30/app236/SpringDocApp236Test.java | 37 +++++++ .../test/resources/results/3.0.1/app236.json | 98 +++++++++++++++++++ 10 files changed, 240 insertions(+), 51 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/ClassOne.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/ClassTwo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/SpringDocApp236Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app236.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java index 72699bb43..bceba72dd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java @@ -227,7 +227,7 @@ private void addParameters(OpenAPI openAPI, RequestMethod requestMethod, MethodA MethodParameter methodParameter, ParameterInfo parameterInfo, Parameter parameter) { List parameterAnnotations = Arrays.asList(getParameterAnnotations(methodParameter)); if (requestBuilder.isValidParameter(parameter,methodAttributes)) { - requestBuilder.applyBeanValidatorAnnotations(parameter, parameterAnnotations); + requestBuilder.applyBeanValidatorAnnotations(parameter, parameterAnnotations, parameterInfo.isParameterObject()); operation.addParametersItem(parameter); } else if (!RequestMethod.GET.equals(requestMethod)) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java index 94b744912..bfd4b031b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java @@ -93,11 +93,6 @@ public class DelegatingMethodParameter extends MethodParameter { */ private final Annotation[] methodAnnotations; - /** - * The annotations to mask from the list of annotations on this method parameter. - */ - private final Annotation[] maskedAnnotations; - /** * The Is not required. */ @@ -110,19 +105,17 @@ public class DelegatingMethodParameter extends MethodParameter { * @param parameterName the parameter name * @param additionalParameterAnnotations the additional parameter annotations * @param methodAnnotations the method annotations - * @param maskedAnnotations any annotations that should not be included in the final list of annotations * @param isParameterObject the is parameter object * @param isNotRequired the is required */ - DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, Annotation[] methodAnnotations, Annotation[] maskedAnnotations, boolean isParameterObject, boolean isNotRequired) { + DelegatingMethodParameter(MethodParameter delegate, String parameterName, Annotation[] additionalParameterAnnotations, Annotation[] methodAnnotations, boolean isParameterObject, boolean isNotRequired) { super(delegate); this.delegate = delegate; this.additionalParameterAnnotations = additionalParameterAnnotations; this.parameterName = parameterName; this.isParameterObject = isParameterObject; this.isNotRequired = isNotRequired; - this.methodAnnotations = methodAnnotations; - this.maskedAnnotations = maskedAnnotations; + this.methodAnnotations =methodAnnotations; } /** @@ -153,7 +146,7 @@ public static MethodParameter[] customize(String[] pNames, MethodParameter[] par } else { String name = pNames != null ? pNames[i] : p.getParameterName(); - explodedParameters.add(new DelegatingMethodParameter(p, name, null, null, null, false, false)); + explodedParameters.add(new DelegatingMethodParameter(p, name, null, null, false, false)); } } return explodedParameters.toArray(new MethodParameter[0]); @@ -186,15 +179,7 @@ public static MethodParameter changeContainingClass(MethodParameter methodParame @NonNull public Annotation[] getParameterAnnotations() { Annotation[] methodAnnotations = ArrayUtils.addAll(delegate.getParameterAnnotations(), this.methodAnnotations); - methodAnnotations = ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); - if (maskedAnnotations == null) { - return methodAnnotations; - } else { - List maskedAnnotationList = List.of(maskedAnnotations); - return Arrays.stream(methodAnnotations) - .filter(annotation -> !maskedAnnotationList.contains(annotation)) - .toArray(Annotation[]::new); - } + return ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); } @Override diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index 04123a705..7012d7552 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -38,6 +38,7 @@ import java.time.LocalTime; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -56,11 +57,11 @@ import io.swagger.v3.core.util.PrimitiveType; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Schema; -import org.springdoc.core.service.AbstractRequestService; import org.springframework.core.GenericTypeResolver; import org.springframework.core.MethodParameter; +import static org.springdoc.core.service.AbstractRequestService.hasNotNullAnnotation; import static org.springdoc.core.utils.Constants.DOT; /** @@ -159,11 +160,8 @@ private static Stream fromGetterOfField(Class paramClass, Fi return Stream.empty(); } String prefix = fieldNamePrefix + resolveName(parameter, schema).orElse(field.getName()) + DOT; - boolean notNullAnnotationsPresent = AbstractRequestService.hasNotNullAnnotation(Arrays.stream(field.getDeclaredAnnotations()) - .map(Annotation::annotationType) - .map(Class::getSimpleName) - .collect(Collectors.toSet())); - return extractFrom(type, prefix, parentRequired && resolveRequired(schema, parameter, !notNullAnnotationsPresent)); + boolean isNullable = isNullable(field.getDeclaredAnnotations()); + return extractFrom(type, prefix, parentRequired && resolveRequired(schema, parameter, isNullable)); } } @@ -265,28 +263,15 @@ private static Stream fromSimpleClass(Class paramClass, Fiel try { Parameter parameter = field.getAnnotation(Parameter.class); Schema schema = field.getAnnotation(Schema.class); - boolean visible = resolveVisible(parameter, schema); - if (!visible) { - return Stream.empty(); - } - - boolean forcedRequired = resolveRequired(schema, parameter, true); - - boolean isNotRequired = !((isParentRequired || forcedRequired) && resolveRequired(schema, parameter, !AbstractRequestService.hasNotNullAnnotation(Arrays.stream(fieldAnnotations) - .map(Annotation::annotationType) - .map(Class::getSimpleName) - .collect(Collectors.toSet())))); - Annotation[] notNullFieldAnnotations = Arrays.stream(fieldAnnotations) - .filter(annotation -> AbstractRequestService.hasNotNullAnnotation(List.of(annotation.annotationType().getSimpleName()))) - .toArray(Annotation[]::new); + boolean isNullable = isNullable(fieldAnnotations); + boolean isNotRequired = !(isParentRequired && resolveRequired(schema, parameter, isNullable)); if (paramClass.getSuperclass() != null && paramClass.isRecord()) { return Stream.of(paramClass.getRecordComponents()) .filter(d -> d.getName().equals(field.getName())) .map(RecordComponent::getAccessor) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), notNullFieldAnnotations, true, isNotRequired)); - + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); } else return Stream.of(Introspector.getBeanInfo(paramClass).getPropertyDescriptors()) @@ -295,7 +280,7 @@ private static Stream fromSimpleClass(Class paramClass, Fiel .filter(Objects::nonNull) .map(method -> new MethodParameter(method, -1)) .map(methodParameter -> DelegatingMethodParameter.changeContainingClass(methodParameter, paramClass)) - .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), notNullFieldAnnotations, true, isNotRequired)); + .map(param -> new DelegatingMethodParameter(param, fieldNamePrefix + field.getName(), fieldAnnotations, param.getMethodAnnotations(), true, isNotRequired)); } catch (IntrospectionException e) { return Stream.of(); @@ -366,4 +351,17 @@ public static void removeSimpleTypes(Class... classes) { SIMPLE_TYPES.removeAll(Arrays.asList(classes)); } + /** + * Is nullable boolean. + * + * @param fieldAnnotations the field annotations + * @return the boolean + */ + private static boolean isNullable(Annotation[] fieldAnnotations) { + Collection annotationSimpleNames = Arrays.stream(fieldAnnotations) + .map(Annotation::annotationType) + .map(Class::getSimpleName) + .collect(Collectors.toSet()); + return !hasNotNullAnnotation(annotationSimpleNames); + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java index 22191ffb7..ad4451825 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java @@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springdoc.core.extractor.DelegatingMethodParameter; import org.springdoc.core.service.GenericParameterService; import org.springframework.core.MethodParameter; @@ -337,4 +338,14 @@ public ParameterId getParameterId() { public void setParameterId(ParameterId parameterId) { this.parameterId = parameterId; } + + /** + * Is parameter object boolean. + * + * @return the boolean + */ + public boolean isParameterObject() { + return methodParameter instanceof DelegatingMethodParameter delegatingMethodParameter + && delegatingMethodParameter.isParameterObject(); + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 60ec6963f..81d6b7357 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -343,7 +343,7 @@ public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, parameter.setDescription(paramJavadocDescription); } } - applyBeanValidatorAnnotations(parameter, parameterAnnotations); + applyBeanValidatorAnnotations(parameter, parameterAnnotations, parameterInfo.isParameterObject()); } else if (!RequestMethod.GET.equals(requestMethod) || OpenApiVersion.OPENAPI_3_1.getVersion().equals(openAPI.getOpenapi())) { if (operation.getRequestBody() != null) @@ -584,9 +584,6 @@ public Parameter buildParam(ParameterInfo parameterInfo, Components components, if (parameter.getRequired() == null) parameter.setRequired(parameterInfo.isRequired()); - if (Boolean.TRUE.equals(parameter.getRequired()) && parameterInfo.getMethodParameter() instanceof DelegatingMethodParameter delegatingMethodParameter && delegatingMethodParameter.isNotRequired()) - parameter.setRequired(false); - if (containsDeprecatedAnnotation(parameterInfo.getMethodParameter().getParameterAnnotations())) parameter.setDeprecated(true); @@ -612,15 +609,16 @@ public Parameter buildParam(ParameterInfo parameterInfo, Components components, /** * Apply bean validator annotations. * - * @param parameter the parameter - * @param annotations the annotations + * @param parameter the parameter + * @param annotations the annotations + * @param isParameterObject the is parameter object */ - public void applyBeanValidatorAnnotations(final Parameter parameter, final List annotations) { + public void applyBeanValidatorAnnotations(final Parameter parameter, final List annotations, final boolean isParameterObject) { Map annos = new HashMap<>(); if (annotations != null) annotations.forEach(annotation -> annos.put(annotation.annotationType().getSimpleName(), annotation)); boolean annotationExists = hasNotNullAnnotation(annos.keySet()); - if (annotationExists) + if (annotationExists && !isParameterObject) parameter.setRequired(true); Schema schema = parameter.getSchema(); applyValidationsToSchema(annos, schema); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/ClassOne.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/ClassOne.java new file mode 100644 index 000000000..91df42f50 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/ClassOne.java @@ -0,0 +1,18 @@ +package test.org.springdoc.api.v30.app236; + + +import jakarta.validation.Valid; + +public class ClassOne { + + @Valid + private ClassTwo description; + + public @Valid ClassTwo getDescription() { + return description; + } + + public void setDescription(@Valid ClassTwo description) { + this.description = description; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/ClassTwo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/ClassTwo.java new file mode 100644 index 000000000..65fdf2041 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/ClassTwo.java @@ -0,0 +1,20 @@ +package test.org.springdoc.api.v30.app236; + + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import jakarta.validation.constraints.NotNull; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ClassTwo { + + @NotNull + private String name; + + public @NotNull String getName() { + return name; + } + + public void setName(@NotNull String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/HelloController.java new file mode 100644 index 000000000..958184983 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/HelloController.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v30.app236; + + +import jakarta.validation.Valid; +import org.springdoc.core.annotations.ParameterObject; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(path = "/testOne", consumes = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity testOne(@ParameterObject @Valid ClassOne test) { + return ResponseEntity.ok("ok"); + } + + @PostMapping(path = "/testTwo", consumes = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity testTwo(@RequestBody ClassOne test) { + return ResponseEntity.ok("ok"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/SpringDocApp236Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/SpringDocApp236Test.java new file mode 100644 index 000000000..f7ee84ff3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/SpringDocApp236Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app236; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp236Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app236.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app236.json new file mode 100644 index 000000000..7787fd8e6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app236.json @@ -0,0 +1,98 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/testTwo": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "testTwo", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClassOne" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testOne": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "testOne", + "parameters": [ + { + "name": "description.name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ClassOne": { + "type": "object", + "properties": { + "description": { + "$ref": "#/components/schemas/ClassTwo" + } + } + }, + "ClassTwo": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } +} From 3114c101a581a1b361749ab425d38843e0738878 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 2 Jan 2025 21:39:16 +0100 Subject: [PATCH 142/226] code review --- .../converters/PolymorphicModelConverter.java | 49 ++++++----- .../springdoc/api/app13/SpringDocApp13Test.kt | 27 +++---- .../org/springdoc/api/app13/TestController.kt | 1 - .../springdoc/api/app14/SpringDocApp14Test.kt | 30 +++++++ .../org/springdoc/api/app14/TestController.kt | 47 +++++++++++ .../src/test/resources/results/app14.json | 81 +++++++++++++++++++ 6 files changed, 192 insertions(+), 43 deletions(-) create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/TestController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app14.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 1673ce8a1..31ece6e16 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -110,35 +110,32 @@ else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSi @Override public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator chain) { JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); - - if (javaType == null || !chain.hasNext()) { - return null; - } - - for (Field field : FieldUtils.getAllFields(javaType.getRawClass())) { - if (field.isAnnotationPresent(JsonUnwrapped.class)) { - PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); + if (javaType != null) { + for (Field field : FieldUtils.getAllFields(javaType.getRawClass())) { + if (field.isAnnotationPresent(JsonUnwrapped.class)) { + PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); + } } - } - - String parentName = type.getParent() == null ? null : type.getParent().getName(); - if (parentName != null && PARENT_TYPES_TO_IGNORE.stream().noneMatch(parentName::startsWith)){ - type.resolveAsRef(true); - } - - Schema resolvedSchema = getResolvedSchema(javaType, chain.next().resolve(type, context, chain)); - if (resolvedSchema == null || resolvedSchema.get$ref() == null) { - return resolvedSchema; - } - - if(resolvedSchema.get$ref().contains(Components.COMPONENTS_SCHEMAS_REF)) { - String schemaName = resolvedSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); - Schema existingSchema = context.getDefinedModels().get(schemaName); - if (existingSchema != null && (existingSchema.getOneOf() != null || existingSchema.getAllOf() != null || existingSchema.getAnyOf() != null)) { - return resolvedSchema; + if (chain.hasNext()) { + if (!type.isResolveAsRef() && type.getParent() != null + && PARENT_TYPES_TO_IGNORE.stream().noneMatch(ignore -> type.getParent().getName().startsWith(ignore))) + type.resolveAsRef(true); + Schema resolvedSchema = chain.next().resolve(type, context, chain); + resolvedSchema = getResolvedSchema(javaType, resolvedSchema); + if (resolvedSchema == null || resolvedSchema.get$ref() == null) { + return resolvedSchema; + } + if(resolvedSchema.get$ref().contains(Components.COMPONENTS_SCHEMAS_REF)) { + String schemaName = resolvedSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); + Schema existingSchema = context.getDefinedModels().get(schemaName); + if (existingSchema != null && (existingSchema.getOneOf() != null || existingSchema.getAllOf() != null)) { + return resolvedSchema; + } + } + return composePolymorphicSchema(type, resolvedSchema, context.getDefinedModels().values()); } } - return composePolymorphicSchema(type, resolvedSchema, context.getDefinedModels().values()); + return null; } /** diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt index 1f2f41145..0cf4ba3c5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt @@ -23,27 +23,22 @@ import org.springdoc.core.properties.SpringDocConfigProperties.ApiDocs.OpenApiVe import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.test.context.SpringBootTest import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.ComponentScan import org.springframework.context.annotation.Configuration import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest -@SpringBootTest//(classes = [Config::class]) class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest() { - - @Configuration - class Config{ - @Bean - fun springDocConfigProperties():SpringDocConfigProperties{ - val x= SpringDocConfigProperties() - x.apiDocs.version = OpenApiVersion.OPENAPI_3_1 - return x - } - - } - - - @SpringBootApplication - class DemoApplication + @SpringBootApplication + class DemoApplication { + @Bean + fun springDocConfigProperties():SpringDocConfigProperties{ + val x= SpringDocConfigProperties() + x.apiDocs.version = OpenApiVersion.OPENAPI_3_1 + return x + } + } + } diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt index 7ec21bac8..e13610707 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt @@ -19,7 +19,6 @@ package test.org.springdoc.api.app13 -import io.swagger.v3.oas.annotations.OpenAPI31 import io.swagger.v3.oas.annotations.media.Schema import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt new file mode 100644 index 000000000..9d7d5e471 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt @@ -0,0 +1,30 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.app14 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest + +class SpringDocApp14Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/TestController.kt new file mode 100644 index 000000000..3f220e658 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/TestController.kt @@ -0,0 +1,47 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.app14 + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@Schema(description = "Generic description") +data class KeyValue( + val key: String, + val value: String, +) + +@Schema +data class SomeDTO( + @Schema(description = "Description A", allOf = [KeyValue::class]) val field_a: KeyValue, + @Schema(description = "Description B", allOf = [KeyValue::class]) val field_b: KeyValue, +) + +@RestController +@RequestMapping("/test") +class TestController { + + @PostMapping("/test") + fun create(@RequestBody some: SomeDTO) { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app14.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app14.json new file mode 100644 index 000000000..75e6323d4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app14.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test/test": { + "post": { + "tags": [ + "test-controller" + ], + "operationId": "create", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SomeDTO" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "KeyValue": { + "required": [ + "key", + "value" + ], + "type": "object", + "description": "Generic description", + "allOf": [ + { + "$ref": "#/components/schemas/KeyValue" + }, + { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + ] + }, + "SomeDTO": { + "required": [ + "field_a", + "field_b" + ], + "type": "object", + "properties": { + "field_a": { + "$ref": "#/components/schemas/KeyValue" + }, + "field_b": { + "$ref": "#/components/schemas/KeyValue" + } + } + } + } + } +} From 9d7f6ae64500c06a3fcb13e24fe47d487b6f8b62 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 2 Jan 2025 22:01:04 +0100 Subject: [PATCH 143/226] Moving to OpenAPI 3.1 as the default implementation for springdoc-openapi. Fixes #2790 --- .../org/springdoc/api/AbstractOpenApiResource.java | 2 ++ .../core/properties/SpringDocConfigProperties.java | 2 +- .../test/org/springdoc/api/AbstractCommonTest.java | 2 ++ .../test/org/springdoc/ui/AbstractCommonTest.java | 2 ++ .../springdoc/api/v30/AbstractSpringDocV30Test.java | 2 ++ .../api/v30/app136/SpringDocApp136Test.java | 2 +- .../api/v30/app193/SpringDocApp193Test.java | 2 +- .../api/v30/app209/SpringDocApp209Test.java | 3 ++- .../springdoc/api/v31/AbstractSpringDocV31Test.java | 1 - .../test/org/springdoc/ui/AbstractCommonTest.java | 2 ++ .../test/org/springdoc/api/AbstractCommonTest.java | 2 +- .../test/org/springdoc/api/AbstractCommonTest.java | 2 +- .../org/springdoc/api/AbstractSpringDocTest.java | 6 ++---- .../test/org/springdoc/api/AbstractCommonTest.java | 2 ++ .../test/org/springdoc/api/AbstractCommonTest.java | 2 ++ .../org/springdoc/api/AbstractSpringDocTest.java | 2 ++ .../org/springdoc/api/AbstractSpringDocTest.java | 2 ++ .../org/springdoc/api/AbstractSpringDocTest.java | 2 ++ .../org/springdoc/api/AbstractSpringDocTest.java | 2 ++ .../org/springdoc/api/AbstractKotlinSpringDocTest.kt | 2 ++ .../springdoc/api/AbstractKotlinSpringDocMVCTest.kt | 2 ++ .../org/springdoc/api/app13/SpringDocApp13Test.kt | 12 ++---------- .../org/springdoc/api/AbstractSpringDocTest.java | 2 ++ 23 files changed, 39 insertions(+), 21 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index ef3643245..820e85e24 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -510,6 +510,8 @@ private void trimIndentOperation(Operation operation) { */ protected void calculateWebhooks(OpenAPI calculatedOpenAPI, Locale locale) { Webhooks[] webhooksAttr = openAPIService.getWebhooks(); + if(ArrayUtils.isEmpty(webhooksAttr)) + return; var webhooks = Arrays.stream(webhooksAttr).map(Webhooks::value).flatMap(Arrays::stream).toArray(Webhook[]::new); Arrays.stream(webhooks).forEach(webhook -> { io.swagger.v3.oas.annotations.Operation apiOperation = webhook.operation(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java index 8365100af..14e486bc7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java @@ -1304,7 +1304,7 @@ public static class ApiDocs { /** * The OpenAPI version. */ - private OpenApiVersion version; + private OpenApiVersion version = OpenApiVersion.OPENAPI_3_1; /** * Gets path. diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractCommonTest.java index d075a1a93..3f94f121c 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractCommonTest.java @@ -11,10 +11,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; @AutoConfigureWebTestClient(timeout = "3600000") @ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractCommonTest { protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractCommonTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractCommonTest.java index abe19f152..c4fa0d6f3 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractCommonTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractCommonTest.java @@ -12,10 +12,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; @AutoConfigureWebTestClient(timeout = "3600000") @ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractCommonTest { protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocV30Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocV30Test.java index f1c8e81af..66bf69b63 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocV30Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocV30Test.java @@ -29,6 +29,7 @@ import test.org.springdoc.api.AbstractCommonTest; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MvcResult; import static org.hamcrest.Matchers.is; @@ -38,6 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest +@TestPropertySource(properties = { "springdoc.api-docs.version=openapi_3_0" }) public abstract class AbstractSpringDocV30Test extends AbstractCommonTest { public static String className; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/SpringDocApp136Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/SpringDocApp136Test.java index 98d481358..eeceb5d61 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/SpringDocApp136Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app136/SpringDocApp136Test.java @@ -52,7 +52,7 @@ /** * Tests deterministic creation of operationIds */ -@SpringBootTest(properties = { SPRINGDOC_CACHE_DISABLED + "=true" }) +@SpringBootTest(properties = { SPRINGDOC_CACHE_DISABLED + "=true", "springdoc.api-docs.version=openapi_3_0" }) public class SpringDocApp136Test extends AbstractCommonTest { @Autowired diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java index 0b967785a..fc02621b3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app193/SpringDocApp193Test.java @@ -39,7 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -@SpringBootTest +@SpringBootTest(properties = { "springdoc.api-docs.version=openapi_3_0" }) public class SpringDocApp193Test extends AbstractCommonTest { @Test diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app209/SpringDocApp209Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app209/SpringDocApp209Test.java index a18f07ac7..49fcaf4ba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app209/SpringDocApp209Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app209/SpringDocApp209Test.java @@ -56,7 +56,8 @@ @SpringBootTest(properties = { "springdoc.pre-loading-enabled=true", - "springdoc.pre-loading-locales=ja" + "springdoc.pre-loading-locales=ja", + "springdoc.api-docs.version=openapi_3_0" }) public class SpringDocApp209Test extends AbstractCommonTest { public static String className; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java index 7c69d37bf..20db130a8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java @@ -39,7 +39,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest -@TestPropertySource(properties = { "springdoc.api-docs.version=openapi_3_1" }) public abstract class AbstractSpringDocV31Test extends AbstractCommonTest { public static String className; diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractCommonTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractCommonTest.java index 6befb7bd9..768ace84f 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractCommonTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/AbstractCommonTest.java @@ -9,10 +9,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MockMvc; @AutoConfigureMockMvc @ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractCommonTest { @Autowired diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java index 14e357531..9100ddb4e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java @@ -20,7 +20,7 @@ @AutoConfigureWebTestClient(timeout = "3600000") @ActiveProfiles("test") -@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" }) +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" , "springdoc.api-docs.version=openapi_3_0" }) public abstract class AbstractCommonTest { protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java index 82d484d9c..3ecba115c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java @@ -13,7 +13,7 @@ @AutoConfigureMockMvc @ActiveProfiles("test") -@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" }) +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" , "springdoc.api-docs.version=openapi_3_0" }) public abstract class AbstractCommonTest { @Autowired diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 63cff6c93..ae5f08e1b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -24,14 +24,13 @@ import java.nio.file.Paths; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springdoc.core.utils.Constants; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; @@ -44,10 +43,9 @@ @ActiveProfiles("test") @SpringBootTest @AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractSpringDocTest { - protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractSpringDocTest.class); - public static String className; @Autowired diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java index d075a1a93..3f94f121c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java @@ -11,10 +11,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; @AutoConfigureWebTestClient(timeout = "3600000") @ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractCommonTest { protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java index 34d647911..7ba22b811 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java @@ -8,10 +8,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MockMvc; @AutoConfigureMockMvc @ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractCommonTest { @Autowired diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java index e7c091b24..3cc8d4828 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java @@ -32,6 +32,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; @@ -44,6 +45,7 @@ @ActiveProfiles("test") @SpringBootTest @AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractSpringDocTest { protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractSpringDocTest.class); diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 08aa39f91..c5a3f253e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -36,6 +36,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; @@ -48,6 +49,7 @@ @ActiveProfiles("test") @SpringBootTest @AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractSpringDocTest { public static String className; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index c14aa7c97..d09755609 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -32,6 +32,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; @@ -47,6 +48,7 @@ @ActiveProfiles("test") @SpringBootTest @AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractSpringDocTest { /** diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index 010552690..549773fb9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.EntityExchangeResult; import org.springframework.test.web.reactive.server.WebTestClient; @@ -38,6 +39,7 @@ @WebFluxTest @ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractSpringDocTest { protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractSpringDocTest.class); diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt index 6e67f62e6..04c85ebfc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt @@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.TestPropertySource import org.springframework.test.web.reactive.server.WebTestClient import java.nio.charset.StandardCharsets import java.nio.file.Files @@ -34,6 +35,7 @@ import java.nio.file.Paths @WebFluxTest @ActiveProfiles("test") @AutoConfigureWebTestClient(timeout = "3600000") +@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_0"]) abstract class AbstractKotlinSpringDocTest { @Autowired diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocMVCTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocMVCTest.kt index 2a0e48a19..129ce3197 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocMVCTest.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocMVCTest.kt @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.TestPropertySource import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.request.MockMvcRequestBuilders import org.springframework.test.web.servlet.result.MockMvcResultMatchers @@ -35,6 +36,7 @@ import java.nio.file.Paths @SpringBootTest @AutoConfigureMockMvc @ActiveProfiles("test") +@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_0"]) abstract class AbstractKotlinSpringDocMVCTest { @Autowired diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt index 0cf4ba3c5..053547d02 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt @@ -21,23 +21,15 @@ package test.org.springdoc.api.app13 import org.springdoc.core.properties.SpringDocConfigProperties import org.springdoc.core.properties.SpringDocConfigProperties.ApiDocs.OpenApiVersion import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.boot.test.context.SpringBootTest import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.ComponentScan -import org.springframework.context.annotation.Configuration +import org.springframework.test.context.TestPropertySource import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - +@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_1"]) class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest() { @SpringBootApplication class DemoApplication { - @Bean - fun springDocConfigProperties():SpringDocConfigProperties{ - val x= SpringDocConfigProperties() - x.apiDocs.version = OpenApiVersion.OPENAPI_3_1 - return x - } } diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java index ca3eec8b9..6bff84da3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java @@ -33,6 +33,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; @@ -45,6 +46,7 @@ @ActiveProfiles("test") @SpringBootTest @AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) public abstract class AbstractSpringDocTest { public static String className; From edbf166fa0b2c77c6fef3b35c46b9720c62931c0 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 3 Jan 2025 13:18:16 +0100 Subject: [PATCH 144/226] Adding workaround for #2804 --- pom.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f7f9ace05..2f2b0efc2 100644 --- a/pom.xml +++ b/pom.xml @@ -65,8 +65,10 @@ 1.13.1 0.9.1 0.15.0 - 4.2.1-SNAPSHOT + 4.2.0 1.4.0 + 2.1.0 + 1.9 @@ -101,6 +103,11 @@ test + + org.springframework.cloud + spring-cloud-function-core + ${spring-cloud-function.version} + org.springframework.cloud spring-cloud-function-web From b1d4377a23351d84e0e74395a2301bfc86f6701d Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 3 Jan 2025 14:35:12 +0100 Subject: [PATCH 145/226] code review --- CHANGELOG.md | 26 +++++++++++++++++++ .../api/AbstractOpenApiResource.java | 4 +-- .../java/org/springdoc/api/ErrorMessage.java | 2 +- .../api/OpenApiResourceNotFoundException.java | 2 +- .../core/annotations/ParameterObject.java | 2 +- .../core/annotations/RouterOperation.java | 2 +- .../core/annotations/RouterOperations.java | 2 +- .../CacheOrGroupedOpenApiCondition.java | 2 +- .../MultipleOpenApiGroupsCondition.java | 2 +- .../MultipleOpenApiSupportCondition.java | 2 +- .../conditions/SpecPropertiesCondition.java | 2 +- .../configuration/SpringDocConfiguration.java | 2 +- .../SpringDocDataRestConfiguration.java | 2 +- ...SpringDocFunctionCatalogConfiguration.java | 2 +- .../SpringDocGroovyConfiguration.java | 2 +- .../SpringDocHateoasConfiguration.java | 2 +- ...ngDocJacksonKotlinModuleConfiguration.java | 2 +- .../SpringDocJavadocConfiguration.java | 2 +- .../SpringDocKotlinConfiguration.kt | 3 +-- .../SpringDocKotlinxConfiguration.java | 2 +- .../SpringDocPageableConfiguration.java | 2 +- .../SpringDocRequiredModule.java | 2 +- .../SpringDocSecurityConfiguration.java | 2 +- .../SpringDocSecurityOAuth2Customizer.java | 2 +- .../SpringDocSecurityOAuth2EndpointUtils.java | 2 +- .../SpringDocSortConfiguration.java | 2 +- .../SpringDocSpecPropertiesConfiguration.java | 2 +- .../SpringDocUIConfiguration.java | 2 +- .../hints/SpringDocDataRestHints.java | 2 +- .../configuration/hints/SpringDocHints.java | 2 +- .../hints/SpringDocSecurityHints.java | 2 +- ...gDocOAuth2AuthorizationServerMetadata.java | 2 +- .../oauth2/SpringDocOAuth2Token.java | 2 +- .../SpringDocOAuth2TokenIntrospection.java | 2 +- ...pringDocOidcClientRegistrationRequest.java | 2 +- ...ringDocOidcClientRegistrationResponse.java | 2 +- .../SpringDocOidcProviderConfiguration.java | 2 +- ...pringdocActuatorBeanFactoryConfigurer.java | 2 +- .../SpringdocBeanFactoryConfigurer.java | 2 +- .../converters/AdditionalModelsConverter.java | 2 +- .../CollectionModelContentConverter.java | 2 +- .../core/converters/ConverterUtils.java | 2 +- .../core/converters/FileSupportConverter.java | 2 +- .../converters/JavaTypeToIgnoreConverter.java | 2 +- .../converters/ModelConverterRegistrar.java | 2 +- .../core/converters/PageOpenAPIConverter.java | 2 +- .../converters/PageableOpenAPIConverter.java | 2 +- .../converters/PolymorphicModelConverter.java | 4 +-- .../PropertyCustomizingConverter.java | 2 +- .../RepresentationModelLinksOASMixin.java | 2 +- .../converters/ResponseSupportConverter.java | 2 +- .../SchemaPropertyDeprecatingConverter.java | 2 +- .../core/converters/SortOpenAPIConverter.java | 2 +- .../converters/WebFluxSupportConverter.java | 2 +- .../converters/models/DefaultPageable.java | 2 +- .../converters/models/MonetaryAmount.java | 2 +- .../core/converters/models/Pageable.java | 2 +- .../models/PageableAsQueryParam.java | 2 +- .../core/converters/models/Sort.java | 2 +- .../converters/models/SortAsQueryParam.java | 26 +++++++++++++++++++ .../core/converters/models/SortObject.java | 2 +- .../ActuatorOpenApiCustomizer.java | 2 +- .../ActuatorOperationCustomizer.java | 2 +- ...stDelegatingMethodParameterCustomizer.java | 2 +- .../DataRestRouterOperationCustomizer.java | 2 +- .../DelegatingMethodParameterCustomizer.java | 2 +- .../customizers/GlobalOpenApiCustomizer.java | 2 +- .../GlobalOperationCustomizer.java | 2 +- .../JavadocPropertyCustomizer.java | 2 +- .../KotlinDeprecatedPropertyCustomizer.kt | 2 +- .../customizers/OpenApiBuilderCustomizer.java | 2 +- .../core/customizers/OpenApiCustomizer.java | 2 +- .../OpenApiHateoasLinksCustomizer.java | 2 +- .../customizers/OpenApiLocaleCustomizer.java | 2 +- .../core/customizers/OperationCustomizer.java | 2 +- .../customizers/OperationIdCustomizer.java | 2 +- .../core/customizers/ParameterCustomizer.java | 2 +- ...rameterObjectNamingStrategyCustomizer.java | 2 +- .../core/customizers/PropertyCustomizer.java | 2 +- .../QuerydslPredicateOperationCustomizer.java | 2 +- .../RouterOperationCustomizer.java | 2 +- .../customizers/ServerBaseUrlCustomizer.java | 2 +- .../customizers/SpecPropertiesCustomizer.java | 2 +- .../customizers/SpringDocCustomizers.java | 2 +- .../springdoc/core/data/ControllerType.java | 2 +- .../core/data/DataRestOperationService.java | 2 +- .../core/data/DataRestRepository.java | 2 +- .../core/data/DataRestRequestService.java | 2 +- .../core/data/DataRestResponseService.java | 2 +- .../data/DataRestRouterOperationService.java | 2 +- .../core/data/DataRestTagsService.java | 2 +- .../SpringDocParameterNameDiscoverer.java | 2 +- .../extractor/DelegatingMethodParameter.java | 8 +++--- .../MethodParameterPojoExtractor.java | 4 +-- .../filters/GlobalOpenApiMethodFilter.java | 2 +- .../core/filters/OpenApiMethodFilter.java | 2 +- .../fn/AbstractRouterFunctionVisitor.java | 2 +- .../fn/AbstractSpringdocRouteBuilder.java | 2 +- .../springdoc/core/fn/RouterFunctionData.java | 2 +- .../springdoc/core/fn/RouterOperation.java | 2 +- .../core/fn/builders/apiresponse/Builder.java | 2 +- .../core/fn/builders/arrayschema/Builder.java | 2 +- .../core/fn/builders/content/Builder.java | 2 +- .../discriminatormapping/Builder.java | 2 +- .../core/fn/builders/encoding/Builder.java | 2 +- .../fn/builders/exampleobject/Builder.java | 2 +- .../core/fn/builders/extension/Builder.java | 2 +- .../builders/extensionproperty/Builder.java | 2 +- .../externaldocumentation/Builder.java | 2 +- .../core/fn/builders/header/Builder.java | 2 +- .../core/fn/builders/link/Builder.java | 2 +- .../fn/builders/linkparameter/Builder.java | 2 +- .../core/fn/builders/operation/Builder.java | 2 +- .../core/fn/builders/parameter/Builder.java | 2 +- .../core/fn/builders/requestbody/Builder.java | 2 +- .../core/fn/builders/schema/Builder.java | 2 +- .../builders/securityrequirement/Builder.java | 2 +- .../core/fn/builders/server/Builder.java | 2 +- .../fn/builders/servervariable/Builder.java | 2 +- .../core/mixins/SortedOpenAPIMixin.java | 2 +- .../core/mixins/SortedOpenAPIMixin31.java | 2 +- .../core/mixins/SortedSchemaMixin.java | 2 +- .../core/mixins/SortedSchemaMixin31.java | 2 +- .../core/models/ControllerAdviceInfo.java | 2 +- .../springdoc/core/models/GroupedOpenApi.java | 2 +- .../core/models/MethodAdviceInfo.java | 2 +- .../core/models/MethodAttributes.java | 2 +- .../springdoc/core/models/ParameterId.java | 2 +- .../springdoc/core/models/ParameterInfo.java | 2 +- .../core/models/RequestBodyInfo.java | 2 +- .../AbstractSwaggerUiConfigProperties.java | 2 +- .../properties/SpringDocConfigProperties.java | 2 +- .../properties/SwaggerUiConfigParameters.java | 2 +- .../properties/SwaggerUiConfigProperties.java | 2 +- .../properties/SwaggerUiOAuthProperties.java | 2 +- .../core/providers/ActuatorProvider.java | 2 +- .../core/providers/CloudFunctionProvider.java | 2 +- .../core/providers/DataRestHalProvider.java | 2 +- .../core/providers/HateoasHalProvider.java | 2 +- .../core/providers/JavadocProvider.java | 2 +- .../core/providers/ObjectMapperProvider.java | 2 +- .../RepositoryRestConfigurationProvider.java | 2 +- .../RepositoryRestResourceProvider.java | 2 +- .../providers/RouterFunctionProvider.java | 2 +- .../providers/SecurityOAuth2Provider.java | 2 +- .../SpringCloudFunctionProvider.java | 2 +- .../SpringDataWebPropertiesProvider.java | 2 +- .../providers/SpringDocJavadocProvider.java | 2 +- .../core/providers/SpringDocProviders.java | 2 +- .../SpringRepositoryRestResourceProvider.java | 2 +- .../core/providers/SpringWebProvider.java | 2 +- .../WebConversionServiceProvider.java | 2 +- .../core/service/AbstractRequestService.java | 4 +-- .../core/service/GenericParameterService.java | 2 +- .../core/service/GenericResponseService.java | 2 +- .../core/service/OpenAPIService.java | 2 +- .../core/service/OperationService.java | 2 +- .../core/service/RequestBodyService.java | 2 +- .../core/service/SecuritySchemePair.java | 2 +- .../core/service/SecurityService.java | 2 +- .../org/springdoc/core/utils/Constants.java | 2 +- .../org/springdoc/core/utils/EntityInfo.java | 2 +- .../core/utils/PropertyResolverUtils.java | 2 +- .../core/utils/SpringDocAnnotationsUtils.java | 2 +- .../core/utils/SpringDocDataRestUtils.java | 2 +- .../core/utils/SpringDocPropertiesUtils.java | 2 +- .../springdoc/core/utils/SpringDocUtils.java | 2 +- .../ui/AbstractSwaggerIndexTransformer.java | 2 +- .../springdoc/ui/AbstractSwaggerWelcome.java | 2 +- .../springdoc/ui/SpringDocUIException.java | 2 +- .../ui/SwaggerResourceResolverUtils.java | 2 +- .../api/MultipleOpenApiActuatorResource.java | 2 +- .../webflux/api/MultipleOpenApiResource.java | 2 +- .../api/MultipleOpenApiWebFluxResource.java | 2 +- .../webflux/api/OpenApiActuatorResource.java | 2 +- .../webflux/api/OpenApiResource.java | 2 +- .../webflux/api/OpenApiWebfluxResource.java | 2 +- .../MultipleOpenApiSupportConfiguration.java | 2 +- .../SpringDocWebFluxConfiguration.java | 2 +- .../core/fn/SpringdocRouteBuilder.java | 2 +- .../providers/ActuatorWebFluxProvider.java | 2 +- .../core/providers/SpringWebFluxProvider.java | 2 +- .../webflux/core/service/RequestService.java | 2 +- .../core/visitor/RouterFunctionVisitor.java | 2 +- .../springdoc/webflux/ui/SwaggerConfig.java | 2 +- .../webflux/ui/SwaggerConfigResource.java | 2 +- .../ui/SwaggerIndexPageTransformer.java | 2 +- .../webflux/ui/SwaggerIndexTransformer.java | 2 +- .../webflux/ui/SwaggerResourceResolver.java | 2 +- .../springdoc/webflux/ui/SwaggerUiHome.java | 2 +- .../webflux/ui/SwaggerWebFluxConfigurer.java | 2 +- .../webflux/ui/SwaggerWelcomeActuator.java | 2 +- .../webflux/ui/SwaggerWelcomeCommon.java | 2 +- .../webflux/ui/SwaggerWelcomeWebFlux.java | 2 +- .../api/MultipleOpenApiActuatorResource.java | 2 +- .../webmvc/api/MultipleOpenApiResource.java | 2 +- .../api/MultipleOpenApiWebMvcResource.java | 2 +- .../webmvc/api/OpenApiActuatorResource.java | 2 +- .../springdoc/webmvc/api/OpenApiResource.java | 2 +- .../webmvc/api/OpenApiWebMvcResource.java | 2 +- .../MultipleOpenApiSupportConfiguration.java | 2 +- .../SpringDocWebMvcConfiguration.java | 2 +- .../webmvc/core/fn/SpringdocRouteBuilder.java | 2 +- .../providers/ActuatorWebMvcProvider.java | 2 +- .../RouterFunctionWebMvcProvider.java | 2 +- .../core/providers/SpringWebMvcProvider.java | 2 +- .../webmvc/core/service/RequestService.java | 2 +- .../api/v30/app236/HelloController.java | 1 + .../api/v31/AbstractSpringDocV31Test.java | 1 - .../springdoc/webmvc/ui/SwaggerConfig.java | 2 +- .../webmvc/ui/SwaggerConfigResource.java | 2 +- .../ui/SwaggerIndexPageTransformer.java | 2 +- .../webmvc/ui/SwaggerIndexTransformer.java | 2 +- .../webmvc/ui/SwaggerResourceResolver.java | 2 +- .../springdoc/webmvc/ui/SwaggerUiHome.java | 2 +- .../webmvc/ui/SwaggerWebMvcConfigurer.java | 2 +- .../webmvc/ui/SwaggerWelcomeActuator.java | 2 +- .../webmvc/ui/SwaggerWelcomeCommon.java | 2 +- .../webmvc/ui/SwaggerWelcomeWebMvc.java | 2 +- .../springdoc/api/app3/HelloController.java | 2 +- .../api/app11/SystemStatusController.kt | 2 -- .../springdoc/api/app13/SpringDocApp13Test.kt | 3 --- .../springdoc/api/app14/SpringDocApp14Test.kt | 1 - 223 files changed, 276 insertions(+), 231 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f0a9c514..5b13aaf1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.7.1] - 2025-01-03 + +### Added +- #2790 - Moving to OpenAPI 3.1 as the default implementation for springdoc-openapi +- #2817 - Obey annotations when flattening ParameterObject fields +- #2826 - Make it possible to mark parameters with @RequestParam annotation to be sent in form instead of query. +- #2822 - Support returning null in ParameterCustomizer +- #2830 - Add support for deprecated fields. +- #2780 - Add Security Schema by AutoConfigure + +### Changed +- Upgrade spring-boot to 3.4.1 +- Upgrade spring-cloud-function to 4.2.0 +- Upgrade swagger-core to 2.2.27 + +### Fixed +- #2804 - Stable release 2.7.0 depends on Spring Cloud Milestone 4.2.0-M1 +- #2828 - Required a bean of type 'org.springframework.data.rest.webmvc.mapping.Associations' that could not be found. +- #2823 - Capturing pattern in identical paths only renders the path element of one method +- #2817 - Automatically add required if a field is @notNull or @NotBlank. +- #2814 - An unresolvable circular reference with management.endpoint.gateway.enabled=true. +- #2798 - Object schema generated for Unit Kotlin type. +- #2797 - Removing operationId via customizer does not work anymore. +- #2833 - Resolve infinite recursion and add example test with OpenAPI v3.1 +- #2827 - Ignoring @Parameter(required = false) + ## [2.7.0] - 2024-23-11 ### Added diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 820e85e24..ea5046bba 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.api; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java index 034d96972..7a076bfd0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/ErrorMessage.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java index cff51003c..3dd2e7e39 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/OpenApiResourceNotFoundException.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java index 6693bb7c6..116b7f231 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/ParameterObject.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java index 0a8540d50..79f31ca43 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperation.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java index f2241a337..a3495cb7f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/annotations/RouterOperations.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java index b4d95e0ff..ae8da1105 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/CacheOrGroupedOpenApiCondition.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java index 27123ae9a..b7246fc9a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiGroupsCondition.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java index 77239a9f0..3c050d0cd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/MultipleOpenApiSupportCondition.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/SpecPropertiesCondition.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/SpecPropertiesCondition.java index def8a40d9..b964da9ec 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/SpecPropertiesCondition.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/conditions/SpecPropertiesCondition.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 15dcd9014..d69abcb72 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java index ef382aa25..f7d17aefb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocDataRestConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java index 7db8ef5d0..e50f4b00f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocFunctionCatalogConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java index c98ac1227..a5d19c91b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocGroovyConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java index f9ab95450..f84cdbffd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java index bffa81467..5316593b0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJacksonKotlinModuleConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java index 9d94a0761..981878603 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocJavadocConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt index 457e5ed9c..82cd690a5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ import io.swagger.v3.oas.annotations.Parameter import org.springdoc.core.customizers.KotlinDeprecatedPropertyCustomizer import org.springdoc.core.customizers.ParameterCustomizer import org.springdoc.core.providers.ObjectMapperProvider -import org.springdoc.core.service.AbstractRequestService.addRequestWrapperToIgnore import org.springdoc.core.utils.Constants import org.springdoc.core.utils.SpringDocUtils import org.springframework.boot.autoconfigure.condition.ConditionalOnBean diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java index 62002637a..ca51110ad 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinxConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java index 7f1e351de..d77d5dbc0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocPageableConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java index 64258a469..1c2380106 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocRequiredModule.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java index ddbc478da..051b2b20e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java index 026287bfa..94b933eca 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2EndpointUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2EndpointUtils.java index dd7b1ba5f..201db0de2 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2EndpointUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2EndpointUtils.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java index f1f79de3c..ff751eb5e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSortConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java index 99136c420..5e87fb67e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSpecPropertiesConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java index d54cb124c..e4b4babe2 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java index e15d4c5ff..27538ccaf 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocDataRestHints.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java index 55428fa3d..ab3661b17 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java index 9bd3d02c5..0af857d8e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocSecurityHints.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2AuthorizationServerMetadata.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2AuthorizationServerMetadata.java index ad57c68a1..6ffccf630 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2AuthorizationServerMetadata.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2AuthorizationServerMetadata.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2Token.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2Token.java index 369fafc39..31667ef27 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2Token.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2Token.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2TokenIntrospection.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2TokenIntrospection.java index 13b34a0b7..cc127ce55 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2TokenIntrospection.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOAuth2TokenIntrospection.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationRequest.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationRequest.java index 97c0c327d..1894545e8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationRequest.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationRequest.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationResponse.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationResponse.java index ecd9d852b..365f08a2c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationResponse.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcClientRegistrationResponse.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcProviderConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcProviderConfiguration.java index 9cc97461a..55d9d7313 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcProviderConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/oauth2/SpringDocOidcProviderConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java index 6e5294201..1adedafcd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocActuatorBeanFactoryConfigurer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java index 845b389f3..816f407fb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configurer/SpringdocBeanFactoryConfigurer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java index 1e8b673dc..a3fd6ab3b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java index 72adf3a81..08e8e6e52 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/CollectionModelContentConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java index 247bc235e..b49a02e82 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ConverterUtils.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java index 8d5fce596..547fd4c17 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/FileSupportConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java index b40659070..a8457b378 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/JavaTypeToIgnoreConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java index 0cc94cb40..8a363c93b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java index 2799e5077..281c6efb3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java index 2faf74dd0..0e2864c88 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 31ece6e16..338db8cde 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.converters; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java index 188f97537..85fb1e30c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PropertyCustomizingConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java index cfdc65127..0d0fe462c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java index b820589ef..118152a3c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ResponseSupportConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java index d08f6c7dd..06340b00a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java index 5dc533013..875bba99c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java index 434d8ff02..62f04c19e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/WebFluxSupportConverter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java index fa59c38b7..2d0afe986 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/DefaultPageable.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java index 2b63c3a14..a37c4c33c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/MonetaryAmount.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java index cd5d5b601..b469e88a3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Pageable.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java index ebd89348e..6bad26ab1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/PageableAsQueryParam.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java index 16ea63f3b..15055afc8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/Sort.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortAsQueryParam.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortAsQueryParam.java index b1eaf3dfd..56e3b62bd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortAsQueryParam.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortAsQueryParam.java @@ -1,3 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + package org.springdoc.core.converters.models; import java.lang.annotation.ElementType; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java index 131adef31..f59d862eb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/models/SortObject.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java index 27d85889a..5810af1da 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java index 8843ac3b5..73eed5e8b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java index 6aea22f12..8a8ef92dc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestRouterOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestRouterOperationCustomizer.java index 51a79aaec..a31015f4e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestRouterOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestRouterOperationCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java index 0c1cc5cb4..d6475c4c4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DelegatingMethodParameterCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java index a095e05f9..a2a2fc631 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOpenApiCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java index ed9ab472c..22dc998ec 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java index fd76c76a4..db9cf5141 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/JavadocPropertyCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/KotlinDeprecatedPropertyCustomizer.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/KotlinDeprecatedPropertyCustomizer.kt index 23889b038..3e397242d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/KotlinDeprecatedPropertyCustomizer.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/KotlinDeprecatedPropertyCustomizer.kt @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java index b1b673a25..4631fbd0b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiBuilderCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java index 122a34d42..f54d294c4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java index bb77dab38..028725dcd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java index 4ee54f1fd..af86fc0ea 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiLocaleCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java index d0016c9ef..518802606 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java index 4a446a246..dc718aa5e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OperationIdCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java index 61fc363cc..084ae2cc6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java index 464dcef43..5a7875474 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ParameterObjectNamingStrategyCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java index ebbb9b3b5..9f500c4d7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/PropertyCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java index c06aee89d..dd6fc4e4d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/RouterOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/RouterOperationCustomizer.java index 196e2ef7d..42b98a7f5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/RouterOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/RouterOperationCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java index 229427559..985a4ffba 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ServerBaseUrlCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java index 1a7ba9877..98ed3883c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpecPropertiesCustomizer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java index 286c331cc..577cf39ed 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java index c23d148ce..adfc18cb4 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/ControllerType.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java index 71f93b67b..b75ce3fa3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestOperationService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java index 87874be1e..305fe969e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRepository.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java index bceba72dd..6fad33712 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRequestService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java index 7f5d7af35..46412ad2e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestResponseService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java index 85cd00e74..bd640ad95 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java index f6e1797fc..faafd1976 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestTagsService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/discoverer/SpringDocParameterNameDiscoverer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/discoverer/SpringDocParameterNameDiscoverer.java index 10344c6d9..0bef332a3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/discoverer/SpringDocParameterNameDiscoverer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/discoverer/SpringDocParameterNameDiscoverer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java index bfd4b031b..11b39e482 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/DelegatingMethodParameter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.extractor; @@ -178,8 +178,8 @@ public static MethodParameter changeContainingClass(MethodParameter methodParame @Override @NonNull public Annotation[] getParameterAnnotations() { - Annotation[] methodAnnotations = ArrayUtils.addAll(delegate.getParameterAnnotations(), this.methodAnnotations); - return ArrayUtils.addAll(methodAnnotations, additionalParameterAnnotations); + Annotation[] allMethodAnnotations = ArrayUtils.addAll(delegate.getParameterAnnotations(), this.methodAnnotations); + return ArrayUtils.addAll(allMethodAnnotations, additionalParameterAnnotations); } @Override diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index 7012d7552..1d51a5b4e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.extractor; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java index df86a27de..f47daca2b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/GlobalOpenApiMethodFilter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java index edbccd7de..bf6b24124 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/filters/OpenApiMethodFilter.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java index 5f10fc44b..6064b7b1f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractRouterFunctionVisitor.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java index a19283c2a..cfd641ac1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/AbstractSpringdocRouteBuilder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java index fb9e03425..1018af8c8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterFunctionData.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java index 0d70c08ee..94da9fe60 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/RouterOperation.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java index 7a8c8f8c4..782d1df06 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/apiresponse/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java index 278b276d4..0007e66e2 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/arrayschema/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java index 92ac322a1..7c3a863f7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/content/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java index 0944436e1..f30e8a138 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/discriminatormapping/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java index 04f94375f..2e2da146f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/encoding/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java index 3d41d0cda..d0bf83e9a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/exampleobject/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java index be3bd437d..2d5860599 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extension/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java index 28365ceb9..4c198043e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/extensionproperty/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java index 96aa0d096..aa6624646 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/externaldocumentation/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java index 86950dcd7..8f57a1ded 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/header/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java index dc2d9d3ae..964ccf9b2 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/link/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java index c59fdb181..62588982c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/linkparameter/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java index d17b65d74..35a157dcf 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/operation/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java index 780e28d6f..8c02e861e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java index 1dad234d3..8f1ccb2c3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/requestbody/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java index a326d22b5..fe7bbaff0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java index 823f49b88..3aa093f5c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/securityrequirement/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java index ae981c420..bea8eb511 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/server/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java index ae54dc2bd..f5a975613 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/servervariable/Builder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java index a9e8bd3cf..d1200600b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java index d1f9392f3..bdc8dd369 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java index 38f3aba05..9459b2e96 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java index f7775f55a..55595e81c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java index 3008aa98a..e31eabec8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ControllerAdviceInfo.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java index 1fce141de..137ba3704 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/GroupedOpenApi.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAdviceInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAdviceInfo.java index 78211b54a..4da609961 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAdviceInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAdviceInfo.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java index 7fa1e2130..bbe7666ed 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/MethodAttributes.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java index 132b1c158..e541d8b4d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterId.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java index ad4451825..158198bed 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/ParameterInfo.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java index ee1b2f763..b5130e395 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/models/RequestBodyInfo.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java index b9b64f549..ce857ea4e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/AbstractSwaggerUiConfigProperties.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java index 14e486bc7..ba642ed81 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java index f25c1ccc1..dab9a56fb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigParameters.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java index 6d93fdd9b..1be9ba363 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java index a4aae30de..68ae492b5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiOAuthProperties.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java index 98ac57385..a4ad04a9b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ActuatorProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java index 2ca549581..1c2f43f74 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/CloudFunctionProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java index 42d8f837d..874c9e34e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/DataRestHalProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java index 19c499e74..820b111c5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/HateoasHalProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java index f878d4ed7..3a85fb940 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java index a1284006f..f5823daf3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java index 033ff14f4..c51746fff 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestConfigurationProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java index edd93cc95..23fbddf1a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RepositoryRestResourceProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java index 89597e8c3..ab338a25f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/RouterFunctionProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java index 1598d7124..284685dbf 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SecurityOAuth2Provider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java index e9d56c9a0..c729384c0 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringCloudFunctionProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java index 6ac657382..6892fed96 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDataWebPropertiesProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java index a781b5b0e..dc0fa7dd7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java index e9a05117f..c386fb932 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocProviders.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java index 7975b21dd..e1f84ac17 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringRepositoryRestResourceProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java index 8def461bb..0c392d78c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringWebProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java index 81de30b7f..e572422c8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/WebConversionServiceProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 81d6b7357..442344d87 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.service; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index 40ddbe55a..f605afa41 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index 7d8994c3c..ed87e8947 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java index fef081a29..858238d6c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java index 625fbe490..f4728a818 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java index 4f4b4fea6..ee91bc01b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/RequestBodyService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java index a4be06409..fa98e480c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecuritySchemePair.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java index b80c7b555..d664bbfd7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/SecurityService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java index 117f61227..e8dbf962e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java index 2eb485792..77b2fb58f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/EntityInfo.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java index fc0a580a8..3178f1f6f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java index a22cabc44..faed6bba9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java index 193ef097a..9306a6c3f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java index ac40d0f56..a1b4a40c3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocPropertiesUtils.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java index d5a793f77..a41acc816 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java index 4f7e3cf32..62a346ef3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java index da2f279d3..4a4ff15bc 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/AbstractSwaggerWelcome.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java index 9472d387d..78c5ec3c1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SpringDocUIException.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java index 41e85934c..92dab2d81 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/ui/SwaggerResourceResolverUtils.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java index 73592319c..b7237f0b5 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiActuatorResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java index fb9edd391..6606e1d19 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java index b73ace89a..7723dca71 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/MultipleOpenApiWebFluxResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java index 7bb6230ab..715cb0c90 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java index 8a2ab23f7..da2e12e21 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java index 6a5410f39..a25f33ab8 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiWebfluxResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java index b5133bb62..f9331d49d 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/MultipleOpenApiSupportConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java index c1220943e..49bee0990 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java index 118a443d3..46259db45 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/fn/SpringdocRouteBuilder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java index 786594527..5e03f9451 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/ActuatorWebFluxProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java index 564ce5bc3..2c2bd5bd1 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java index 796d6ef29..5a293e578 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/service/RequestService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java index 995bba1e6..57a417028 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/visitor/RouterFunctionVisitor.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java index 5c1c4d734..cbabe6642 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java index 486a483c8..8db596784 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfigResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java index bb8c54171..e5776ca32 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java index eaa4df112..25fd1c739 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexTransformer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java index 7e9ee7507..d5ccc0b34 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerResourceResolver.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java index 343355c91..0c48b2c2b 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerUiHome.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java index 9dd9e675d..eefa9f798 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java index af191383d..e3f71dcd3 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java index bf8d0defb..a7e4d1d8b 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java index 5ad06aa28..bcc3a0119 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java index 8a4dc6203..637d47a93 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiActuatorResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java index 3c6f44a95..647a6d75c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java index 8b3d559b8..097872c63 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/MultipleOpenApiWebMvcResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java index 7a0d08c38..32291d816 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiActuatorResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java index 20d040628..a1fcf1e16 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java index b6dae47d3..de359f0df 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiWebMvcResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java index fd227250a..0e9c5310b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/MultipleOpenApiSupportConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java index bafc6ebb3..2df2a480c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/configuration/SpringDocWebMvcConfiguration.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java index fbdd6c86f..e9b058c06 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/fn/SpringdocRouteBuilder.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java index 58345a83d..d42495402 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/ActuatorWebMvcProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java index 2cda7a700..618b17388 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/RouterFunctionWebMvcProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java index c4eb5b441..e64e17e4d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java index c9fe37d7c..9feb94fc8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/service/RequestService.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/HelloController.java index 958184983..9c822d971 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app236/HelloController.java @@ -3,6 +3,7 @@ import jakarta.validation.Valid; import org.springdoc.core.annotations.ParameterObject; + import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java index 20db130a8..1c3f0ffca 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java @@ -29,7 +29,6 @@ import test.org.springdoc.api.AbstractCommonTest; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.servlet.MvcResult; import static org.hamcrest.Matchers.is; diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java index 00985a5ff..8d5eb953c 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java index b4a84c1ce..fb442976b 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfigResource.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java index bc328d551..18355a4fd 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java index 442aaf01c..1463a8f04 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexTransformer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java index 2135654ea..0be64bcb5 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerResourceResolver.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java index c17c55fe9..e7f0bc825 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerUiHome.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java index 7fb695971..1399e0857 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java index 567f385a0..769911e61 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeActuator.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java index a417ffa39..f202d6c5d 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java index e6aa41c6a..00f485938 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java @@ -4,7 +4,7 @@ * * * * * * * * * * * * - * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * Copyright 2019-2025 the original author or authors. * * * * * * * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * * * * * you may not use this file except in compliance with the License. diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java index fa4e73631..d49db78f1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java @@ -19,8 +19,8 @@ package test.org.springdoc.api.app3; import org.springdoc.core.converters.models.PageableAsQueryParam; - import org.springdoc.core.converters.models.SortAsQueryParam; + import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt index b67d61cec..f407aa069 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt @@ -23,8 +23,6 @@ import kotlinx.coroutines.reactor.mono import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController -import kotlin.reflect.full.findAnnotation -import kotlin.reflect.full.memberProperties enum class SystemStatus(val status: String) { OK("OK") diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt index 053547d02..13c893550 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt @@ -18,10 +18,7 @@ package test.org.springdoc.api.app13 -import org.springdoc.core.properties.SpringDocConfigProperties -import org.springdoc.core.properties.SpringDocConfigProperties.ApiDocs.OpenApiVersion import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.Bean import org.springframework.test.context.TestPropertySource import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt index 9d7d5e471..967f289c9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt @@ -19,7 +19,6 @@ package test.org.springdoc.api.app14 import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest class SpringDocApp14Test : AbstractKotlinSpringDocMVCTest() { From d32785e26863588e65e2bd6c76a16813ced058a4 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 3 Jan 2025 22:09:03 +0100 Subject: [PATCH 146/226] Adding more tests for v3.1 --- pom.xml | 1 + .../api/v31/app100/HelloController.java | 44 ++ .../springdoc/api/v31/app100/PersonDTO.java | 69 ++ .../api/v31/app100/SpringDocApp100Test.java | 37 ++ .../api/v31/app101/HelloController.java | 47 ++ .../springdoc/api/v31/app101/HelloDTO.java | 45 ++ .../api/v31/app101/SpringDocApp101Test.java | 39 ++ .../v31/app102/InheritedRequestParams.java | 42 ++ .../api/v31/app102/RequestParams.java | 148 +++++ .../api/v31/app102/SpringDocApp102Test.java | 34 + .../api/v31/app102/TestController.java | 39 ++ .../springdoc/api/v31/app103/ExampleBody.java | 47 ++ .../api/v31/app103/HelloController.java | 57 ++ .../api/v31/app103/SpringDocApp103Test.java | 34 + .../api/v31/app104/CrudController.java | 55 ++ .../org/springdoc/api/v31/app104/Design.java | 28 + .../api/v31/app104/DesignController.java | 38 ++ .../springdoc/api/v31/app104/HavingPK.java | 28 + .../api/v31/app104/SpringDocApp104Test.java | 34 + .../api/v31/app105/SpringDocApp105Test.java | 108 +++ .../springdoc/api/v31/app105/api/ApiUtil.java | 52 ++ .../v31/app105/api/ExceptionTranslator.java | 55 ++ .../api/v31/app105/api/HomeController.java | 48 ++ .../api/v31/app105/api/pet/PetApi.java | 165 +++++ .../v31/app105/api/pet/PetApiController.java | 50 ++ .../v31/app105/api/pet/PetApiDelegate.java | 147 +++++ .../app105/api/pet/PetApiDelegateImpl.java | 33 + .../api/v31/app105/api/store/StoreApi.java | 110 ++++ .../app105/api/store/StoreApiController.java | 50 ++ .../app105/api/store/StoreApiDelegate.java | 99 +++ .../api/store/StoreApiDelegateImpl.java | 33 + .../api/v31/app105/api/user/UserApi.java | 138 ++++ .../app105/api/user/UserApiController.java | 50 ++ .../v31/app105/api/user/UserApiDelegate.java | 128 ++++ .../app105/api/user/UserApiDelegateImpl.java | 33 + .../springdoc/api/v31/app105/model/Body.java | 103 +++ .../springdoc/api/v31/app105/model/Body1.java | 105 +++ .../api/v31/app105/model/Category.java | 97 +++ .../v31/app105/model/ModelApiResponse.java | 120 ++++ .../springdoc/api/v31/app105/model/Order.java | 232 +++++++ .../springdoc/api/v31/app105/model/Pet.java | 246 +++++++ .../springdoc/api/v31/app105/model/Tag.java | 97 +++ .../springdoc/api/v31/app105/model/User.java | 238 +++++++ .../api/v31/app106/HelloController.java | 55 ++ .../api/v31/app106/SpringDocApp106Test.java | 34 + .../api/v31/app107/HelloController.java | 60 ++ .../api/v31/app107/SpringDocApp107Test.java | 34 + .../api/v31/app108/ActionResult.java | 88 +++ .../api/v31/app108/HelloController.java | 38 ++ .../api/v31/app108/SpringDocApp108Test.java | 34 + .../api/v31/app109/HelloController.java | 49 ++ .../api/v31/app109/SpringDocApp109Test.java | 34 + .../api/v31/app11/HelloController.java | 54 ++ .../api/v31/app11/SpringDocApp11Test.java | 36 + .../api/v31/app110/ErrorMessage.java | 58 ++ .../v31/app110/GlobalControllerAdvice.java | 151 +++++ .../org/springdoc/api/v31/app110/Person.java | 116 ++++ .../api/v31/app110/PersonController.java | 76 +++ .../api/v31/app110/PersonController2.java | 75 +++ .../org/springdoc/api/v31/app110/Problem.java | 59 ++ .../api/v31/app110/SpringDocApp110Test.java | 57 ++ .../api/v31/app111/ErrorMessage.java | 58 ++ .../v31/app111/GlobalControllerAdvice.java | 151 +++++ .../org/springdoc/api/v31/app111/Person.java | 116 ++++ .../api/v31/app111/PersonController.java | 75 +++ .../api/v31/app111/PersonController2.java | 75 +++ .../org/springdoc/api/v31/app111/Problem.java | 59 ++ .../api/v31/app111/SpringDocApp111Test.java | 56 ++ .../api/v31/app112/ErrorMessage.java | 58 ++ .../v31/app112/GlobalControllerAdvice.java | 151 +++++ .../org/springdoc/api/v31/app112/Person.java | 116 ++++ .../api/v31/app112/PersonController.java | 75 +++ .../org/springdoc/api/v31/app112/Problem.java | 59 ++ .../api/v31/app112/SpringDocApp112Test.java | 56 ++ .../v31/app112/sample/PersonController2.java | 77 +++ .../api/v31/app113/HelloController.java | 47 ++ .../api/v31/app113/SpringDocApp113Test.java | 36 + .../api/v31/app114/HelloController.java | 49 ++ .../api/v31/app114/SpringDocApp114Test.java | 47 ++ .../api/v31/app115/HelloController.java | 43 ++ .../app115/JavaTimeOperationCustomizer.java | 56 ++ .../api/v31/app115/SpringDocApp115Test.java | 37 ++ .../api/v31/app116/FooErrorHandler.java | 39 ++ .../api/v31/app116/HelloController.java | 47 ++ .../api/v31/app116/SpringDocApp116Test.java | 37 ++ .../api/v31/app117/HelloApplication.java | 180 +++++ .../api/v31/app117/SpringDocApp117Test.java | 36 + .../api/v31/app118/AbstractParent.java | 71 ++ .../api/v31/app118/ConcreteParent.java | 71 ++ .../springdoc/api/v31/app118/Controller.java | 68 ++ .../api/v31/app118/SpringDocApp118Test.java | 36 + .../api/v31/app119/HelloController.java | 57 ++ .../springdoc/api/v31/app119/JsonRequest.java | 38 ++ .../api/v31/app119/SpringDocApp119Test.java | 36 + .../api/v31/app12/HelloController.java | 45 ++ .../api/v31/app12/SpringDocApp12Test.java | 35 + .../springdoc/api/v31/app120/AccountId.java | 56 ++ .../v31/app120/MetaAnnotationController.java | 168 +++++ .../api/v31/app120/SpringDocApp120Test.java | 38 ++ .../v31/app121/InheritedRequestParams.java | 43 ++ .../api/v31/app121/RequestParams.java | 143 ++++ .../api/v31/app121/SpringDocApp121Test.java | 38 ++ .../api/v31/app121/TestController.java | 40 ++ .../api/v31/app122/BaseController.java | 42 ++ .../springdoc/api/v31/app122/BaseObject.java | 33 + .../springdoc/api/v31/app122/CustomerDto.java | 33 + .../api/v31/app122/FirstController.java | 35 + .../api/v31/app122/SpringDocApp122Test.java | 38 ++ .../org/springdoc/api/v31/app122/Wrapper.java | 35 + .../api/v31/app123/HelloController.java | 42 ++ .../api/v31/app123/MyExceptionHandler.java | 50 ++ .../api/v31/app123/SpringDocApp123Test.java | 38 ++ .../api/v31/app124/HelloController.java | 54 ++ .../api/v31/app124/MyExceptionHandler.java | 40 ++ .../api/v31/app124/SpringDocApp124Test.java | 38 ++ .../api/v31/app126/HelloController.java | 65 ++ .../org/springdoc/api/v31/app126/Problem.java | 97 +++ ...SecurityProblemResponsesConfiguration.java | 83 +++ .../api/v31/app126/SpringDocApp126Test.java | 59 ++ .../api/v31/app127/AbstractObject.java | 56 ++ .../api/v31/app127/ConcreteObjectA.java | 39 ++ .../api/v31/app127/ConcreteType.java | 40 ++ .../springdoc/api/v31/app127/Controller.java | 52 ++ .../api/v31/app127/SpringDocApp127Test.java | 54 ++ .../springdoc/api/v31/app127/Umbrella.java | 41 ++ .../api/v31/app129/ActualReturnedEntity.java | 34 + .../api/v31/app129/HelloController.java | 46 ++ .../api/v31/app129/OperationResponse.java | 33 + .../api/v31/app129/SpringDocApp129Test.java | 39 ++ .../api/v31/app13/HelloController.java | 38 ++ .../springdoc/api/v31/app13/PersonDTO.java | 66 ++ .../api/v31/app13/SpringDocApp13Test.java | 35 + .../api/v31/app130/HelloController.java | 43 ++ .../api/v31/app130/SpringDocApp130Test.java | 39 ++ .../springdoc/api/v31/app130/TrackerData.java | 47 ++ .../api/v31/app131/HelloController.java | 87 +++ .../api/v31/app131/Organization.java | 70 ++ .../api/v31/app131/RestControllerError.java | 37 ++ .../api/v31/app131/SpringDocApp131Test.java | 39 ++ .../api/v31/app132/HelloController.java | 87 +++ .../api/v31/app132/Organization.java | 70 ++ .../api/v31/app132/RestControllerError.java | 37 ++ .../api/v31/app132/SpringDocApp132Test.java | 39 ++ .../api/v31/app133/HelloController.java | 60 ++ .../api/v31/app133/SpringDocApp133Test.java | 39 ++ .../api/v31/app134/HelloController.java | 135 ++++ .../api/v31/app134/OpenApiConfig.java | 69 ++ .../api/v31/app134/SpringDocApp134Test.java | 86 +++ .../org/springdoc/api/v31/app135/Book.java | 64 ++ .../api/v31/app135/BookRepository.java | 44 ++ .../springdoc/api/v31/app135/BookRouter.java | 111 ++++ .../api/v31/app135/SpringDocApp135Test.java | 39 ++ .../api/v31/app136/OperationIdController.java | 54 ++ .../api/v31/app136/SpringDocApp136Test.java | 89 +++ .../api/v31/app137/HelloController.java | 39 ++ .../api/v31/app137/OpenApiConfig.java | 41 ++ .../api/v31/app137/SpringDocApp137Test.java | 41 ++ .../api/v31/app138/HelloController.java | 40 ++ .../api/v31/app138/SpringDocApp138Test.java | 104 +++ .../api/v31/app139/HelloController.java | 45 ++ .../api/v31/app139/SpringDocApp139Test.java | 41 ++ .../api/v31/app14/HelloController.java | 49 ++ .../api/v31/app14/SpringDocApp14Test.java | 52 ++ .../api/v31/app140/HelloApplication.java | 182 +++++ .../api/v31/app140/SpringDocApp140Test.java | 36 + .../org/springdoc/api/v31/app141/Book.java | 64 ++ .../api/v31/app141/BookRepository.java | 44 ++ .../springdoc/api/v31/app141/BookRouter.java | 106 +++ .../api/v31/app141/SpringDocApp141Test.java | 39 ++ .../api/v31/app142/HelloApplication.java | 176 +++++ .../api/v31/app142/SpringDocApp142Test.java | 36 + .../api/v31/app143/HelloHiddenController.java | 43 ++ .../api/v31/app143/SpringDocApp143Test.java | 44 ++ .../api/v31/app149/HelloController.java | 74 +++ .../api/v31/app149/HelloMessage.java | 36 + .../api/v31/app149/HiddenHelloController.java | 46 ++ .../api/v31/app149/SpringDocApp149Test.java | 44 ++ .../api/v31/app15/HelloController.java | 45 ++ .../api/v31/app15/SpringDocApp15Test.java | 67 ++ .../api/v31/app150/HelloController.java | 74 +++ .../api/v31/app150/SpringDocApp150Test.java | 40 ++ .../api/v31/app151/HelloController.java | 43 ++ .../api/v31/app151/SpringDocApp151Test.java | 40 ++ .../api/v31/app152/HelloController.java | 54 ++ .../api/v31/app152/SpringDocApp152Test.java | 40 ++ .../springdoc/api/v31/app153/OrderState.java | 44 ++ .../api/v31/app153/OrderStateMapper.java | 43 ++ .../api/v31/app153/SpringDocApp153Test.java | 40 ++ .../api/v31/app153/TestController.java | 46 ++ .../api/v31/app154/HelloController.java | 65 ++ .../api/v31/app154/OpenApiConfiguration.java | 51 ++ .../api/v31/app154/SpringDocApp154Test.java | 40 ++ .../app155/AbstractIntParameterObject.java | 48 ++ .../v31/app155/AbstractParameterObject.java | 52 ++ .../api/v31/app155/ConcreteEnum.java | 32 + .../app155/ConcreteIntParameterObject.java | 38 ++ .../v31/app155/ConcreteParameterObject.java | 38 ++ .../api/v31/app155/HelloController.java | 49 ++ .../api/v31/app155/SpringDocApp155Test.java | 40 ++ .../api/v31/app156/HelloController.java | 69 ++ .../springdoc/api/v31/app156/SomeEnum.java | 30 + .../api/v31/app156/SpringDocApp156Test.java | 40 ++ .../org/springdoc/api/v31/app156/User.java | 59 ++ .../org/springdoc/api/v31/app157/Bar.java | 36 + .../org/springdoc/api/v31/app157/Foo.java | 36 + .../api/v31/app157/HelloController.java | 49 ++ .../api/v31/app157/SpringDocApp157Test.java | 81 +++ .../api/v31/app157/StringyConverter.java | 61 ++ .../api/v31/app158/CommonFooErrorHandler.java | 38 ++ .../springdoc/api/v31/app158/ErrorDTO.java | 44 ++ .../api/v31/app158/HelloController.java | 44 ++ .../springdoc/api/v31/app158/SimpleDTO.java | 46 ++ .../v31/app158/SpecificFooErrorHandler.java | 31 + .../api/v31/app158/SpringDocApp158Test.java | 36 + .../api/v31/app159/CustomException.java | 31 + .../org/springdoc/api/v31/app159/FooBean.java | 56 ++ .../api/v31/app159/FooErrorHandler.java | 51 ++ .../api/v31/app159/HelloController.java | 46 ++ .../api/v31/app159/SpringDocApp159Test.java | 36 + .../org/springdoc/api/v31/app159/Views.java | 33 + .../api/v31/app16/HelloController.java | 38 ++ .../api/v31/app16/SpringDocApp16Test.java | 48 ++ .../api/v31/app160/HelloController.java | 79 +++ .../api/v31/app160/SpringDocApp160Test.java | 55 ++ .../api/v31/app161/HelloController.java | 61 ++ .../api/v31/app161/SpringDocApp161Test.java | 45 ++ .../api/v31/app162/OpenApiConfig.java | 48 ++ .../api/v31/app162/SpringDocApp162Test.java | 42 ++ .../api/v31/app163/CommissionDto.java | 69 ++ .../api/v31/app163/CommissionsResource.java | 56 ++ .../app163/ExampleRegistrationCustomizer.java | 49 ++ .../springdoc/api/v31/app163/Examples.java | 88 +++ .../api/v31/app163/SpringDocApp163Test.java | 40 ++ .../api/v31/app164/SampleResponseClass.java | 86 +++ .../api/v31/app164/SpringDocApp164Test.java | 39 ++ .../api/v31/app164/TestApiController.java | 38 ++ .../api/v31/app165/HelloController.java | 62 ++ .../api/v31/app165/SpringDocApp165Test.java | 36 + .../v31/app166/GlobalErrorResponseDto.java | 42 ++ .../v31/app166/GlobalExceptionHandler.java | 41 ++ .../api/v31/app166/LocalErrorResponseDto.java | 42 ++ .../api/v31/app166/SpringDocApp166Test.java | 43 ++ .../api/v31/app166/TestApiController.java | 47 ++ .../api/v31/app167/HelloController.java | 46 ++ .../api/v31/app167/SpringDocApp167Test.java | 40 ++ .../api/v31/app168/AbstractParent.java | 71 ++ .../api/v31/app168/ConcreteParent.java | 71 ++ .../springdoc/api/v31/app168/Controller.java | 68 ++ .../api/v31/app168/SpringDocApp168Test.java | 52 ++ .../DefaultRequestMappingHandlerMapping.java | 66 ++ .../app169/DefaultWebMvcRegistrations.java | 39 ++ .../api/v31/app169/SpringDocApp169Test.java | 37 ++ .../api/v31/app169/TestController.java | 37 ++ .../api/v31/app17/HelloController.java | 42 ++ .../api/v31/app17/SpringDocApp17Test.java | 35 + .../api/v31/app170/HelloController.java | 36 + .../api/v31/app170/SpringDocApp170Test.java | 50 ++ .../api/v31/app171/HelloLocaleController.java | 47 ++ .../api/v31/app171/SpringDocApp171Test.java | 84 +++ .../api/v31/app172/HelloController.java | 39 ++ .../api/v31/app172/SpringDocApp172Test.java | 70 ++ .../api/v31/app173/HelloController.java | 37 ++ .../api/v31/app173/SpringDocApp173Test.java | 78 +++ .../api/v31/app177/AnnotatedController.java | 102 +++ .../api/v31/app177/SpringDocApp177Test.java | 68 ++ .../api/v31/app178/AnnotatedController.java | 103 +++ .../api/v31/app178/SpringDocApp178Test.java | 68 ++ .../api/v31/app179/HelloController.java | 37 ++ .../api/v31/app179/MyConfiguration.java | 39 ++ .../api/v31/app179/MyIdPathVariable.java | 35 + .../org/springdoc/api/v31/app179/MyObj.java | 44 ++ .../api/v31/app179/MyObjArgumentResolver.java | 47 ++ .../v31/app179/MyPathParameterCustomizer.java | 47 ++ .../api/v31/app179/SpringDocApp179Test.java | 35 + .../api/v31/app18/HelloController.java | 70 ++ .../api/v31/app18/SpringDocApp18Test.java | 37 ++ .../org/springdoc/api/v31/app180/Body.java | 107 +++ .../api/v31/app180/MapExclusion.java | 32 + .../springdoc/api/v31/app180/RESTService.java | 56 ++ .../api/v31/app180/SpringDocApp180Test.java | 36 + .../v31/app181/AbstractParameterObject.java | 48 ++ .../v31/app181/ConcreteParameterObject.java | 38 ++ .../api/v31/app181/HelloController.java | 44 ++ .../api/v31/app181/SpringDocApp181Test.java | 40 ++ .../api/v31/app182/HelloController.java | 60 ++ .../api/v31/app182/SpringDocApp182Test.java | 38 ++ .../api/v31/app183/HelloController.java | 46 ++ .../api/v31/app183/SpringDocApp183Test.java | 62 ++ .../org/springdoc/api/v31/app183/User.java | 65 ++ .../api/v31/app183/UserConverter.java | 38 ++ .../springdoc/api/v31/app183/WebConfig.java | 39 ++ .../api/v31/app184/HelloController.java | 59 ++ .../api/v31/app184/SpringDocApp184Test.java | 132 ++++ .../org/springdoc/api/v31/app185/Cat.java | 48 ++ .../org/springdoc/api/v31/app185/Dog.java | 48 ++ .../org/springdoc/api/v31/app185/Pet.java | 49 ++ .../api/v31/app185/PetController.java | 42 ++ .../api/v31/app185/SpringDocApp185Test.java | 36 + .../api/v31/app187/HelloController.java | 54 ++ .../api/v31/app187/SpringDocApp187Test.java | 36 + .../org/springdoc/api/v31/app188/FooBar.java | 38 ++ .../api/v31/app188/FooBarConverter.java | 42 ++ .../api/v31/app188/HelloController.java | 108 +++ .../api/v31/app188/SpringDocApp188Test.java | 36 + .../springdoc/api/v31/app189/ArticleApi.java | 29 + .../springdoc/api/v31/app189/ArticleDto.java | 28 + .../api/v31/app189/ArticleQueryCondition.java | 17 + .../api/v31/app189/SpringDocApp189Test.java | 36 + .../api/v31/app19/HelloController.java | 54 ++ .../api/v31/app19/SpringDocApp19Test.java | 35 + .../app190/ConcreteSubclassFromGeneric.java | 9 + .../api/v31/app190/HelloController.java | 49 ++ .../org/springdoc/api/v31/app190/MyData.java | 15 + .../api/v31/app190/SimpleGeneric.java | 16 + .../api/v31/app190/SimpleInnerClass.java | 22 + .../api/v31/app190/SimpleInnerInnerClass.java | 16 + .../api/v31/app190/SimpleOuterClass.java | 15 + .../api/v31/app190/SpringDocApp190Test.java | 34 + .../api/v31/app192/HelloController.java | 121 ++++ .../api/v31/app192/SpringDocApp192Test.java | 36 + .../api/v31/app192/SpringDocTestApp.java | 34 + .../org/springdoc/api/v31/app193/Animal.java | 17 + .../api/v31/app193/BasicController.java | 28 + .../org/springdoc/api/v31/app193/Book.java | 22 + .../org/springdoc/api/v31/app193/Books.java | 23 + .../org/springdoc/api/v31/app193/Cat.java | 22 + .../org/springdoc/api/v31/app193/Dog.java | 33 + .../springdoc/api/v31/app193/Knowledge.java | 14 + .../springdoc/api/v31/app193/Response.java | 18 + .../api/v31/app193/SpringDocApp193Test.java | 61 ++ .../springdoc/api/v31/app194/ArticleApi.java | 29 + .../springdoc/api/v31/app194/ArticleDto.java | 28 + .../api/v31/app194/ArticleQueryCondition.java | 17 + .../api/v31/app194/SpringDocApp194Test.java | 36 + .../api/v31/app195/Example2Controller.java | 36 + .../api/v31/app195/ExampleController.java | 35 + .../api/v31/app195/SpringDocApp195Test.java | 34 + .../api/v31/app196/JSONController.java | 20 + .../api/v31/app196/JSPController.java | 23 + .../api/v31/app196/SpringDocApp196Test.java | 37 ++ .../api/v31/app197/Example2Controller.java | 24 + .../api/v31/app197/ExampleController.java | 24 + .../api/v31/app197/MyExceptionHandler.java | 23 + .../api/v31/app197/SpringDocApp197Test.java | 34 + .../api/v31/app198/HelloController.java | 15 + .../springdoc/api/v31/app198/Response.java | 49 ++ .../api/v31/app198/SpringDocApp198Test.java | 45 ++ .../v31/app199/CustomExceptionHandler.java | 23 + .../springdoc/api/v31/app199/ErrorDto.java | 12 + .../api/v31/app199/HelloController.java | 107 +++ .../api/v31/app199/SpringDocApp199Test.java | 34 + .../api/v31/app20/HelloController.java | 43 ++ .../api/v31/app20/SpringDocApp20Test.java | 35 + .../org/springdoc/api/v31/app200/FooBar.java | 35 + .../api/v31/app200/FooBarController.java | 14 + .../api/v31/app200/FooBarConverter.java | 15 + .../api/v31/app200/SpringDocApp200Test.java | 34 + .../api/v31/app201/Example2Controller.java | 36 + .../api/v31/app201/SpringDocApp201Test.java | 34 + .../api/v31/app201/SpringWebConfig.java | 20 + .../api/v31/app202/Example2Controller.java | 24 + .../api/v31/app202/ExampleController.java | 26 + .../api/v31/app202/MyExceptionHandler.java | 23 + .../api/v31/app202/SpringDocApp202Test.java | 34 + .../springdoc/api/v31/app203/OrderDemo.java | 41 ++ .../api/v31/app203/SpringDocApp203Test.java | 57 ++ .../DefaultFlatParamObjectController.java | 14 + .../org/springdoc/api/v31/app204/Person.java | 32 + .../api/v31/app204/SpringDocApp204Test.java | 34 + .../springdoc/api/v31/app205/OrderDemo.java | 23 + .../api/v31/app205/SpringdocApp205Test.java | 21 + .../api/v31/app206/PersonRequest.java | 54 ++ .../api/v31/app206/PersonResponse.java | 54 ++ .../v31/app206/RequiredModeController.java | 14 + .../api/v31/app206/SpringdocApp206Test.java | 12 + .../api/v31/app207/SpringdocApp207Test.java | 12 + .../app207/controller/SuperController.java | 20 + .../app207/controller/SysUserController.java | 14 + .../api/v31/app207/model/SuperEntity.java | 5 + .../api/v31/app207/model/SysUser.java | 4 + .../api/v31/app208/HelloController.java | 26 + .../api/v31/app208/RequestObject.java | 26 + .../api/v31/app208/SpringdocApp208Test.java | 14 + .../api/v31/app209/HelloController.java | 70 ++ .../api/v31/app209/SpringDocApp209Test.java | 115 ++++ .../api/v31/app21/HelloController.java | 54 ++ .../api/v31/app21/SpringDocApp21Test.java | 37 ++ .../api/v31/app210/SpringDocApp210Test.java | 47 ++ .../api/v31/app211/HelloController.java | 61 ++ .../api/v31/app211/SpringDocApp211Test.java | 36 + .../api/v31/app212/HelloController.java | 50 ++ .../springdoc/api/v31/app212/PersonDTO.java | 22 + .../api/v31/app212/SpringDocApp212Test.java | 66 ++ .../api/v31/app213/HelloController.java | 67 ++ .../springdoc/api/v31/app213/PersonDTO.java | 113 ++++ .../api/v31/app213/SpringDocApp213Test.java | 39 ++ .../api/v31/app214/SpringDocApp214Test.java | 61 ++ .../api/v31/app215/SpringDocApp215Test.java | 44 ++ .../v31/app215/SpringDocApp215bisTest.java | 44 ++ .../api/v31/app216/HelloController.java | 47 ++ .../api/v31/app216/SpringDocApp216Test.java | 37 ++ .../api/v31/app217/HelloController.java | 32 + .../springdoc/api/v31/app217/PersonDTO.java | 22 + .../api/v31/app217/SpringDocApp217Test.java | 64 ++ .../api/v31/app218/HelloController.java | 64 ++ .../api/v31/app218/SpringDocApp218Test.java | 37 ++ .../api/v31/app219/HelloController.java | 42 ++ .../api/v31/app219/SpringDocApp219Test.java | 37 ++ .../springdoc/api/v31/app219/TestObject.java | 49 ++ .../api/v31/app22/HelloController.java | 42 ++ .../springdoc/api/v31/app22/PersonDTO.java | 66 ++ .../api/v31/app22/SpringDocApp22Test.java | 35 + .../api/v31/app220/HelloController.java | 63 ++ .../api/v31/app220/SpringDocApp220Test.java | 35 + .../org/springdoc/api/v31/app221/HomeApi.java | 23 + .../api/v31/app221/HomeController.java | 24 + .../api/v31/app221/SpringDocApp221Test.java | 35 + .../api/v31/app222/HelloController.java | 27 + .../api/v31/app222/SpringDocApp222Test.java | 55 ++ .../api/v31/app223/ARestController.java | 23 + .../api/v31/app223/SpringDocApp223Test.java | 35 + .../v31/app223/apiobjects/AbstractChild.java | 61 ++ .../v31/app223/apiobjects/AbstractParent.java | 72 ++ .../api/v31/app223/apiobjects/Response.java | 4 + .../springdoc/api/v31/app224/RootModel.java | 27 + .../api/v31/app224/SpringDocApp224Test.java | 35 + .../api/v31/app224/TestController.java | 15 + .../api/v31/app224/UnwrappedModel.java | 14 + .../api/v31/app225/HelloController.java | 35 + .../api/v31/app225/SpringDocApp225Test.java | 35 + .../api/v31/app226/HelloController.java | 37 ++ .../api/v31/app226/SpringDocApp226Test.java | 35 + .../api/v31/app227/HelloController.java | 43 ++ .../api/v31/app227/SpringDocApp227Test.java | 30 + .../springdoc/api/v31/app227/model/Item.java | 14 + .../v31/app227/wrapper/NoGenericWrapper.java | 12 + .../app227/wrapper/ResponseEntityWrapper.java | 13 + .../api/v31/app228/HelloController.java | 56 ++ .../api/v31/app228/SpringDocApp228Test.java | 35 + .../springdoc/api/v31/app229/LocaleParam.java | 66 ++ .../api/v31/app229/SpringDocApp229Test.java | 37 ++ .../springdoc/api/v31/app229/XController.java | 47 ++ .../api/v31/app23/HelloController.java | 49 ++ .../api/v31/app23/SpringDocApp23Test.java | 35 + .../api/v31/app230/App230Controller.java | 22 + .../api/v31/app230/App230RequestBody.java | 21 + .../api/v31/app230/SpringDocApp230Test.java | 40 ++ .../app231/ApplicationsRestController.java | 25 + .../api/v31/app231/SpringDocApp231Test.java | 40 ++ .../springdoc/api/v31/app231/SubClass.java | 17 + .../springdoc/api/v31/app231/SuperClass.java | 18 + .../api/v31/app232/HelloController.java | 19 + .../api/v31/app232/SpringDocApp232Test.java | 50 ++ .../api/v31/app233/ParameterController.java | 95 +++ .../api/v31/app233/SpringDocApp233Test.java | 185 ++++++ .../api/v31/app234/HelloController.java | 40 ++ .../org/springdoc/api/v31/app234/MyObj.java | 44 ++ .../v31/app234/MyPathParameterCustomizer.java | 39 ++ .../api/v31/app234/SpringDocApp234Test.java | 35 + .../api/v31/app235/MyDebugController.java | 67 ++ .../api/v31/app235/SpringDocApp235Test.java | 37 ++ .../springdoc/api/v31/app236/ClassOne.java | 18 + .../springdoc/api/v31/app236/ClassTwo.java | 20 + .../api/v31/app236/HelloController.java | 25 + .../api/v31/app236/SpringDocApp236Test.java | 37 ++ .../api/v31/app24/HelloController.java | 49 ++ .../api/v31/app24/SpringDocApp24Test.java | 32 + .../api/v31/app24/SpringDocTestApp.java | 62 ++ .../api/v31/app25/HelloController.java | 77 +++ .../api/v31/app25/SpringDocApp25Test.java | 35 + .../test/org/springdoc/api/v31/app26/Bar.java | 38 ++ .../test/org/springdoc/api/v31/app26/Foo.java | 39 ++ .../api/v31/app26/HelloController.java | 38 ++ .../org/springdoc/api/v31/app26/MyModel.java | 41 ++ .../api/v31/app26/SpringDocApp26Test.java | 35 + .../org/springdoc/api/v31/app27/Advice.java | 56 ++ .../test/org/springdoc/api/v31/app27/Bar.java | 29 + .../test/org/springdoc/api/v31/app27/Foo.java | 29 + .../api/v31/app27/HelloController.java | 47 ++ .../springdoc/api/v31/app27/MyException.java | 34 + .../api/v31/app27/SpringDocApp27Test.java | 50 ++ .../api/v31/app28/HelloController.java | 40 ++ .../api/v31/app28/SpringDocApp28Test.java | 35 + .../api/v31/app29/HelloController.java | 51 ++ .../api/v31/app29/SpringDocApp29Test.java | 35 + .../springdoc/api/v31/app29/TrackerData.java | 47 ++ .../api/v31/app30/HelloController.java | 40 ++ .../api/v31/app30/SpringDocApp30Test.java | 35 + .../api/v31/app31/HelloController.java | 71 ++ .../api/v31/app31/SpringDocApp31Test.java | 35 + .../api/v31/app32/HelloController.java | 52 ++ .../api/v31/app32/SpringDocApp32Test.java | 35 + .../api/v31/app33/HelloController.java | 42 ++ .../api/v31/app33/SpringDocApp33Test.java | 35 + .../api/v31/app34/HelloController.java | 42 ++ .../api/v31/app34/MyExceptionHandler.java | 49 ++ .../api/v31/app34/SpringDocApp34Test.java | 35 + .../api/v31/app35/HelloController.java | 58 ++ .../api/v31/app35/SpringDocApp35Test.java | 41 ++ .../test/org/springdoc/api/v31/app37/Bar.java | 29 + .../test/org/springdoc/api/v31/app37/Car.java | 30 + .../test/org/springdoc/api/v31/app37/Foo.java | 29 + .../api/v31/app37/HelloController.java | 64 ++ .../test/org/springdoc/api/v31/app37/Pet.java | 30 + .../api/v31/app37/SpringDocApp37Test.java | 35 + .../api/v31/app38/HelloController.java | 41 ++ .../api/v31/app38/SpringDocApp38Test.java | 35 + .../api/v31/app39/HelloController.java | 49 ++ .../api/v31/app39/SpringDocApp39Test.java | 32 + .../api/v31/app39/SpringDocTestApp.java | 56 ++ .../api/v31/app40/HelloController.java | 40 ++ .../api/v31/app40/SpringDocApp40Test.java | 35 + .../api/v31/app41/HelloController.java | 57 ++ .../api/v31/app41/SpringDocApp411Test.java | 65 ++ .../api/v31/app41/SpringDocApp41Test.java | 67 ++ .../api/v31/app42/HelloController.java | 38 ++ .../api/v31/app42/SpringDocApp42Test.java | 45 ++ .../org/springdoc/api/v31/app42/TweetId.java | 37 ++ .../api/v31/app43/HelloController.java | 43 ++ .../api/v31/app43/SpringDocApp43Test.java | 35 + .../api/v31/app44/HelloController.java | 131 ++++ .../api/v31/app44/SpringDocApp44Test.java | 55 ++ .../api/v31/app45/HelloController.java | 69 ++ .../api/v31/app45/HelloController2.java | 69 ++ .../api/v31/app45/OpenApiConfig.java | 36 + .../springdoc/api/v31/app45/PersonDTO.java | 66 ++ .../api/v31/app45/SpringDocApp45Test.java | 35 + .../api/v31/app46/HelloController.java | 50 ++ .../api/v31/app46/SpringDocApp46Test.java | 35 + .../api/v31/app47/BasicController.java | 26 + .../api/v31/app47/HelloController.java | 44 ++ .../api/v31/app47/SpringDocApp47Test.java | 35 + .../v31/app48/AbstractHelloController.java | 48 ++ .../api/v31/app48/HelloController.java | 51 ++ .../api/v31/app48/SpringDocApp48Test.java | 35 + .../api/v31/app49/HelloController.java | 47 ++ .../api/v31/app49/SpringDocApp49Test.java | 32 + .../api/v31/app49/SpringDocTestApp.java | 55 ++ .../api/v31/app50/HelloController.java | 46 ++ .../api/v31/app50/SpringDocApp50Test.java | 32 + .../api/v31/app50/SpringDocTestApp.java | 55 ++ .../api/v31/app51/HelloController.java | 78 +++ .../api/v31/app51/SpringDocApp51Test.java | 35 + .../api/v31/app52/HelloController.java | 65 ++ .../api/v31/app52/SpringDocApp52Test.java | 35 + .../api/v31/app53/HelloController.java | 99 +++ .../HelloControllerWithGlobalApiResponse.java | 57 ++ .../api/v31/app53/SpringDocApp53Test.java | 35 + .../api/v31/app54/HelloController.java | 61 ++ .../springdoc/api/v31/app54/MealParty.java | 38 ++ .../api/v31/app54/SpringDocApp54Test.java | 35 + .../org/springdoc/api/v31/app54/Views.java | 33 + .../api/v31/app55/HelloController.java | 54 ++ .../api/v31/app55/SpringDocApp55Test.java | 35 + .../api/v31/app56/GlobalExceptionHandler.java | 64 ++ .../api/v31/app56/HelloController.java | 38 ++ .../api/v31/app56/SpringDocApp56Test.java | 35 + .../api/v31/app57/HelloController.java | 42 ++ .../api/v31/app57/SpringDocApp57Test.java | 35 + .../api/v31/app58/HelloController.java | 105 +++ .../api/v31/app58/SpringDocApp58Test.java | 35 + .../springdoc/api/v31/app59/HelloBody.java | 36 + .../api/v31/app59/HelloController.java | 47 ++ .../api/v31/app59/HelloController2.java | 48 ++ .../api/v31/app59/HelloExceptionHandler.java | 64 ++ .../api/v31/app59/SpringDocApp59Test.java | 35 + .../api/v31/app60/HelloController.java | 56 ++ .../springdoc/api/v31/app60/QueryPaging.java | 42 ++ .../springdoc/api/v31/app60/QuerySort.java | 38 ++ .../api/v31/app60/SpringDocApp60Test.java | 35 + .../api/v31/app61/HelloController.java | 52 ++ .../api/v31/app61/SpringDocApp61Test.java | 35 + .../api/v31/app62/BaseController.java | 47 ++ .../api/v31/app62/SpringDocApp62Test.java | 35 + .../api/v31/app62/TestController.java | 43 ++ .../api/v31/app63/HelloController.java | 44 ++ .../api/v31/app63/SpringDocApp63Test.java | 40 ++ .../api/v31/app64/HelloController.java | 45 ++ .../api/v31/app64/SpringDocApp64Test.java | 37 ++ .../api/v31/app65/HelloController.java | 45 ++ .../api/v31/app65/SpringDocApp65Test.java | 35 + .../api/v31/app66/DefaultHealthCheckApi.java | 46 ++ .../api/v31/app66/HelloController.java | 45 ++ .../api/v31/app66/SpringDocApp66Test.java | 35 + .../api/v31/app66/UndocumentedClass.java | 32 + .../api/v31/app67/HelloController.java | 110 ++++ .../api/v31/app67/SpringDocApp67Test.java | 35 + .../api/v31/app69/HelloController.java | 50 ++ .../springdoc/api/v31/app69/PersonDTO.java | 28 + .../api/v31/app69/SpringDocApp69Test.java | 35 + .../api/v31/app70/HelloController.java | 46 ++ .../api/v31/app70/SpringDocApp70Test.java | 35 + .../app70/customizer/CustomizedOperation.java | 33 + .../app70/customizer/CustomizedParameter.java | 33 + .../app70/customizer/CustomizedProperty.java | 33 + .../app70/customizer/OperationCustomizer.java | 42 ++ .../app70/customizer/ParameterCustomizer.java | 42 ++ .../app70/customizer/PropertyCustomizer.java | 66 ++ .../api/v31/app70/model/ApiType.java | 39 ++ .../test/org/springdoc/api/v31/app71/Dog.java | 42 ++ .../api/v31/app71/HelloController.java | 38 ++ .../api/v31/app71/SpringDocApp71Test.java | 35 + .../app72/BlockingAutoConfigurationTest.java | 113 ++++ .../app72/CacheAutoConfigurationTest1.java | 91 +++ .../v31/app72/GroupAutoConfigurationTest.java | 62 ++ .../api/v31/app73/HelloController.java | 51 ++ .../api/v31/app73/SpringDocApp73Test.java | 35 + .../api/v31/app74/HelloController.java | 51 ++ .../api/v31/app74/SpringDocApp74Test.java | 35 + .../api/v31/app75/HelloController.java | 105 +++ .../springdoc/api/v31/app75/PersonDTO.java | 66 ++ .../RestResponseEntityExceptionHandler.java | 46 ++ .../api/v31/app75/SpringDocApp75Test.java | 36 + .../api/v31/app76/HelloController.java | 50 ++ .../api/v31/app76/SpringDocApp76Test.java | 55 ++ .../api/v31/app77/HelloController.java | 56 ++ .../api/v31/app77/SpringDocApp77Test.java | 35 + .../api/v31/app78/HelloController.java | 48 ++ .../springdoc/api/v31/app78/PersonDTO.java | 66 ++ .../api/v31/app78/SpringDocApp78Test.java | 35 + .../api/v31/app79/HelloController.java | 42 ++ .../api/v31/app79/SpringDocApp79Test.java | 36 + .../api/v31/app80/HelloController.java | 56 ++ .../api/v31/app80/SpringDocApp80Test.java | 37 ++ .../springdoc/api/v31/app80/TestObject.java | 49 ++ .../api/v31/app81/HelloController.java | 39 ++ .../api/v31/app81/SpringDocApp81Test.java | 71 ++ .../api/v31/app82/HelloController.java | 42 ++ .../springdoc/api/v31/app82/PersonDTO.java | 66 ++ .../api/v31/app82/SpringDocApp82Test.java | 36 + .../api/v31/app83/HelloController.java | 69 ++ .../springdoc/api/v31/app83/PersonDTO.java | 66 ++ .../api/v31/app83/SpringDocApp83Test.java | 36 + .../api/v31/app84/HelloController.java | 45 ++ .../api/v31/app84/SpringDocApp84Test.java | 36 + .../api/v31/app85/HelloController.java | 48 ++ .../api/v31/app85/SpringDocApp85Test.java | 36 + .../api/v31/app86/HelloController.java | 44 ++ .../api/v31/app86/SpringDocApp86Test.java | 39 ++ .../api/v31/app86/test/HelloController2.java | 44 ++ .../api/v31/app87/HelloController.java | 96 +++ .../api/v31/app87/SpringDocApp87Test.java | 36 + .../api/v31/app88/HelloController.java | 38 ++ .../api/v31/app88/SpringDocApp88Test.java | 37 ++ .../api/v31/app89/HelloController.java | 40 ++ .../api/v31/app89/SpringDocApp89Test.java | 46 ++ .../api/v31/app90/HelloController.java | 66 ++ .../api/v31/app90/SpringDocApp90Test.java | 32 + .../api/v31/app90/SpringDocTestApp.java | 78 +++ .../org/springdoc/api/v31/app90/User.java | 317 +++++++++ .../org/springdoc/api/v31/app91/Advice.java | 91 +++ .../org/springdoc/api/v31/app91/ApiError.java | 58 ++ .../org/springdoc/api/v31/app91/Greeting.java | 50 ++ .../api/v31/app91/GreetingController.java | 57 ++ .../api/v31/app91/SpringDocApp91Test.java | 39 ++ .../api/v31/app92/HelloController.java | 42 ++ .../api/v31/app92/ParameterCustomizer.java | 43 ++ .../api/v31/app92/SpringDocApp92Test.java | 37 ++ .../api/v31/app93/BaseClientModel.java | 32 + .../api/v31/app93/BaseController.java | 37 ++ .../api/v31/app93/SpecificClientModel.java | 32 + .../api/v31/app93/SpecificController.java | 30 + .../api/v31/app93/SpringDocApp93Test.java | 37 ++ .../api/v31/app94/SpringDocApp94Test.java | 125 ++++ .../api/v31/app95/HelloController.java | 45 ++ .../api/v31/app95/SpringDocApp95Test.java | 39 ++ .../api/v31/app96/HelloController.java | 53 ++ .../api/v31/app96/SpringDocApp96Test.java | 37 ++ .../api/v31/app97/HelloController.java | 49 ++ .../api/v31/app97/SpringDocApp97Test.java | 37 ++ .../springdoc/api/v31/app97/StudentV1.java | 37 ++ .../springdoc/api/v31/app97/StudentV2.java | 37 ++ .../springdoc/api/v31/app97/StudentV3.java | 37 ++ .../api/v31/app98/HelloController.java | 38 ++ .../v31/app98/IgnoredAnnotationParameter.java | 33 + .../api/v31/app98/SpringDocApp98Test.java | 41 ++ .../api/v31/app99/HelloController.java | 46 ++ .../api/v31/app99/SpringDocApp99Test.java | 39 ++ .../test/resources/results/3.1.0/app100.json | 69 ++ .../test/resources/results/3.1.0/app101.json | 1 + .../test/resources/results/3.1.0/app102.json | 135 ++++ .../test/resources/results/3.1.0/app103.json | 78 +++ .../test/resources/results/3.1.0/app104.json | 79 +++ .../resources/results/3.1.0/app105-1.json | 263 ++++++++ .../resources/results/3.1.0/app105-2.json | 418 ++++++++++++ .../resources/results/3.1.0/app105-3.json | 623 ++++++++++++++++++ .../resources/results/3.1.0/app105-4.json | 81 +++ .../test/resources/results/3.1.0/app106.json | 49 ++ .../test/resources/results/3.1.0/app107.json | 70 ++ .../test/resources/results/3.1.0/app108.json | 1 + .../test/resources/results/3.1.0/app109.json | 1 + .../test/resources/results/3.1.0/app11.json | 95 +++ .../test/resources/results/3.1.0/app110.json | 275 ++++++++ .../test/resources/results/3.1.0/app111.json | 193 ++++++ .../test/resources/results/3.1.0/app112.json | 275 ++++++++ .../test/resources/results/3.1.0/app113.json | 71 ++ .../test/resources/results/3.1.0/app114.json | 70 ++ .../test/resources/results/3.1.0/app115.json | 37 ++ .../test/resources/results/3.1.0/app116.json | 51 ++ .../test/resources/results/3.1.0/app117.json | 144 ++++ .../test/resources/results/3.1.0/app118.json | 1 + .../test/resources/results/3.1.0/app119.json | 81 +++ .../test/resources/results/3.1.0/app12.json | 45 ++ .../test/resources/results/3.1.0/app120.json | 258 ++++++++ .../test/resources/results/3.1.0/app121.json | 191 ++++++ .../test/resources/results/3.1.0/app122.json | 69 ++ .../test/resources/results/3.1.0/app123.json | 64 ++ .../test/resources/results/3.1.0/app124.json | 1 + .../test/resources/results/3.1.0/app126.json | 109 +++ .../test/resources/results/3.1.0/app129.json | 81 +++ .../test/resources/results/3.1.0/app13.json | 63 ++ .../test/resources/results/3.1.0/app130.json | 44 ++ .../test/resources/results/3.1.0/app131.json | 104 +++ .../test/resources/results/3.1.0/app132.json | 104 +++ .../test/resources/results/3.1.0/app133.json | 108 +++ .../resources/results/3.1.0/app134-1.json | 70 ++ .../resources/results/3.1.0/app134-2.json | 132 ++++ .../resources/results/3.1.0/app134-3.json | 70 ++ .../resources/results/3.1.0/app134-4.json | 80 +++ .../resources/results/3.1.0/app134-5.json | 71 ++ .../test/resources/results/3.1.0/app135.json | 393 +++++++++++ .../test/resources/results/3.1.0/app136.json | 127 ++++ .../test/resources/results/3.1.0/app137.json | 58 ++ .../test/resources/results/3.1.0/app138.json | 1 + .../test/resources/results/3.1.0/app139.json | 78 +++ .../test/resources/results/3.1.0/app14.json | 66 ++ .../test/resources/results/3.1.0/app140.json | 144 ++++ .../test/resources/results/3.1.0/app141.json | 393 +++++++++++ .../test/resources/results/3.1.0/app142.json | 144 ++++ .../test/resources/results/3.1.0/app143.json | 1 + .../test/resources/results/3.1.0/app149.json | 91 +++ .../test/resources/results/3.1.0/app15.json | 41 ++ .../test/resources/results/3.1.0/app150.json | 118 ++++ .../test/resources/results/3.1.0/app151.json | 37 ++ .../test/resources/results/3.1.0/app152.json | 37 ++ .../test/resources/results/3.1.0/app153.json | 1 + .../test/resources/results/3.1.0/app154.json | 1 + .../test/resources/results/3.1.0/app155.json | 116 ++++ .../test/resources/results/3.1.0/app156.json | 70 ++ .../test/resources/results/3.1.0/app157.json | 76 +++ .../test/resources/results/3.1.0/app158.json | 70 ++ .../test/resources/results/3.1.0/app159.json | 95 +++ .../resources/results/3.1.0/app160-1.json | 57 ++ .../test/resources/results/3.1.0/app160.json | 57 ++ .../test/resources/results/3.1.0/app161.json | 120 ++++ .../test/resources/results/3.1.0/app162.json | 14 + .../test/resources/results/3.1.0/app163.json | 105 +++ .../test/resources/results/3.1.0/app164.json | 62 ++ .../test/resources/results/3.1.0/app165.json | 114 ++++ .../test/resources/results/3.1.0/app166.json | 57 ++ .../test/resources/results/3.1.0/app167.json | 46 ++ .../test/resources/results/3.1.0/app168.json | 129 ++++ .../test/resources/results/3.1.0/app169.json | 46 ++ .../test/resources/results/3.1.0/app17.json | 41 ++ .../test/resources/results/3.1.0/app170.json | 36 + .../resources/results/3.1.0/app171-en-GB.json | 65 ++ .../resources/results/3.1.0/app171-en-US.json | 65 ++ .../resources/results/3.1.0/app171-fr-FR.json | 65 ++ .../test/resources/results/3.1.0/app172.json | 46 ++ .../test/resources/results/3.1.0/app173.json | 29 + .../resources/results/3.1.0/app177-1.json | 54 ++ .../resources/results/3.1.0/app177-2.json | 36 + .../resources/results/3.1.0/app177-3.json | 72 ++ .../test/resources/results/3.1.0/app177.json | 54 ++ .../resources/results/3.1.0/app178-1.json | 54 ++ .../resources/results/3.1.0/app178-2.json | 36 + .../resources/results/3.1.0/app178-3.json | 72 ++ .../test/resources/results/3.1.0/app178.json | 72 ++ .../test/resources/results/3.1.0/app179.json | 48 ++ .../test/resources/results/3.1.0/app18.json | 203 ++++++ .../test/resources/results/3.1.0/app180.json | 94 +++ .../test/resources/results/3.1.0/app181.json | 64 ++ .../test/resources/results/3.1.0/app182.json | 1 + .../test/resources/results/3.1.0/app183.json | 107 +++ .../resources/results/3.1.0/app184-1.json | 97 +++ .../resources/results/3.1.0/app184-2.json | 112 ++++ .../resources/results/3.1.0/app184-3.json | 112 ++++ .../test/resources/results/3.1.0/app184.json | 112 ++++ .../test/resources/results/3.1.0/app185.json | 117 ++++ .../test/resources/results/3.1.0/app187.json | 53 ++ .../test/resources/results/3.1.0/app188.json | 1 + .../test/resources/results/3.1.0/app189.json | 111 ++++ .../test/resources/results/3.1.0/app19.json | 107 +++ .../test/resources/results/3.1.0/app190.json | 165 +++++ .../test/resources/results/3.1.0/app192.json | 244 +++++++ .../resources/results/3.1.0/app193-1.json | 1 + .../test/resources/results/3.1.0/app193.json | 138 ++++ .../test/resources/results/3.1.0/app194.json | 127 ++++ .../test/resources/results/3.1.0/app195.json | 66 ++ .../test/resources/results/3.1.0/app196.json | 134 ++++ .../test/resources/results/3.1.0/app197.json | 84 +++ .../test/resources/results/3.1.0/app198.json | 1 + .../test/resources/results/3.1.0/app199.json | 87 +++ .../test/resources/results/3.1.0/app20.json | 15 + .../test/resources/results/3.1.0/app200.json | 50 ++ .../test/resources/results/3.1.0/app201.json | 41 ++ .../test/resources/results/3.1.0/app202.json | 1 + .../test/resources/results/3.1.0/app203.json | 47 ++ .../test/resources/results/3.1.0/app204.json | 73 ++ .../test/resources/results/3.1.0/app205.json | 46 ++ .../test/resources/results/3.1.0/app206.json | 115 ++++ .../test/resources/results/3.1.0/app207.json | 109 +++ .../test/resources/results/3.1.0/app208.json | 96 +++ .../test/resources/results/3.1.0/app209.json | 203 ++++++ .../test/resources/results/3.1.0/app21.json | 63 ++ .../test/resources/results/3.1.0/app211.json | 1 + .../results/3.1.0/app212-grouped.json | 127 ++++ .../test/resources/results/3.1.0/app212.json | 125 ++++ .../test/resources/results/3.1.0/app213.json | 71 ++ .../test/resources/results/3.1.0/app216.json | 42 ++ .../resources/results/3.1.0/app217-1.json | 1 + .../resources/results/3.1.0/app217-2.json | 1 + .../test/resources/results/3.1.0/app217.json | 51 ++ .../test/resources/results/3.1.0/app218.json | 48 ++ .../test/resources/results/3.1.0/app219.json | 76 +++ .../test/resources/results/3.1.0/app22.json | 59 ++ .../test/resources/results/3.1.0/app220.json | 1 + .../test/resources/results/3.1.0/app221.json | 83 +++ .../test/resources/results/3.1.0/app222.json | 121 ++++ .../test/resources/results/3.1.0/app223.json | 1 + .../test/resources/results/3.1.0/app224.json | 52 ++ .../test/resources/results/3.1.0/app225.json | 39 ++ .../test/resources/results/3.1.0/app226.json | 45 ++ .../test/resources/results/3.1.0/app227.json | 73 ++ .../test/resources/results/3.1.0/app228.json | 126 ++++ .../test/resources/results/3.1.0/app229.json | 1 + .../test/resources/results/3.1.0/app23.json | 54 ++ .../test/resources/results/3.1.0/app230.json | 58 ++ .../test/resources/results/3.1.0/app231.json | 77 +++ .../test/resources/results/3.1.0/app232.json | 137 ++++ .../test/resources/results/3.1.0/app233.json | 381 +++++++++++ .../test/resources/results/3.1.0/app234.json | 38 ++ .../test/resources/results/3.1.0/app235.json | 132 ++++ .../test/resources/results/3.1.0/app236.json | 98 +++ .../test/resources/results/3.1.0/app24.json | 81 +++ .../test/resources/results/3.1.0/app25.json | 1 + .../test/resources/results/3.1.0/app26.json | 88 +++ .../test/resources/results/3.1.0/app27.json | 69 ++ .../test/resources/results/3.1.0/app28.json | 59 ++ .../test/resources/results/3.1.0/app29.json | 77 +++ .../test/resources/results/3.1.0/app30.json | 47 ++ .../test/resources/results/3.1.0/app31.json | 1 + .../test/resources/results/3.1.0/app32.json | 62 ++ .../test/resources/results/3.1.0/app33.json | 1 + .../test/resources/results/3.1.0/app34.json | 1 + .../test/resources/results/3.1.0/app35.json | 70 ++ .../test/resources/results/3.1.0/app37.json | 129 ++++ .../test/resources/results/3.1.0/app38.json | 37 ++ .../test/resources/results/3.1.0/app39.json | 85 +++ .../test/resources/results/3.1.0/app40.json | 36 + .../test/resources/results/3.1.0/app41.json | 1 + .../test/resources/results/3.1.0/app42.json | 45 ++ .../test/resources/results/3.1.0/app43.json | 57 ++ .../test/resources/results/3.1.0/app44.json | 107 +++ .../test/resources/results/3.1.0/app45.json | 162 +++++ .../test/resources/results/3.1.0/app46.json | 1 + .../test/resources/results/3.1.0/app47.json | 1 + .../test/resources/results/3.1.0/app48.json | 106 +++ .../test/resources/results/3.1.0/app49.json | 43 ++ .../test/resources/results/3.1.0/app50.json | 53 ++ .../test/resources/results/3.1.0/app51.json | 185 ++++++ .../test/resources/results/3.1.0/app52.json | 190 ++++++ .../test/resources/results/3.1.0/app53.json | 234 +++++++ .../test/resources/results/3.1.0/app54.json | 132 ++++ .../test/resources/results/3.1.0/app55.json | 37 ++ .../test/resources/results/3.1.0/app56.json | 57 ++ .../test/resources/results/3.1.0/app57.json | 47 ++ .../test/resources/results/3.1.0/app58.json | 1 + .../test/resources/results/3.1.0/app59.json | 183 +++++ .../test/resources/results/3.1.0/app60.json | 109 +++ .../test/resources/results/3.1.0/app61.json | 85 +++ .../test/resources/results/3.1.0/app62.json | 52 ++ .../test/resources/results/3.1.0/app63.json | 15 + .../test/resources/results/3.1.0/app64.json | 47 ++ .../test/resources/results/3.1.0/app65.json | 88 +++ .../test/resources/results/3.1.0/app66.json | 88 +++ .../test/resources/results/3.1.0/app67.json | 1 + .../test/resources/results/3.1.0/app69.json | 109 +++ .../test/resources/results/3.1.0/app70.json | 1 + .../test/resources/results/3.1.0/app71.json | 59 ++ .../test/resources/results/3.1.0/app73.json | 150 +++++ .../test/resources/results/3.1.0/app74.json | 46 ++ .../test/resources/results/3.1.0/app75.json | 1 + .../test/resources/results/3.1.0/app76.json | 73 ++ .../test/resources/results/3.1.0/app77.json | 1 + .../test/resources/results/3.1.0/app78.json | 93 +++ .../test/resources/results/3.1.0/app79.json | 46 ++ .../test/resources/results/3.1.0/app80.json | 81 +++ .../test/resources/results/3.1.0/app82.json | 77 +++ .../test/resources/results/3.1.0/app83.json | 100 +++ .../test/resources/results/3.1.0/app84.json | 66 ++ .../test/resources/results/3.1.0/app85.json | 45 ++ .../test/resources/results/3.1.0/app86.json | 39 ++ .../test/resources/results/3.1.0/app87.json | 208 ++++++ .../test/resources/results/3.1.0/app88.json | 33 + .../test/resources/results/3.1.0/app89.json | 47 ++ .../test/resources/results/3.1.0/app90.json | 1 + .../test/resources/results/3.1.0/app91.json | 98 +++ .../test/resources/results/3.1.0/app92.json | 46 ++ .../test/resources/results/3.1.0/app93.json | 61 ++ .../test/resources/results/3.1.0/app94.json | 77 +++ .../test/resources/results/3.1.0/app95.json | 42 ++ .../test/resources/results/3.1.0/app96.json | 108 +++ .../test/resources/results/3.1.0/app97.json | 136 ++++ .../test/resources/results/3.1.0/app98.json | 29 + .../test/resources/results/3.1.0/app99.json | 29 + 906 files changed, 52829 insertions(+) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/HelloDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/ExampleBody.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/CrudController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/Design.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/DesignController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/HavingPK.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/ApiUtil.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/ExceptionTranslator.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/HomeController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApi.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegate.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegateImpl.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApi.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegate.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegateImpl.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApi.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegate.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegateImpl.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Body.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Body1.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Category.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/ModelApiResponse.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Order.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Pet.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Tag.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/User.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/ActionResult.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/ErrorMessage.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/GlobalControllerAdvice.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/Person.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/PersonController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/PersonController2.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/Problem.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/ErrorMessage.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/GlobalControllerAdvice.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/Person.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/PersonController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/PersonController2.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/Problem.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/ErrorMessage.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/GlobalControllerAdvice.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/Person.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/PersonController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/Problem.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/sample/PersonController2.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/FooErrorHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/HelloApplication.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/AbstractParent.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/ConcreteParent.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/JsonRequest.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/AccountId.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/MetaAnnotationController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/InheritedRequestParams.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/RequestParams.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/BaseController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/BaseObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/CustomerDto.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/FirstController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/Wrapper.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/MyExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/MyExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/Problem.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SecurityProblemResponsesConfiguration.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/AbstractObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/ConcreteObjectA.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/ConcreteType.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/Umbrella.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/ActualReturnedEntity.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/OperationResponse.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/TrackerData.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/Organization.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/RestControllerError.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/Organization.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/RestControllerError.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/OpenApiConfig.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/Book.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/BookRepository.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/BookRouter.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app136/OperationIdController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app136/SpringDocApp136Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/OpenApiConfig.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/HelloApplication.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/Book.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/BookRepository.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/BookRouter.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/HelloApplication.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/HelloHiddenController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/SpringDocApp143Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HiddenHelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/OrderState.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/OrderStateMapper.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/OpenApiConfiguration.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/AbstractIntParameterObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/AbstractParameterObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteEnum.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteIntParameterObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteParameterObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SomeEnum.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/User.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/Bar.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/Foo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/StringyConverter.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/CommonFooErrorHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/ErrorDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SimpleDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpecificFooErrorHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/CustomException.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/FooBean.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/FooErrorHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/Views.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/OpenApiConfig.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/CommissionDto.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/CommissionsResource.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/ExampleRegistrationCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/Examples.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SampleResponseClass.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/TestApiController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/SpringDocApp165Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/GlobalErrorResponseDto.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/GlobalExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/LocalErrorResponseDto.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/TestApiController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/AbstractParent.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/ConcreteParent.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/DefaultRequestMappingHandlerMapping.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/DefaultWebMvcRegistrations.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/HelloLocaleController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/SpringDocApp172Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/AnnotatedController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/SpringDocApp177Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/AnnotatedController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/SpringDocApp178Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyConfiguration.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyIdPathVariable.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyObj.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyObjArgumentResolver.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyPathParameterCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/SpringDocApp179Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/Body.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/MapExclusion.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/RESTService.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/SpringDocApp180Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/AbstractParameterObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/ConcreteParameterObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/SpringDocApp181Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/SpringDocApp182Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/SpringDocApp183Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/User.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/UserConverter.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/WebConfig.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Cat.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Dog.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Pet.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/PetController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/SpringDocApp185Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/FooBar.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/FooBarConverter.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleApi.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleDto.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleQueryCondition.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/ConcreteSubclassFromGeneric.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/MyData.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleGeneric.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleInnerClass.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleInnerInnerClass.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleOuterClass.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocApp192Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Animal.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/BasicController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Book.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Books.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Cat.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Dog.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Knowledge.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Response.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/SpringDocApp193Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleApi.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleDto.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleQueryCondition.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/SpringDocApp194Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/Example2Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/ExampleController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/SpringDocApp195Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/JSONController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/JSPController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/SpringDocApp196Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/Example2Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/ExampleController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/MyExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/SpringDocApp197Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/Response.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/SpringDocApp198Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/CustomExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/ErrorDto.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/SpringDocApp199Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBar.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBarController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBarConverter.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/SpringDocApp200Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/Example2Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringDocApp201Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringWebConfig.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/Example2Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/ExampleController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/MyExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/SpringDocApp202Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/OrderDemo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/SpringDocApp203Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/DefaultFlatParamObjectController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/Person.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/SpringDocApp204Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/OrderDemo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/SpringdocApp205Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/PersonRequest.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/PersonResponse.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/RequiredModeController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/SpringdocApp206Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/SpringdocApp207Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/controller/SuperController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/controller/SysUserController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/model/SuperEntity.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/model/SysUser.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/RequestObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/SpringdocApp208Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app209/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app209/SpringDocApp209Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app210/SpringDocApp210Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/SpringDocApp211Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/SpringDocApp212Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/SpringDocApp213Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app214/SpringDocApp214Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app215/SpringDocApp215Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app215/SpringDocApp215bisTest.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/SpringDocApp216Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/SpringDocApp217Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/SpringDocApp218Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/SpringDocApp219Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/TestObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/SpringDocApp220Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/HomeApi.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/HomeController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/SpringDocApp221Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/SpringDocApp222Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/ARestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/SpringDocApp223Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/AbstractChild.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/AbstractParent.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/Response.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/RootModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/SpringDocApp224Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/UnwrappedModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/SpringDocApp225Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/SpringDocApp226Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/SpringDocApp227Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/model/Item.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/wrapper/NoGenericWrapper.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/wrapper/ResponseEntityWrapper.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/SpringDocApp228Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/LocaleParam.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/SpringDocApp229Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/XController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/App230Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/App230RequestBody.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/SpringDocApp230Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/ApplicationsRestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SpringDocApp231Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SubClass.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SuperClass.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/SpringDocApp232Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/ParameterController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/MyObj.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/MyPathParameterCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/SpringDocApp234Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/MyDebugController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/SpringDocApp235Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/ClassOne.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/ClassTwo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/SpringDocApp236Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/Bar.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/Foo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/MyModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Advice.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Bar.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Foo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/MyException.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/TrackerData.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/MyExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Bar.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Car.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Foo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Pet.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/TweetId.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/HelloController2.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/OpenApiConfig.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/BasicController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/AbstractHelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/HelloControllerWithGlobalApiResponse.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/MealParty.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/Views.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/GlobalExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloBody.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloController2.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/QueryPaging.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/QuerySort.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/BaseController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/DefaultHealthCheckApi.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/UndocumentedClass.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedOperation.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedParameter.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedProperty.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/OperationCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/ParameterCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/PropertyCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/model/ApiType.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/Dog.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/RestResponseEntityExceptionHandler.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/TestObject.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/PersonDTO.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/test/HelloController2.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/User.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/Advice.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/ApiError.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/Greeting.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/GreetingController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/ParameterCustomizer.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/BaseClientModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/BaseController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpecificClientModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpecificController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV1.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV2.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV3.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/IgnoredAnnotationParameter.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app100.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app101.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app102.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app103.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app104.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-1.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-2.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-3.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app106.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app107.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app108.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app109.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app11.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app110.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app111.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app112.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app113.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app114.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app115.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app116.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app117.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app118.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app119.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app12.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app120.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app121.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app122.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app123.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app124.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app129.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app13.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app130.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app131.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app132.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app133.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-1.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-2.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-3.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-4.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-5.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app135.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app136.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app137.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app138.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app139.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app14.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app140.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app141.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app142.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app143.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app149.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app15.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app150.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app151.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app152.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app153.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app154.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app155.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app156.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app157.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app158.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app159.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app160-1.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app160.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app161.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app162.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app163.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app164.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app165.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app166.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app167.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app168.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app169.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app17.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app170.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-GB.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-US.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-fr-FR.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app172.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app173.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-1.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-2.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-3.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-1.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-2.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-3.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app179.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app18.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app180.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app181.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app182.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app183.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-1.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-2.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-3.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app185.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app187.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app188.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app189.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app19.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app190.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app192.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193-1.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app194.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app195.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app196.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app197.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app198.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app199.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app20.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app200.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app201.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app202.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app203.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app204.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app205.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app206.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app207.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app208.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app209.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app21.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app211.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app212-grouped.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app212.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app213.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app216.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-1.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-2.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app218.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app219.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app22.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app220.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app221.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app222.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app223.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app224.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app225.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app226.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app227.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app228.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app229.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app23.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app230.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app231.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app232.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app233.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app234.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app235.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app236.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app24.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app25.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app26.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app27.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app28.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app29.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app30.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app31.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app32.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app33.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app34.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app35.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app37.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app38.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app39.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app40.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app41.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app42.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app43.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app44.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app45.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app46.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app47.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app48.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app49.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app50.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app51.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app52.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app53.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app54.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app55.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app56.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app57.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app58.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app59.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app60.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app61.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app62.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app63.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app64.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app65.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app66.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app67.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app69.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app70.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app71.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app73.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app74.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app75.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app76.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app77.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app78.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app79.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app80.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app82.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app83.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app84.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app85.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app86.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app87.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app88.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app89.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app90.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app91.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app92.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app93.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app94.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app95.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app96.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app97.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app98.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app99.json diff --git a/pom.xml b/pom.xml index 2f2b0efc2..27a229dec 100644 --- a/pom.xml +++ b/pom.xml @@ -69,6 +69,7 @@ 1.4.0 2.1.0 1.9 + 1.9 diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/HelloController.java new file mode 100644 index 000000000..9f5b93c06 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app100; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.tags.Tags; +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Tags(value = @Tag(name = "hello-ap1")) +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + @Tags(value = @Tag(name = "hello-ap2")) + public PersonDTO getAllPets(@NotNull String toto) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/PersonDTO.java new file mode 100644 index 000000000..779228c00 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/PersonDTO.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app100; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java new file mode 100644 index 000000000..eee8650ee --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app100; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp100Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/HelloController.java new file mode 100644 index 000000000..366cc42b1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app101; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/hello") +public class HelloController { + + @GetMapping + @ApiResponse(content = @Content(schema = @Schema( + description = "${test.app101.operation.hello.response.schema.description}", + implementation = HelloDTO.class))) + public HelloDTO hello() { + return new HelloDTO(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/HelloDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/HelloDTO.java new file mode 100644 index 000000000..c5fcb19d7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/HelloDTO.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app101; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "${test.app101.schema.hello.description}") +public class HelloDTO { + + @Schema(description = "${test.app101.schema.hello.param.id.description}") + private String id; + + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java new file mode 100644 index 000000000..f66477825 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app101; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +@ActiveProfiles("101") +public class SpringDocApp101Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java new file mode 100644 index 000000000..a474876c8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NotBlank; + +public class InheritedRequestParams extends RequestParams { + @Parameter(description = "parameter from child of RequestParams") + @NotBlank + private String childParam; + + public String getChildParam() { + return childParam; + } + + public void setChildParam(String childParam) { + this.childParam = childParam; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java new file mode 100644 index 000000000..197e59734 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java @@ -0,0 +1,148 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import java.math.BigInteger; +import java.util.List; +import java.util.Optional; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.lang.Nullable; + +public class RequestParams { + + @Parameter(description = "string parameter") + @JsonIgnore + private String stringParam; + + @Deprecated + private String stringParam1; + + @Parameter(description = "string parameter2", required = true) + private String stringParam2; + + @Parameter(description = "int parameter") + private int intParam; + + private Optional intParam2; + + @Nullable + private String intParam3; + + private Nested nested; + + private List nestedList; + + public String getStringParam() { + return stringParam; + } + + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + public int getIntParam() { + return intParam; + } + + public void setIntParam(int intParam) { + this.intParam = intParam; + } + + public Optional getIntParam2() { + return intParam2; + } + + public void setIntParam2(Optional intParam2) { + this.intParam2 = intParam2; + } + + @Nullable + public String getIntParam3() { + return intParam3; + } + + public void setIntParam3(@Nullable String intParam3) { + this.intParam3 = intParam3; + } + + public String getStringParam1() { + return stringParam1; + } + + public void setStringParam1(String stringParam1) { + this.stringParam1 = stringParam1; + } + + public String getStringParam2() { + return stringParam2; + } + + public void setStringParam2(String stringParam2) { + this.stringParam2 = stringParam2; + } + + public Nested getNested() { + return nested; + } + + public void setNested(Nested nested) { + this.nested = nested; + } + + public List getNestedList() { + return nestedList; + } + + public void setNestedList(List nestedList) { + this.nestedList = nestedList; + } + + public static class Nested { + private String param1; + + private BigInteger param2; + + @Parameter(description = "nested string parameter") + public String getParam1() { + return param1; + } + + public void setParam1(String param1) { + this.param1 = param1; + } + + @Parameter(description = "nested BigInteger parameter") + public BigInteger getParam2() { + return param2; + } + + public void setParam2(BigInteger param2) { + this.param2 = param2; + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java new file mode 100644 index 000000000..56ee20aec --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp102Test extends AbstractSpringDocV31Test { + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/TestController.java new file mode 100644 index 000000000..ac7c90406 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/TestController.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.lang.Nullable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestController { + @GetMapping("test") + public void getTest(@RequestParam @Nullable String param, @ParameterObject InheritedRequestParams requestParams) { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/ExampleBody.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/ExampleBody.java new file mode 100644 index 000000000..dfb956a51 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/ExampleBody.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app103; + +public class ExampleBody { + private String stringParam; + + private int intParam; + + public String getStringParam() { + return stringParam; + } + + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + public int getIntParam() { + return intParam; + } + + public void setIntParam(int intParam) { + this.intParam = intParam; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/HelloController.java new file mode 100644 index 000000000..bf136ab65 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app103; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Encoding; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class HelloController { + + @PostMapping(value = "/test/103", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Operation( + requestBody = @RequestBody( + content = @Content( + encoding = @Encoding(name = "body", contentType = "application/json") + ) + ) + ) + public String postMyRequestBody( + @RequestPart("body") ExampleBody body, + @RequestParam("file") MultipartFile file + ) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java new file mode 100644 index 000000000..a3db241ca --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app103; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp103Test extends AbstractSpringDocV31Test { + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/CrudController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/CrudController.java new file mode 100644 index 000000000..a902de56f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/CrudController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +@SuppressWarnings("rawtypes") +public abstract class CrudController { + + @GetMapping(path = "{id}") + @ResponseBody + @Operation(description = "Get single object") + public T get( // + @Parameter(description = "The id to get.", required = true) @PathVariable("id") int id) { + return null; + } + + @GetMapping(path = "") + @ResponseBody + @Operation(description = "Receive a list of objects") + public List list() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/Design.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/Design.java new file mode 100644 index 000000000..df3b5ae4b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/Design.java @@ -0,0 +1,28 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +public class Design extends HavingPK { +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/DesignController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/DesignController.java new file mode 100644 index 000000000..d379ff8f6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/DesignController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Tag(name = "design") +@Controller +@RequestMapping("/design") +public class DesignController extends CrudController { + + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/HavingPK.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/HavingPK.java new file mode 100644 index 000000000..f4f3377bf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/HavingPK.java @@ -0,0 +1,28 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +public class HavingPK { +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java new file mode 100644 index 000000000..27119691b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp104Test extends AbstractSpringDocV31Test { + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java new file mode 100644 index 000000000..acfbfd77a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java @@ -0,0 +1,108 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { + "springdoc.group-configs[0].group=stores", + "springdoc.group-configs[0].paths-to-match=/store/**", + "springdoc.group-configs[1].group=users", + "springdoc.group-configs[1].packages-to-scan=test.org.springdoc.api.v31.app105.api.user", + "springdoc.group-configs[2].group=pets", + "springdoc.group-configs[2].paths-to-match=/pet/**", + "springdoc.group-configs[3].group=groups test", + "springdoc.group-configs[3].paths-to-match=/v1/**", + "springdoc.group-configs[3].paths-to-exclude=/v1/users", + "springdoc.group-configs[3].packages-to-scan=test.org.springdoc.api.v31.app105.api.user,test.org.springdoc.api.v31.app105.api.store", +}) +public class SpringDocApp105Test extends AbstractSpringDocV31Test { + + public static String className; + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app105-1.json"), true)); + } + + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app105-2.json"), true)); + } + + @Test + void testApp3() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app105-3.json"), true)); + } + + @Test + void testApp4() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app105-4.json"), true)); + } + + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/ApiUtil.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/ApiUtil.java new file mode 100644 index 000000000..4a3e93d25 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/ApiUtil.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api; + +import java.io.IOException; + +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.server.ResponseStatusException; + +public class ApiUtil { + + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); + req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static void checkApiKey(NativeWebRequest req) { + if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { + throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/ExceptionTranslator.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/ExceptionTranslator.java new file mode 100644 index 000000000..244f3905b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/ExceptionTranslator.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api; + +import java.util.Map; + +import jakarta.validation.ConstraintViolationException; + +import org.springframework.boot.web.error.ErrorAttributeOptions; +import org.springframework.boot.web.servlet.error.ErrorAttributes; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.WebRequest; + +@RestControllerAdvice +public class ExceptionTranslator { + + private final ErrorAttributes errorAttributes; + + public ExceptionTranslator(ErrorAttributes errorAttributes) { + this.errorAttributes = errorAttributes; + } + + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Map processConstraintViolationException(WebRequest request) { + request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); + return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/HomeController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/HomeController.java new file mode 100644 index 000000000..e161e9b9b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/HomeController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; +import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; + +/** + * Home redirection to swagger api documentation + */ +@Controller +public class HomeController { + + @Value(SWAGGER_UI_PATH) + private String swaggerUiPath; + + @GetMapping(DEFAULT_PATH_SEPARATOR) + public String index() { + return REDIRECT_URL_PREFIX + swaggerUiPath; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApi.java new file mode 100644 index 000000000..487f1b43f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApi.java @@ -0,0 +1,165 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app105.api.pet; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v31.app105.model.ModelApiResponse; +import test.org.springdoc.api.v31.app105.model.Pet; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { + @OAuthScope(name = "write:pets", description = "modify pets in your account"), + @OAuthScope(name = "read:pets", description = "read your pets") }))) +@Tag(name = "pet", description = "the pet API") +public interface PetApi { + + default PetApiDelegate getDelegate() { + return new PetApiDelegate() { + }; + } + + @Operation(summary = "Add a new pet to the store", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default void addPet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + // return getDelegate().addPet(pet); + } + + @Operation(summary = "Deletes a pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @DeleteMapping(value = "/pet/{petId}") + default ResponseEntity deletePet( + @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + return getDelegate().deletePet(petId, apiKey); + } + + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid status value") }) + @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByStatus( + @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { + return getDelegate().findPetsByStatus(status); + } + + @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid tag value") }) + @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByTags( + @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + return getDelegate().findPetsByTags(tags); + } + + @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { + @SecurityRequirement(name = "api_key") }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getPetById( + @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + return getDelegate().getPetById(petId); + } + + @Operation(summary = "Update an existing pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") }) + @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default ResponseEntity updatePet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + return getDelegate().updatePet(pet); + } + + @Operation(summary = "Updates a pet in the store with form data", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) + default ResponseEntity updatePetWithForm( + @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, + @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { + return getDelegate().updatePetWithForm(petId, name, status); + } + + @Operation(summary = "uploads an image", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) + @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { + "multipart/form-data" }) + default ResponseEntity uploadFile( + @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { + return getDelegate().uploadFile(petId, additionalMetadata, file); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiController.java new file mode 100644 index 000000000..d7abf0329 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.pet; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +public class PetApiController implements PetApi { + + private final PetApiDelegate delegate; + + public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { + }); + } + + @Override + public PetApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegate.java new file mode 100644 index 000000000..64f98278f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegate.java @@ -0,0 +1,147 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.pet; + +import java.util.List; +import java.util.Optional; + +import jakarta.validation.Valid; +import test.org.springdoc.api.v31.app105.api.ApiUtil; +import test.org.springdoc.api.v31.app105.model.ModelApiResponse; +import test.org.springdoc.api.v31.app105.model.Pet; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface PetApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * @see PetApi#addPet + */ + default void addPet(Pet pet) { + + } + + /** + * @see PetApi#deletePet + */ + default ResponseEntity deletePet(Long petId, + String apiKey) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#findPetsByStatus + */ + default ResponseEntity> findPetsByStatus(List status) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + break; + } + } + }); + } + + /** + * @see PetApi#findPetsByTags + */ + default ResponseEntity> findPetsByTags(List tags) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#getPetById + */ + default ResponseEntity getPetById(Long petId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#updatePet + */ + default ResponseEntity updatePet(Pet pet) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#updatePetWithForm + */ + default ResponseEntity updatePetWithForm(Long petId, + String name, + String status) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#uploadFile + */ + default ResponseEntity uploadFile(Long petId, + String additionalMetadata, + @Valid MultipartFile file) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegateImpl.java new file mode 100644 index 000000000..9027155de --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegateImpl.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.pet; + +import org.springframework.stereotype.Service; + +@Service +public class PetApiDelegateImpl implements PetApiDelegate { + + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApi.java new file mode 100644 index 000000000..70a0f61e5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApi.java @@ -0,0 +1,110 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app105.api.store; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import test.org.springdoc.api.v31.app105.model.Order; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() { + }; + } + + @Operation(summary = "Delete purchase order by ID", tags = { "store" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @DeleteMapping(value = "/store/order/{orderId}") + default ResponseEntity deleteOrder( + @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { + return getDelegate().deleteOrder(orderId); + } + + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { + @SecurityRequirement(name = "api_key") }, tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) + @GetMapping(value = "/store/inventory", produces = { "application/json" }) + default ResponseEntity> getInventory() { + return getDelegate().getInventory(); + } + + @Operation(summary = "Find purchase order by ID", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { + return getDelegate().getOrderById(orderId); + } + + @Operation(summary = "Place an order for a pet", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid Order") }) + @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { + "application/json" }) + default ResponseEntity placeOrder( + @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { + return getDelegate().placeOrder(order); + } + + @GetMapping(value = "/v1/stores") + default void stores(@Valid @NotBlank String name) { + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiController.java new file mode 100644 index 000000000..9a06afeea --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.store; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +public class StoreApiController implements StoreApi { + + private final StoreApiDelegate delegate; + + public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { + }); + } + + @Override + public StoreApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegate.java new file mode 100644 index 000000000..e0f13e3c1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegate.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.store; + +import java.util.Map; +import java.util.Optional; + +import test.org.springdoc.api.v31.app105.api.ApiUtil; +import test.org.springdoc.api.v31.app105.model.Order; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface StoreApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * @see StoreApi#deleteOrder + */ + default ResponseEntity deleteOrder(String orderId) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see StoreApi#getInventory + */ + default ResponseEntity> getInventory() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see StoreApi#getOrderById + */ + default ResponseEntity getOrderById(Long orderId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + break; + } + } + }); + } + + /** + * @see StoreApi#placeOrder + */ + default ResponseEntity placeOrder(Order order) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegateImpl.java new file mode 100644 index 000000000..1599cfe7b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegateImpl.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.store; + +import org.springframework.stereotype.Service; + +@Service +public class StoreApiDelegateImpl implements StoreApiDelegate { + + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApi.java new file mode 100644 index 000000000..afe422289 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApi.java @@ -0,0 +1,138 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app105.api.user; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v31.app105.model.User; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "user", description = "the user API") +public interface UserApi { + + default UserApiDelegate getDelegate() { + return new UserApiDelegate() { + }; + } + + @Operation(summary = "Create user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user", consumes = { "application/json" }) + default ResponseEntity createUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { + return getDelegate().createUser(user); + } + + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) + default ResponseEntity createUsersWithArrayInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithArrayInput(user); + } + + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) + default ResponseEntity createUsersWithListInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithListInput(user); + } + + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @DeleteMapping(value = "/user/{username}") + default ResponseEntity deleteUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + return getDelegate().deleteUser(username); + } + + @Operation(summary = "Get user by user name", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + + @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) + default ResponseEntity getUserByName( + @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + return getDelegate().getUserByName(username); + } + + @Operation(summary = "Logs user into the system", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) + @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) + default ResponseEntity loginUser( + @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + return getDelegate().loginUser(username, password); + } + + @Operation(summary = "Logs out current logged in user session", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @GetMapping(value = "/user/logout") + default ResponseEntity logoutUser() { + return getDelegate().logoutUser(); + } + + @Operation(summary = "Updated user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + @PutMapping(value = "/user/{username}", consumes = { "application/json" }) + default ResponseEntity updateUser( + @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { + return getDelegate().updateUser(username, user); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiController.java new file mode 100644 index 000000000..4aca6a8d8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.user; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +public class UserApiController implements UserApi { + + private final UserApiDelegate delegate; + + public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { + }); + } + + @Override + public UserApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegate.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegate.java new file mode 100644 index 000000000..bc1d17fa5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegate.java @@ -0,0 +1,128 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.user; + +import java.util.List; +import java.util.Optional; + +import test.org.springdoc.api.v31.app105.api.ApiUtil; +import test.org.springdoc.api.v31.app105.model.User; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface UserApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * @see UserApi#createUser + */ + default ResponseEntity createUser(User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#createUsersWithArrayInput + */ + default ResponseEntity createUsersWithArrayInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#createUsersWithListInput + */ + default ResponseEntity createUsersWithListInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#deleteUser + */ + default ResponseEntity deleteUser(String username) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#getUserByName + */ + default ResponseEntity getUserByName(String username) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#loginUser + */ + default ResponseEntity loginUser(String username, + String password) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#logoutUser + */ + default ResponseEntity logoutUser() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#updateUser + */ + default ResponseEntity updateUser(String username, + User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegateImpl.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegateImpl.java new file mode 100644 index 000000000..08a1965b9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegateImpl.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.user; + +import org.springframework.stereotype.Service; + +@Service +public class UserApiDelegateImpl implements UserApiDelegate { + + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Body.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Body.java new file mode 100644 index 000000000..bd769f0f6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Body.java @@ -0,0 +1,103 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Body { + + @Schema(description = "Updated name of the pet") + /** + * Updated name of the pet + **/ + private String name = null; + + @Schema(description = "Updated status of the pet") + /** + * Updated status of the pet + **/ + private String status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Updated name of the pet + * + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Body name(String name) { + this.name = name; + return this; + } + + /** + * Updated status of the pet + * + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Body status(String status) { + this.status = status; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Body {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Body1.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Body1.java new file mode 100644 index 000000000..499beff91 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Body1.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import java.io.File; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Body1 { + + @Schema(description = "Additional data to pass to server") + /** + * Additional data to pass to server + **/ + private String additionalMetadata = null; + + @Schema(description = "file to upload") + /** + * file to upload + **/ + private File file = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Additional data to pass to server + * + * @return additionalMetadata + **/ + @JsonProperty("additionalMetadata") + public String getAdditionalMetadata() { + return additionalMetadata; + } + + public void setAdditionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + } + + public Body1 additionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + return this; + } + + /** + * file to upload + * + * @return file + **/ + @JsonProperty("file") + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } + + public Body1 file(File file) { + this.file = file; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Body1 {\n"); + + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Category.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Category.java new file mode 100644 index 000000000..f3d660b21 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Category.java @@ -0,0 +1,97 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Category { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/ModelApiResponse.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/ModelApiResponse.java new file mode 100644 index 000000000..8ed898e68 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/ModelApiResponse.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class ModelApiResponse { + + @Schema(description = "") + private Integer code = null; + + @Schema(description = "") + private String type = null; + + @Schema(description = "") + private String message = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get code + * + * @return code + **/ + @JsonProperty("code") + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * + * @return type + **/ + @JsonProperty("type") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * + * @return message + **/ + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Order.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Order.java new file mode 100644 index 000000000..38e0af215 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Order.java @@ -0,0 +1,232 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Order { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private Long petId = null; + + @Schema(description = "") + private Integer quantity = null; + + @Schema(description = "") + private Date shipDate = null; + + @Schema(description = "Order Status") + /** + * Order Status + **/ + private StatusEnum status = null; + + @Schema(description = "") + private Boolean complete = false; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * + * @return petId + **/ + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * + * @return quantity + **/ + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * + * @return shipDate + **/ + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + if (status == null) { + return null; + } + return status.getValue(); + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * + * @return complete + **/ + @JsonProperty("complete") + public Boolean isisComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public enum StatusEnum { + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + private final String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Pet.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Pet.java new file mode 100644 index 000000000..8344ca7f3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Pet.java @@ -0,0 +1,246 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +public class Pet { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private Category category = null; + + @Schema(example = "doggie", required = true, description = "") + private String name = null; + + @Schema(required = true, description = "") + private List photoUrls = new ArrayList(); + + @Schema(description = "") + private List tags = null; + + @Schema(description = "pet status in the store") + /** + * pet status in the store + **/ + private StatusEnum status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * + * @return category + **/ + @JsonProperty("category") + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * + * @return name + **/ + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * + * @return photoUrls + **/ + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * + * @return tags + **/ + @JsonProperty("tags") + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * + * @return status + **/ + @JsonProperty("status") + public StatusEnum getStatus() { + if (status == null) { + return null; + } + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public enum StatusEnum { + AVAILABLE("available"), PENDING("pending"), SOLD("sold"); + + private final String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Tag.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Tag.java new file mode 100644 index 000000000..f9d2674cc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/Tag.java @@ -0,0 +1,97 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Tag { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/User.java new file mode 100644 index 000000000..cd4e7ff20 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/model/User.java @@ -0,0 +1,238 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class User { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private String username = null; + + @Schema(description = "") + private String firstName = null; + + @Schema(description = "") + private String lastName = null; + + @Schema(description = "") + private String email = null; + + @Schema(description = "") + private String password = null; + + @Schema(description = "") + private String phone = null; + + @Schema(description = "User Status") + /** + * User Status + **/ + private Integer userStatus = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * + * @return username + **/ + @JsonProperty("username") + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * + * @return firstName + **/ + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * + * @return lastName + **/ + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * + * @return email + **/ + @JsonProperty("email") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * + * @return password + **/ + @JsonProperty("password") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * + * @return phone + **/ + @JsonProperty("phone") + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * + * @return userStatus + **/ + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/HelloController.java new file mode 100644 index 000000000..d959b478d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app106; + +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @Operation(summary = "find-articles") + @GetMapping + @Parameter(name = HttpHeaders.IF_MODIFIED_SINCE, + description = "DateTime", + in = ParameterIn.HEADER, + schema = @Schema(type = "string", format = "date-time"), + example = "2020-01-01T00:00:00.000Z" + ) + public ResponseEntity findArticles(@RequestHeader(value = HttpHeaders.IF_MODIFIED_SINCE, required = false) Instant modifiedSince) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java new file mode 100644 index 000000000..9ede8356f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app106; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp106Test extends AbstractSpringDocV31Test { + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/HelloController.java new file mode 100644 index 000000000..ea12f5552 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/HelloController.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app107; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(path = "/entity-b", produces = { "application/json", "application/xml" }) + public EntityB getEntityB() { + return new EntityB(); + } + + public class EntityB { + + @Schema(required = true) + @JsonProperty("fieldB") + private String fieldB; + + @Schema(required = true) + @JsonProperty("entityA") + private EntityA entityA; + //Getters and setters... + } + + public class EntityA { + @Schema(required = true) + @JsonProperty("fieldA") + private String fieldA; + //Getters and setters... + } +} + diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java new file mode 100644 index 000000000..0b5d086da --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app107; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp107Test extends AbstractSpringDocV31Test { + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/ActionResult.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/ActionResult.java new file mode 100644 index 000000000..6a6e127be --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/ActionResult.java @@ -0,0 +1,88 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app108; + +public class ActionResult { + + protected T value; + + protected boolean success; + + protected String errorCode; + + protected String message; + + protected Object errorValue; + + protected String targetUrl; + + public T getValue() { + return value; + } + + public void setValue(T value) { + this.value = value; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Object getErrorValue() { + return errorValue; + } + + public void setErrorValue(Object errorValue) { + this.errorValue = errorValue; + } + + public String getTargetUrl() { + return targetUrl; + } + + public void setTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/HelloController.java new file mode 100644 index 000000000..74d06bc96 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/HelloController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app108; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping + public ActionResult update(String toto) { + return null; + } +} + diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java new file mode 100644 index 000000000..1b8b43bb3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app108; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp108Test extends AbstractSpringDocV31Test { + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/HelloController.java new file mode 100644 index 000000000..476b4987b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app109; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.core.io.ByteArrayResource; +import org.springframework.core.io.Resource; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/api/v1/resource") + public Resource getResource() { + return new ByteArrayResource(new byte[] {}); + } + + @GetMapping("/api/v1/bytearray") + @ApiResponse(content = @Content(schema = @Schema(type = "string", format = "binary"))) + public byte[] getByteArray() { + return new byte[] {}; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java new file mode 100644 index 000000000..ff6cb37f8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app109; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp109Test extends AbstractSpringDocV31Test { + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java new file mode 100644 index 000000000..2738a9572 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import java.util.List; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class HelloController { + + @PostMapping(path = "/documents", consumes = "multipart/form-data") + public ResponseEntity uploadDocuments(@RequestPart("doc") List multipartFiles) { + return null; + } + + @RequestMapping(value = "/tracks", method = RequestMethod.POST, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + public @ResponseBody + String postTrack(@RequestParam("file") MultipartFile file) { + return "redirect:/"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..46a2e117f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp11Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/ErrorMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/ErrorMessage.java new file mode 100644 index 000000000..26f8f0a45 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/ErrorMessage.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +public class ErrorMessage { + + private List errors; + + public ErrorMessage() { + } + + public ErrorMessage(List errors) { + this.errors = errors; + } + + public ErrorMessage(String error) { + this(Collections.singletonList(error)); + } + + public ErrorMessage(String... errors) { + this(Arrays.asList(errors)); + } + + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/GlobalControllerAdvice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/GlobalControllerAdvice.java new file mode 100644 index 000000000..e78393ad8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/GlobalControllerAdvice.java @@ -0,0 +1,151 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.FieldError; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +@ControllerAdvice(assignableTypes = PersonController.class) +public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +{ + /** + * Note use base class if you wish to leverage its handling. + * Some code will need changing. + */ + private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); + + @ExceptionHandler(Throwable.class) + @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity problem(final Throwable e) { + String message = "Problem occured"; + UUID uuid = UUID.randomUUID(); + String logRef = uuid.toString(); + logger.error("logRef=" + logRef, message, e); + return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); + } + + + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex + ) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + List globalErrors = ex.getBindingResult().getGlobalErrors(); + List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); + String error; + for (FieldError fieldError : fieldErrors) { + error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); + errors.add(error); + } + for (ObjectError objectError : globalErrors) { + error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); + errors.add(error); + } + ErrorMessage errorMessage = new ErrorMessage(errors); + + //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex + ) { + Set> constraintViolations = ex.getConstraintViolations(); + + + List errors = new ArrayList<>(constraintViolations.size()); + String error; + for (ConstraintViolation constraintViolation : constraintViolations) { + + error = constraintViolation.getMessage(); + errors.add(error); + } + + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex + ) { + + List errors = new ArrayList<>(); + String error = ex.getParameterName() + ", " + ex.getMessage(); + errors.add(error); + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + + @ExceptionHandler(HttpMediaTypeNotSupportedException.class) + @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) + public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex + ) { + String unsupported = "Unsupported content type: " + ex.getContentType(); + String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); + ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); + return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); + } + + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { + Throwable mostSpecificCause = ex.getMostSpecificCause(); + ErrorMessage errorMessage; + if (mostSpecificCause != null) { + String exceptionName = mostSpecificCause.getClass().getName(); + String message = mostSpecificCause.getMessage(); + errorMessage = new ErrorMessage(exceptionName, message); + } + else { + errorMessage = new ErrorMessage(ex.getMessage()); + } + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/Person.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/Person.java new file mode 100644 index 000000000..1891289e0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/Person.java @@ -0,0 +1,116 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import org.hibernate.validator.constraints.CreditCardNumber; + + +public class Person { + private long id; + + private String firstName; + + @NotNull + @NotBlank + @Size(max = 10) + private String lastName; + + @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") + private String email; + + @Email() + private String email1; + + @Min(18) + @Max(30) + private int age; + + @CreditCardNumber + private String creditCardNumber; + + public String getCreditCardNumber() { + return creditCardNumber; + } + + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEmail1() { + return email1; + } + + public void setEmail1(String email1) { + this.email1 = email1; + } + + @Size(min = 2) + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/PersonController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/PersonController.java new file mode 100644 index 000000000..39dac4e74 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/PersonController.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +public class PersonController { + private final Random ran = new Random(); + + @RequestMapping(path = "/person", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) throws HttpMediaTypeNotSupportedException { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) throws HttpMediaTypeNotSupportedException { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/PersonController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/PersonController2.java new file mode 100644 index 000000000..a4936ba28 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/PersonController2.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +public class PersonController2 { + private final Random ran = new Random(); + + @RequestMapping(path = "/person2", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/Problem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/Problem.java new file mode 100644 index 000000000..40e1c887a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/Problem.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +public class Problem { + + private String logRef; + + private String message; + + public Problem(String logRef, String message) { + super(); + this.logRef = logRef; + this.message = message; + } + + public Problem() { + super(); + + } + + public String getLogRef() { + return logRef; + } + + public void setLogRef(String logRef) { + this.logRef = logRef; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java new file mode 100644 index 000000000..06e97ac27 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "application-description=description", + "application-version=v1" }) +public class SpringDocApp110Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + + @Bean + public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { + + return new OpenAPI() + .info(new Info() + .title("sample application API") + .version(appVersion) + .description(appDesciption) + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/ErrorMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/ErrorMessage.java new file mode 100644 index 000000000..4e62fef8a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/ErrorMessage.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +public class ErrorMessage { + + private List errors; + + public ErrorMessage() { + } + + public ErrorMessage(List errors) { + this.errors = errors; + } + + public ErrorMessage(String error) { + this(Collections.singletonList(error)); + } + + public ErrorMessage(String... errors) { + this(Arrays.asList(errors)); + } + + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/GlobalControllerAdvice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/GlobalControllerAdvice.java new file mode 100644 index 000000000..f59d91b1b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/GlobalControllerAdvice.java @@ -0,0 +1,151 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.FieldError; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +@ControllerAdvice(basePackages = "test.org.springdoc.api.v31.appzzz") +public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +{ + /** + * Note use base class if you wish to leverage its handling. + * Some code will need changing. + */ + private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); + + @ExceptionHandler(Throwable.class) + @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity problem(final Throwable e) { + String message = "Problem occured"; + UUID uuid = UUID.randomUUID(); + String logRef = uuid.toString(); + logger.error("logRef=" + logRef, message, e); + return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); + } + + + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex + ) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + List globalErrors = ex.getBindingResult().getGlobalErrors(); + List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); + String error; + for (FieldError fieldError : fieldErrors) { + error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); + errors.add(error); + } + for (ObjectError objectError : globalErrors) { + error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); + errors.add(error); + } + ErrorMessage errorMessage = new ErrorMessage(errors); + + //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex + ) { + Set> constraintViolations = ex.getConstraintViolations(); + + + List errors = new ArrayList<>(constraintViolations.size()); + String error; + for (ConstraintViolation constraintViolation : constraintViolations) { + + error = constraintViolation.getMessage(); + errors.add(error); + } + + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex + ) { + + List errors = new ArrayList<>(); + String error = ex.getParameterName() + ", " + ex.getMessage(); + errors.add(error); + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + + @ExceptionHandler(HttpMediaTypeNotSupportedException.class) + @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) + public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex + ) { + String unsupported = "Unsupported content type: " + ex.getContentType(); + String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); + ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); + return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); + } + + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { + Throwable mostSpecificCause = ex.getMostSpecificCause(); + ErrorMessage errorMessage; + if (mostSpecificCause != null) { + String exceptionName = mostSpecificCause.getClass().getName(); + String message = mostSpecificCause.getMessage(); + errorMessage = new ErrorMessage(exceptionName, message); + } + else { + errorMessage = new ErrorMessage(ex.getMessage()); + } + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/Person.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/Person.java new file mode 100644 index 000000000..e8b3d2e1e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/Person.java @@ -0,0 +1,116 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import org.hibernate.validator.constraints.CreditCardNumber; + + +public class Person { + private long id; + + private String firstName; + + @NotNull + @NotBlank + @Size(max = 10) + private String lastName; + + @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") + private String email; + + @Email() + private String email1; + + @Min(18) + @Max(30) + private int age; + + @CreditCardNumber + private String creditCardNumber; + + public String getCreditCardNumber() { + return creditCardNumber; + } + + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEmail1() { + return email1; + } + + public void setEmail1(String email1) { + this.email1 = email1; + } + + @Size(min = 2) + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/PersonController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/PersonController.java new file mode 100644 index 000000000..115e66578 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/PersonController.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +public class PersonController { + private final Random ran = new Random(); + + @RequestMapping(path = "/person", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/PersonController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/PersonController2.java new file mode 100644 index 000000000..a1e84ba66 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/PersonController2.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +public class PersonController2 { + private final Random ran = new Random(); + + @RequestMapping(path = "/person2", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/Problem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/Problem.java new file mode 100644 index 000000000..b33a10c59 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/Problem.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +public class Problem { + + private String logRef; + + private String message; + + public Problem(String logRef, String message) { + super(); + this.logRef = logRef; + this.message = message; + } + + public Problem() { + super(); + + } + + public String getLogRef() { + return logRef; + } + + public void setLogRef(String logRef) { + this.logRef = logRef; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java new file mode 100644 index 000000000..baa3d692b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "application-description=description", + "application-version=v1" }) +public class SpringDocApp111Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + + @Bean + public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { + return new OpenAPI() + .info(new Info() + .title("sample application API") + .version(appVersion) + .description(appDesciption) + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/ErrorMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/ErrorMessage.java new file mode 100644 index 000000000..6ba5f2bcb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/ErrorMessage.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +public class ErrorMessage { + + private List errors; + + public ErrorMessage() { + } + + public ErrorMessage(List errors) { + this.errors = errors; + } + + public ErrorMessage(String error) { + this(Collections.singletonList(error)); + } + + public ErrorMessage(String... errors) { + this(Arrays.asList(errors)); + } + + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/GlobalControllerAdvice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/GlobalControllerAdvice.java new file mode 100644 index 000000000..e00534d04 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/GlobalControllerAdvice.java @@ -0,0 +1,151 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.FieldError; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +@ControllerAdvice(basePackages = "test.org.springdoc.api.v31.app112.sample") +public class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +{ + /** + * Note use base class if you wish to leverage its handling. + * Some code will need changing. + */ + private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); + + @ExceptionHandler(Throwable.class) + @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity problem(final Throwable e) { + String message = "Problem occured"; + UUID uuid = UUID.randomUUID(); + String logRef = uuid.toString(); + logger.error("logRef=" + logRef, message, e); + return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); + } + + + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex + ) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + List globalErrors = ex.getBindingResult().getGlobalErrors(); + List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); + String error; + for (FieldError fieldError : fieldErrors) { + error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); + errors.add(error); + } + for (ObjectError objectError : globalErrors) { + error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); + errors.add(error); + } + ErrorMessage errorMessage = new ErrorMessage(errors); + + //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex + ) { + Set> constraintViolations = ex.getConstraintViolations(); + + + List errors = new ArrayList<>(constraintViolations.size()); + String error; + for (ConstraintViolation constraintViolation : constraintViolations) { + + error = constraintViolation.getMessage(); + errors.add(error); + } + + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex + ) { + + List errors = new ArrayList<>(); + String error = ex.getParameterName() + ", " + ex.getMessage(); + errors.add(error); + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + + @ExceptionHandler(HttpMediaTypeNotSupportedException.class) + @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) + public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex + ) { + String unsupported = "Unsupported content type: " + ex.getContentType(); + String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); + ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); + return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); + } + + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { + Throwable mostSpecificCause = ex.getMostSpecificCause(); + ErrorMessage errorMessage; + if (mostSpecificCause != null) { + String exceptionName = mostSpecificCause.getClass().getName(); + String message = mostSpecificCause.getMessage(); + errorMessage = new ErrorMessage(exceptionName, message); + } + else { + errorMessage = new ErrorMessage(ex.getMessage()); + } + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/Person.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/Person.java new file mode 100644 index 000000000..3b84906bd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/Person.java @@ -0,0 +1,116 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import org.hibernate.validator.constraints.CreditCardNumber; + + +public class Person { + private long id; + + private String firstName; + + @NotNull + @NotBlank + @Size(max = 10) + private String lastName; + + @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") + private String email; + + @Email() + private String email1; + + @Min(18) + @Max(30) + private int age; + + @CreditCardNumber + private String creditCardNumber; + + public String getCreditCardNumber() { + return creditCardNumber; + } + + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEmail1() { + return email1; + } + + public void setEmail1(String email1) { + this.email1 = email1; + } + + @Size(min = 2) + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/PersonController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/PersonController.java new file mode 100644 index 000000000..8bdce790c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/PersonController.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +public class PersonController { + private final Random ran = new Random(); + + @RequestMapping(path = "/person", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/Problem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/Problem.java new file mode 100644 index 000000000..a2f700f5f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/Problem.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +public class Problem { + + private String logRef; + + private String message; + + public Problem(String logRef, String message) { + super(); + this.logRef = logRef; + this.message = message; + } + + public Problem() { + super(); + + } + + public String getLogRef() { + return logRef; + } + + public void setLogRef(String logRef) { + this.logRef = logRef; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java new file mode 100644 index 000000000..91f260b22 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "application-description=description", + "application-version=v1" }) +public class SpringDocApp112Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + + @Bean + public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { + return new OpenAPI() + .info(new Info() + .title("sample application API") + .version(appVersion) + .description(appDesciption) + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/sample/PersonController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/sample/PersonController2.java new file mode 100644 index 000000000..c16e0e866 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/sample/PersonController2.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112.sample; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import test.org.springdoc.api.v31.app112.Person; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Validated +public class PersonController2 { + private final Random ran = new Random(); + + @RequestMapping(path = "/person2", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) throws HttpMediaTypeNotSupportedException { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) throws HttpMediaTypeNotSupportedException { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/HelloController.java new file mode 100644 index 000000000..d52b87710 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app113; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/lol") + public void test(@RequestBody(required = false) Body body) { + } + + @PostMapping("/lol2") + public void test2(@RequestBody Optional body) { + } + + public class Body { + public String field; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java new file mode 100644 index 000000000..d003a01c4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app113; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp113Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/HelloController.java new file mode 100644 index 000000000..724d0597e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app114; + +import javax.money.MonetaryAmount; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/foos1", consumes = MediaType.APPLICATION_JSON_VALUE) + MonetaryAmount getCurrency(@RequestBody CarDTO carDTO) { + return carDTO.price; + } + + class CarDTO { + @JsonProperty("price") + MonetaryAmount price; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java new file mode 100644 index 000000000..603fdb1c3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app114; + +import java.math.BigDecimal; + +import javax.money.MonetaryAmount; + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp114Test extends AbstractSpringDocV31Test { + + static { + SpringDocUtils.getConfig() + .removeFromSchemaMap(BigDecimal.class) + .replaceWithClass(MonetaryAmount.class, org.springdoc.core.converters.models.MonetaryAmount.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/HelloController.java new file mode 100644 index 000000000..69ee39b86 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app115; + +import java.time.Duration; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/api/v2/timeout", + consumes = { MediaType.ALL_VALUE }, + produces = { MediaType.APPLICATION_JSON_VALUE }) + public Duration timeouts() { + return Duration.ofSeconds(5); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java new file mode 100644 index 000000000..f59f723e1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app115; + +import java.time.Duration; +import java.util.Map; + +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.Schema; +import org.springdoc.core.customizers.OperationCustomizer; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; + +@Component +public class JavaTimeOperationCustomizer implements OperationCustomizer { + @Override + public Operation customize(Operation operation, HandlerMethod handlerMethod) { + if (handlerMethod.getReturnType().getParameterType().isAssignableFrom(Duration.class)) { + for (Map.Entry entry : operation.getResponses().entrySet()) { + io.swagger.v3.oas.models.responses.ApiResponse response = entry.getValue(); + Content content = response.getContent(); + if (content.containsKey(MediaType.APPLICATION_JSON_VALUE)) { + Schema schema = content.get(MediaType.APPLICATION_JSON_VALUE).getSchema(); + schema.getProperties().clear(); + schema.setType("string"); + } + } + } + return operation; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java new file mode 100644 index 000000000..6251c0888 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app115; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp115Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/FooErrorHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/FooErrorHandler.java new file mode 100644 index 000000000..ef8287450 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/FooErrorHandler.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app116; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +@ControllerAdvice(assignableTypes = HelloController.class) +public class FooErrorHandler { + + @ExceptionHandler + public ResponseEntity storeAssignmentPublishingError(Exception e) { + return new ResponseEntity<>("foo", HttpStatus.INTERNAL_SERVER_ERROR); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/HelloController.java new file mode 100644 index 000000000..ee2a65c2d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app116; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) +public class HelloController { + + @PostMapping("/foo") + public String create(@RequestBody String foo) { + return "foo"; + } +} + + diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java new file mode 100644 index 000000000..fd117917c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app116; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp116Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/HelloApplication.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/HelloApplication.java new file mode 100644 index 000000000..f11d77e4f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/HelloApplication.java @@ -0,0 +1,180 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app117; + +import java.io.IOException; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import jakarta.servlet.FilterChain; +import jakarta.servlet.GenericFilter; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.ServerRequest; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +@Configuration +public class HelloApplication { + + @Bean + @RouterOperations({ @RouterOperation(path = "/people", method = RequestMethod.GET, beanClass = PersonService.class, beanMethod = "all"), + @RouterOperation(path = "/people/{id}", beanClass = PersonService.class, beanMethod = "byId"), + @RouterOperation(path = "/people", method = RequestMethod.POST, beanClass = PersonService.class, beanMethod = "save") }) + RouterFunction routes(PersonHandler ph) { + String root = ""; + return route() + .GET(root + "/people", ph::handleGetAllPeople) + .GET(root + "/people/{id}", ph::handleGetPersonById) + .POST(root + "/people", ph::handlePostPerson) + .filter((serverRequest, handlerFunction) -> { + return handlerFunction.handle(serverRequest); + }) + .build(); + } +} + +@Component +class SimpleFilter extends GenericFilter { + + @Override + public void doFilter(ServletRequest req, ServletResponse res, + FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(req, res); + } +} + +@Component +class PersonHandler { + + private final PersonService personService; + + PersonHandler(PersonService personService) { + this.personService = personService; + } + + ServerResponse handleGetAllPeople(ServerRequest serverRequest) { + return ok().body(personService.all()); + } + + ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { + Person result = personService.save(new Person(null, r.body(Person.class).getName())); + URI uri = URI.create("/people/" + result.getId()); + return ServerResponse.created(uri).body(result); + } + + ServerResponse handleGetPersonById(ServerRequest r) { + return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); + } +} + +@RestController +class GreetingsRestController { + + @GetMapping("/greet/{name}") + String greet(@PathVariable String name) { + return "hello " + name + "!"; + } +} + +@Service +class PersonService { + + private final AtomicLong counter = new AtomicLong(); + + private final Set people = Stream.of( + new Person(counter.incrementAndGet(), "Jane"), + new Person(counter.incrementAndGet(), "Josh"), + new Person(counter.incrementAndGet(), "Gordon")) + .collect(Collectors.toCollection(HashSet::new)); + + + Person save(Person p) { + Person person = new Person(counter.incrementAndGet(), p.getName()); + this.people.add(person); + return person; + } + + Set all() { + return this.people; + } + + Person byId(@Parameter(in = ParameterIn.PATH) Long id) { + return this.people.stream() + .filter(p -> p.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); + } + +} + +class Person { + + private Long id; + + private String name; + + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java new file mode 100644 index 000000000..e7f39f1dd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app117; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp117Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/AbstractParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/AbstractParent.java new file mode 100644 index 000000000..40b69fb6c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/AbstractParent.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app118; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildOfAbstract1.class), + @Type(ChildOfAbstract2.class) +}) +public abstract class AbstractParent { + private int id; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + +class ChildOfAbstract1 extends AbstractParent { + private String abstrachChild1Param; + + public String getAbstrachChild1Param() { + return abstrachChild1Param; + } + + public void setAbstrachChild1Param(String abstrachChild1Param) { + this.abstrachChild1Param = abstrachChild1Param; + } +} + +class ChildOfAbstract2 extends AbstractParent { + private String abstractChild2Param; + + public String getAbstractChild2Param() { + return abstractChild2Param; + } + + public void setAbstractChild2Param(String abstractChild2Param) { + this.abstractChild2Param = abstractChild2Param; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/ConcreteParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/ConcreteParent.java new file mode 100644 index 000000000..b9d46e15b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/ConcreteParent.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app118; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildOfConcrete1.class), + @Type(ChildOfConcrete2.class) +}) +public class ConcreteParent { + private int id; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + +class ChildOfConcrete1 extends ConcreteParent { + private String concreteChild1Param; + + public String getConcreteChild1Param() { + return concreteChild1Param; + } + + public void setConcreteChild1Param(String concreteChild1Param) { + this.concreteChild1Param = concreteChild1Param; + } +} + +class ChildOfConcrete2 extends ConcreteParent { + private String concreteChild2Param; + + public String getConcreteChild2Param() { + return concreteChild2Param; + } + + public void setConcreteChild2Param(String concreteChild2Param) { + this.concreteChild2Param = concreteChild2Param; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/Controller.java new file mode 100644 index 000000000..4fcab573c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/Controller.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app118; + +import java.util.List; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("class-hierarchy") +public class Controller { + @PostMapping("abstract-parent") + public Response abstractParent(@RequestBody AbstractParent payload) { + return null; + } + + @PostMapping("concrete-parent") + public Response concreteParent(@RequestBody ConcreteParent payload) { + return null; + } +} + +class Response { + AbstractParent abstractParent; + + List concreteParents; + + public AbstractParent getAbstractParent() { + return abstractParent; + } + + public void setAbstractParent(AbstractParent abstractParent) { + this.abstractParent = abstractParent; + } + + public List getConcreteParents() { + return concreteParents; + } + + public void setConcreteParents(List concreteParents) { + this.concreteParents = concreteParents; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java new file mode 100644 index 000000000..615340fb6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app118; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp118Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/HelloController.java new file mode 100644 index 000000000..ab77cb0d1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app119; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Encoding; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class HelloController { + + @Operation(summary = "Multiple files and JSON payloads as multi part request") + @PostMapping( + value = "multi", + consumes = MediaType.MULTIPART_FORM_DATA_VALUE, + produces = MediaType.TEXT_PLAIN_VALUE) + public String multiFilesInMultiPart( + @RequestPart("params") + @RequestBody(content = @Content(encoding = @Encoding(name="params", contentType=MediaType.APPLICATION_JSON_VALUE))) + @Parameter( + description = "This is the configuration", + content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)) final JsonRequest jsonRequest, + @RequestPart(value = "file1", required = false) @Parameter(description = "This is file1") final MultipartFile file1, + @RequestPart(value = "file2", required = false) @Parameter(description = "This is file2") final MultipartFile file2) { + return "Hello World " + jsonRequest.getName(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/JsonRequest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/JsonRequest.java new file mode 100644 index 000000000..53c733a50 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/JsonRequest.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app119; + +public class JsonRequest { + + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java new file mode 100644 index 000000000..622d03bb5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app119; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp119Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java new file mode 100644 index 000000000..6d1cac57c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + @Operation(parameters = { + @Parameter(name = "name", in = ParameterIn.QUERY, schema = @Schema(implementation = String.class)) }) + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java new file mode 100644 index 000000000..55c5a37d3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp12Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/AccountId.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/AccountId.java new file mode 100644 index 000000000..e40bd01d7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/AccountId.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app120; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.core.annotation.AliasFor; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +@Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Parameter(description = "non alias description") +public @interface AccountId { + + @AliasFor(annotation = Parameter.class, value = "name") + String name() default ""; + + @AliasFor(annotation = Parameter.class, value = "example") + String example() default "123456"; + + @AliasFor(annotation = Parameter.class, value = "in") + ParameterIn in() default ParameterIn.DEFAULT; + + @AliasFor(annotation = Parameter.class, value = "schema") + Schema schema() default @Schema(); +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/MetaAnnotationController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/MetaAnnotationController.java new file mode 100644 index 000000000..cc6528aca --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/MetaAnnotationController.java @@ -0,0 +1,168 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ +package test.org.springdoc.api.v31.app120; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +import io.swagger.v3.oas.annotations.extensions.Extension; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +@RestController +public class MetaAnnotationController { + + @GetMapping(value = "/simpleTest/{accountId}") + String simpleTest(@PathVariable @AccountId String accountId) { + return accountId; + } + + /** + * When there is a top level {@code @Parameter} annotation it has precedence over the meta-annotation + * So the id parameter should have all the defaults, with a name of "id" + */ + @GetMapping(value = "/testTopLevelParamAnnotationOverrides/{id}") + String testTopLevelParamAnnotationOverrides(@PathVariable @AccountId @Parameter(name = "id") String accountId) { + return accountId; + } + + @GetMapping(value = "/testQueryParam") + String testQueryParam(@RequestParam @AccountId String accountId) { + return accountId; + } + + /** + * {@code @AliasFor} in the {@code @AccountId} annotation allows us to override the default it provides. + */ + @GetMapping(value = "/testAliasFor") + String testAliasFor(@RequestParam @AccountId(example = "OVERRIDDEN EXAMPLE") String accountId) { + return accountId; + } + + @GetMapping(value = "/testMetaMetaAnnotation/{accountId}") + String testMetaMetaAnnotation( + @RequestParam @QueryAccountId String queryAccountId, + @PathVariable @AccountId String accountId) { + return accountId; + } + + @GetMapping(value = "/testAllAttributesAsAlias/") + String testAllAttributesAsAlias( + @RequestParam @TestAllAttributesAsAlias String name) { + return name; + } + + @GetMapping(value = "/testNoAliasFors/") + String testNoAliasFors( + @RequestParam @TestAllAttributesAsAlias String name) { + return name; + } + + /** + * This should inherent all the attributes of {@code @AccountId}, but give it a different name + */ + @Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) + @Retention(RetentionPolicy.RUNTIME) + @AccountId(name = "queryAccountId") + @interface QueryAccountId { + } + + @Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) + @Retention(RetentionPolicy.RUNTIME) + @Parameter + @interface TestAllAttributesAsAlias { + + @AliasFor(annotation = Parameter.class, attribute = "name") + String name() default "name"; + + @AliasFor(annotation = Parameter.class, attribute = "in") + ParameterIn in() default ParameterIn.QUERY; + + @AliasFor(annotation = Parameter.class, attribute = "description") + String description() default "desc"; + + @AliasFor(annotation = Parameter.class, attribute = "required") + boolean required() default true; + + @AliasFor(annotation = Parameter.class, attribute = "deprecated") + boolean deprecated() default true; + + @AliasFor(annotation = Parameter.class, attribute = "allowEmptyValue") + boolean allowEmptyValue() default true; + + @AliasFor(annotation = Parameter.class, attribute = "style") + ParameterStyle style() default ParameterStyle.DEEPOBJECT; + + @AliasFor(annotation = Parameter.class, attribute = "explode") + Explode explode() default Explode.TRUE; + + @AliasFor(annotation = Parameter.class, attribute = "allowReserved") + boolean allowReserved() default true; + + @AliasFor(annotation = Parameter.class, attribute = "schema") + Schema schema() default @Schema(name = "special schema", implementation = Boolean.class); + + @AliasFor(annotation = Parameter.class, attribute = "array") + ArraySchema array() default @ArraySchema(); + + @AliasFor(annotation = Parameter.class, attribute = "content") + Content[] content() default {}; + + @AliasFor(annotation = Parameter.class, attribute = "hidden") + boolean hidden() default false; + + @AliasFor(annotation = Parameter.class, attribute = "examples") + ExampleObject[] examples() default {}; + + @AliasFor(annotation = Parameter.class, attribute = "example") + String example() default "1234"; + + @AliasFor(annotation = Parameter.class, attribute = "extensions") + Extension[] extensions() default {}; + + @AliasFor(annotation = Parameter.class, attribute = "ref") + String ref() default ""; + } + + @Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) + @Retention(RetentionPolicy.RUNTIME) + @Parameter(name = "name", description = "desc", schema = @Schema(implementation = Boolean.class)) + @interface TestNoAliasFors { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java new file mode 100644 index 000000000..e6c03fbf3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app120; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp120Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/InheritedRequestParams.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/InheritedRequestParams.java new file mode 100644 index 000000000..6b39db2cb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/InheritedRequestParams.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app121; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NotBlank; + +public class InheritedRequestParams extends RequestParams { + + @Parameter(description = "parameter from child of RequestParams") + @NotBlank + private String childParam; + + public String getChildParam() { + return childParam; + } + + public void setChildParam(String childParam) { + this.childParam = childParam; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/RequestParams.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/RequestParams.java new file mode 100644 index 000000000..a55e0f7bb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/RequestParams.java @@ -0,0 +1,143 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app121; + +import java.math.BigInteger; +import java.util.List; +import java.util.Optional; + +import io.swagger.v3.oas.annotations.Parameter; + + +public class RequestParams { + + @Parameter(description = "string parameter") + private String stringParam; + + @Deprecated + private String stringParam1; + + @Parameter(description = "string parameter2", required = true) + private String stringParam2; + + @Parameter(description = "int parameter") + private int intParam; + + private Optional intParam2; + + private String intParam3; + + private Nested nested; + + private List nestedList; + + public String getStringParam() { + return stringParam; + } + + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + public int getIntParam() { + return intParam; + } + + public void setIntParam(int intParam) { + this.intParam = intParam; + } + + public Optional getIntParam2() { + return intParam2; + } + + public void setIntParam2(Optional intParam2) { + this.intParam2 = intParam2; + } + + public String getIntParam3() { + return intParam3; + } + + public void setIntParam3(String intParam3) { + this.intParam3 = intParam3; + } + + public String getStringParam1() { + return stringParam1; + } + + public void setStringParam1(String stringParam1) { + this.stringParam1 = stringParam1; + } + + public String getStringParam2() { + return stringParam2; + } + + public void setStringParam2(String stringParam2) { + this.stringParam2 = stringParam2; + } + + public Nested getNested() { + return nested; + } + + public void setNested(Nested nested) { + this.nested = nested; + } + + public List getNestedList() { + return nestedList; + } + + public void setNestedList(List nestedList) { + this.nestedList = nestedList; + } + + public static class Nested { + private String param1; + + private BigInteger param2; + + @Parameter(description = "nested string parameter") + public String getParam1() { + return param1; + } + + public void setParam1(String param1) { + this.param1 = param1; + } + + @Parameter(description = "nested BigInteger parameter") + public BigInteger getParam2() { + return param2; + } + + public void setParam2(BigInteger param2) { + this.param2 = param2; + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java new file mode 100644 index 000000000..5feb19927 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app121; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp121Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/TestController.java new file mode 100644 index 000000000..4777ca21b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/TestController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app121; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestController { + + @PostMapping("test") + public InheritedRequestParams getTest(@RequestParam String param, @ParameterObject InheritedRequestParams requestParams) { + return requestParams; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/BaseController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/BaseController.java new file mode 100644 index 000000000..75184bbd4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/BaseController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public abstract class BaseController { + + @PostMapping + @Operation(summary = "create") + public ResponseEntity create(@RequestBody Wrapper payload) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/BaseObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/BaseObject.java new file mode 100644 index 000000000..9f5ab05f0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/BaseObject.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class BaseObject { + + @JsonProperty("baseStr") + private String baseStr; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/CustomerDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/CustomerDto.java new file mode 100644 index 000000000..5a6d0b984 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/CustomerDto.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class CustomerDto extends BaseObject { + + @JsonProperty("customerName") + private String customerName; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/FirstController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/FirstController.java new file mode 100644 index 000000000..59ad2e190 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/FirstController.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Tag(name = "example") +public class FirstController extends BaseController { + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java new file mode 100644 index 000000000..df9dfd8d8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app122; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp122Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/Wrapper.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/Wrapper.java new file mode 100644 index 000000000..4cabf1035 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/Wrapper.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Wrapper { + + + @JsonProperty("wrapper") + private String wrapper; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/HelloController.java new file mode 100644 index 000000000..d4c4d72af --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app123; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/MyExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/MyExceptionHandler.java new file mode 100644 index 000000000..72b74d585 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/MyExceptionHandler.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app123; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class MyExceptionHandler { + + @ExceptionHandler(IllegalArgumentException.class) + @ApiResponse(responseCode = "404", description = "Not here", content = @Content) + @ResponseStatus(HttpStatus.NOT_FOUND) + public void bad(IllegalArgumentException e) { + + } + + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java new file mode 100644 index 000000000..db3e495d7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app123; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp123Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/HelloController.java new file mode 100644 index 000000000..4c2d7bef5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app124; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @ExceptionHandler(IllegalArgumentException.class) + @ApiResponse(responseCode = "404", description = "Not here", content = @Content) + @ResponseStatus(HttpStatus.NOT_FOUND) + public void bad(IllegalArgumentException e) { + + } + + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + throw new IllegalArgumentException(); + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/MyExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/MyExceptionHandler.java new file mode 100644 index 000000000..6c52c9e16 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/MyExceptionHandler.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app124; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class MyExceptionHandler { + + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java new file mode 100644 index 000000000..b00a4a020 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app124; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp124Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/HelloController.java new file mode 100644 index 000000000..3b9d4dc42 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/HelloController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app126; + +import java.util.ArrayList; +import java.util.Collection; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.ResponseEntity.ok; + +@RestController +@ApiResponses(value = { + @ApiResponse(responseCode = "401", ref = SecurityProblemResponsesConfiguration.UNAUTHORIZED_401_NO_TOKEN_RESPONSE_REF), + @ApiResponse(responseCode = "401", ref = SecurityProblemResponsesConfiguration.UNAUTHORIZED_401_BAD_TOKEN_RESPONSE_REF), + @ApiResponse(responseCode = "403", ref = SecurityProblemResponsesConfiguration.FORBIDDEN_403_RESPONSE_REF) }) +//@ApiResponses(value = { +// @ApiResponse(responseCode = "401", description = "Invalid authentication.", content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), +// @ApiResponse(responseCode = "401", description = "Invalid authentication.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), +// @ApiResponse(responseCode = "403", description = "Missing authorities.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}) }) +public class HelloController { + + private static final Collection CURRENCIES = new ArrayList<>(); + + static { + CURRENCIES.add("EUR"); + CURRENCIES.add("USD"); + } + + @GetMapping + @Operation(description = "Get all currencies", summary = "getAllCurrencies") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "All currencies returned") }) + public ResponseEntity> getAllCurrencies() { + return ok(CURRENCIES); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/Problem.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/Problem.java new file mode 100644 index 000000000..7bbbb9788 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/Problem.java @@ -0,0 +1,97 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app126; + +import java.net.URI; +import java.util.Collections; +import java.util.Map; + +public interface Problem { + + URI DEFAULT_TYPE = URI.create("about:blank"); + + /** + * An absolute URI that identifies the problem type. When dereferenced, + * it SHOULD provide human-readable documentation for the problem type + * (e.g., using HTML). When this member is not present, its value is + * assumed to be "about:blank". + * + * @return an absolute URI that identifies this problem's type + */ + default URI getType() { + return DEFAULT_TYPE; + } + + /** + * A short, human-readable summary of the problem type. It SHOULD NOT + * change from occurrence to occurrence of the problem, except for + * purposes of localisation. + * + * @return a short, human-readable summary of this problem + */ + default String getTitle() { + return null; + } + + /** + * The HTTP status code generated by the origin server for this + * occurrence of the problem. + * + * @return the HTTP status code + */ + default Integer getStatus() { + return null; + } + + /** + * A human readable explanation specific to this occurrence of the problem. + * + * @return A human readable explaination of this problem + */ + default String getDetail() { + return null; + } + + /** + * An absolute URI that identifies the specific occurrence of the problem. + * It may or may not yield further information if dereferenced. + * + * @return an absolute URI that identifies this specific problem + */ + default URI getInstance() { + return null; + } + + /** + * Optional, additional attributes of the problem. Implementations can choose to ignore this in favor of concrete, + * typed fields. + * + * @return additional parameters + */ + default Map getParameters() { + return Collections.emptyMap(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SecurityProblemResponsesConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SecurityProblemResponsesConfiguration.java new file mode 100644 index 000000000..978a989a6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SecurityProblemResponsesConfiguration.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app126; + +import java.io.IOException; +import java.util.AbstractMap; +import java.util.Map; + +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.MediaType; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.responses.ApiResponse; + +import org.springframework.beans.factory.parsing.Problem; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import static org.springframework.http.MediaType.APPLICATION_PROBLEM_JSON_VALUE; + +/** + * Configuration class defining standard OpenAPI Specification for operations + */ +@Configuration +public class SecurityProblemResponsesConfiguration { + + private static final String HTTP_401_NO_TOKEN = "http401NoToken"; + + public static final String UNAUTHORIZED_401_NO_TOKEN_RESPONSE_REF = "#/components/responses/" + HTTP_401_NO_TOKEN; + + private static final String HTTP_401_BAD_TOKEN = "http401BadToken"; + + public static final String UNAUTHORIZED_401_BAD_TOKEN_RESPONSE_REF = "#/components/responses/" + HTTP_401_BAD_TOKEN; + + private static final String HTTP_403 = "http403"; + + public static final String FORBIDDEN_403_RESPONSE_REF = "#/components/responses/" + HTTP_403; + + @Bean + public Map.Entry http401NoTokenResponse() throws IOException { + return simpleResponse(HTTP_401_NO_TOKEN, "Invalid authentication."); + } + + @Bean + public Map.Entry http401BadTokenResponse() throws IOException { + return simpleResponse(HTTP_401_BAD_TOKEN, "Invalid authentication."); + } + + @Bean + public Map.Entry http403Example() throws IOException { + return simpleResponse(HTTP_403, "Missing authorities."); + } + + private Map.Entry simpleResponse(String code, String description) throws IOException { + ApiResponse response = new ApiResponse().description(description).content(new Content().addMediaType( + APPLICATION_PROBLEM_JSON_VALUE, + new MediaType() + .schema(new Schema().$ref("#/components/schemas/Problem")))); + return new AbstractMap.SimpleEntry<>(code, response); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java new file mode 100644 index 000000000..2158ff8d2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app126; + +import java.util.List; +import java.util.Map; + +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverters; +import io.swagger.v3.core.converter.ResolvedSchema; +import io.swagger.v3.oas.models.responses.ApiResponse; +import org.springdoc.core.customizers.OpenApiCustomizer; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp126Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + + @Bean + public OpenApiCustomizer responseRegistrationCustomizer(List> responsesToRegister) { + ResolvedSchema resolvedSchema = ModelConverters.getInstance(true) + .resolveAsResolvedSchema(new AnnotatedType(Problem.class)); + return openApi -> { + openApi.getComponents().addSchemas("Problem", resolvedSchema.schema); + responsesToRegister.forEach(entry -> openApi.getComponents().addResponses(entry.getKey(), entry.getValue())); + }; + } + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/AbstractObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/AbstractObject.java new file mode 100644 index 000000000..662f94a12 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/AbstractObject.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "type", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ConcreteObjectA.class, name = "Type A") +}) +public abstract class AbstractObject { + + private final ConcreteType type; + + private final String name; + + protected AbstractObject(ConcreteType type, String name) { + this.type = type; + this.name = name; + } + + public ConcreteType getType() { + return type; + } + + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/ConcreteObjectA.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/ConcreteObjectA.java new file mode 100644 index 000000000..d708d29c6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/ConcreteObjectA.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +public class ConcreteObjectA extends AbstractObject { + + private final String description; + + public ConcreteObjectA(String name, String description) { + super(ConcreteType.TYPE_A, name); + this.description = description; + } + + public String getDescription() { + return description; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/ConcreteType.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/ConcreteType.java new file mode 100644 index 000000000..b8c379f77 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/ConcreteType.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +public enum ConcreteType { + TYPE_A("Type A"), + TYPE_B("Type B"); + + private final String name; + + ConcreteType(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/Controller.java new file mode 100644 index 000000000..025474d9f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/Controller.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class Controller { + + @Operation(summary = "Test Bug", responses = { + @ApiResponse(responseCode = "200", description = "OK", + content = @Content( + schema = @Schema(implementation = Umbrella.class), + examples = @ExampleObject(ref = "#/components/examples/umbrellaExample", name = "Example with weird YAML tag") + ) + ) + }) + @GetMapping(value = "/bug", produces = MediaType.APPLICATION_JSON_VALUE) + public Umbrella bug() { + return new Umbrella(new ConcreteObjectA("a", "b")); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java new file mode 100644 index 000000000..cd6249b1b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app127; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.web.servlet.MvcResult; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp127Test extends AbstractSpringDocV31Test { + + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + ".yaml")).andExpect(status().isOk()).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Assertions.assertTrue(!result.contains("!")); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/Umbrella.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/Umbrella.java new file mode 100644 index 000000000..1789c1377 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/Umbrella.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +import io.swagger.v3.oas.annotations.media.Schema; + +public class Umbrella { + + @Schema(description = "This reference to abstract class causes weird YAML tag to be added", anyOf = ConcreteObjectA.class) + private final AbstractObject object; + + public Umbrella(AbstractObject object) { + this.object = object; + } + + public AbstractObject getObject() { + return object; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/ActualReturnedEntity.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/ActualReturnedEntity.java new file mode 100644 index 000000000..fb0a57dc6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/ActualReturnedEntity.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app129; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ActualReturnedEntity { + + @JsonProperty + String result; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java new file mode 100644 index 000000000..a52df52e7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app129; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.request.async.DeferredResult; + +@RestController +@RequestMapping(path = "/api", headers = { "userId", "registrationId" }) +public class HelloController { + + @PostMapping("/test") + @ApiResponses({ @ApiResponse(responseCode = "200") }) + public DeferredResult> update( + @RequestBody ActualReturnedEntity entity) throws Exception { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/OperationResponse.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/OperationResponse.java new file mode 100644 index 000000000..88f41a65e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/OperationResponse.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app129; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class OperationResponse { + + @JsonProperty + String operationResult; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java new file mode 100644 index 000000000..d7664659a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app129; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp129Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java new file mode 100644 index 000000000..ec8ff0780 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app13; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + public String persons(final PersonDTO dto) { + return "OK"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java new file mode 100644 index 000000000..a2fe7d80f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app13; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java new file mode 100644 index 000000000..8b206d4a3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app13; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp13Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/HelloController.java new file mode 100644 index 000000000..5d89b1686 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app130; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/values/data") + TrackerData list(TrackerData toto) { + return toto; + } + + @GetMapping(value = "/values/datakk") + TrackerData get(TrackerData toto) { + return toto; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java new file mode 100644 index 000000000..90baa73bd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app130; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp130Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/TrackerData.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/TrackerData.java new file mode 100644 index 000000000..ed62069e8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/TrackerData.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app130; + +import java.time.Instant; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Schema; + +@Hidden +public class TrackerData { + + @JsonProperty("trackerId") + String trackerId; + + @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") + @JsonProperty("timestamp") + Instant timestamp; + + @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") + @JsonProperty("value") + Double value; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/HelloController.java new file mode 100644 index 000000000..dbb3ebd26 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/HelloController.java @@ -0,0 +1,87 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app131; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @Operation(summary = "Create the organization", description = "Create the organization") + @ApiResponses( + value = { + @ApiResponse( + responseCode = "204", + description = "The organization was created successfully"), + @ApiResponse( + responseCode = "400", + description = "Invalid argument", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "409", + description = "An organization with the specified ID already exists", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "500", + description = + "An error has occurred and the request could not be processed at this time", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))) + }) + @RequestMapping( + value = "/organizations", + method = RequestMethod.POST, + produces = "application/json") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void createOrganization( + @Parameter(name = "organization", required = true) + @RequestBody + Organization organization) { + + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/Organization.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/Organization.java new file mode 100644 index 000000000..90a09c994 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/Organization.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app131; + + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = + "This is the description being overwritten") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "id", "name" }) +public class Organization { + + @Schema( + description = + "The Universally Unique Identifier (UUID) uniquely identifying the organization", + required = true) + @JsonProperty(required = true) + private UUID id; + + @Schema(description = "The name of the organization", required = true) + @JsonProperty(required = true) + private String name; + + public Organization() { + } + + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/RestControllerError.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/RestControllerError.java new file mode 100644 index 000000000..ab6c08f25 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/RestControllerError.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app131; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class RestControllerError { + + @JsonProperty + private String id; + + @JsonProperty + private String message; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java new file mode 100644 index 000000000..17bd6a8d2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app131; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp131Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/HelloController.java new file mode 100644 index 000000000..1a143ece8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/HelloController.java @@ -0,0 +1,87 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app132; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @Operation(summary = "Create the organization", description = "Create the organization") + @ApiResponses( + value = { + @ApiResponse( + responseCode = "204", + description = "The organization was created successfully"), + @ApiResponse( + responseCode = "400", + description = "Invalid argument", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "409", + description = "An organization with the specified ID already exists", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "500", + description = + "An error has occurred and the request could not be processed at this time", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))) + }) + @RequestMapping( + value = "/organizations", + method = RequestMethod.POST, + produces = "application/json") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void createOrganization( + @Parameter(name = "organization", description = "i want to override the description of this object", required = true) + @RequestBody + Organization organization) { + + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/Organization.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/Organization.java new file mode 100644 index 000000000..8800b930c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/Organization.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app132; + + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = + "This is the description being overwritten") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "id", "name" }) +public class Organization { + + @Schema( + description = + "The Universally Unique Identifier (UUID) uniquely identifying the organization", + required = true) + @JsonProperty(required = true) + private UUID id; + + @Schema(description = "The name of the organization", required = true) + @JsonProperty(required = true) + private String name; + + public Organization() { + } + + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/RestControllerError.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/RestControllerError.java new file mode 100644 index 000000000..37234d217 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/RestControllerError.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app132; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class RestControllerError { + + @JsonProperty + private String id; + + @JsonProperty + private String message; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java new file mode 100644 index 000000000..18754ed00 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app132; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp132Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/HelloController.java new file mode 100644 index 000000000..ac73c8cb9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/HelloController.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app133; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(path = "/test1", headers = { "myHeader" }) + public String getMessageFromHeader1( + @Parameter(name = "myHeader", description = "A header", schema = @Schema(allowableValues = { "foo", "bar" })) + @RequestHeader("myHeader") String header + ) { + return "bar " + header; + } + + @GetMapping("/test2") + public String getMessageFromHeader2( + @Parameter(name = "myHeader", description = "A header", schema = @Schema(type = "integer")) + @RequestHeader("myHeader") Integer header + ) { + return "bar " + header; + } + + @GetMapping(path = "/test3", headers = { "myHeader" }) + public String getMessageFromHeader3( + @Parameter(name = "myHeader", description = "A header", schema = @Schema(type = "integer")) + @RequestHeader("myHeader") Integer header + ) { + return "bar " + header; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java new file mode 100644 index 000000000..f9fcd29d5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app133; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp133Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/HelloController.java new file mode 100644 index 000000000..963f305c4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/HelloController.java @@ -0,0 +1,135 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app134; + +import java.util.Collections; +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + + +@SpringBootApplication +@RestController +@Tag(name = "The sample resource") +public class HelloController { + + // ----------------------------------------------------------------------------------------------------------------- + + public static final String VERSION_1 = "application/vnd.samples.v1+json"; + + public static final String VERSION_2 = "application/vnd.samples.v2+json"; + + public static final String HEADER_1 = "X-API-VERSION=1"; + + public static final String HEADER_2 = "Accept-version=v2"; + + @GetMapping(value = "/{id}", produces = VERSION_1, headers = HEADER_1) + @ResponseStatus(HttpStatus.OK) + @Operation(operationId = "getSampleV1", deprecated = true, description = "Get the sample by its id." + ) + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = SampleV1.class))) + public SampleV1 getSampleV1(@Parameter(description = "The sample's id", required = true) + @PathVariable final String id) { + return new SampleV1(id); + } + + @GetMapping(value = "/{id}", produces = VERSION_2, headers = { HEADER_2, HEADER_1 }) + @ResponseStatus(HttpStatus.OK) + @Operation(operationId = "getSampleV2", description = "Get the sample by its id. This represents V2.") + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = SampleV1.class))) + public SampleV2 getSampleV2(@Parameter(description = "The sample's id", required = true) + @PathVariable final Long id) { + return new SampleV2(id); + } + + @PostMapping(path = "/search", consumes = VERSION_2, produces = VERSION_2) + @Operation(description = "Searches for sample objects using the given search request.") + @ApiResponse(responseCode = "200", + content = @Content(array = @ArraySchema(schema = @Schema(implementation = SampleV2.class)))) + public List searchSamples(@RequestBody final SampleSearchRequest searchRequest) { + return Collections.singletonList(new SampleV2(searchRequest.getId())); + } + + + private class SampleV1 { + + private String id; + + public SampleV1(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + } + + private class SampleV2 { + private long id; + + public SampleV2(long id) { + this.id = id; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + } + + private class SampleSearchRequest { + private final long id; + + public SampleSearchRequest(long id) { + this.id = id; + } + + public long getId() { + return id; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/OpenApiConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/OpenApiConfig.java new file mode 100644 index 000000000..826a45f81 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/OpenApiConfig.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app134; + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class OpenApiConfig { + + @Bean + public GroupedOpenApi groupV1OpenApi() { + return GroupedOpenApi.builder() + .group("v1-group").producesToMatch(HelloController.VERSION_1) + .build(); + } + + @Bean + public GroupedOpenApi groupV2OpenApi() { + return GroupedOpenApi.builder() + .group("v2-group").producesToMatch(HelloController.VERSION_2) + .build(); + } + + @Bean + public GroupedOpenApi groupV3OpenApi() { + return GroupedOpenApi.builder() + .group("v2-consumes-group").consumesToMatch(HelloController.VERSION_2) + .build(); + } + + @Bean + public GroupedOpenApi groupV4OpenApi() { + return GroupedOpenApi.builder() + .group("v1-headers-group").headersToMatch(HelloController.HEADER_1) + .build(); + } + + @Bean + public GroupedOpenApi groupV5OpenApi() { + return GroupedOpenApi.builder() + .group("v1-v2-headers-group").headersToMatch(HelloController.HEADER_1, HelloController.HEADER_2) + .build(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java new file mode 100644 index 000000000..7db7de622 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app134; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp134Test extends AbstractSpringDocV31Test { + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-1.json"), true)); + } + + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-2.json"), true)); + } + + @Test + void testApp3() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-headers-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-3.json"), true)); + } + + @Test + void testApp4() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-v2-headers-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-4.json"), true)); + } + + @Test + void testApp5() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-consumes-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-5.json"), true)); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/Book.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/Book.java new file mode 100644 index 000000000..f7f55b1a3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/Book.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app135; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/BookRepository.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/BookRepository.java new file mode 100644 index 000000000..e0801afbf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app135; + +import java.util.Arrays; +import java.util.List; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + List findByAuthor(String author) { + Book[] books = { new Book("1", "title1", "author1") }; + return Arrays.asList(books); + } + + List findAll() { + Book[] books = { new Book("2", "title2", "author2") }; + return Arrays.asList(books); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/BookRouter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/BookRouter.java new file mode 100644 index 000000000..c1ee0eb42 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/BookRouter.java @@ -0,0 +1,111 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app135; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.servlet.function.RequestPredicates; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.RouterFunctions; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springframework.web.servlet.function.RouterFunctions.nest; +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +@Configuration +class BookRouter { + + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes(BookRepository br) { + return + RouterFunctions.nest(RequestPredicates.path("/greeter").and(RequestPredicates.path("/greeter2")), + RouterFunctions.route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author"))))); + } + + @Bean + @RouterOperations({ + @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes1(BookRepository br) { + return + RouterFunctions.nest(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + RouterFunctions.route(RequestPredicates.GET("/books"), req -> ServerResponse.ok().body(br.findAll())) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ServerResponse.ok().body(br.findByAuthor(req.pathVariable("author"))))); + } + + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes3(BookRepository br) { + return + nest(RequestPredicates.path("/greeter").or(RequestPredicates.path("/greeter2")), + route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author"))))); + } + + @Bean + @RouterOperations({ + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes4(BookRepository br) { + return + nest(RequestPredicates.path("/test"), + nest(RequestPredicates.path("/greeter").and(RequestPredicates.path("/greeter2")), + route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java new file mode 100644 index 000000000..e6b8e1bab --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app135; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp135Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app136/OperationIdController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app136/OperationIdController.java new file mode 100644 index 000000000..7e581742c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app136/OperationIdController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app136; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class OperationIdController { + + @GetMapping(path = "/test_0") // gets operationId opIdTest_3 + public String opIdTest() { + return ""; + } + + @GetMapping(path = "/test_1") // gets operationId opIdTest_2 + public String opIdTest(@RequestParam String param) { + return ""; + } + + @GetMapping(path = "/test_2") // gets operationId opIdTest_1 + public String opIdTest(@RequestParam Integer param) { + return ""; + } + + @GetMapping(path = "/test_3") // gets operationId opIdTest + public String opIdTest(@RequestParam Boolean param) { + return ""; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app136/SpringDocApp136Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app136/SpringDocApp136Test.java new file mode 100644 index 000000000..f2a13533e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app136/SpringDocApp136Test.java @@ -0,0 +1,89 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app136; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.ThreadLocalRandom; + +import jakarta.servlet.http.HttpServletRequest; +import org.junit.jupiter.api.RepeatedTest; +import org.springdoc.webmvc.api.OpenApiWebMvcResource; +import test.org.springdoc.api.AbstractCommonTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springdoc.core.utils.Constants.SPRINGDOC_CACHE_DISABLED; + + +/** + * Tests deterministic creation of operationIds + */ +@SpringBootTest(properties = { SPRINGDOC_CACHE_DISABLED + "=true", "springdoc.api-docs.version=openapi_3_1" }) +public class SpringDocApp136Test extends AbstractCommonTest { + + @Autowired + OpenApiWebMvcResource resource; + + @Autowired + RequestMappingHandlerMapping requestMappingHandlerMapping; + + @RepeatedTest(10) + public void shouldGenerateOperationIdsDeterministically() throws Exception { + shuffleSpringHandlerMethods(); + + HttpServletRequest request = mock(HttpServletRequest.class); + when(request.getRequestURL()).thenReturn(new StringBuffer("http://localhost")); + + String expected = getContent("results/3.1.0/app136.json"); + byte[] openApiBytes = resource.openapiJson(request, "", Locale.getDefault()); + String openApi = new String(openApiBytes, StandardCharsets.UTF_8); // for UTF-8 encoding assertEquals(expected, openApi, true); + assertEquals(expected, openApi, true); + } + + private void shuffleSpringHandlerMethods() { + Map handlerMethods = requestMappingHandlerMapping.getHandlerMethods(); + List> collect = new ArrayList<>(handlerMethods.entrySet()); + collect.sort(Comparator.comparing(a -> ThreadLocalRandom.current().nextBoolean() ? -1 : 1)); + + collect.forEach(e -> requestMappingHandlerMapping.unregisterMapping(e.getKey())); + collect.forEach(e -> requestMappingHandlerMapping.registerMapping(e.getKey(), e.getValue().getBean(), e.getValue().getMethod())); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/HelloController.java new file mode 100644 index 000000000..509e1a721 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/HelloController.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app137; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SecurityRequirement(name = "security_auth") +public class HelloController { + + @GetMapping("/test") + public void test(String hello) { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/OpenApiConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/OpenApiConfig.java new file mode 100644 index 000000000..bb30c549a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/OpenApiConfig.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app137; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.servers.Server; + +@OpenAPIDefinition(servers = @Server(url = "${test.server}", description = "${test.desc}"), info = @Info(title = "My App", + description = "Some long and useful description", version = "v1")) +@SecurityScheme(name = "security_auth", type = SecuritySchemeType.OAUTH2, + flows = @OAuthFlows(authorizationCode = @OAuthFlow( + authorizationUrl = "http://authorization.url" + , tokenUrl = "http://token.url", scopes = {}))) +public class OpenApiConfig {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java new file mode 100644 index 000000000..00a8270ca --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app137; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = { "test.server=http://test.toto.com", "test.desc=toto desc" }) +public class SpringDocApp137Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/HelloController.java new file mode 100644 index 000000000..d5972693c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/HelloController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app138; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/testB") + public void testB(String hello) { + } + + @GetMapping("/testA") + public void testA(String hello) { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java new file mode 100644 index 000000000..e5d7e456f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app138; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.v3.core.util.ObjectMapperFactory; +import io.swagger.v3.oas.models.OpenAPI; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springdoc.core.providers.ObjectMapperProvider; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = "springdoc.writer-with-order-by-keys=true") +public class SpringDocApp138Test extends AbstractSpringDocV31Test { + + @Autowired + ObjectMapperProvider objectMapperProvider; + + private static Map apiExtensions() { + Map extensions = new HashMap(); + + Map linkedMap = new LinkedHashMap(); + linkedMap.put("property1", "value1"); + linkedMap.put("property2", null); + + extensions.put("x-my-vendor-extensions", linkedMap); + return extensions; + } + + @Test + protected void testApp() throws Exception { + MvcResult mockMvcResult = mockMvc.perform(MockMvcRequestBuilders.get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app138.json"); + Assertions.assertEquals(expected, result); + } + + @BeforeEach + void init() throws IllegalAccessException { + Field conField = FieldUtils.getDeclaredField(ObjectMapperProvider.class, "jsonMapper", true); + ObjectMapper mapper = SpringDocObjectMapperFactory.createJson(); + conField.set(objectMapperProvider, mapper); + } + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OpenAPI api() { + return new OpenAPI() + .extensions(apiExtensions()); + } + } + + private static class SpringDocObjectMapperFactory extends ObjectMapperFactory { + public static ObjectMapper createJson() { + return ObjectMapperFactory.createJson(); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/HelloController.java new file mode 100644 index 000000000..e078830da --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/HelloController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app139; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test1") + public String echo1(@RequestParam(name = "${test.name}", defaultValue = "${test.default-value}") String text) { + return text; + } + + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test2") + public String echo2(@RequestParam(value = "${test.value}", defaultValue = "${test.default-value}") String text) { + return text; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java new file mode 100644 index 000000000..eb668d465 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app139; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = { "test.name=text", "test.value=text", "test.default-value=default-text" }) +public class SpringDocApp139Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java new file mode 100644 index 000000000..4f017354b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app14; + +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.http.HttpEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Tag(name = "greeting", description = "test") +public class HelloController { + + @GetMapping("/persons") + public void persons(@Valid @NotBlank String name) { + + } + + @GetMapping("/test") + @Tag(name = "lang.change") + public HttpEntity demo2() { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java new file mode 100644 index 000000000..103358ab9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app14; + +import java.util.Locale; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp14Test extends AbstractSpringDocV31Test { + + private static Locale DEFAULT_LOCALE; + + @BeforeAll + public static void init() { + DEFAULT_LOCALE = Locale.getDefault(); + Locale.setDefault(Locale.US); + } + + @AfterAll + public static void clean() { + Locale.setDefault(DEFAULT_LOCALE); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/HelloApplication.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/HelloApplication.java new file mode 100644 index 000000000..ee961731f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/HelloApplication.java @@ -0,0 +1,182 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app140; + +import java.io.IOException; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import jakarta.servlet.FilterChain; +import jakarta.servlet.GenericFilter; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.function.HandlerFunction; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.ServerRequest; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +@Configuration +public class HelloApplication { + + private static ServerResponse filter(ServerRequest serverRequest, HandlerFunction handlerFunction) throws Exception { + return handlerFunction.handle(serverRequest); + } + + @Bean + RouterFunction routes(PersonHandler ph) { + String root = ""; + return route() + .GET(root + "/people", ph::handleGetAllPeople) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("all")) + .GET(root + "/people/{id}", ph::handleGetPersonById) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("byId")) + .POST(root + "/people", ph::handlePostPerson) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("save")) + .filter(HelloApplication::filter) + .build(); + } +} + +@Component +class SimpleFilter extends GenericFilter { + + @Override + public void doFilter(ServletRequest req, ServletResponse res, + FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(req, res); + } +} + +@Component +class PersonHandler { + + private final PersonService personService; + + PersonHandler(PersonService personService) { + this.personService = personService; + } + + ServerResponse handleGetAllPeople(ServerRequest serverRequest) { + return ok().body(personService.all()); + } + + ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { + Person result = personService.save(new Person(null, r.body(Person.class).getName())); + URI uri = URI.create("/people/" + result.getId()); + return ServerResponse.created(uri).body(result); + } + + ServerResponse handleGetPersonById(ServerRequest r) { + return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); + } +} + +@RestController +class GreetingsRestController { + + @GetMapping("/greet/{name}") + String greet(@PathVariable String name) { + return "hello " + name + "!"; + } +} + +@Service +class PersonService { + + private final AtomicLong counter = new AtomicLong(); + + private final Set people = Stream.of( + new Person(counter.incrementAndGet(), "Jane"), + new Person(counter.incrementAndGet(), "Josh"), + new Person(counter.incrementAndGet(), "Gordon")) + .collect(Collectors.toCollection(HashSet::new)); + + + Person save(Person p) { + Person person = new Person(counter.incrementAndGet(), p.getName()); + this.people.add(person); + return person; + } + + Set all() { + return this.people; + } + + Person byId(@Parameter(in = ParameterIn.PATH) Long id) { + return this.people.stream() + .filter(p -> p.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); + } + +} + +class Person { + + private Long id; + + private String name; + + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java new file mode 100644 index 000000000..50bc5b2e5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app140; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp140Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/Book.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/Book.java new file mode 100644 index 000000000..ddc6821af --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/Book.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app141; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/BookRepository.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/BookRepository.java new file mode 100644 index 000000000..a541fdd50 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app141; + +import java.util.Arrays; +import java.util.List; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + List findByAuthor(String author) { + Book[] books = { new Book("1", "title1", "author1") }; + return Arrays.asList(books); + } + + List findAll() { + Book[] books = { new Book("2", "title2", "author2") }; + return Arrays.asList(books); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/BookRouter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/BookRouter.java new file mode 100644 index 000000000..b09218085 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/BookRouter.java @@ -0,0 +1,106 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app141; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.servlet.function.RouterFunction; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.servlet.function.RequestPredicates.GET; +import static org.springframework.web.servlet.function.RequestPredicates.accept; +import static org.springframework.web.servlet.function.RequestPredicates.path; +import static org.springframework.web.servlet.function.RouterFunctions.nest; +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +@Configuration +class BookRouter { + + + @Bean + RouterFunction routes(BookRepository br) { + return nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"))) + ); + } + + @Bean + RouterFunction routes1(BookRepository br) { + return nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + route(GET("/books"), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor")))); + } + + @Bean + RouterFunction routes3(BookRepository br) { + return nest(path("/greeter").or(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor")))); + } + + @Bean + RouterFunction routes4(BookRepository br) { + return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"))))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java new file mode 100644 index 000000000..3ff28cc9f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app141; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp141Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/HelloApplication.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/HelloApplication.java new file mode 100644 index 000000000..fe1d3fbbc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/HelloApplication.java @@ -0,0 +1,176 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app142; + +import java.io.IOException; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import jakarta.servlet.FilterChain; +import jakarta.servlet.GenericFilter; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import org.springdoc.webmvc.core.fn.SpringdocRouteBuilder; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.function.HandlerFunction; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.ServerRequest; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springframework.web.servlet.function.ServerResponse.ok; + +@Configuration +public class HelloApplication { + + private static ServerResponse filter(ServerRequest serverRequest, HandlerFunction handlerFunction) throws Exception { + return handlerFunction.handle(serverRequest); + } + + @Bean + RouterFunction routes(PersonHandler ph) { + String root = ""; + return SpringdocRouteBuilder.route() + .GET(root + "/people", ph::handleGetAllPeople, ops -> ops.beanClass(PersonService.class).beanMethod("all")) + .GET(root + "/people/{id}", ph::handleGetPersonById, ops -> ops.beanClass(PersonService.class).beanMethod("byId")) + .POST(root + "/people", ph::handlePostPerson, ops -> ops.beanClass(PersonService.class).beanMethod("save")).build(); + } + +} + +@Component +class SimpleFilter extends GenericFilter { + + @Override + public void doFilter(ServletRequest req, ServletResponse res, + FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(req, res); + } +} + +@Component +class PersonHandler { + + private final PersonService personService; + + PersonHandler(PersonService personService) { + this.personService = personService; + } + + ServerResponse handleGetAllPeople(ServerRequest serverRequest) { + return ok().body(personService.all()); + } + + ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { + Person result = personService.save(new Person(null, r.body(Person.class).getName())); + URI uri = URI.create("/people/" + result.getId()); + return ServerResponse.created(uri).body(result); + } + + ServerResponse handleGetPersonById(ServerRequest r) { + return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); + } +} + +@RestController +class GreetingsRestController { + + @GetMapping("/greet/{name}") + String greet(@PathVariable String name) { + return "hello " + name + "!"; + } +} + +@Service +class PersonService { + + private final AtomicLong counter = new AtomicLong(); + + private final Set people = Stream.of( + new Person(counter.incrementAndGet(), "Jane"), + new Person(counter.incrementAndGet(), "Josh"), + new Person(counter.incrementAndGet(), "Gordon")) + .collect(Collectors.toCollection(HashSet::new)); + + + Person save(Person p) { + Person person = new Person(counter.incrementAndGet(), p.getName()); + this.people.add(person); + return person; + } + + Set all() { + return this.people; + } + + Person byId(@Parameter(in = ParameterIn.PATH) Long id) { + return this.people.stream() + .filter(p -> p.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); + } + +} + +class Person { + + private Long id; + + private String name; + + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java new file mode 100644 index 000000000..a97bd8032 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app142; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp142Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/HelloHiddenController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/HelloHiddenController.java new file mode 100644 index 000000000..0c85ee6bc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/HelloHiddenController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app143; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Hidden +public class HelloHiddenController { + + @GetMapping("/testA") + public void testA(String hello) { + } + + @GetMapping("/testB") + public void testB(String hello) { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/SpringDocApp143Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/SpringDocApp143Test.java new file mode 100644 index 000000000..615978187 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/SpringDocApp143Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app143; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * Test issue 907 fix. + * Hidden controller showing up in swagger UI when springdoc.show-actuator is enabled + */ +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true", + "springdoc.show-actuator=true", "management.endpoints.web.exposure.exclude=functions" +}) +public class SpringDocApp143Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java new file mode 100644 index 000000000..33bb0249f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +/** + * To test the case a user does not use @RestController but puts @Operation on handler methods + * and wants these methods to be exposed. + * + * @author Azige + */ +@Controller +public class HelloController { + + @GetMapping("/hello") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public String hello() { + return "forward:/message"; + } + + @GetMapping("/message") + @Operation + @ResponseBody + public HelloMessage message() { + return new HelloMessage("Lucky numbers!", 777); + } + + @GetMapping("/helloModelAndView") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public ModelAndView helloModelAndView() { + ModelAndView mav = new ModelAndView(); + mav.setViewName("forward:/message"); + return mav; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java new file mode 100644 index 000000000..626d12294 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +public class HelloMessage { + public String text; + + public int number; + + public HelloMessage(String text, int number) { + this.text = text; + this.number = number; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HiddenHelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HiddenHelloController.java new file mode 100644 index 000000000..56e659cd3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/HiddenHelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/api") +public class HiddenHelloController { + + @Operation(description = "I want here some custom config") + @GetMapping("/{entity}/{id}") + public ResponseEntity getEntity() { + throw new UnsupportedOperationException("the body is not relevant now"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java new file mode 100644 index 000000000..99089738f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.model-and-view-allowed=true") +public class SpringDocApp149Test extends AbstractSpringDocV31Test { + + @BeforeAll + public static void init() { + SpringDocUtils.getConfig().addHiddenRestControllers(HiddenHelloController.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java new file mode 100644 index 000000000..91b06722d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app15; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.json.JSONObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + @Operation(description = "${springdoc.operation-descriptions.myOperation}", responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(hidden = true)))) + public JSONObject persons() { + return new JSONObject(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java new file mode 100644 index 000000000..adc0c3bdb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app15; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Contact; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "springdoc.operation-descriptions.myOperation=My Desc", + "springdoc.openapidefinition.info.title=My title", + "springdoc.openapidefinition.info.desc=My description", + "springdoc.openapidefinition.info.version=My version", + "springdoc.openapidefinition.info.terms=My terms", + "springdoc.openapidefinition.info.license.name=My license name", + "springdoc.openapidefinition.info.license.url=My license url", + "springdoc.openapidefinition.info.contact.name=My contact name", + "springdoc.openapidefinition.info.contact.email=My contact email", + "springdoc.openapidefinition.info.contact.url=My contact url" +}) +public class SpringDocApp15Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + @OpenAPIDefinition(info = @Info( + title = "${springdoc.openapidefinition.info.title}", + description = "${springdoc.openapidefinition.info.desc}", + version = "${springdoc.openapidefinition.info.version}", + termsOfService = "${springdoc.openapidefinition.info.terms}", + license = @License( + name = "${springdoc.openapidefinition.info.license.name}", + url = "${springdoc.openapidefinition.info.license.url}" + ), + contact = @Contact( + name = "${springdoc.openapidefinition.info.contact.name}", + email = "${springdoc.openapidefinition.info.contact.email}", + url = "${springdoc.openapidefinition.info.contact.url}" + ) + )) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/HelloController.java new file mode 100644 index 000000000..07bc09c03 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/HelloController.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app150; + +import java.time.LocalDate; +import java.util.List; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.format.annotation.DateTimeFormat.ISO.DATE; + +@RestController +public class HelloController { + + @GetMapping("/test/") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test(@RequestParam(defaultValue = "1") Integer toto) { + + } + + @GetMapping("/test1") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test1(@RequestParam @Parameter(schema = @Schema(defaultValue = "false", type = "boolean")) boolean toto) { + + } + + @GetMapping("/test3") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test3(@RequestParam(defaultValue = "users,123") List toto) { + + } + + @GetMapping("/test4") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test4(@DateTimeFormat(iso = DATE) @RequestParam(defaultValue = "2021-03-08") LocalDate localDate) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java new file mode 100644 index 000000000..4bf8db2dd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app150; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp150Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/HelloController.java new file mode 100644 index 000000000..8bb4923d9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app151; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/test") +public class HelloController { + + @GetMapping("") + /** + * A test endpoint mounted under `/test` + * @return 0 + */ + public int test() { + return 0; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java new file mode 100644 index 000000000..eebecf638 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app151; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp151Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java new file mode 100644 index 000000000..3ae5c42a8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app152; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.util.pattern.PathPatternParser; + +@RestController +@RequestMapping("/api") +public class HelloController { + + @GetMapping + public String helloWorld() { + return "ok"; + } + + @Configuration + public class WebConfig implements WebMvcConfigurer { + + @Override + public void configurePathMatch(PathMatchConfigurer configurer) { + configurer.setPatternParser(new PathPatternParser()); + } + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java new file mode 100644 index 000000000..39f8701b3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app152; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp152Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/OrderState.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/OrderState.java new file mode 100644 index 000000000..5373bd5c3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/OrderState.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import io.swagger.v3.oas.annotations.media.Schema; + + +@Schema(type = "string", allowableValues = { "finished", "new" }) +public enum OrderState { + FINISHED("finished"), + NEW("new"); + + private final String value; + + OrderState(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/OrderStateMapper.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/OrderStateMapper.java new file mode 100644 index 000000000..a18e81333 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/OrderStateMapper.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import java.beans.PropertyEditorSupport; +import java.util.Arrays; + +import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; + +public class OrderStateMapper extends PropertyEditorSupport { + + @Override + public void setAsText(String text) { + setValue( + Arrays.stream(OrderState.class.getEnumConstants()) + .filter(e -> e.getValue().equals(text)) + .findFirst() + .orElseThrow(() -> new MethodArgumentTypeMismatchException( + text, OrderState.class, "orderState", null, null))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java new file mode 100644 index 000000000..b1439c000 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp153Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/TestController.java new file mode 100644 index 000000000..730d2a433 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/TestController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.InitBinder; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +class TestController { + + @InitBinder + public void initBinder(WebDataBinder dataBinder) { + dataBinder.registerCustomEditor(OrderState.class, new OrderStateMapper()); + } + + @GetMapping(value = { "/orders" }) + public Object method( + @RequestParam(value = "state", defaultValue = "finished") OrderState orderState) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/HelloController.java new file mode 100644 index 000000000..6f19ea6f4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/HelloController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app154; + +import java.time.Instant; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @GetMapping(path = "/") + public String hello() { + return "Hello world at " + Instant.now().toString(); + } + + @PostMapping(value = "/persons") + public void create(@ParameterObject Long id, @RequestBody Object o) { + + } + + @PostMapping(value = "/personsone") + public void createone(Long id, @RequestBody Object o) { + + } + + @PostMapping(value = "/createtwo") + public void createtwo(int id) { + + } + + @PostMapping(value = "/createthree") + public void createthree(Integer id) { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/OpenApiConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/OpenApiConfiguration.java new file mode 100644 index 000000000..d233a4dfd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/OpenApiConfiguration.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app154; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.security.SecuritySchemes; + +@OpenAPIDefinition(info = @Info(title = "toto", version = "1.0"), + security = { @SecurityRequirement(name = "basicAuth"), @SecurityRequirement(name = "bearerToken") } +) +@SecuritySchemes({ + @SecurityScheme( + name = "basicAuth", + type = SecuritySchemeType.HTTP, + scheme = "basic" + ), + @SecurityScheme( + name = "bearerToken", + type = SecuritySchemeType.HTTP, + scheme = "bearer", + bearerFormat = "JWT" + ) +}) +public class OpenApiConfiguration { +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java new file mode 100644 index 000000000..aeae6dc9b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app154; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp154Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/AbstractIntParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/AbstractIntParameterObject.java new file mode 100644 index 000000000..569247dd9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/AbstractIntParameterObject.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +public class AbstractIntParameterObject { + + int primitiveBaseField; + + T genericField; + + public int getPrimitiveBaseField() { + return primitiveBaseField; + } + + public void setPrimitiveBaseField(int primitiveBaseField) { + this.primitiveBaseField = primitiveBaseField; + } + + public T getGenericField() { + return genericField; + } + + public void setGenericField(T genericField) { + this.genericField = genericField; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/AbstractParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/AbstractParameterObject.java new file mode 100644 index 000000000..6dc314d02 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/AbstractParameterObject.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +public class AbstractParameterObject> { + + int primitiveBaseField; + + @Parameter(schema = @Schema(type = "string", allowableValues = { "ONE", "TWO" })) + T genericField; + + public int getPrimitiveBaseField() { + return primitiveBaseField; + } + + public void setPrimitiveBaseField(int primitiveBaseField) { + this.primitiveBaseField = primitiveBaseField; + } + + public T getGenericField() { + return genericField; + } + + public void setGenericField(T genericField) { + this.genericField = genericField; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteEnum.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteEnum.java new file mode 100644 index 000000000..ddb36d883 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteEnum.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + + +enum ConcreteEnum { + ONE, + TWO + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteIntParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteIntParameterObject.java new file mode 100644 index 000000000..32047a2ac --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteIntParameterObject.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +public class ConcreteIntParameterObject extends AbstractIntParameterObject { + + int primitiveConcreteField; + + public int getPrimitiveConcreteField() { + return primitiveConcreteField; + } + + public void setPrimitiveConcreteField(int primitiveConcreteField) { + this.primitiveConcreteField = primitiveConcreteField; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteParameterObject.java new file mode 100644 index 000000000..6c98cea9b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/ConcreteParameterObject.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +public class ConcreteParameterObject extends AbstractParameterObject { + + int primitiveConcreteField; + + public int getPrimitiveConcreteField() { + return primitiveConcreteField; + } + + public void setPrimitiveConcreteField(int primitiveConcreteField) { + this.primitiveConcreteField = primitiveConcreteField; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/HelloController.java new file mode 100644 index 000000000..f8a466230 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test1") + public ResponseEntity sayHello(@ParameterObject final ConcreteParameterObject test) { + System.out.println("Field B = " + test); + return new ResponseEntity("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + + @GetMapping("/test2") + public ResponseEntity sayHello(@ParameterObject final ConcreteIntParameterObject test) { + System.out.println("Field B = " + test); + return new ResponseEntity("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java new file mode 100644 index 000000000..89633882f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp155Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/HelloController.java new file mode 100644 index 000000000..d395ea96b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/HelloController.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app156; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY; + +@RestController +public class HelloController { + @GetMapping("/hello") + @Parameter(name = "someEnums", in = QUERY, description = "SomeEum decs", + array = @ArraySchema(schema = @Schema(implementation = SomeEnum.class))) + @Parameter(name = "textSet", in = QUERY, description = "First decs", + array = @ArraySchema(schema = @Schema(implementation = String.class))) + @Parameter(name = "someText", in = QUERY, description = "Second decs", + schema = @Schema(type = "string")) + public String hello(@Parameter(hidden = true) User user) { + String forReturn = "Hello "; + StringBuilder stringBuilder = new StringBuilder(forReturn); + + if (user.getSomeEnums() != null) { + for (SomeEnum some : user.getSomeEnums()) { + stringBuilder.append(some); + stringBuilder.append(" "); + } + } + + if (user.getSomeText() != null) { + for (String text : user.getTextSet()) { + stringBuilder.append(text); + stringBuilder.append(" "); + } + } + + if (user.getSomeText() != null) { + stringBuilder.append(user.getSomeText()); + } + + return stringBuilder.toString(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SomeEnum.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SomeEnum.java new file mode 100644 index 000000000..19e2b3fbc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SomeEnum.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app156; + +public enum SomeEnum { + FIRST, + SECOND +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java new file mode 100644 index 000000000..56d609527 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app156; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp156Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/User.java new file mode 100644 index 000000000..026996cbf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/User.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app156; + +import java.util.Set; + +public class User { + private String someText; + + private Set textSet; + + private Set someEnums; + + public String getSomeText() { + return someText; + } + + public void setSomeText(String someText) { + this.someText = someText; + } + + public Set getTextSet() { + return textSet; + } + + public void setTextSet(Set textSet) { + this.textSet = textSet; + } + + public Set getSomeEnums() { + return someEnums; + } + + public void setSomeEnums(Set someEnums) { + this.someEnums = someEnums; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/Bar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/Bar.java new file mode 100644 index 000000000..7b60f05c0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/Bar.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +/** + * A class without a String in it + */ +public class Bar { + private Object child; + + public Object getChild() { + return this.child; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/Foo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/Foo.java new file mode 100644 index 000000000..aa934049d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/Foo.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +/** + * A class with a String in it + */ +public class Foo { + private String child; + + public String getChild() { + return this.child; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/HelloController.java new file mode 100644 index 000000000..5b7648128 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Put Foo and Bar in the schema's components, make sure there is an ignored wrapper + * ({@code ResponseEntity}). + */ +@RestController +public class HelloController { + + @GetMapping("/foo") + public ResponseEntity getFoo() { + return new ResponseEntity(HttpStatus.OK); + } + + @GetMapping("/bar") + public ResponseEntity getBar() { + return new ResponseEntity(HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java new file mode 100644 index 000000000..7d8c447ea --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +import java.util.ArrayList; + +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * This test is to make sure that a new model converter can access the parent of a type, even if + * the type is enclosed in an ignored wrapper. We test this by setting up a model converter which + * adds "stringy" to the "required" property of a schema's parent, when the sub schema is a String. + */ +public class SpringDocApp157Test extends AbstractSpringDocV31Test { + + /** + * The Converters. + */ + private final ModelConverters converters = ModelConverters.getInstance(true); + + @Autowired + private StringyConverter stringyConverter; + + /** + * Unregister converter. + */ + @AfterEach + public void unregisterConverter() { + converters.removeConverter(stringyConverter); + } + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.components.schemas.Foo.required", is(new ArrayList() {{ + add("stringy"); + }}))) + .andExpect(jsonPath("$.components.schemas.Bar", not(hasProperty("required")))); + } + + @SpringBootApplication + static class SpringBootApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/StringyConverter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/StringyConverter.java new file mode 100644 index 000000000..f0ee4e84c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/StringyConverter.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +import java.util.Iterator; + +import com.fasterxml.jackson.databind.JavaType; +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverterContext; +import io.swagger.v3.oas.models.media.Schema; +import org.springdoc.core.providers.ObjectMapperProvider; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class StringyConverter implements ModelConverter { + + @Autowired + ObjectMapperProvider objectMapperProvider; + + public StringyConverter(ObjectMapperProvider objectMapperProvider) { + this.objectMapperProvider = objectMapperProvider; + } + + + @Override + public Schema resolve(AnnotatedType type, ModelConverterContext context, + Iterator chain) { + + JavaType javaType = objectMapperProvider.jsonMapper().constructType(type.getType()); + + if (javaType.getRawClass().equals(String.class)) { + type.getParent().addRequiredItem("stringy"); + } + return chain.next().resolve(type, context, chain); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/CommonFooErrorHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/CommonFooErrorHandler.java new file mode 100644 index 000000000..eb022dfc5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/CommonFooErrorHandler.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + +public class CommonFooErrorHandler { + + @ExceptionHandler + @ResponseStatus(HttpStatus.CONFLICT) + public ErrorDTO onException(Exception e) { + return new ErrorDTO("Something wrong has happened"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/ErrorDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/ErrorDTO.java new file mode 100644 index 000000000..1214e0e92 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/ErrorDTO.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +public class ErrorDTO { + private String message; + + public ErrorDTO() { + } + + public ErrorDTO(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/HelloController.java new file mode 100644 index 000000000..2fb40c584 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) +public class HelloController { + + @GetMapping("/foo") + public SimpleDTO hello() { + return new SimpleDTO("foo"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SimpleDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SimpleDTO.java new file mode 100644 index 000000000..fdbcad7ae --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SimpleDTO.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +public class SimpleDTO { + + private String payload; + + public SimpleDTO() { + } + + public SimpleDTO(String payload) { + this.payload = payload; + } + + public String getPayload() { + return payload; + } + + public void setPayload(String payload) { + this.payload = payload; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpecificFooErrorHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpecificFooErrorHandler.java new file mode 100644 index 000000000..e15777d42 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpecificFooErrorHandler.java @@ -0,0 +1,31 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +import org.springframework.web.bind.annotation.ControllerAdvice; + +@ControllerAdvice(assignableTypes = HelloController.class) +public class SpecificFooErrorHandler extends CommonFooErrorHandler { +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java new file mode 100644 index 000000000..547700c61 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp158Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/CustomException.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/CustomException.java new file mode 100644 index 000000000..7c6535d90 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/CustomException.java @@ -0,0 +1,31 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +public class CustomException extends RuntimeException { + public CustomException(String message) { + super(message); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/FooBean.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/FooBean.java new file mode 100644 index 000000000..a18aa4426 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/FooBean.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +import com.fasterxml.jackson.annotation.JsonView; + +public class FooBean { + @JsonView(Views.View2.class) + private String message; + + @JsonView(Views.View1.class) + private int code; + + public FooBean(String message, int code) { + this.message = message; + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/FooErrorHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/FooErrorHandler.java new file mode 100644 index 000000000..39a9c026d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/FooErrorHandler.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +import com.fasterxml.jackson.annotation.JsonView; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ControllerAdvice(assignableTypes = HelloController.class) +public class FooErrorHandler { + + @ExceptionHandler + @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR) + @JsonView(Views.View1.class) + public ResponseEntity storeAssignmentPublishingError(Exception e) { + return new ResponseEntity<>(new FooBean("INTERNAL_SERVER_ERROR", 500), HttpStatus.INTERNAL_SERVER_ERROR); + } + + @ExceptionHandler + @ResponseStatus(value = HttpStatus.BAD_REQUEST) + @JsonView(Views.View2.class) + public ResponseEntity storeAssignmentPublishingError(CustomException e) { + return new ResponseEntity<>(new FooBean("BAD Request", 400), HttpStatus.BAD_REQUEST); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/HelloController.java new file mode 100644 index 000000000..d6ec4d332 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) +public class HelloController { + + @PostMapping("/foo") + public String create(@RequestBody String foo) { + return "foo"; + } +} + diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java new file mode 100644 index 000000000..21d4861b5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp159Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/Views.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/Views.java new file mode 100644 index 000000000..3413c85c8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/Views.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +public class Views { + public static class View1 { + } + + public static class View2 extends View1 { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/HelloController.java new file mode 100644 index 000000000..ac8a23a5b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/HelloController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java new file mode 100644 index 000000000..60b5fed17 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.test.context.TestPropertySource; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = "springdoc.api-docs.enabled=false") +public class SpringDocApp16Test extends AbstractSpringDocV31Test { + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isNotFound()); + } + + @SpringBootConfiguration + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/HelloController.java new file mode 100644 index 000000000..141367408 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/HelloController.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app160; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("test") + public ErrorResponse doSomethingInteresting() { + return null; + } + + @Bean + public GroupedOpenApi bundleApi() { + return GroupedOpenApi.builder() + .group("test") + .pathsToMatch("/**") + .build(); + } + + @Bean + public ResourceBundleMessageSource translator() { + ResourceBundleMessageSource source = new ResourceBundleMessageSource(); + source.setBasenames("swagger-message-160"); + source.setUseCodeAsDefaultMessage(true); + source.setDefaultEncoding("utf-8"); + return source; + } + + @PropertySource("classpath:swagger-message-160.properties") + @Configuration + public class SwaggerMessage {} + + @Schema(description = "${ErrorResponse}") + public class ErrorResponse { + + @Schema(description = "${ErrorCode}", required = true) + @JsonProperty + private Integer errorCode; + + @Schema(description = "${ErrorMessage}") + @JsonProperty + private String errorMessage; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java new file mode 100644 index 000000000..871b7feb4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app160; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") +public class SpringDocApp160Test extends AbstractSpringDocV31Test { + + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app160-1.json"), true)); + } + + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/HelloController.java new file mode 100644 index 000000000..8fee8137a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app161; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @Operation(summary = "add") + @PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ResponseEntity add(@Parameter(description = "content") @RequestPart(value = "content") String content) throws Exception { + return null; + } + + + @Operation(summary = "add2") + @PostMapping(value = "/add2", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ResponseEntity add2( + @Parameter(description = "content") @RequestPart(value = "content") String content, + @RequestPart(value = "type") String type + ) { + return null; + } + + @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Operation(summary = "test") + public void test(@RequestPart("strValue") String strValue, + @RequestPart("intValue") Integer intValue) { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java new file mode 100644 index 000000000..3904634cb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app161; + +import java.util.Locale; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp161Test extends AbstractSpringDocV31Test { + + @Test + protected void testApp() throws Exception { + Locale.setDefault(Locale.US); + super.testApp(); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/OpenApiConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/OpenApiConfig.java new file mode 100644 index 000000000..077046ec5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/OpenApiConfig.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app162; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.v3.oas.models.servers.Server; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class OpenApiConfig { + @Bean + OpenApiCustomizer openApiCustomizer() { + return openApi -> { + openApi.getInfo().version("v1"); + Server server = new Server().url(""); + List servers = new ArrayList<>(); + servers.add(server); + openApi.servers(servers); + }; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java new file mode 100644 index 000000000..119b2a5b8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app162; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp162Test extends AbstractSpringDocV31Test { + + @Test + void testApp2() throws Exception { + super.testApp(); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/CommissionDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/CommissionDto.java new file mode 100644 index 000000000..d71d7c7c5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/CommissionDto.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class CommissionDto { + private String email; + + private String firstName; + + private String lastName; + + public CommissionDto() { + } + + public CommissionDto(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/CommissionsResource.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/CommissionsResource.java new file mode 100644 index 000000000..2560a9948 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/CommissionsResource.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; +import static org.springframework.http.ResponseEntity.accepted; + +@RestController +public class CommissionsResource { + + @PutMapping(value = "{id}", consumes = APPLICATION_JSON_VALUE) + @Operation(description = "updateCommission", summary = "Update a commission") + @ApiResponse(responseCode = "202", description = "Commission updated", content = @Content(schema = @Schema(implementation = CommissionDto.class), examples = @ExampleObject(name = "202", ref = Examples.PUT_COMMISSION_RESPONSE_BODY_EXAMPLE_KEY))) + public ResponseEntity updateCommission( + @Parameter(description = "Commission's id", required = true) @PathVariable("id") String commissionId, + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "A commission to update", required = true, content = @Content(schema = @Schema(implementation = CommissionDto.class), examples = @ExampleObject(name = "requestExample", ref = Examples.PUT_COMMISSION_REQUEST_BODY_EXAMPLE_KEY))) @RequestBody(required = true) @Valid CommissionDto commission) { + return accepted().body(commission); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/ExampleRegistrationCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/ExampleRegistrationCustomizer.java new file mode 100644 index 000000000..f0a394be0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/ExampleRegistrationCustomizer.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163; + +import java.util.List; +import java.util.Map; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.examples.Example; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.stereotype.Component; + +@Component +public class ExampleRegistrationCustomizer implements OpenApiCustomizer { + + private final List> examplesToRegister; + + public ExampleRegistrationCustomizer(List> examplesToRegister) { + this.examplesToRegister = examplesToRegister; + } + + @Override + public void customise(OpenAPI openApi) { + examplesToRegister.forEach(entry -> openApi.getComponents().addExamples(entry.getKey(), entry.getValue())); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/Examples.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/Examples.java new file mode 100644 index 000000000..20c099430 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/Examples.java @@ -0,0 +1,88 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163; + +import java.util.AbstractMap; +import java.util.Map; + +import io.swagger.v3.oas.models.examples.Example; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * This class contributes OpenAPI examples. + * + * Each example is contributed through a bean typed as a map entry + * (Map.Entry) and referenced through a constant by a resource + * operation's @ApiResponse. + */ +@Configuration +public class Examples { + + public static final String PREFIX = "#/components/examples/"; + + public static final String PUT_COMMISSION_REQUEST_BODY_EXAMPLE_KEY = "httpPutCommissionRequestBodyExample"; + + public static final String PUT_COMMISSION_REQUEST_BODY_EXAMPLE = PREFIX + PUT_COMMISSION_REQUEST_BODY_EXAMPLE_KEY; + + public static final String PUT_COMMISSION_RESPONSE_BODY_EXAMPLE_KEY = "httpPutCommissionResponseBodyExample"; + + public static final String PUT_COMMISSION_RESPONSE_BODY_EXAMPLE = PREFIX + PUT_COMMISSION_RESPONSE_BODY_EXAMPLE_KEY; + + @Bean + public Map.Entry httpPutCommissionRequestBodyExample() { + Example httpPutCommissionRequestBodyExample = new Example(); + Map.Entry entry = new AbstractMap.SimpleEntry<>(PUT_COMMISSION_REQUEST_BODY_EXAMPLE_KEY, + httpPutCommissionRequestBodyExample); + httpPutCommissionRequestBodyExample + .setSummary("HTTP 202 JSON Body request example for updateCommission operation"); + + CommissionDto commission = new CommissionDto("esteban@dugueperoux.com", "Esteban", + "DUGUEPEROUX"); + + httpPutCommissionRequestBodyExample.setValue(commission); + + return entry; + } + + @Bean + public Map.Entry httpPutCommissionResponseBodyExample() { + Example httpPutCommissionResponseBodyExample = new Example(); + Map.Entry entry = new AbstractMap.SimpleEntry<>(PUT_COMMISSION_RESPONSE_BODY_EXAMPLE_KEY, + httpPutCommissionResponseBodyExample); + httpPutCommissionResponseBodyExample + .setSummary("HTTP 202 JSON Body response example for updateCommission operation"); + + CommissionDto commission = new CommissionDto("esteban@dugueperoux.com", "Esteban", + "DUGUEPEROUX"); + + httpPutCommissionResponseBodyExample.setValue(commission); + + return entry; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java new file mode 100644 index 000000000..4a5c5ebf7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Import; + +public class SpringDocApp163Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + @Import({ Examples.class, ExampleRegistrationCustomizer.class }) + static class SpringDocTestApp { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SampleResponseClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SampleResponseClass.java new file mode 100644 index 000000000..824192c23 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SampleResponseClass.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app164; + +import java.util.List; + +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; + +public class SampleResponseClass { + + private String idAsFirstParameter; + + private String nameAsSecondParamater; + + private String lastNameAsThirdParameter; + + private boolean booleanValueAsFourthParameter; + + @ArraySchema( arraySchema = @Schema( description = "${blahDescription.value}" ), + schema = @Schema( description = "${blahDescription.value}" ) ) + private List listBlah; + + public List getListBlah() { + return listBlah; + } + + public void setListBlah(List listBlah) { + this.listBlah = listBlah; + } + + public String getIdAsFirstParameter() { + return idAsFirstParameter; + } + + public void setIdAsFirstParameter(String idAsFirstParameter) { + this.idAsFirstParameter = idAsFirstParameter; + } + + public String getNameAsSecondParamater() { + return nameAsSecondParamater; + } + + public void setNameAsSecondParamater(String nameAsSecondParamater) { + this.nameAsSecondParamater = nameAsSecondParamater; + } + + public String getLastNameAsThirdParameter() { + return lastNameAsThirdParameter; + } + + public void setLastNameAsThirdParameter(String lastNameAsThirdParameter) { + this.lastNameAsThirdParameter = lastNameAsThirdParameter; + } + + public boolean isBooleanValueAsFourthParameter() { + return booleanValueAsFourthParameter; + } + + public void setBooleanValueAsFourthParameter(boolean aBooleanValueAsFourthParameter) { + this.booleanValueAsFourthParameter = aBooleanValueAsFourthParameter; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java new file mode 100644 index 000000000..b6854a913 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app164; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") +public class SpringDocApp164Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/TestApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/TestApiController.java new file mode 100644 index 000000000..caed5d51c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/TestApiController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app164; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestApiController { + + @GetMapping(value = "/test") + public SampleResponseClass getInvoices() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/HelloController.java new file mode 100644 index 000000000..392d61c97 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/HelloController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app165; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/api") +public class HelloController { + + @Operation(description = "I want here some custom config") + @GetMapping("/sample1/{springdoc}") + public ResponseEntity sample1(@PathVariable(name = "#{T(org.springdoc.core.utils.Constants).SPRINGDOC_PREFIX}") String id) { + throw new UnsupportedOperationException("the body is not relevant now"); + } + + @Operation(description = "I want here another some custom config") + @GetMapping("/sample2") + public ResponseEntity sample2(@RequestParam(defaultValue = "#{{}}") List value) { + throw new UnsupportedOperationException("the body is not relevant now"); + } + + @Operation(description = "I want here another some custom config") + @GetMapping("/sample3") + public ResponseEntity sample3(@RequestParam(defaultValue = "#{T(org.springdoc.core.utils.Constants).DEFAULT_SWAGGER_UI_PATH}") String id) { + throw new UnsupportedOperationException("the body is not relevant now"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/SpringDocApp165Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/SpringDocApp165Test.java new file mode 100644 index 000000000..fbb6f7994 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/SpringDocApp165Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app165; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp165Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/GlobalErrorResponseDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/GlobalErrorResponseDto.java new file mode 100644 index 000000000..469681e56 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/GlobalErrorResponseDto.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +public class GlobalErrorResponseDto { + + private String globalMessage; + + public GlobalErrorResponseDto(String globalMessage) { + this.globalMessage = globalMessage; + } + + public String getGlobalMessage() { + return globalMessage; + } + + public void setGlobalMessage(String globalMessage) { + this.globalMessage = globalMessage; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/GlobalExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/GlobalExceptionHandler.java new file mode 100644 index 000000000..05ab209cc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/GlobalExceptionHandler.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +@Component("1") // bean name override to simulate order in HashMap +public class GlobalExceptionHandler { + + @ExceptionHandler(RuntimeException.class) + @ResponseStatus + public GlobalErrorResponseDto processException() { + return new GlobalErrorResponseDto("global"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/LocalErrorResponseDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/LocalErrorResponseDto.java new file mode 100644 index 000000000..5b09f351e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/LocalErrorResponseDto.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +public class LocalErrorResponseDto { + + private String localMessage; + + public LocalErrorResponseDto(String localMessage) { + this.localMessage = localMessage; + } + + public String getLocalMessage() { + return localMessage; + } + + public void setLocalMessage(String localMessage) { + this.localMessage = localMessage; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java new file mode 100644 index 000000000..04d29b9d1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * In this test, it is checked that the error handler is displayed correctly in the documentation. + * Exactly, that the local handler takes precedence over the global one + * */ +@TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") +public class SpringDocApp166Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/TestApiController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/TestApiController.java new file mode 100644 index 000000000..50307f1c9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/TestApiController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Component("0") // bean name override to simulate order in HashMap +public class TestApiController { + + @GetMapping(value = "/test") + public String throwError() { + throw new IllegalArgumentException(); + } + + @ExceptionHandler(RuntimeException.class) + @ResponseStatus + public LocalErrorResponseDto processException() { + return new LocalErrorResponseDto("local"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/HelloController.java new file mode 100644 index 000000000..fed6342bd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app167; + +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/api") +public class HelloController { + + @GetMapping("/sample1") + public ResponseEntity sample1(@Parameter(name = "mySample") String mySample) { + throw new UnsupportedOperationException("the body is not relevant now"); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java new file mode 100644 index 000000000..6b9a882ce --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app167; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +@TestPropertySource(properties = "springdoc.disable-i18n=true") +public class SpringDocApp167Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/AbstractParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/AbstractParent.java new file mode 100644 index 000000000..e485a87aa --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/AbstractParent.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app168; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildOfAbstract1.class), + @Type(ChildOfAbstract2.class) +}) +public abstract class AbstractParent { + private int id; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + +class ChildOfAbstract1 extends AbstractParent { + private String abstrachChild1Param; + + public String getAbstrachChild1Param() { + return abstrachChild1Param; + } + + public void setAbstrachChild1Param(String abstrachChild1Param) { + this.abstrachChild1Param = abstrachChild1Param; + } +} + +class ChildOfAbstract2 extends AbstractParent { + private String abstractChild2Param; + + public String getAbstractChild2Param() { + return abstractChild2Param; + } + + public void setAbstractChild2Param(String abstractChild2Param) { + this.abstractChild2Param = abstractChild2Param; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/ConcreteParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/ConcreteParent.java new file mode 100644 index 000000000..2e44a012a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/ConcreteParent.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app168; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildOfConcrete1.class), + @Type(ChildOfConcrete2.class) +}) +public class ConcreteParent { + private int id; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + +class ChildOfConcrete1 extends ConcreteParent { + private String concreteChild1Param; + + public String getConcreteChild1Param() { + return concreteChild1Param; + } + + public void setConcreteChild1Param(String concreteChild1Param) { + this.concreteChild1Param = concreteChild1Param; + } +} + +class ChildOfConcrete2 extends ConcreteParent { + private String concreteChild2Param; + + public String getConcreteChild2Param() { + return concreteChild2Param; + } + + public void setConcreteChild2Param(String concreteChild2Param) { + this.concreteChild2Param = concreteChild2Param; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/Controller.java new file mode 100644 index 000000000..715954f40 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/Controller.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app168; + +import java.util.List; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("class-hierarchy") +public class Controller { + @PostMapping("abstract-parent") + public Response abstractParent(@RequestBody AbstractParent payload) { + return null; + } + + @PostMapping("concrete-parent") + public Response concreteParent(@RequestBody ConcreteParent payload) { + return null; + } +} + +class Response { + AbstractParent abstractParent; + + List concreteParents; + + public AbstractParent getAbstractParent() { + return abstractParent; + } + + public void setAbstractParent(AbstractParent abstractParent) { + this.abstractParent = abstractParent; + } + + public List getConcreteParents() { + return concreteParents; + } + + public void setConcreteParents(List concreteParents) { + this.concreteParents = concreteParents; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java new file mode 100644 index 000000000..bae10c3a3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app168; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.springdoc.core.converters.PolymorphicModelConverter; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +@TestPropertySource(properties = Constants.SPRINGDOC_POLYMORPHIC_CONVERTER_ENABLED + "=false") +public class SpringDocApp168Test extends AbstractSpringDocV31Test { + + static { + Optional modelConverterOptional = + ModelConverters.getInstance(true).getConverters() + .stream().filter(modelConverter -> modelConverter instanceof PolymorphicModelConverter).findAny(); + modelConverterOptional.ifPresent(ModelConverters.getInstance(true)::removeConverter); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/DefaultRequestMappingHandlerMapping.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/DefaultRequestMappingHandlerMapping.java new file mode 100644 index 000000000..4108e2e8b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/DefaultRequestMappingHandlerMapping.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app169; + +import org.springframework.expression.ParserContext; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.expression.spel.support.StandardEvaluationContext; +import org.springframework.util.StringValueResolver; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +public class DefaultRequestMappingHandlerMapping extends RequestMappingHandlerMapping { + + private static final SpelExpressionParser PARSER = new SpelExpressionParser(); + + private static final ThreadLocal handlerHolder = new ThreadLocal<>(); + + @Override + public void setEmbeddedValueResolver(StringValueResolver resolver) { + super.setEmbeddedValueResolver(new StringValueResolver() { + @Override + public String resolveStringValue(String strVal) { + Object handler = handlerHolder.get(); + if (handler != null) { + strVal = String.valueOf(PARSER.parseExpression(strVal, ParserContext.TEMPLATE_EXPRESSION) + .getValue(new StandardEvaluationContext(handler))); + } + if (resolver != null) { + strVal = resolver.resolveStringValue(strVal); + } + return strVal; + } + }); + } + + @Override + protected void detectHandlerMethods(Object handler) { + Object handlerObject = (handler instanceof String ? obtainApplicationContext().getBean((String) handler) + : handler); + handlerHolder.set(handlerObject); + super.detectHandlerMethods(handler); + handlerHolder.remove(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/DefaultWebMvcRegistrations.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/DefaultWebMvcRegistrations.java new file mode 100644 index 000000000..0aee15fcd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/DefaultWebMvcRegistrations.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app169; + +import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +@Component +public class DefaultWebMvcRegistrations implements WebMvcRegistrations { + + @Override + public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { + return new DefaultRequestMappingHandlerMapping(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java new file mode 100644 index 000000000..26611564f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app169; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp169Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/TestController.java new file mode 100644 index 000000000..5cc8ad523 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/TestController.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app169; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestController { + + @PostMapping("/echo") + public String echo(String content) { + return content; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/HelloController.java new file mode 100644 index 000000000..bcd8ec03f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app17; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java new file mode 100644 index 000000000..812978613 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app17; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp17Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/HelloController.java new file mode 100644 index 000000000..57f684e7d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/HelloController.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app170; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + @GetMapping("hello") + public String hello() { + return "Hello"; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java new file mode 100644 index 000000000..0e3900c98 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app170; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.OpenApiCustomizer; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + + +public class SpringDocApp170Test extends AbstractSpringDocV31Test { + + @Test + void testApp1() throws Exception { + this.testApp(); + } + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OpenApiCustomizer openApiCustomizer() { + return openApi -> openApi.getServers().forEach(s -> s.url("URL")); + } + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/HelloLocaleController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/HelloLocaleController.java new file mode 100644 index 000000000..c7a4f202b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/HelloLocaleController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app171; + +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.http.HttpEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Tag(name = "greeting", description = "test") +public class HelloLocaleController { + + @GetMapping("/persons") + public void persons(@Valid @NotBlank String name) { + } + + @GetMapping("/test") + public HttpEntity demo2() { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java new file mode 100644 index 000000000..e908519e9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app171; + +import java.util.Locale; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.OpenApiLocaleCustomizer; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.http.HttpHeaders; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = Constants.SPRINGDOC_CACHE_DISABLED + "=false") +public class SpringDocApp171Test extends AbstractSpringDocV31Test { + + @Test + @Override + public void testApp() throws Exception { + Locale.setDefault(Locale.US); + testApp(Locale.US); + testApp(Locale.FRANCE); + testApp(Locale.UK); + } + + private void testApp(Locale locale) throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL).locale(locale).header(HttpHeaders.ACCEPT_LANGUAGE, locale.toLanguageTag())).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + "-" + locale.toLanguageTag() + ".json"); + assertEquals(expected, result, true); + } + + @SpringBootApplication + static class SpringDocTestApp { + + @Autowired + ResourceBundleMessageSource resourceBundleMessageSource; + + @Bean + public OpenApiLocaleCustomizer openApiLocaleCustomizer() { + return (openAPI, locale) + -> openAPI.getInfo().title(resourceBundleMessageSource.getMessage("test", null, locale)); + } + + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/HelloController.java new file mode 100644 index 000000000..ae850168d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/HelloController.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app172; + + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/customer/{id}") + public String getTenantById(@PathVariable("id") String customerId) { + return "Tenant_" + customerId; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/SpringDocApp172Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/SpringDocApp172Test.java new file mode 100644 index 000000000..bfd701b29 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/SpringDocApp172Test.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app172; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { "springdoc.show-actuator=true", "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.include = tenant" }) +public class SpringDocApp172Test extends AbstractSpringDocV31Test { + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/sample-group")) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.1.0/app172.json"), true)); + } + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public GroupedOpenApi actuatorApi(OpenApiCustomizer actuatorOpenApiCustomizer, OperationCustomizer actuatorCustomizer) { + return GroupedOpenApi.builder() + .group("sample-group") + .packagesToScan("test.org.springdoc.api.v31.app172") + .addOpenApiCustomizer(actuatorOpenApiCustomizer) + .addOperationCustomizer(actuatorCustomizer) + .pathsToExclude("/health/*") + .build(); + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/HelloController.java new file mode 100644 index 000000000..0f133dbfc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/HelloController.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app173; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test") + public void printHello() { + System.out.println("Hello"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java new file mode 100644 index 000000000..a0ee8321e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app173; + +import java.util.Locale; +import java.util.Map; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.http.HttpHeaders; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp173Test extends AbstractSpringDocV31Test { + + @Test + @Override + public void testApp() throws Exception { + Locale.setDefault(Locale.US); + testApp(Locale.US); + testApp(Locale.FRANCE); + } + + private void testApp(Locale locale) throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL).locale(locale).header(HttpHeaders.ACCEPT_LANGUAGE, locale.toLanguageTag())).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OpenAPI openAPI() { + return new OpenAPI() + .info(new Info().extensions(Map.of("TEST", "HELLO"))) + .extensions(Map.of("TEST", "HELLO")); + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/AnnotatedController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/AnnotatedController.java new file mode 100644 index 000000000..31242cccf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/AnnotatedController.java @@ -0,0 +1,102 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app177; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.util.Arrays; +import java.util.List; + +import org.springdoc.core.filters.OpenApiMethodFilter; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class AnnotatedController { + + @Group1 + @GetMapping("/annotated") + public String annotatedGet() { + return "annotated"; + } + + @Group1 + @Group3 + @PostMapping("/annotated") + public String annotatedPost() { + return "annotated"; + } + + @Group2 + @Group3 + @PutMapping("/annotated") + public String annotatedPut() { + return "annotated"; + } + + @PostMapping("/notAnnotated") + public String notAnnotatedPost() { + return "annotated"; + } + + @Bean + public List apis() { + GroupedOpenApi group1OpenApi = GroupedOpenApi.builder() + .group("annotatedGroup1") + .addOpenApiMethodFilter(method -> method.isAnnotationPresent(Group1.class)) + .build(); + + GroupedOpenApi group2OpenApi = GroupedOpenApi.builder() + .group("annotatedGroup2") + .addOpenApiMethodFilter(method -> method.isAnnotationPresent(Group2.class)) + .build(); + + GroupedOpenApi group3OpenApi = GroupedOpenApi.builder() + .group("annotatedCombinedGroup") + .addOpenApiMethodFilter(method -> method.isAnnotationPresent(Group1.class) || method.isAnnotationPresent(Group2.class)) + .build(); + + return Arrays.asList(group1OpenApi, group2OpenApi, group3OpenApi); + } + + @Bean + public OpenApiMethodFilter methodFilter() { + return method -> method.isAnnotationPresent(Group3.class); + } + + @Retention(RetentionPolicy.RUNTIME) + @interface Group1 {} + + @Retention(RetentionPolicy.RUNTIME) + @interface Group2 {} + + @Retention(RetentionPolicy.RUNTIME) + @interface Group3 {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/SpringDocApp177Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/SpringDocApp177Test.java new file mode 100644 index 000000000..133adbc80 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/SpringDocApp177Test.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app177; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +class SpringDocApp177Test extends AbstractSpringDocV31Test { + + @Test + void testFilterOnlyPicksUpMatchedMethods() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/annotatedGroup1")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app177-1.json"), true)); + } + + @Test + void testFilterOnlyPicksUpMatchedMethodsWithDifferentFilter() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/annotatedGroup2")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app177-2.json"), true)); + } + + @Test + void testFilterOnlyPicksUpCombinedMatchedMethods() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/annotatedCombinedGroup")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app177-3.json"), true)); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/AnnotatedController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/AnnotatedController.java new file mode 100644 index 000000000..c40ab52ac --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/AnnotatedController.java @@ -0,0 +1,103 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app178; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Method; +import java.util.function.Predicate; + +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class AnnotatedController { + + @Group1 + @GetMapping("/annotated") + public String annotatedGet() { + return "annotated"; + } + + @Group1 + @PostMapping("/annotated") + public String annotatedPost() { + return "annotated"; + } + + @Group2 + @PutMapping("/annotated") + public String annotatedPut() { + return "annotated"; + } + + + @Bean + public GroupedOpenApi group1OpenApi() { + Predicate hidingCondition = method -> method.isAnnotationPresent(Group1.class); + return GroupedOpenApi.builder() + .group("annotatedGroup1") + .addOperationCustomizer(getOperationCustomizer(hidingCondition)) + .build(); + } + + @Bean + public GroupedOpenApi group2OpenApi() { + Predicate filterCondition = method -> method.isAnnotationPresent(Group2.class); + return GroupedOpenApi.builder() + .group("annotatedGroup2") + .addOperationCustomizer(getOperationCustomizer(filterCondition)) + .build(); + } + + @Bean + public GroupedOpenApi group3OpenApi() { + Predicate hidingCondition = method -> method.isAnnotationPresent(Group1.class) || method.isAnnotationPresent(Group2.class); + return GroupedOpenApi.builder() + .group("annotatedCombinedGroup") + .addOperationCustomizer(getOperationCustomizer(hidingCondition)) + .build(); + } + + private OperationCustomizer getOperationCustomizer(Predicate filterCondition) { + return (operation, handlerMethod) -> filterCondition.test(handlerMethod.getMethod()) ? operation : null; + } + + @Retention(RetentionPolicy.RUNTIME) + @interface Group1 { + + } + + @Retention(RetentionPolicy.RUNTIME) + @interface Group2 { + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/SpringDocApp178Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/SpringDocApp178Test.java new file mode 100644 index 000000000..33f5e7ea7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/SpringDocApp178Test.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app178; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +class SpringDocApp178Test extends AbstractSpringDocV31Test { + + @Test + void testFilterOnlyPicksUpMatchedMethods() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/annotatedGroup1")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app178-1.json"), true)); + } + + @Test + void testFilterOnlyPicksUpMatchedMethodsWithDifferentFilter() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/annotatedGroup2")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app178-2.json"), true)); + } + + @Test + void testFilterOnlyPicksUpCombinedMatchedMethods() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/annotatedCombinedGroup")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app178-3.json"), true)); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/HelloController.java new file mode 100644 index 000000000..923937e55 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/HelloController.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app179; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + @GetMapping("/test/{objId}") + String test(@MyIdPathVariable MyObj obj) { + return obj.getContent(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyConfiguration.java new file mode 100644 index 000000000..5db83d3e8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyConfiguration.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app179; + +import java.util.List; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class MyConfiguration implements WebMvcConfigurer { + @Override + public void addArgumentResolvers(List resolvers) { + resolvers.add(new MyObjArgumentResolver()); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyIdPathVariable.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyIdPathVariable.java new file mode 100644 index 000000000..cb7eb9462 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyIdPathVariable.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app179; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface MyIdPathVariable { +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyObj.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyObj.java new file mode 100644 index 000000000..2bc62372b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyObj.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app179; + +public class MyObj { + private final String id; + + private final String content; + + public MyObj(String id, String content) { + this.id = id; + this.content = content; + } + + public String getId() { + return id; + } + + public String getContent() { + return content; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyObjArgumentResolver.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyObjArgumentResolver.java new file mode 100644 index 000000000..b4ea7a987 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyObjArgumentResolver.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app179; + +import org.springframework.core.MethodParameter; +import org.springframework.web.bind.support.WebDataBinderFactory; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.method.support.ModelAndViewContainer; + + +public class MyObjArgumentResolver implements HandlerMethodArgumentResolver { + + @Override + public boolean supportsParameter(MethodParameter parameter) { + return parameter.hasParameterAnnotation(MyIdPathVariable.class) && + MyObj.class.isAssignableFrom(parameter.getParameterType()); + } + + @Override + public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, + NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { + return new MyObj("id", "content"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyPathParameterCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyPathParameterCustomizer.java new file mode 100644 index 000000000..52f04a623 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/MyPathParameterCustomizer.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app179; + +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.PathParameter; +import org.springdoc.core.customizers.ParameterCustomizer; + +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; + +@Component +public class MyPathParameterCustomizer implements ParameterCustomizer { + @Override + public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { + if (methodParameter.hasParameterAnnotation(MyIdPathVariable.class)) { + Parameter alternativeParameter = new PathParameter(); + alternativeParameter.setName("objId"); + alternativeParameter.setSchema(new StringSchema()); + return alternativeParameter; + } + return parameterModel; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/SpringDocApp179Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/SpringDocApp179Test.java new file mode 100644 index 000000000..35e13f330 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/SpringDocApp179Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app179; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp179Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java new file mode 100644 index 000000000..5ecf79df2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app18; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NegativeOrZero; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.PositiveOrZero; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + public String persons(@NotBlank String name) { + return "OK"; + } + + @GetMapping(value = "/persons2") + public String persons2(@NotBlank @Parameter(description = "persons name") String name) { + return "OK"; + } + + @GetMapping(value = "/persons3") + public String persons3(@NotBlank @Parameter(description = "persons name") @RequestParam String name) { + return "OK"; + } + + @GetMapping(value = "/persons4") + public String persons4(@PositiveOrZero int age) { + return "OK"; + } + + @GetMapping(value = "/persons5") + public String persons5(@NegativeOrZero int age) { + return "OK"; + } + + @GetMapping(value = "/persons6") + public String persons6(@NotEmpty @Parameter(description = "persons name") String name) { + return "OK"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java new file mode 100644 index 000000000..f0dff7717 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app18; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.pre-loading-enabled=true") +public class SpringDocApp18Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/Body.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/Body.java new file mode 100644 index 000000000..d185fe5f8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/Body.java @@ -0,0 +1,107 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app180; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import io.swagger.v3.oas.annotations.media.Schema; + + +@Schema(name = "Body", description = "Body", example = "{\"key\":\"value\"}") +public class Body implements Map, MapExclusion { + + @Schema(hidden = true) + private Map data; + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } + + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean containsKey(Object key) { + return false; + } + + @Override + public boolean containsValue(Object value) { + return false; + } + + @Override + public Object get(Object key) { + return null; + } + + @Override + public Object put(String key, Object value) { + return null; + } + + @Override + public Object remove(Object key) { + return null; + } + + @Override + public void putAll(Map m) { + + } + + @Override + public void clear() { + + } + + @Override + public Set keySet() { + return null; + } + + @Override + public Collection values() { + return null; + } + + @Override + public Set> entrySet() { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/MapExclusion.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/MapExclusion.java new file mode 100644 index 000000000..bddd4bf19 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/MapExclusion.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app180; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +public interface MapExclusion { + @JsonIgnore + boolean isEmpty(); +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/RESTService.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/RESTService.java new file mode 100644 index 000000000..4c6fc1fd6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/RESTService.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app180; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("api") +@Tag(name = "REST Service") +public class RESTService { + + @PostMapping("/testWithoutSchema") + @Operation(summary = "Test Request Body type Schema usage [Error]") + public String withoutSchema(@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true) + @RequestBody Body body) { + return "without proper schema"; + } + + @PostMapping("/testWithSchema") + @Operation(summary = "Test Request Body type Schema usage [Correct]") + public String withSchema(@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = @Content(schema = @Schema(implementation = Body.class))) + @RequestBody Body body) { + return "with proper schema"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/SpringDocApp180Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/SpringDocApp180Test.java new file mode 100644 index 000000000..7fbefa669 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/SpringDocApp180Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app180; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +class SpringDocApp180Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/AbstractParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/AbstractParameterObject.java new file mode 100644 index 000000000..50cde25fe --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/AbstractParameterObject.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app181; + +public class AbstractParameterObject { + + int primitiveBaseField; + + T genericField; + + public int getPrimitiveBaseField() { + return primitiveBaseField; + } + + public void setPrimitiveBaseField(int primitiveBaseField) { + this.primitiveBaseField = primitiveBaseField; + } + + public T getGenericField() { + return genericField; + } + + public void setGenericField(T genericField) { + this.genericField = genericField; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/ConcreteParameterObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/ConcreteParameterObject.java new file mode 100644 index 000000000..f95d358a6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/ConcreteParameterObject.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app181; + +public class ConcreteParameterObject extends AbstractParameterObject { + + int primitiveConcreteField; + + public int getPrimitiveConcreteField() { + return primitiveConcreteField; + } + + public void setPrimitiveConcreteField(int primitiveConcreteField) { + this.primitiveConcreteField = primitiveConcreteField; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/HelloController.java new file mode 100644 index 000000000..aa4714d2f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app181; + + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test1") + public ResponseEntity sayHello(@ParameterObject final ConcreteParameterObject test) { + System.out.println("Field B = " + test); + return new ResponseEntity("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/SpringDocApp181Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/SpringDocApp181Test.java new file mode 100644 index 000000000..36dfa6d20 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/SpringDocApp181Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app181; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +public class SpringDocApp181Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/HelloController.java new file mode 100644 index 000000000..de9c757cf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/HelloController.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app182; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @ExceptionHandler(IllegalArgumentException.class) + @ApiResponse(responseCode = "404", description = "Not here", content = @Content) + @ResponseStatus(HttpStatus.NOT_FOUND) + public void bad(IllegalArgumentException e) { + + } + + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } + + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + throw new IllegalArgumentException(); + + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/SpringDocApp182Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/SpringDocApp182Test.java new file mode 100644 index 000000000..ebdcc964e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/SpringDocApp182Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app182; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author bnasslahsen + */ +public class SpringDocApp182Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/HelloController.java new file mode 100644 index 000000000..274cf8dff --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app183; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@Tag(name = "NetworkServices", description = "the NetworkServices API") +public class HelloController { + + + @GetMapping("/{userId}") + public User doSomething(@PathVariable("userId") User user) { + return new User(user.getId(), "tototot"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/SpringDocApp183Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/SpringDocApp183Test.java new file mode 100644 index 000000000..c2a280015 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/SpringDocApp183Test.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app183; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.core.convert.converter.Converter; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +public class SpringDocApp183Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + + record ObjectA(String aa, String aaa) {} + + record ObjectB(Integer bb, Integer bbb) {} + + @Component + class BToAConvertor implements Converter { + @Override + public ObjectA convert(ObjectB source) { + return new ObjectA(source.bb+"", source.bbb+""); + } + } + + @RestController + class Controller { + @PostMapping("/test") + public String test(@RequestBody ObjectA request) { + return "OK!"; + } + } + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/User.java new file mode 100644 index 000000000..bde58e948 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/User.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app183; + +public class User { + + String id; + + String toto; + + + public User() { + } + + public User(String id, String toto) { + this.id = id; + this.toto = toto; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getToto() { + return toto; + } + + public void setToto(String toto) { + this.toto = toto; + } + + @Override + public String toString() { + return "User{" + + "id='" + id + '\'' + + ", toto='" + toto + '\'' + + '}'; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/UserConverter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/UserConverter.java new file mode 100644 index 000000000..a4095f3b3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/UserConverter.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app183; + +import org.springframework.core.convert.converter.Converter; + +public class UserConverter implements Converter { + + @Override + public User convert(String userId) { + // Fetch from repository + User user = new User(); + user.setId(userId); + return user; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/WebConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/WebConfig.java new file mode 100644 index 000000000..16512ddfd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/WebConfig.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app183; + +import org.springframework.context.annotation.Configuration; +import org.springframework.format.FormatterRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebConfig implements WebMvcConfigurer { + + @Override + public void addFormatters(FormatterRegistry registry) { + registry.addConverter(new UserConverter()); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/HelloController.java new file mode 100644 index 000000000..4373be84b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/HelloController.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app184; + + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/globalBeanFiltered") + public String globalBeanFiltered() { + return "globalBeanFiltered"; + } + + @GetMapping("/beanFiltered") + public String beanFiltered() { + return "beanFiltered"; + } + + @GetMapping("/group1Filtered") + public String group1Filtered() { + return "group1Filtered"; + } + + @GetMapping("/group2Filtered") + public String group2Filtered() { + return "group2Filtered"; + } + + @GetMapping("/group3Filtered") + public String group3Filtered() { + return "group3Filtered"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java new file mode 100644 index 000000000..40734b9b6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java @@ -0,0 +1,132 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app184; + +import java.util.Objects; + +import io.swagger.v3.oas.models.parameters.HeaderParameter; +import io.swagger.v3.oas.models.servers.Server; +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.GlobalOpenApiCustomizer; +import org.springdoc.core.customizers.GlobalOperationCustomizer; +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.filters.GlobalOpenApiMethodFilter; +import org.springdoc.core.filters.OpenApiMethodFilter; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { + "springdoc.group-configs[0].group=group1", + "springdoc.group-configs[0].paths-to-exclude=/group1Filtered", +}) +public class SpringDocApp184Test extends AbstractSpringDocV31Test { + + @Test + void testGroup1() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group1")) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.1.0/app184-1.json"), true)); + } + + @Test + void testGroup2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group2")) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.1.0/app184-2.json"), true)); + } + + @Test + void testGroup3() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group3")) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.1.0/app184-3.json"), true)); + } + + @SpringBootApplication + static class SpringDocTestApp { + + @Bean + public GlobalOpenApiCustomizer addUrlGlobalBean() { + return openApi -> openApi.getServers().add(new Server().url("urlGlobalBean")); + } + + @Bean + public OpenApiCustomizer addUrlBean() { + return openApi -> openApi.getServers().add(new Server().url("urlBean")); + } + + @Bean + public GlobalOperationCustomizer addHeaderGlobaBeanl() { + return (operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGlobalBean")); + } + + @Bean + public OperationCustomizer addHeaderBean() { + return (operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerBean")); + } + + @Bean + public GlobalOpenApiMethodFilter globalFilterBean() { + return method -> !Objects.equals(method.getName(), "globalBeanFiltered"); + } + + @Bean + public OpenApiMethodFilter filterBean() { + return method -> !Objects.equals(method.getName(), "beanFiltered"); + } + + @Bean + public GroupedOpenApi group2() { + return GroupedOpenApi.builder() + .group("group2") + .addOpenApiCustomizer(openApi -> openApi.getServers().add(new Server().url("urlGroup2"))) + .addOperationCustomizer((operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGroup2"))) + .addOpenApiMethodFilter(method -> !Objects.equals(method.getName(), "group2Filtered")) + .build(); + } + + @Bean + public GroupedOpenApi group3() { + return GroupedOpenApi.builder() + .group("group3") + .addOpenApiCustomizer(openApi -> openApi.getServers().add(new Server().url("urlGroup3"))) + .addOperationCustomizer((operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGroup3"))) + .addOpenApiMethodFilter(method -> !Objects.equals(method.getName(), "group3Filtered")) + .build(); + } + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Cat.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Cat.java new file mode 100644 index 000000000..e657c534f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Cat.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app185; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class Cat extends Pet { + + private final boolean meows; + + public Cat() { + super(); + this.meows = false; + } + + public Cat(boolean meows, String name) { + super(name); + this.meows = meows; + } + + public boolean getMeows() { + return meows; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Dog.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Dog.java new file mode 100644 index 000000000..ec99f44c0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Dog.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app185; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class Dog extends Pet { + + private final boolean barks; + + public Dog() { + super(); + this.barks = false; + } + + public Dog(boolean barks, String name) { + super(name); + this.barks = barks; + } + + public boolean getBarks() { + return barks; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Pet.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Pet.java new file mode 100644 index 000000000..fa3f760da --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/Pet.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app185; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.Schema; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(Dog.class), + @JsonSubTypes.Type(Cat.class) +}) +@Schema(description = "This is a Pet") +public class Pet { + + public final String name; + + public Pet() { + this.name = null; + } + + public Pet(String name) { + this.name = name; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/PetController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/PetController.java new file mode 100644 index 000000000..303d47daa --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/PetController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app185; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class PetController { + + @GetMapping("/any") + public Pet getAnyPet() { + return new Cat(true, "cat"); + } + + @GetMapping("/dog") + public Dog getDog() { + return new Dog(true, "dog"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/SpringDocApp185Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/SpringDocApp185Test.java new file mode 100644 index 000000000..81d8c6c7b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/SpringDocApp185Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app185; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp185Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/HelloController.java new file mode 100644 index 000000000..afdbc1d5a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app187; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@OpenAPIDefinition(tags = { + @Tag(name = "Definition First Tag"), + @Tag(name = "Definition Second Tag full", description = "desc definition") +}) +@Tag(name = "Second Tag") +@Tag(name = "Fourth Tag Full", description = "desc class", externalDocs = @ExternalDocumentation(description = "docs desc class")) +@Tag(name = "Fifth Tag Full", description = "desc class", externalDocs = @ExternalDocumentation(description = "docs desc class")) +@Tag(name = "Sixth Tag") +public class HelloController { + + @GetMapping("/hello") + @Operation(tags = { "Example Tag", "Second Tag" }) + @Tag(name = "Third Tag") + @Tag(name = "Second Tag") + @Tag(name = "Fourth Tag Full", description = "desc", externalDocs = @ExternalDocumentation(description = "docs desc")) + public void hello() { + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java new file mode 100644 index 000000000..37400187a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app187; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp187Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/FooBar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/FooBar.java new file mode 100644 index 000000000..a8f2d8901 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/FooBar.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app188; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(type = "String", allowableValues = { "foo", "bar" }) +public enum FooBar { + FOO, + BAR; + + public String toLowerCase() { + var lower = this.name().toLowerCase(); + return lower.replace("_", "-"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/FooBarConverter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/FooBarConverter.java new file mode 100644 index 000000000..4af542738 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/FooBarConverter.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app188; + +import org.springframework.core.convert.converter.Converter; +import org.springframework.stereotype.Component; + +@Component +public class FooBarConverter implements Converter { + + @Override + public FooBar convert(String source) { + return FooBar.valueOf(fooBarToUpperCase(source)); + } + + private String fooBarToUpperCase(String source) { + var upper = source.toUpperCase(); + return upper.replace("-", "_"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/HelloController.java new file mode 100644 index 000000000..729cde606 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/HelloController.java @@ -0,0 +1,108 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app188; + + +import java.time.Instant; +import java.util.Map; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.SpecVersion; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.responses.ApiResponse; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.utils.SpringDocAnnotationsUtils; + +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.method.HandlerMethod; + +@RestController +public class HelloController { + + @GetMapping("/test") + public void test() { + } + + @GetMapping(value = "/example/{fooBar}") + public String getFooBar(@PathVariable FooBar fooBar) { + return fooBar.name(); + } + + @Bean + public OpenAPI openAPI() { + return new OpenAPI().components(new Components()); + } + + @Bean + public OperationCustomizer operationCustomizer(OpenAPI api) { + io.swagger.v3.oas.models.media.Schema errorResponseSchema = SpringDocAnnotationsUtils.extractSchema( + api.getComponents(), + ErrorResponse.class, + null, + null, SpecVersion.V30 + ); + + ApiResponse errorApiResponse = new ApiResponse().content(new Content().addMediaType( + MediaType.APPLICATION_JSON_VALUE, + new io.swagger.v3.oas.models.media.MediaType().schema(errorResponseSchema) + )); + + return (Operation operation, HandlerMethod handlerMethod) -> { + operation.getResponses().addApiResponse("5xx", errorApiResponse); + return operation; + }; + } + + public class ErrorResponse { + @Schema(example = "2022-05-09T00:00:00.000Z") + Instant timestamp; + + @Schema(example = "{\"param1\":\"val1\",\"param2\":\"val2\"}") + Map data; + + public Instant getTimestamp() { + return timestamp; + } + + public void setTimestamp(Instant timestamp) { + this.timestamp = timestamp; + } + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java new file mode 100644 index 000000000..02627c6ae --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app188; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp188Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleApi.java new file mode 100644 index 000000000..d5c116e0d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleApi.java @@ -0,0 +1,29 @@ +package test.org.springdoc.api.v31.app189; + +import java.util.LinkedList; +import java.util.List; + +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@Tag(name = "Article Api") +@RestController("/article") +public class ArticleApi { + + @GetMapping("query") + public List query(@ParameterObject ArticleQueryCondition condition) { + return new LinkedList<>(); + } + + @PostMapping(value = "create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ArticleDto create(@ParameterObject ArticleDto dto, @RequestPart MultipartFile file) { + return new ArticleDto(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleDto.java new file mode 100644 index 000000000..9a2f1b148 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleDto.java @@ -0,0 +1,28 @@ +package test.org.springdoc.api.v31.app189; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class ArticleDto { + @Schema(description = "title") + private String title; + + @Schema(description = "content") + private String content; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleQueryCondition.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleQueryCondition.java new file mode 100644 index 000000000..33e16efb2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/ArticleQueryCondition.java @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v31.app189; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class ArticleQueryCondition { + @Schema(description = "title") + private String title; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java new file mode 100644 index 000000000..b9f7126c3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app189; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.default-support-form-data=true") +public class SpringDocApp189Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/HelloController.java new file mode 100644 index 000000000..34067ca0e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app19; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/persons") + public String persons(@RequestBody(description = "requestBody description as parameter") String name) { + return "OK"; + } + + @RequestBody(description = "requestBody description outside") + @PostMapping(value = "/persons2") + public String persons2(String name) { + return "OK"; + } + + @Operation(requestBody = @RequestBody(description = "requestBody inside operation annotation")) + @PostMapping(value = "/persons3") + public String persons3(@NotBlank String name) { + return "OK"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java new file mode 100644 index 000000000..a468e89ba --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app19; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp19Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/ConcreteSubclassFromGeneric.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/ConcreteSubclassFromGeneric.java new file mode 100644 index 000000000..52252d4bb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/ConcreteSubclassFromGeneric.java @@ -0,0 +1,9 @@ +package test.org.springdoc.api.v31.app190; + +public class ConcreteSubclassFromGeneric extends SimpleGeneric { + private String topName; + + public String getTopName() { + return topName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/HelloController.java new file mode 100644 index 000000000..ab633a5fc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app190; + + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + @GetMapping("/nested") + public ResponseEntity nested(@ParameterObject final SimpleOuterClass filter) { + return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + + @GetMapping("/nestedTypeErasureGeneric") + public ResponseEntity nestedTypeErasureGeneric(@ParameterObject final SimpleGeneric filter) { + return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + + @GetMapping("/nestedReifiableGeneric") + public ResponseEntity nestedReifiableGeneric(@ParameterObject final ConcreteSubclassFromGeneric filter) { + return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/MyData.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/MyData.java new file mode 100644 index 000000000..4ad08de31 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/MyData.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v31.app190; + +public class MyData { + private String firstName; + + private Integer maxNumber; + + public Integer getMaxNumber() { + return maxNumber; + } + + public String getFirstName() { + return firstName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleGeneric.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleGeneric.java new file mode 100644 index 000000000..2eab31595 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleGeneric.java @@ -0,0 +1,16 @@ +package test.org.springdoc.api.v31.app190; + +public class SimpleGeneric { + + private String name; + + private T child; + + public T getChild() { + return child; + } + + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleInnerClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleInnerClass.java new file mode 100644 index 000000000..4a36bb306 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleInnerClass.java @@ -0,0 +1,22 @@ +package test.org.springdoc.api.v31.app190; + +public class SimpleInnerClass { + + private SimpleInnerInnerClass innerInnerClass; + + private Boolean name; + + private Integer maxNumber; + + public Integer getMaxNumber() { + return maxNumber; + } + + public Boolean getName() { + return name; + } + + public SimpleInnerInnerClass getInnerInnerClass() { + return innerInnerClass; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleInnerInnerClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleInnerInnerClass.java new file mode 100644 index 000000000..32c98fdc0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleInnerInnerClass.java @@ -0,0 +1,16 @@ +package test.org.springdoc.api.v31.app190; + +public class SimpleInnerInnerClass { + + Boolean name; + + private Integer maxNumber; + + public Integer getMaxNumber() { + return maxNumber; + } + + public Boolean getName() { + return name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleOuterClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleOuterClass.java new file mode 100644 index 000000000..92fbbef70 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SimpleOuterClass.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v31.app190; + +public class SimpleOuterClass { + private String name; + + private SimpleInnerClass innerClass; + + public String getName() { + return name; + } + + public SimpleInnerClass getInnerClass() { + return innerClass; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java new file mode 100644 index 000000000..8b2134819 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app190; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp190Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/HelloController.java new file mode 100644 index 000000000..a5170281a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/HelloController.java @@ -0,0 +1,121 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app192; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + @Operation(description = "Adds 200 as api response, because there are nothing defined to get another response") + @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) + @PostMapping(value = "/postWithoutAnyResponse", produces = MediaType.APPLICATION_JSON_VALUE) + public void postWithoutAnyResponse(String test) { + } + + @Operation(description = "Adds 201 as api response, because it defined by @ResponseStatus") + @PostMapping(value = "/postWithResponseStatusOnly", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = HttpStatus.CREATED) + public ResponseEntity postWithResponseStatusOnly() { + return ResponseEntity.ok("hello"); + } + + @Operation(description = "Adds 200 as additional api response, because it defined by @ResponseStatus", + responses = { + @ApiResponse(responseCode = "422", description = "Test") + }) + @ApiResponses({ + @ApiResponse(responseCode = "409", description = "Test 2") + }) + @GetMapping(value = "/withResponseStatus", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = HttpStatus.OK) + public ResponseEntity withResponseStatus() { + return ResponseEntity.ok("hello"); + } + + @Operation(description = "Adds 200 as api response, because it defined by @ResponseStatus") + @GetMapping(value = "/withResponseStatusOnly", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = HttpStatus.OK) + public ResponseEntity withResponseStatusOnly() { + return ResponseEntity.ok("hello"); + } + + @Operation(description = "Doesn't creates the default 200 Response, because there are explicit declared api responses." + + "This test ensures that the current default handling is not changed, because otherwise very many tests will fail.", + responses = { + @ApiResponse(responseCode = "422", description = "Test") + }) + @ApiResponses({ + @ApiResponse(responseCode = "409", description = "Test 2") }) + @GetMapping(value = "/withoutResponseStatus", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity withoutResponseStatus() { + return ResponseEntity.ok("hello"); + } + + + @Operation(description = "Results in the default handling like before") + @GetMapping(value = "/withoutAnyResponseInformation", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity withoutAnyResponseInformation() { + return ResponseEntity.ok("hello"); + } + + @Operation(description = "Overwrites the 200 @ResponseStatus-Information by the explicit declared @ApiResponse", + responses = { + @ApiResponse(responseCode = "200", description = "Test2", content = @Content), + @ApiResponse(responseCode = "422", description = "Test") + }) + @ApiResponses({ + @ApiResponse(responseCode = "409", description = "Test 2") + }) + @GetMapping(value = "/overwrite200InOperation", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = HttpStatus.OK) + public ResponseEntity overwrite200InOperation() { + return ResponseEntity.ok("hello"); + } + + @Operation(description = "Overwrites the 200 @ResponseStatus-Information by the explicit declared @ApiResponse", + responses = { + @ApiResponse(responseCode = "422", description = "Test") + }) + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "Test2", content = @Content), + @ApiResponse(responseCode = "409", description = "Test 2") + }) + @GetMapping(value = "/overwrite200InDoc", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = HttpStatus.OK) + public ResponseEntity overwrite200InDoc() { + return ResponseEntity.ok("hello"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocApp192Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocApp192Test.java new file mode 100644 index 000000000..9a8311f09 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocApp192Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app192; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp192Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocTestApp.java new file mode 100644 index 000000000..94793958d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocTestApp.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app192; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Animal.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Animal.java new file mode 100644 index 000000000..850da58f6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Animal.java @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v31.app193; + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Interface of the Animal. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "dog"), + @JsonSubTypes.Type(value = Cat.class, name = "cat"), +}) +@Schema(description = "Represents an Animal class.") +public interface Animal {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/BasicController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/BasicController.java new file mode 100644 index 000000000..a1480da74 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/BasicController.java @@ -0,0 +1,28 @@ +package test.org.springdoc.api.v31.app193; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(path = "/") +public class BasicController { + + @GetMapping("/test") + @ResponseStatus(HttpStatus.OK) + @Operation(summary = "get", description = "Provides a list of books.") + public Knowledge get() { + return new Books(new Book("Introduction to algorithms")); + } + + @GetMapping("/test1") + @Operation(summary = "get1", description = "Provides an animal.") + public Animal get1() { + + return new Dog("Foo", 12); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Book.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Book.java new file mode 100644 index 000000000..73802e8ce --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Book.java @@ -0,0 +1,22 @@ +package test.org.springdoc.api.v31.app193; + + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "Represents a Book.") +public class Book { + + private String title; + + public Book(String title) { + this.title = title; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Books.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Books.java new file mode 100644 index 000000000..09a847993 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Books.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v31.app193; + + +import java.util.ArrayList; +import java.util.Arrays; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "Represents a list of Books.") +public class Books extends ArrayList implements Knowledge { + + public Books() { + super(); + } + + public Books(Book... books) { + this(); + + if (books != null) { + Arrays.stream(books).forEach(this::add); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Cat.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Cat.java new file mode 100644 index 000000000..6749b3baf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Cat.java @@ -0,0 +1,22 @@ +package test.org.springdoc.api.v31.app193; + + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "Represents a Cat class.") +public class Cat implements Animal { + + private Integer speed; + + public Cat(Integer speed) { + this.speed = speed; + } + + public Integer getSpeed() { + return speed; + } + + public void setSpeed(Integer speed) { + this.speed = speed; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Dog.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Dog.java new file mode 100644 index 000000000..7c481c85b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Dog.java @@ -0,0 +1,33 @@ +package test.org.springdoc.api.v31.app193; + + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "Represents a Dog class.") +public class Dog implements Animal { + + private String name; + + private Integer age; + + public Dog(String name, Integer age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Knowledge.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Knowledge.java new file mode 100644 index 000000000..b155e1c7e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Knowledge.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app193; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Interface of the Knowledge. + */ +@Schema(description = "Represents the knowledge.") +@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.WRAPPER_OBJECT) +@JsonSubTypes({ @JsonSubTypes.Type(value = Books.class) }) +public interface Knowledge { +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Response.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Response.java new file mode 100644 index 000000000..479d4d2d8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/Response.java @@ -0,0 +1,18 @@ +package test.org.springdoc.api.v31.app193; + +public class Response { + + private Knowledge books; + + public Response(Knowledge books) { + this.books = books; + } + + public Knowledge getBooks() { + return books; + } + + public void setBooks(Knowledge books) { + this.books = books; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/SpringDocApp193Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/SpringDocApp193Test.java new file mode 100644 index 000000000..a52caa280 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app193/SpringDocApp193Test.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app193; + + +import org.apache.commons.lang3.JavaVersion; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.AbstractCommonTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.web.servlet.MvcResult; + +import static org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast; +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest(properties = { "springdoc.api-docs.version=openapi_3_1" }) +public class SpringDocApp193Test extends AbstractCommonTest { + + @Test + protected void testApp() throws Exception { + final MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + final String result = mockMvcResult.getResponse().getContentAsString(); + // In Java 21 the getFirst() and getLast() methods were added to the List interface. + // Those are the POJO getters, therefore Jackson will add them during serialization. + // So there are two different expected results for Java prior 21 and starting from Java 21. + final var expectedResponseFile = isJavaVersionAtLeast(JavaVersion.JAVA_21) ? "app193-1.json" : "app193.json"; + final String expected = getContent("results/3.1.0/" + expectedResponseFile); + assertEquals(expected, result, true); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleApi.java new file mode 100644 index 000000000..3b71f6183 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleApi.java @@ -0,0 +1,29 @@ +package test.org.springdoc.api.v31.app194; + +import java.util.LinkedList; +import java.util.List; + +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@Tag(name = "Article Api") +@RestController("/article") +public class ArticleApi { + + @GetMapping("query") + public List query(@ParameterObject ArticleQueryCondition condition) { + return new LinkedList<>(); + } + + @PostMapping(value = "create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ArticleDto create(@ParameterObject ArticleDto dto, @RequestPart MultipartFile file) { + return new ArticleDto(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleDto.java new file mode 100644 index 000000000..b54c0e42d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleDto.java @@ -0,0 +1,28 @@ +package test.org.springdoc.api.v31.app194; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class ArticleDto { + @Schema(description = "title") + private String title; + + @Schema(description = "content") + private String content; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleQueryCondition.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleQueryCondition.java new file mode 100644 index 000000000..16e98e967 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/ArticleQueryCondition.java @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v31.app194; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class ArticleQueryCondition { + @Schema(description = "title") + private String title; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/SpringDocApp194Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/SpringDocApp194Test.java new file mode 100644 index 000000000..b295d71c2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/SpringDocApp194Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app194; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.default-support-form-data=false") +public class SpringDocApp194Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/Example2Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/Example2Controller.java new file mode 100644 index 000000000..341e999ba --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/Example2Controller.java @@ -0,0 +1,36 @@ +package test.org.springdoc.api.v31.app195; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/example2") +public class Example2Controller { + + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ApiResponse(responseCode = "500", description = "ExceptionHandler in example2") + public String customControllerException() { + return "example2"; + } + + @GetMapping("/500") + @Operation( + tags = "example2", + summary = "Example2 method", + description = "This method is an example2" + ) + public void test() { + throw new RuntimeException(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/ExampleController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/ExampleController.java new file mode 100644 index 000000000..17288c7c9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/ExampleController.java @@ -0,0 +1,35 @@ +package test.org.springdoc.api.v31.app195; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/example") +public class ExampleController { + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ApiResponse(responseCode = "500", description = "ExceptionHandler in example") + public String customControllerException() { + return "example"; + } + + @GetMapping("/500") + @Operation( + tags = { "example" }, + summary = "Example method", + description = "This method is an example" + ) + public void test() { + throw new RuntimeException(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/SpringDocApp195Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/SpringDocApp195Test.java new file mode 100644 index 000000000..532e291e5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/SpringDocApp195Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app195; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp195Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/JSONController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/JSONController.java new file mode 100644 index 000000000..9331fe136 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/JSONController.java @@ -0,0 +1,20 @@ +package test.org.springdoc.api.v31.app196; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController() +@RequestMapping("/json") +@Validated +public class JSONController { + + @GetMapping() + public ResponseEntity listTemplates() { + return ResponseEntity.status(HttpStatus.OK).body("Hello World"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/JSPController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/JSPController.java new file mode 100644 index 000000000..2b594da83 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/JSPController.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v31.app196; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +@RestController +@RequestMapping("/jsp") +public class JSPController { + + + @GetMapping(produces = MediaType.TEXT_HTML_VALUE) + @ResponseBody + public ModelAndView HelloJSP() { + ModelAndView jsp = new ModelAndView(); + jsp.setViewName("index"); + + return jsp; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/SpringDocApp196Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/SpringDocApp196Test.java new file mode 100644 index 000000000..3aa6f7e7b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/SpringDocApp196Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app196; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.show-actuator=true", + "springdoc.model-and-view-allowed=false" }) +public class SpringDocApp196Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/Example2Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/Example2Controller.java new file mode 100644 index 000000000..ac5fa2001 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/Example2Controller.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v31.app197; + +import org.springframework.http.HttpStatus; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/example2") +public class Example2Controller { + @GetMapping("/") + public void index() throws HttpRequestMethodNotSupportedException { + throw new IllegalArgumentException(); + } + + @ExceptionHandler(IllegalArgumentException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public String customControllerException() { + return "example"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/ExampleController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/ExampleController.java new file mode 100644 index 000000000..bbf6e5acd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/ExampleController.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v31.app197; + +import org.springframework.http.HttpStatus; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/example") +public class ExampleController { + @GetMapping("/") + public void index() throws HttpRequestMethodNotSupportedException { + throw new IllegalArgumentException(); + } + + @ExceptionHandler(IllegalArgumentException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public String customControllerException() { + return "example"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/MyExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/MyExceptionHandler.java new file mode 100644 index 000000000..a9524de5e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/MyExceptionHandler.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v31.app197; + +import java.util.HashMap; +import java.util.Map; + +import org.springframework.http.HttpStatus; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ControllerAdvice +public class MyExceptionHandler { + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ExceptionHandler({ HttpRequestMethodNotSupportedException.class }) + @ResponseBody + public Map handleError() { + Map errorMap = new HashMap(); + errorMap.put("message", "error"); + return errorMap; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/SpringDocApp197Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/SpringDocApp197Test.java new file mode 100644 index 000000000..d0e65539d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/SpringDocApp197Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app197; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp197Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/HelloController.java new file mode 100644 index 000000000..ff4503788 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/HelloController.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v31.app198; + +import java.math.BigDecimal; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController("/") +public class HelloController { + + @GetMapping + public Response test() { + return new Response(BigDecimal.ONE, BigDecimal.ONE, BigDecimal.ONE); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/Response.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/Response.java new file mode 100644 index 000000000..70e504cef --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/Response.java @@ -0,0 +1,49 @@ +package test.org.springdoc.api.v31.app198; + +import java.math.BigDecimal; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * @author bnasslahsen + */ +public class Response { + + public Response(BigDecimal val1, BigDecimal val2, BigDecimal val3) { + this.val1 = val1; + this.val2 = val2; + this.val3 = val3; + } + + @Schema(deprecated = true) + @Deprecated + private BigDecimal val1; + + private BigDecimal val2; + + private BigDecimal val3; + + public BigDecimal getVal1() { + return val1; + } + + public void setVal1(BigDecimal val1) { + this.val1 = val1; + } + + public BigDecimal getVal2() { + return val2; + } + + public void setVal2(BigDecimal val2) { + this.val2 = val2; + } + + public BigDecimal getVal3() { + return val3; + } + + public void setVal3(BigDecimal val3) { + this.val3 = val3; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/SpringDocApp198Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/SpringDocApp198Test.java new file mode 100644 index 000000000..cc2d2d891 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/SpringDocApp198Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app198; + +import java.math.BigDecimal; + +import io.swagger.v3.oas.models.media.Schema; +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp198Test extends AbstractSpringDocV31Test { + + static { + SpringDocUtils.getConfig().replaceWithSchema( + BigDecimal.class, + new Schema().type("string").format("decimal") + ); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/CustomExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/CustomExceptionHandler.java new file mode 100644 index 000000000..97fe3df77 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/CustomExceptionHandler.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v31.app199; + +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR; + +@ControllerAdvice +public class CustomExceptionHandler { + + static public class MyInternalException extends Exception {} + + @ResponseStatus( value = INTERNAL_SERVER_ERROR ) + @ExceptionHandler( MyInternalException.class ) + @ResponseBody + public ErrorDto handleMyInternalException( final MyInternalException ex ) { + return new ErrorDto( ex.getMessage() ); + } + + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/ErrorDto.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/ErrorDto.java new file mode 100644 index 000000000..3f6779ce6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/ErrorDto.java @@ -0,0 +1,12 @@ +package test.org.springdoc.api.v31.app199; + +public class ErrorDto { + private String message; + + public ErrorDto( final String message ) { + this.message = message; + } + + public String getMessage() { return message; } + public void setMessage( final String message ) { this.message = message; } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/HelloController.java new file mode 100644 index 000000000..9edf7f90f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/HelloController.java @@ -0,0 +1,107 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app199; + + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.examples.Example; +import org.springdoc.core.customizers.OperationCustomizer; +import test.org.springdoc.api.v31.app199.CustomExceptionHandler.MyInternalException; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.method.HandlerMethod; + +import static org.springframework.http.MediaType.ALL_VALUE; +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; + +@RestController +public class HelloController { + + @Autowired + ObjectMapper defaultObjectMapper; + + @GetMapping( + value = "/first", + produces = APPLICATION_JSON_VALUE + ) + public void first() throws MyInternalException {} + + @GetMapping( + value = "/second", + produces = APPLICATION_JSON_VALUE + ) + public void second() throws MyInternalException {} + + @Bean + public OperationCustomizer operationCustomizer() + { + return ( Operation operation, HandlerMethod handlerMethod ) -> + { + final io.swagger.v3.oas.models.media.MediaType mediaType = operation + .getResponses() + .get( "500" ) + .getContent() + .get( ALL_VALUE ); + + mediaType.setExamples( mediaType.getExamples() != null + ? mediaType.getExamples() + : new LinkedHashMap<>() ); + + final Map examples = mediaType.getExamples(); + + switch ( handlerMethod.getMethod().getName() ) { + + case "first" : + examples.put( + "First case example", + new Example().value( + defaultObjectMapper.valueToTree( + new ErrorDto( "An ErrorDto sample specific to /first endpoint" ) + ) + ) + ); + break; + + case "second" : + examples.put( + "Second case example", + new Example().value( + defaultObjectMapper.valueToTree( + new ErrorDto( "An ErrorDto sample specific to /second endpoint" ) + ) + ) + ); + break; + } + + return operation; + }; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/SpringDocApp199Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/SpringDocApp199Test.java new file mode 100644 index 000000000..a9b452889 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/SpringDocApp199Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app199; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp199Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/HelloController.java new file mode 100644 index 000000000..f8cb38574 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import io.swagger.v3.oas.annotations.Hidden; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + @Hidden + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java new file mode 100644 index 000000000..e1d833e5b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp20Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBar.java new file mode 100644 index 000000000..bcfe0aff8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBar.java @@ -0,0 +1,35 @@ +package test.org.springdoc.api.v31.app200; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FooBar { + FOO("foo"), + BAR("bar"); + + private String value; + + FooBar(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FooBar fromValue(String value) { + for (FooBar b : FooBar.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBarController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBarController.java new file mode 100644 index 000000000..71d6acd81 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBarController.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app200; + + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class FooBarController { + @GetMapping(value = "/example/{fooBar}") + public String getFooBar(@PathVariable FooBar fooBar) { + return fooBar.name(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBarConverter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBarConverter.java new file mode 100644 index 000000000..1075cba19 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/FooBarConverter.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v31.app200; + + +import org.springframework.core.convert.converter.Converter; +import org.springframework.stereotype.Component; + +@Component +public class FooBarConverter implements Converter { + + @Override + public FooBar convert(String source) { + return FooBar.fromValue(source); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/SpringDocApp200Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/SpringDocApp200Test.java new file mode 100644 index 000000000..ac35e45b0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/SpringDocApp200Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app200; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp200Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/Example2Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/Example2Controller.java new file mode 100644 index 000000000..a6df978da --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/Example2Controller.java @@ -0,0 +1,36 @@ +package test.org.springdoc.api.v31.app201; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/example2") +public class Example2Controller { + + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ApiResponse(responseCode = "500", description = "ExceptionHandler in example2") + public String customControllerException() { + return "example2"; + } + + @GetMapping("/500") + @Operation( + tags = "example2", + summary = "Example2 method", + description = "This method is an example2" + ) + public void test() { + throw new RuntimeException(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringDocApp201Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringDocApp201Test.java new file mode 100644 index 000000000..e5326cb61 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringDocApp201Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app201; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp201Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringWebConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringWebConfig.java new file mode 100644 index 000000000..3c125891d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringWebConfig.java @@ -0,0 +1,20 @@ +package test.org.springdoc.api.v31.app201; + +import java.util.List; + +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * @author bnasslahsen + */ +@Component +public class SpringWebConfig implements WebMvcConfigurer { + + @Override + public void configureMessageConverters(List> converters) { + converters.removeIf(c -> c instanceof StringHttpMessageConverter); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/Example2Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/Example2Controller.java new file mode 100644 index 000000000..bb8292b75 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/Example2Controller.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v31.app202; + +import org.springframework.http.HttpStatus; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/example2") +public class Example2Controller { + @GetMapping("/") + public void index() throws HttpRequestMethodNotSupportedException { + throw new IllegalArgumentException(); + } + + @ExceptionHandler(IllegalArgumentException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public String customControllerException() { + return "example"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/ExampleController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/ExampleController.java new file mode 100644 index 000000000..a41acf0a1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/ExampleController.java @@ -0,0 +1,26 @@ +package test.org.springdoc.api.v31.app202; + +import org.springframework.http.HttpStatus; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/example") +@Validated +public class ExampleController { + @GetMapping("/") + public void index() throws HttpRequestMethodNotSupportedException { + throw new IllegalArgumentException(); + } + + @ExceptionHandler(IllegalArgumentException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public String customControllerException() { + return "example"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/MyExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/MyExceptionHandler.java new file mode 100644 index 000000000..923662f3d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/MyExceptionHandler.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v31.app202; + +import java.util.HashMap; +import java.util.Map; + +import org.springframework.http.HttpStatus; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ControllerAdvice +public class MyExceptionHandler { + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ExceptionHandler({ HttpRequestMethodNotSupportedException.class }) + @ResponseBody + public Map handleError() { + Map errorMap = new HashMap(); + errorMap.put("message", "error"); + return errorMap; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/SpringDocApp202Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/SpringDocApp202Test.java new file mode 100644 index 000000000..32d826980 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/SpringDocApp202Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2023 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app202; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp202Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/OrderDemo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/OrderDemo.java new file mode 100644 index 000000000..2bbdb79dc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/OrderDemo.java @@ -0,0 +1,41 @@ +package test.org.springdoc.api.v31.app203; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.tags.Tag; +import org.springdoc.core.customizers.GlobalOpenApiCustomizer; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +public class OrderDemo { + + public static class Customizer2 implements OpenApiCustomizer, GlobalOpenApiCustomizer { + public void customise(OpenAPI openApi) { + openApi.addTagsItem(new Tag().name("2")); + } + } + + public static class Customizer3 implements OpenApiCustomizer, GlobalOpenApiCustomizer { + public void customise(OpenAPI openApi) { + openApi.addTagsItem(new Tag().name("3")); + } + } + + public static class Customizer1 implements OpenApiCustomizer, GlobalOpenApiCustomizer { + public void customise(OpenAPI openApi) { + openApi.addTagsItem(new Tag().name("1")); + } + } + + @RestController + public static class MyController { + + @GetMapping("/test") + public String testingMethod() { + return "foo"; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/SpringDocApp203Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/SpringDocApp203Test.java new file mode 100644 index 000000000..78e88e89b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/SpringDocApp203Test.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2023 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app203; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Import; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { "springdoc.group-configs[0].group=mygroup", "springdoc.group-configs[0].paths-to-match=/test" }) +public class SpringDocApp203Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + @Import({ + OrderDemo.Customizer1.class, + OrderDemo.Customizer2.class, + OrderDemo.Customizer3.class, + }) + static class SpringDocTestApp {} + + @Test + void testApp1() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/mygroup")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app203.json"), true)); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/DefaultFlatParamObjectController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/DefaultFlatParamObjectController.java new file mode 100644 index 000000000..4cfd4c696 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/DefaultFlatParamObjectController.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app204; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class DefaultFlatParamObjectController { + @GetMapping("/test1") + public String test1(@RequestParam String email, @Validated Person person) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/Person.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/Person.java new file mode 100644 index 000000000..def8a6d6b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/Person.java @@ -0,0 +1,32 @@ +package test.org.springdoc.api.v31.app204; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; + +public class Person { + private long id; + + private String firstName; + + @NotBlank + @Size(max = 10) + private String lastName; + + public Person(long id, String firstName, String lastName) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + } + + public long getId() { + return id; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/SpringDocApp204Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/SpringDocApp204Test.java new file mode 100644 index 000000000..321ea265d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/SpringDocApp204Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2023 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app204; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.default-flat-param-object=true" }) +public class SpringDocApp204Test extends AbstractSpringDocV31Test { + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/OrderDemo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/OrderDemo.java new file mode 100644 index 000000000..b8fa2b453 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/OrderDemo.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v31.app205; + +/** + * @author bnasslahsen + */ + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + + +public class OrderDemo { + + @RestController + public static class MyController { + + @GetMapping("/test/{*param}") + public String testingMethod(@PathVariable("param") String param) { + return "foo"; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/SpringdocApp205Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/SpringdocApp205Test.java new file mode 100644 index 000000000..e3a966937 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/SpringdocApp205Test.java @@ -0,0 +1,21 @@ +package test.org.springdoc.api.v31.app205; + +/** + * @author bnasslahsen + */ + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * Fix regression in #2031 + */ +@TestPropertySource(properties = { "springdoc.group-configs[0].group=mygroup", "springdoc.group-configs[0].paths-to-match=/test" }) +public class SpringdocApp205Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/PersonRequest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/PersonRequest.java new file mode 100644 index 000000000..06cc6bc67 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/PersonRequest.java @@ -0,0 +1,54 @@ +package test.org.springdoc.api.v31.app206; + +import java.util.Optional; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; + +public class PersonRequest { + @Schema(requiredMode = RequiredMode.REQUIRED) + private long id; + + @Schema(requiredMode = RequiredMode.NOT_REQUIRED) + private String firstName; + + @NotBlank + @Size(max = 10) + private String lastName; + + @Schema(requiredMode = RequiredMode.AUTO) + private Optional email; + + @Schema(required = true) + private int age; + + public PersonRequest(long id, String firstName, String lastName, Optional email, int age) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.age = age; + } + + public long getId() { + return id; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public Optional getEmail() { + return email; + } + + public int getAge() { + return age; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/PersonResponse.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/PersonResponse.java new file mode 100644 index 000000000..817a98d0c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/PersonResponse.java @@ -0,0 +1,54 @@ +package test.org.springdoc.api.v31.app206; + +import java.util.Optional; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; + +public class PersonResponse { + @Schema + private long id; + + @NotBlank + @Size(max = 10) + private String firstName; + + @Schema(requiredMode = RequiredMode.REQUIRED) + private String lastName; + + @Schema(requiredMode = RequiredMode.REQUIRED) + private Optional email; + + @Schema(required = true) + private int age; + + public PersonResponse(long id, String firstName, String lastName, Optional email, int age) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.age = age; + } + + public long getId() { + return id; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public Optional getEmail() { + return email; + } + + public int getAge() { + return age; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/RequiredModeController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/RequiredModeController.java new file mode 100644 index 000000000..09c399b13 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/RequiredModeController.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app206; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class RequiredModeController { + @GetMapping + public PersonResponse index(@ParameterObject PersonRequest request) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/SpringdocApp206Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/SpringdocApp206Test.java new file mode 100644 index 000000000..a5b8f4fd3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/SpringdocApp206Test.java @@ -0,0 +1,12 @@ +package test.org.springdoc.api.v31.app206; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringdocApp206Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/SpringdocApp207Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/SpringdocApp207Test.java new file mode 100644 index 000000000..c5792a193 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/SpringdocApp207Test.java @@ -0,0 +1,12 @@ +package test.org.springdoc.api.v31.app207; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringdocApp207Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/controller/SuperController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/controller/SuperController.java new file mode 100644 index 000000000..a44eea147 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/controller/SuperController.java @@ -0,0 +1,20 @@ +package test.org.springdoc.api.v31.app207.controller; + +import java.util.ArrayList; +import java.util.List; + +import test.org.springdoc.api.v31.app207.model.SuperEntity; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; + +public abstract class SuperController> { + + @GetMapping({"page/{current}/{size}", "page"}) + public List findPage(@PathVariable(required = false) Long current, + @PathVariable(required = false) Long size, + @RequestParam(required = false) T params) { + return new ArrayList<>(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/controller/SysUserController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/controller/SysUserController.java new file mode 100644 index 000000000..04cc6ceb1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/controller/SysUserController.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app207.controller; + + +import test.org.springdoc.api.v31.app207.model.SysUser; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api/sysUser") +public class SysUserController extends SuperController { + + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/model/SuperEntity.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/model/SuperEntity.java new file mode 100644 index 000000000..ac7905d51 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/model/SuperEntity.java @@ -0,0 +1,5 @@ +package test.org.springdoc.api.v31.app207.model; + +public class SuperEntity { + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/model/SysUser.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/model/SysUser.java new file mode 100644 index 000000000..1b2da5177 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/model/SysUser.java @@ -0,0 +1,4 @@ +package test.org.springdoc.api.v31.app207.model; + +public class SysUser extends SuperEntity { +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/HelloController.java new file mode 100644 index 000000000..4141ed2e0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/HelloController.java @@ -0,0 +1,26 @@ +package test.org.springdoc.api.v31.app208; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ + +@RestController +@RequestMapping("/test1") +public class HelloController { + + @GetMapping + public String test1(RequestObject object) { + return null; + } + + @PostMapping + public String test2(@RequestBody RequestObject obj) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/RequestObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/RequestObject.java new file mode 100644 index 000000000..1053f4d71 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/RequestObject.java @@ -0,0 +1,26 @@ +package test.org.springdoc.api.v31.app208; + +/** + * @author bnasslahsen + */ +public class RequestObject { + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/SpringdocApp208Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/SpringdocApp208Test.java new file mode 100644 index 000000000..aad3005db --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/SpringdocApp208Test.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app208; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.default-flat-param-object=true" }) +public class SpringdocApp208Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app209/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app209/HelloController.java new file mode 100644 index 000000000..e9848f2db --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app209/HelloController.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2023 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app209; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NegativeOrZero; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.PositiveOrZero; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + public String persons(@NotBlank String name) { + return "OK"; + } + + @GetMapping(value = "/persons2") + public String persons2(@NotBlank @Parameter(description = "persons name") String name) { + return "OK"; + } + + @GetMapping(value = "/persons3") + public String persons3(@NotBlank @Parameter(description = "persons name") @RequestParam String name) { + return "OK"; + } + + @GetMapping(value = "/persons4") + public String persons4(@PositiveOrZero int age) { + return "OK"; + } + + @GetMapping(value = "/persons5") + public String persons5(@NegativeOrZero int age) { + return "OK"; + } + + @GetMapping(value = "/persons6") + public String persons6(@NotEmpty @Parameter(description = "persons name") String name) { + return "OK"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app209/SpringDocApp209Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app209/SpringDocApp209Test.java new file mode 100644 index 000000000..83ec3010c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app209/SpringDocApp209Test.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2023 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app209; + +import java.util.List; +import java.util.Locale; +import java.util.Optional; + +import io.swagger.v3.oas.models.OpenAPI; +import org.junit.jupiter.api.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.ServerBaseUrlCustomizer; +import org.springdoc.core.properties.SpringDocConfigProperties; +import org.springdoc.core.providers.JavadocProvider; +import org.springdoc.core.service.OpenAPIService; +import org.springdoc.core.service.SecurityService; +import org.springdoc.core.utils.Constants; +import org.springdoc.core.utils.PropertyResolverUtils; +import test.org.springdoc.api.AbstractCommonTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Bean; +import org.springframework.http.HttpHeaders; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest(properties = { + "springdoc.pre-loading-enabled=true", + "springdoc.pre-loading-locales=ja", + "springdoc.api-docs.version=openapi_3_1" +}) +public class SpringDocApp209Test extends AbstractCommonTest { + public static String className; + + static { + System.setProperty("user.country", "JP"); + System.setProperty("user.language", "ja"); + } + + @Autowired + private OpenAPIServiceMock openAPIService; + + @SpringBootApplication + static class SpringDocTestApp { + @Bean("openAPIService") + public OpenAPIServiceMock openAPIService(Optional openAPI, SecurityService securityParser, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, Optional> openApiBuilderCustomizers, Optional> serverBaseUrlCustomizers, Optional javadocProvider) { + return new OpenAPIServiceMock(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomizers, serverBaseUrlCustomizers, javadocProvider); + } + } + + public static class OpenAPIServiceMock extends OpenAPIService { + private int numberOfTimesCalculatePathWasCalled; + + public OpenAPIServiceMock(Optional openAPI, SecurityService securityParser, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, Optional> openApiBuilderCustomizers, Optional> serverBaseUrlCustomizers, Optional javadocProvider) { + super(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomizers, serverBaseUrlCustomizers, javadocProvider); + } + + @Override + public void setCachedOpenAPI(OpenAPI cachedOpenAPI, Locale locale) { + numberOfTimesCalculatePathWasCalled++; + super.setCachedOpenAPI(cachedOpenAPI, locale); + } + + public int getNumberOfTimesCalculatePathWasCalled() { + return numberOfTimesCalculatePathWasCalled; + } + } + + @Test + void shouldOnlyByCalledOnce() throws Exception { + // assertEquals(1, openAPIService.getNumberOfTimesCalculatePathWasCalled()); + + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc + .perform(get(Constants.DEFAULT_API_DOCS_URL).header(HttpHeaders.ACCEPT_LANGUAGE, "ja")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + JSONAssert.assertEquals(expected, result, true); + + assertEquals(1, openAPIService.getNumberOfTimesCalculatePathWasCalled()); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java new file mode 100644 index 000000000..320369338 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app21; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SecurityScheme(name = "personstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "${springdoc.oAuthFlow.authorizationUrl}", scopes = { + @OAuthScope(name = "write:persons", description = "modify persons in your account"), + @OAuthScope(name = "read:persons", description = "read your persons") }))) +public class HelloController { + + @Operation(summary = "Add a new person to the store", description = "", security = { + @SecurityRequirement(name = "personstore_auth", scopes = { "write:persons", "read:persons" }) }, tags = { + "person" }) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java new file mode 100644 index 000000000..de657fbae --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app21; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.oAuthFlow.authorizationUrl=http://personstore.swagger.io/oauth/dialog") +public class SpringDocApp21Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app210/SpringDocApp210Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app210/SpringDocApp210Test.java new file mode 100644 index 000000000..2541eef30 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app210/SpringDocApp210Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2023 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app210; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; +import test.org.springdoc.api.AbstractCommonTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +@SpringBootTest +public class SpringDocApp210Test extends AbstractCommonTest { + + @Test + protected void testApp(){ + assertThrows(IllegalArgumentException.class, () -> GroupedOpenApi.builder().group("").build()); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/HelloController.java new file mode 100644 index 000000000..653b96716 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2023 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app211; + +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.SchemaProperty; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + @ApiResponses(value = @ApiResponse( + responseCode = "200", + content = { + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schemaProperties = { + @SchemaProperty( + name = "items", + array = @ArraySchema(schema = @Schema(implementation = PagedObject.class))), + @SchemaProperty(name = "paging", schema = @Schema(implementation = Paging.class)) + } + ) + } + )) + @GetMapping + public String index() { + return null; + } + + record PagedObject(long id, String name) {} + record Paging(int page, int total, int lastPage) {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/SpringDocApp211Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/SpringDocApp211Test.java new file mode 100644 index 000000000..a677445ab --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/SpringDocApp211Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2023 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app211; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp211Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/HelloController.java new file mode 100644 index 000000000..bee6597db --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app212; + +import test.org.springdoc.api.v31.app217.PersonDTO; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons1") + public PersonDTO persons1() { + return new PersonDTO("John"); + } + + @GetMapping(value = "/persons2") + public PersonDTO persons2() { + return new PersonDTO("John"); + } + + @GetMapping(value = "/persons3") + public PersonDTO persons3() { + return new PersonDTO("John"); + } + + @PostMapping(value = "/persons3") + public PersonDTO persons33() { + return new PersonDTO("John"); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/PersonDTO.java new file mode 100644 index 000000000..d6b0a754f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/PersonDTO.java @@ -0,0 +1,22 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app212; + +public record PersonDTO(String name) { +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/SpringDocApp212Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/SpringDocApp212Test.java new file mode 100644 index 000000000..5ff33d815 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/SpringDocApp212Test.java @@ -0,0 +1,66 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app212; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.SpecPropertiesCustomizer; +import org.springdoc.core.models.GroupedOpenApi; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.ActiveProfiles; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 192 test. + *

+ * A test for {@link SpecPropertiesCustomizer} + */ +@ActiveProfiles("212") +public class SpringDocApp212Test extends AbstractSpringDocV31Test { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + + @Bean + GroupedOpenApi apiGroupBeanName() { + return GroupedOpenApi.builder() + .group("apiGroupName") + .packagesToScan("test.org.springdoc.api.v31.app212") + .build(); + } + } + + @Test + void getGroupedOpenapi_shouldCustomizeFromPropertiesWithGroupNamePrefix() throws Exception { + String result = mockMvc.perform(get("/v3/api-docs/apiGroupName")) + .andExpect(status().isOk()) + .andReturn().getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app212-grouped.json"); + assertEquals(expected, result, true); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/HelloController.java new file mode 100644 index 000000000..a18bf5374 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/HelloController.java @@ -0,0 +1,67 @@ +package test.org.springdoc.api.v31.app213; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.extensions.Extension; +import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; + +/** + * @author bnasslahsen + */ +@OpenAPIDefinition( + info = @Info( + + extensions = { @Extension( + name = "${api.extensions.name}", + properties = { + @ExtensionProperty(name = "type", value = "${api.extensions.properties.type}"), + @ExtensionProperty(name = "connectionId", value = "${api.extensions.properties.connectionId}"), + @ExtensionProperty(name = "httpMethod", value = "GET"), + @ExtensionProperty( + name = "uri", + value = "${api.extensions.properties.uri}/testcontroller/getTest"), + @ExtensionProperty(name = "passthroughBehavior", value = "${api.extensions.properties.passthroughBehavior}"), + @ExtensionProperty(name = "connectionType", value = "${api.extensions.properties.connectionType}") }) }, + + title = "${api.info.title}", + version = "${api.info.version}", + description = "${api.info.description}", + termsOfService = "${api.info.termsOfService}"), + servers = { @Server(description = "${api.server.description}", url = "${api.server.url}") }) +@Tag(name = "${api.tag.name}", description = "${api.tag.description}") +@RestController +@RequestMapping(value = "${api.base-request-mapping}/testcontroller", produces = MediaType.APPLICATION_JSON_VALUE) +public class HelloController { + + @PostMapping(path = "/", produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE) + @Operation( + summary = "Get Test", + description = "Get Test", + extensions = { @Extension( + name = "${api.extensions.name}", + properties = { + @ExtensionProperty(name = "type", value = "${api.extensions.properties.type}"), + @ExtensionProperty(name = "connectionId", value = "${api.extensions.properties.connectionId}"), + @ExtensionProperty(name = "httpMethod", value = "GET"), + @ExtensionProperty( + name = "uri", + value = "${api.extensions.properties.uri}/testcontroller/getTest"), + @ExtensionProperty(name = "passthroughBehavior", value = "${api.extensions.properties.passthroughBehavior}"), + @ExtensionProperty(name = "connectionType", value = "${api.extensions.properties.connectionType}") }) }) + + public PersonDTO queryMyDto() { + // This return a PageImpl with the data, the method parameter 'query' is a pojo containg filter properties + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/PersonDTO.java new file mode 100644 index 000000000..a7bb1210f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/PersonDTO.java @@ -0,0 +1,113 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app213; + +/** + * The type Person dto. + */ +public class PersonDTO { + + /** + * The email + */ + private String email; + + /** + * The firstName + */ + private String firstName; + + /** + * The lastName + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/SpringDocApp213Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/SpringDocApp213Test.java new file mode 100644 index 000000000..d3ffa5b1f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/SpringDocApp213Test.java @@ -0,0 +1,39 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app213; + +import org.springdoc.core.customizers.SpecPropertiesCustomizer; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; + +/** + *

+ * A test for {@link SpecPropertiesCustomizer} + */ +@SpringBootTest +@ActiveProfiles("213") +public class SpringDocApp213Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app214/SpringDocApp214Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app214/SpringDocApp214Test.java new file mode 100644 index 000000000..6eee89e7e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app214/SpringDocApp214Test.java @@ -0,0 +1,61 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app214; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.SpecPropertiesCustomizer; +import org.springdoc.core.properties.SpringDocConfigProperties; +import org.springdoc.core.properties.SpringDocConfigProperties.GroupConfig; +import test.org.springdoc.api.AbstractCommonTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.TestPropertySource; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + *

+ * A test for {@link SpecPropertiesCustomizer} + */ +@SpringBootTest +@TestPropertySource(properties = { "springdoc.group-configs[0].group=Group0", + "springdoc.group-configs[0].packages-to-scan=com.my-package", + "springdoc.group-configs[1].group=Group1", + "springdoc.group-configs[1].packages-to-scan=com.my-package", + "springdoc.group-configs[2].group=Group2", + "springdoc.group-configs[2].packages-to-scan=com.my-package", + "springdoc.group-configs[3].group=Group3", + "springdoc.group-configs[3].packages-to-scan=com.my-package" }) + +public class SpringDocApp214Test extends AbstractCommonTest { + + @Autowired + private SpringDocConfigProperties springDocConfigProperties; + + @SpringBootApplication + static class SpringDocTestApp {} + + @Test + protected void testApp() throws Exception { + assertEquals(4, springDocConfigProperties.getGroupConfigs().stream().map(GroupConfig::getGroup).toList().size()); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app215/SpringDocApp215Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app215/SpringDocApp215Test.java new file mode 100644 index 000000000..0d1385fb4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app215/SpringDocApp215Test.java @@ -0,0 +1,44 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app215; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.AbstractCommonTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.context.annotation.ComponentScan; + +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_DEFAULT_API_DOCS; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@WebMvcTest(properties = SPRINGDOC_ENABLE_DEFAULT_API_DOCS+"=false") +public class SpringDocApp215Test extends AbstractCommonTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc" }) + static class SpringDocTestApp {} + + @Test + void test_disable_default_api_docs() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isNotFound()); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app215/SpringDocApp215bisTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app215/SpringDocApp215bisTest.java new file mode 100644 index 000000000..f259c8904 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app215/SpringDocApp215bisTest.java @@ -0,0 +1,44 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app215; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.AbstractCommonTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.context.annotation.ComponentScan; + +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_DEFAULT_API_DOCS; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@WebMvcTest(properties = SPRINGDOC_ENABLE_DEFAULT_API_DOCS+"=true") +public class SpringDocApp215bisTest extends AbstractCommonTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app214" }) + static class SpringDocTestApp {} + + @Test + void test_enable_default_api_docs() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/HelloController.java new file mode 100644 index 000000000..826add455 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app216; + + + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + @Operation(description = "a") + @GetMapping(path = "/", produces = "a/a") + public String a() { + return "A"; + } + + @Operation(description = "b") + @GetMapping(path = "/", produces = "b/b") + public String b() { + return "B"; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/SpringDocApp216Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/SpringDocApp216Test.java new file mode 100644 index 000000000..7082d1b6a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/SpringDocApp216Test.java @@ -0,0 +1,37 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app216; + +import org.springdoc.core.customizers.SpecPropertiesCustomizer; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; + +/** + *

+ * A test for {@link SpecPropertiesCustomizer} + */ +@SpringBootTest +public class SpringDocApp216Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/HelloController.java new file mode 100644 index 000000000..ec2f89d77 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/HelloController.java @@ -0,0 +1,32 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app217; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + public PersonDTO persons() { + return new PersonDTO("John"); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/PersonDTO.java new file mode 100644 index 000000000..5fce236a0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/PersonDTO.java @@ -0,0 +1,22 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app217; + +public record PersonDTO(String name) { +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/SpringDocApp217Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/SpringDocApp217Test.java new file mode 100644 index 000000000..556e405ab --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/SpringDocApp217Test.java @@ -0,0 +1,64 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app217; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.SpecPropertiesCustomizer; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + *

+ * A test for {@link SpecPropertiesCustomizer} + */ +@SpringBootTest +@ActiveProfiles("217") +public class SpringDocApp217Test extends AbstractSpringDocV31Test { + + + @Test + void testApp1() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/demo")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app217-1.json"), true)); + } + + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/user")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app217-2.json"), true)); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/HelloController.java new file mode 100644 index 000000000..afff3bd31 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/HelloController.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app218; + + +import java.net.URI; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.headers.Header; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequestMapping("/") +public class HelloController { + + @Operation( + summary = "Summary", + description = "This is description.", + tags = {"Sample"}, + responses = { + @ApiResponse( + responseCode = "201", + description = "201 (Created)", + headers = + @Header( + name = HttpHeaders.LOCATION, + description = "Sample endpoint", + schema = @Schema(implementation = URI.class) + ) + ) + } + ) + @GetMapping + public String get() { + return "Hello World!"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/SpringDocApp218Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/SpringDocApp218Test.java new file mode 100644 index 000000000..1613acc45 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/SpringDocApp218Test.java @@ -0,0 +1,37 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app218; + +import org.springdoc.core.customizers.SpecPropertiesCustomizer; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; + +/** + *

+ * A test for {@link SpecPropertiesCustomizer} + */ +@SpringBootTest +public class SpringDocApp218Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/HelloController.java new file mode 100644 index 000000000..876c2eec8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app219; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(value = "/api", produces = {"application/xml"}, consumes = {"application/json"}) +public class HelloController { + + @RequestMapping(value = "/testpost", method = RequestMethod.POST, produces = {"application/json"}, + consumes = {"application/json;charset=UTF-8", "application/json; charset=UTF-8"}) + public ResponseEntity testpost(@RequestBody TestObject dto) { + return ResponseEntity.ok(dto); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/SpringDocApp219Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/SpringDocApp219Test.java new file mode 100644 index 000000000..d88c0d2e5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/SpringDocApp219Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app219; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +@ActiveProfiles("219") +public class SpringDocApp219Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/TestObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/TestObject.java new file mode 100644 index 000000000..f7dbdd2f6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/TestObject.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app219; + +import java.time.LocalDateTime; + +public class TestObject { + public String stringValue; + + public LocalDateTime localDateTime; + + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + public LocalDateTime getLocalDateTime() { + return localDateTime; + } + + public void setLocalDateTime(LocalDateTime localDateTime) { + this.localDateTime = localDateTime; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/HelloController.java new file mode 100644 index 000000000..67dfaa1cc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +import java.util.List; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @GetMapping(value = "/persons") + public ResponseEntity>> doGet() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/PersonDTO.java new file mode 100644 index 000000000..70ef4cdd3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/PersonDTO.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java new file mode 100644 index 000000000..378843370 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp22Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/HelloController.java new file mode 100644 index 000000000..2fdca57aa --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/HelloController.java @@ -0,0 +1,63 @@ +package test.org.springdoc.api.v31.app220; + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/parent") + public void parentEndpoint(@RequestBody Superclass parent) { + + } + +} + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @Type(value = IntermediateClass.class, name = IntermediateClass.SCHEMA_NAME), +}) +sealed class Superclass permits IntermediateClass { + + public Superclass() {} +} + +@Schema(name = IntermediateClass.SCHEMA_NAME) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @Type(value = FirstChildClass.class, name = FirstChildClass.SCHEMA_NAME), + @Type(value = SecondChildClass.class, name = SecondChildClass.SCHEMA_NAME) +}) +sealed class IntermediateClass extends Superclass permits FirstChildClass, SecondChildClass { + + public static final String SCHEMA_NAME = "IntermediateClass"; +} + +@Schema(name = FirstChildClass.SCHEMA_NAME) +final class FirstChildClass extends IntermediateClass { + + public static final String SCHEMA_NAME = "Image"; +} + +@Schema(name = SecondChildClass.SCHEMA_NAME) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @Type(value = ThirdChildClass.class, name = ThirdChildClass.SCHEMA_NAME) +}) +sealed class SecondChildClass extends IntermediateClass { + + public static final String SCHEMA_NAME = "Mail"; +} + +@Schema(name = ThirdChildClass.SCHEMA_NAME) +final class ThirdChildClass extends SecondChildClass { + + public static final String SCHEMA_NAME = "Home"; +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/SpringDocApp220Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/SpringDocApp220Test.java new file mode 100644 index 000000000..4269e21fe --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/SpringDocApp220Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app220; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp220Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/HomeApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/HomeApi.java new file mode 100644 index 000000000..621ed25d1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/HomeApi.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v31.app221; + +import java.io.IOException; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import test.org.springdoc.api.v31.app221.HomeController.HelloDto; +import test.org.springdoc.api.v31.app221.HomeController.HelloUploadDto; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; +import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE; + +@Tag(name = "Hello World Api", description = "This is a test api") +@RequestMapping("api/hello") +public interface HomeApi { + + @Operation(summary = "Upload new content", description = "Upload test content") + @PostMapping(produces = APPLICATION_JSON_VALUE, consumes = MULTIPART_FORM_DATA_VALUE) + HelloDto uploadContent(HelloUploadDto contentUploadDto) throws IOException; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/HomeController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/HomeController.java new file mode 100644 index 000000000..a2eac75d2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/HomeController.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v31.app221; + +import java.io.IOException; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class HomeController implements HomeApi { + + @Override + public HelloDto uploadContent(@Valid HelloUploadDto uploadDto) + throws IOException { + var fileBytes = uploadDto.file.getBytes(); + return new HelloDto(uploadDto.title, fileBytes); + } + + public record HelloDto(String title, byte[] file) {} + + public record HelloUploadDto(@NotNull String title, MultipartFile file) {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/SpringDocApp221Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/SpringDocApp221Test.java new file mode 100644 index 000000000..0f52c106f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/SpringDocApp221Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app221; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp221Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/HelloController.java new file mode 100644 index 000000000..28c4a6223 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/HelloController.java @@ -0,0 +1,27 @@ +package test.org.springdoc.api.v31.app222; + + +import test.org.springdoc.api.v31.app222.SpringDocApp222Test.FirstHierarchyUser; +import test.org.springdoc.api.v31.app222.SpringDocApp222Test.SecondHierarchyUser; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ + +@RestController +class HelloController { + + @GetMapping("/hello1") + public FirstHierarchyUser getItems1() { + return null; + } + + @GetMapping("/hello2") + public SecondHierarchyUser getItems2() { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/SpringDocApp222Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/SpringDocApp222Test.java new file mode 100644 index 000000000..eaac7c8bd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/SpringDocApp222Test.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app222; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp222Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + + @JsonTypeInfo(use = Id.NAME, property = "@type") + @JsonSubTypes(@Type(CommonImplementor.class)) + interface FirstHierarchy {} + + @JsonTypeInfo(use = Id.NAME, property = "@type") + @JsonSubTypes(@Type(CommonImplementor.class)) + interface SecondHierarchy {} + + class CommonImplementor implements FirstHierarchy, SecondHierarchy {} + + record CommonImplementorUser(FirstHierarchy firstHierarchy, SecondHierarchy secondHierarchy) {} + + record FirstHierarchyUser(FirstHierarchy firstHierarchy) {} + + record SecondHierarchyUser(SecondHierarchy secondHierarchy) {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/ARestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/ARestController.java new file mode 100644 index 000000000..46ce60f3f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/ARestController.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.v31.app223; + + +import test.org.springdoc.api.v31.app223.apiobjects.AbstractChild; +import test.org.springdoc.api.v31.app223.apiobjects.AbstractParent; +import test.org.springdoc.api.v31.app223.apiobjects.Response; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ARestController { + @PostMapping("/parent") + public Response parentEndpoint(@RequestBody AbstractParent parent) { + return null; + } + + @PostMapping("/child") + public Response childEndpoint(@RequestBody AbstractChild child) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/SpringDocApp223Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/SpringDocApp223Test.java new file mode 100644 index 000000000..ce7271e27 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/SpringDocApp223Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app223; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp223Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/AbstractChild.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/AbstractChild.java new file mode 100644 index 000000000..647bd004c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/AbstractChild.java @@ -0,0 +1,61 @@ +package test.org.springdoc.api.v31.app223.apiobjects; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildType1.class), + @Type(ChildType2.class) +}) +public abstract class AbstractChild { + private int id; + + public AbstractChild(int id) { + this.id = id; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + + class ChildType1 extends AbstractChild { + private String childType1Param; + + public ChildType1(int id, String childType1Param) { + super(id); + this.childType1Param = childType1Param; + } + + public String getChildType1Param() { + return childType1Param; + } + + public void setChildType1Param(String childType1Param) { + this.childType1Param = childType1Param; + } +} + +class ChildType2 extends AbstractChild { + private String childType2Param; + + public ChildType2(int id, String childType2Param) { + super(id); + this.childType2Param = childType2Param; + } + + public String getChildType2Param() { + return childType2Param; + } + + public void setChildType2Param(String childType2Param) { + this.childType2Param = childType2Param; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/AbstractParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/AbstractParent.java new file mode 100644 index 000000000..1db34b92a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/AbstractParent.java @@ -0,0 +1,72 @@ +package test.org.springdoc.api.v31.app223.apiobjects; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + + +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ParentType1.class), + @Type(ParentType2.class) +}) +public abstract class AbstractParent { + private int id; + + public AbstractParent(int id) { + this.id = id; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + +class ParentType1 extends AbstractParent { + private String parentType1Param; + private AbstractChild abstractChild; + + public ParentType1(int id, String parentType1Param, AbstractChild abstractChild) { + super(id); + this.parentType1Param = parentType1Param; + this.abstractChild = abstractChild; + } + + public String getParentType1Param() { + return parentType1Param; + } + + public void setParentType1Param(String parentType1Param) { + this.parentType1Param = parentType1Param; + } + + public AbstractChild getAbstractChild() { + return abstractChild; + } + + public void setAbstractChild(AbstractChild abstractChild) { + this.abstractChild = abstractChild; + } +} + +class ParentType2 extends AbstractParent { + private String parentType2Param; + + public ParentType2(int id, String parentType2Param) { + super(id); + this.parentType2Param = parentType2Param; + } + + public String getParentType2Param() { + return parentType2Param; + } + + public void setParentType2Param(String parentType2Param) { + this.parentType2Param = parentType2Param; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/Response.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/Response.java new file mode 100644 index 000000000..06ca847f8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/apiobjects/Response.java @@ -0,0 +1,4 @@ +package test.org.springdoc.api.v31.app223.apiobjects; + +public record Response(AbstractParent abstractParent, AbstractChild abstractChild) { +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/RootModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/RootModel.java new file mode 100644 index 000000000..0df928bc6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/RootModel.java @@ -0,0 +1,27 @@ +package test.org.springdoc.api.v31.app224; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; + +public class RootModel { + + private Integer rootProperty; + + @JsonUnwrapped + private UnwrappedModel unwrappedModel; + + public Integer getRootProperty() { + return rootProperty; + } + + public void setRootProperty(Integer rootProperty) { + this.rootProperty = rootProperty; + } + + public UnwrappedModel getUnwrappedModel() { + return unwrappedModel; + } + + public void setUnwrappedModel(UnwrappedModel unwrappedModel) { + this.unwrappedModel = unwrappedModel; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/SpringDocApp224Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/SpringDocApp224Test.java new file mode 100644 index 000000000..91f027489 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/SpringDocApp224Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app224; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp224Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/TestController.java new file mode 100644 index 000000000..dea8c7feb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/TestController.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v31.app224; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class TestController { + + @GetMapping + public RootModel getRootModel() { + return new RootModel(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/UnwrappedModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/UnwrappedModel.java new file mode 100644 index 000000000..1ea78b8d6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/UnwrappedModel.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app224; + +public class UnwrappedModel { + + private Integer unwrappedProperty; + + public Integer getUnwrappedProperty() { + return unwrappedProperty; + } + + public void setUnwrappedProperty(Integer unwrappedProperty) { + this.unwrappedProperty = unwrappedProperty; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/HelloController.java new file mode 100644 index 000000000..178598b6c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/HelloController.java @@ -0,0 +1,35 @@ +package test.org.springdoc.api.v31.app225; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping +public class HelloController { + + @PostMapping("/testBoolean") + public void HelloController(@ParameterObject RequestDto requestDto) { + } +} + +@JsonNaming(PropertyNamingStrategies.UpperSnakeCaseStrategy.class) + class RequestDto { + private String personalNumber; + + public String getPersonalNumber() { + return personalNumber; + } + + public void setPersonalNumber(String personalNumber) { + this.personalNumber = personalNumber; + } +} + diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/SpringDocApp225Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/SpringDocApp225Test.java new file mode 100644 index 000000000..6aaa0635a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/SpringDocApp225Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app225; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp225Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/HelloController.java new file mode 100644 index 000000000..c7d4e5af1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/HelloController.java @@ -0,0 +1,37 @@ +package test.org.springdoc.api.v31.app226; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping +public class HelloController { + + @PostMapping("/testBoolean") + @ApiResponse( + useReturnTypeSchema = true, + responseCode = "200", + description = "OK", + content = { + @Content( + mediaType = "*/*", + examples = + @ExampleObject( + name = "success", + value ="...")) + } + ) + public Map HelloController() { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/SpringDocApp226Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/SpringDocApp226Test.java new file mode 100644 index 000000000..d74b4634e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/SpringDocApp226Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app226; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp226Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/HelloController.java new file mode 100644 index 000000000..8e2fe4589 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app227; + + +import test.org.springdoc.api.v31.app227.model.Item; +import test.org.springdoc.api.v31.app227.wrapper.NoGenericWrapper; +import test.org.springdoc.api.v31.app227.wrapper.ResponseEntityWrapper; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public ResponseEntityWrapper persons() { + return new ResponseEntityWrapper<>(Item.fromPayload("1", "OK", "String"), HttpStatus.OK); + } + + @GetMapping("/persons2") + public NoGenericWrapper persons2() { + return new NoGenericWrapper(Item.fromPayload("1", "OK", "String"), HttpStatus.OK); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/SpringDocApp227Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/SpringDocApp227Test.java new file mode 100644 index 000000000..f57c2fa38 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/SpringDocApp227Test.java @@ -0,0 +1,30 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app227; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp227Test extends AbstractSpringDocV31Test { + + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/model/Item.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/model/Item.java new file mode 100644 index 000000000..4e3bee8ba --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/model/Item.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app227.model; + +/** + * Base item + */ +public record Item(String id, String type, T resource) { + + /** + * Create Item object + */ + public static Item fromPayload(String id, String type, T payload) { + return new Item<>(id, type, payload); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/wrapper/NoGenericWrapper.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/wrapper/NoGenericWrapper.java new file mode 100644 index 000000000..798837bf1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/wrapper/NoGenericWrapper.java @@ -0,0 +1,12 @@ +package test.org.springdoc.api.v31.app227.wrapper; + + +import test.org.springdoc.api.v31.app227.model.Item; + +import org.springframework.http.HttpStatusCode; + +public class NoGenericWrapper extends ResponseEntityWrapper { + public NoGenericWrapper(Item body, HttpStatusCode status) { + super(body, status); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/wrapper/ResponseEntityWrapper.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/wrapper/ResponseEntityWrapper.java new file mode 100644 index 000000000..8002762db --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/wrapper/ResponseEntityWrapper.java @@ -0,0 +1,13 @@ +package test.org.springdoc.api.v31.app227.wrapper; + + +import test.org.springdoc.api.v31.app227.model.Item; + +import org.springframework.http.HttpStatusCode; +import org.springframework.http.ResponseEntity; + +public class ResponseEntityWrapper extends ResponseEntity> { + public ResponseEntityWrapper(Item body, HttpStatusCode status) { + super(body, status); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/HelloController.java new file mode 100644 index 000000000..5ea115c37 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/HelloController.java @@ -0,0 +1,56 @@ +package test.org.springdoc.api.v31.app228; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping +public class HelloController { + + + @PostMapping("swaggerTest") + public String swaggerTest(@RequestBody MyRequest myRequest) { + return null; + } + + public class MyRequest { + @Schema(oneOf = {Child1.class, Child2.class}) + @JsonProperty + private Parent parent; + } + + @JsonSubTypes({ + @JsonSubTypes.Type(value = Child1.class), + @JsonSubTypes.Type(value = Child2.class), + @JsonSubTypes.Type(value = Child3.class), + }) + public abstract class Parent { + @JsonProperty + private String parentProperty; + } + + public class Child1 extends Parent { + @JsonProperty + private String childProperty1; + } + + public class Child2 extends Parent { + @JsonProperty + private String childProperty2; + } + + public class Child3 extends Parent { + @JsonProperty + private String childProperty3; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/SpringDocApp228Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/SpringDocApp228Test.java new file mode 100644 index 000000000..2abf63e2d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/SpringDocApp228Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app228; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp228Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/LocaleParam.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/LocaleParam.java new file mode 100644 index 000000000..94afad322 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/LocaleParam.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app229; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +/** + * @author bnasslahsen + */ +@Target({PARAMETER, METHOD, FIELD, ANNOTATION_TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Parameter( + examples = { + @ExampleObject(name = "ar-ae"), + @ExampleObject(name = "bg-bg"), + @ExampleObject(name = "cs-cz"), + @ExampleObject(name = "de-de"), + @ExampleObject(name = "el-gr"), + @ExampleObject(name = "en-us.src"), + @ExampleObject(name = "hu-hu"), + @ExampleObject(name = "pl-pl"), + @ExampleObject(name = "ro-ro"), + @ExampleObject(name = "sk-sk") + } +) +@Size(min = 2, max = 16) +@Pattern(regexp = "\\w+([-.]?\\w+)*") +@Valid +@interface LocaleParam {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/SpringDocApp229Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/SpringDocApp229Test.java new file mode 100644 index 000000000..097ad4076 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/SpringDocApp229Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app229; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp229Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/XController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/XController.java new file mode 100644 index 000000000..e53102804 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/XController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app229; + + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +public class XController { + + + @GetMapping("/") + public ResponseEntity manualTranslationUpdateRun( + @LocaleParam String locale) { + //..... + return ResponseEntity.accepted().build(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/HelloController.java new file mode 100644 index 000000000..f36f8ae80 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app23; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", paramName = "JWT", description = "A core-auth Bearer token") +public class HelloController { + + @Operation(summary = "Add a new person to the store", description = "", security = { + @SecurityRequirement(name = "Authorization") }) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java new file mode 100644 index 000000000..b029a1994 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app23; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp23Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/App230Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/App230Controller.java new file mode 100644 index 000000000..0bc564e03 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/App230Controller.java @@ -0,0 +1,22 @@ +package test.org.springdoc.api.v31.app230; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author edudar + */ +@RestController +@RequestMapping +public class App230Controller { + + @PostMapping("/") + public String swaggerTest(@App230RequestBody MyRequest myRequest) { + return null; + } + + public record MyRequest(int id) { + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/App230RequestBody.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/App230RequestBody.java new file mode 100644 index 000000000..ddf530836 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/App230RequestBody.java @@ -0,0 +1,21 @@ +package test.org.springdoc.api.v31.app230; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +/** + * @author edudar + */ +@Target({PARAMETER, METHOD, ANNOTATION_TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@RequestBody(required = true) +@interface App230RequestBody { + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/SpringDocApp230Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/SpringDocApp230Test.java new file mode 100644 index 000000000..48deb80f5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/SpringDocApp230Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app230; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author edudar + */ +public class SpringDocApp230Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/ApplicationsRestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/ApplicationsRestController.java new file mode 100644 index 000000000..ae41a0676 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/ApplicationsRestController.java @@ -0,0 +1,25 @@ +package test.org.springdoc.api.v31.app231; + +import io.swagger.v3.oas.annotations.Operation; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontProperties.Application; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(value = "/applications", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) +public class ApplicationsRestController { + + @Operation(summary = "Parameter object") + @PostMapping("/parameter-object") + public Application createWithParameterObject( + @RequestBody @ParameterObject SubClass request + ) { + return new Application(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SpringDocApp231Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SpringDocApp231Test.java new file mode 100644 index 000000000..d0f478d9b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SpringDocApp231Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app231; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author bnasslahsen + */ +public class SpringDocApp231Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SubClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SubClass.java new file mode 100644 index 000000000..86b854eed --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SubClass.java @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v31.app231; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "Used to create a new application") +public class SubClass extends SuperClass { + + public SubClass(String name) { + super(name); + } + + @Override + @Schema(description = "Overriding the description in sub class") + public String getName() { + return super.getName(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SuperClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SuperClass.java new file mode 100644 index 000000000..5d57d76d0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SuperClass.java @@ -0,0 +1,18 @@ +package test.org.springdoc.api.v31.app231; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.Size; + +public class SuperClass { + @Size(min = 1, max = 30) + @Schema(description = "Description from the super class") + private String name; + + public SuperClass(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/HelloController.java new file mode 100644 index 000000000..d2f6c8ae8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/HelloController.java @@ -0,0 +1,19 @@ +package test.org.springdoc.api.v31.app232; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping +public class HelloController { + + + @RequestMapping("/") + public String sayHello() { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/SpringDocApp232Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/SpringDocApp232Test.java new file mode 100644 index 000000000..e72a9f3ae --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/SpringDocApp232Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app232; + +import org.springdoc.core.customizers.OperationCustomizer; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * @author bnasslahsen + */ +public class SpringDocApp232Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OperationCustomizer operationIdCustomizer() { + return (operation, handlerMethod) -> { + operation.setOperationId(null); + return operation; + }; + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/ParameterController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/ParameterController.java new file mode 100644 index 000000000..d027a2400 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/ParameterController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app233; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ParameterController { + + @GetMapping("/hidden-parent") + public void nestedParameterObjectWithHiddenParentField(@ParameterObject ParameterObjectWithHiddenField parameters) { + + } + + public record ParameterObjectWithHiddenField( + @Schema(hidden = true) NestedParameterObject schemaHiddenNestedParameterObject, + @Parameter(hidden = true) NestedParameterObject parameterHiddenNestedParameterObject, + NestedParameterObject visibleNestedParameterObject + ) { + + } + + public record NestedParameterObject( + String parameterField) { + } + + @GetMapping("/renamed-parent") + public void nestedParameterObjectWithRenamedParentField(@ParameterObject ParameterObjectWithRenamedField parameters) { + + } + + public record ParameterObjectWithRenamedField( + @Schema(name = "schemaRenamed") NestedParameterObject schemaRenamedNestedParameterObject, + @Parameter(name = "parameterRenamed") NestedParameterObject parameterRenamedNestedParameterObject, + NestedParameterObject originalNameNestedParameterObject + ) { + + } + + @GetMapping("/optional-parent") + public void nestedParameterObjectWithOptionalParentField(@Valid @ParameterObject MultiFieldParameterObject parameters) { + + } + + public record MultiFieldParameterObject( + @Valid @Schema(requiredMode = RequiredMode.REQUIRED) @NotNull MultiFieldNestedParameterObject requiredNotNullParameterObject, + @Valid @Schema(requiredMode = RequiredMode.REQUIRED) MultiFieldNestedParameterObject requiredNoValidationParameterObject, + @Valid @Schema(requiredMode = RequiredMode.NOT_REQUIRED) @NotNull MultiFieldNestedParameterObject notRequiredNotNullParameterObject, + @Valid @Schema(requiredMode = RequiredMode.NOT_REQUIRED) MultiFieldNestedParameterObject notRequiredNoValidationParameterObject, + @Valid @NotNull MultiFieldNestedParameterObject noSchemaNotNullParameterObject, + @Valid MultiFieldNestedParameterObject noSchemaNoValidationParameterObject) { + + } + + public record MultiFieldNestedParameterObject ( + @Schema(requiredMode = RequiredMode.REQUIRED) @NotNull String requiredNotNullField, + @Schema(requiredMode = RequiredMode.REQUIRED) String requiredNoValidationField, + @Schema(requiredMode = RequiredMode.NOT_REQUIRED) @NotNull String notRequiredNotNullField, + @Schema(requiredMode = RequiredMode.NOT_REQUIRED) String notRequiredNoValidationField, + @NotNull String noSchemaNotNullField, + String noSchemaNoValidationField) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java new file mode 100644 index 000000000..b1644f6d0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java @@ -0,0 +1,185 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app233; + +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.jayway.jsonpath.JsonPath; +import net.minidev.json.JSONArray; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.MethodArgumentNotValidException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * @author bnasslahsen, michael.clarke + */ +class SpringDocApp233Test extends AbstractSpringDocV31Test { + + @CsvSource({"requiredNotNullParameterObject.requiredNotNullField, true", + "requiredNotNullParameterObject.requiredNoValidationField, true", + "requiredNotNullParameterObject.notRequiredNotNullField, false", + "requiredNotNullParameterObject.notRequiredNoValidationField, false", + "requiredNotNullParameterObject.noSchemaNotNullField, true", + "requiredNotNullParameterObject.noSchemaNoValidationField, false", + "requiredNoValidationParameterObject.requiredNotNullField, true", + "requiredNoValidationParameterObject.requiredNoValidationField, true", + "requiredNoValidationParameterObject.notRequiredNotNullField, false", + "requiredNoValidationParameterObject.notRequiredNoValidationField, false", + "requiredNoValidationParameterObject.noSchemaNotNullField, true", + "requiredNoValidationParameterObject.noSchemaNoValidationField, false", + "notRequiredNotNullParameterObject.requiredNotNullField, true", + "notRequiredNotNullParameterObject.requiredNoValidationField, true", + "notRequiredNotNullParameterObject.notRequiredNotNullField, false", + "notRequiredNotNullParameterObject.notRequiredNoValidationField, false", + "notRequiredNotNullParameterObject.noSchemaNotNullField, false", + "notRequiredNotNullParameterObject.noSchemaNoValidationField, false", + "notRequiredNoValidationParameterObject.requiredNotNullField, true", + "notRequiredNoValidationParameterObject.requiredNoValidationField, true", + "notRequiredNoValidationParameterObject.notRequiredNotNullField, false", + "notRequiredNoValidationParameterObject.notRequiredNoValidationField, false", + "notRequiredNoValidationParameterObject.noSchemaNotNullField, false", + "notRequiredNoValidationParameterObject.noSchemaNoValidationField, false", + "noSchemaNotNullParameterObject.requiredNotNullField, true", + "noSchemaNotNullParameterObject.requiredNoValidationField, true", + "noSchemaNotNullParameterObject.notRequiredNotNullField, false", + "noSchemaNotNullParameterObject.notRequiredNoValidationField, false", + "noSchemaNotNullParameterObject.noSchemaNotNullField, true", + "noSchemaNotNullParameterObject.noSchemaNoValidationField, false", + "noSchemaNoValidationParameterObject.requiredNotNullField, true", + "noSchemaNoValidationParameterObject.requiredNoValidationField, true", + "noSchemaNoValidationParameterObject.notRequiredNotNullField, false", + "noSchemaNoValidationParameterObject.notRequiredNoValidationField, false", + "noSchemaNoValidationParameterObject.noSchemaNotNullField, false", + "noSchemaNoValidationParameterObject.noSchemaNoValidationField, false"}) + @ParameterizedTest + void shouldHaveCorrectRequireStatus(String field, String required) throws Exception { + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + + String requiredMode = ((JSONArray) JsonPath.parse(result).read("$.paths.['/optional-parent'].get.parameters[?(@.name == '" + field + "')].required")).get(0).toString(); + assertThat(requiredMode).isEqualTo(required); + } + + @Test + void shouldMatchSwaggerFieldRequirementsMatchJavaValidation() throws Exception { + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + + JSONArray allFieldsJsonArray = JsonPath.parse(result).read("$.paths.['/optional-parent'].get.parameters[*].name"); + List allFields = allFieldsJsonArray.stream().map(Object::toString).toList(); + + // check we get no validation failures when all mandatory fields are present + verifySwaggerFieldRequirementsMatchJavaValidation(allFields, List.of()); + + JSONArray mandatoryFieldsJsonArray = JsonPath.parse(result).read("$.paths.['/optional-parent'].get.parameters[?(@.required == true)].name"); + List mandatoryFields = mandatoryFieldsJsonArray.stream().map(Object::toString).toList(); + + // check validation failures when each individual mandatory field is missing + for (String mandatoryField : mandatoryFields) { + List filteredFields = allFields.stream() + .filter(field -> !field.equals(mandatoryField)) + .toList(); + + List expectedErrors = Stream.of(mandatoryField) + // Fields using Swagger annotations to drive required status but not using Java validation to enforce it so don't cause validation errors + .filter(field -> !field.endsWith("requiredNullableField")) + .filter(field -> !field.endsWith("requiredNoValidationField")) + // the error is returned prefixed with the query parameter name, so add it to the expected error message + .map(field -> "multiFieldParameterObject." + field) + .toList(); + verifySwaggerFieldRequirementsMatchJavaValidation(filteredFields, expectedErrors); + } + + + JSONArray nonMandatoryFieldsJsonArray = JsonPath.parse(result).read("$.paths.['/optional-parent'].get.parameters[?(@.required == false)].name"); + List nonMandatoryFields = nonMandatoryFieldsJsonArray.stream().map(Object::toString).toList(); + + // check validation failures for any individual non-mandatory fields being missed + for (String nonMandatoryField : nonMandatoryFields) { + List filteredFields = allFields.stream() + .filter(field -> !field.equals(nonMandatoryField)) + .toList(); + + List expectedErrors = Stream.of(nonMandatoryField) + // Fields that are mandatory but either have nullable parent fields so are excluded in swagger or are marked as not required so do cause validation errors + .filter(field -> field.endsWith("NotNullField")) + // the error is returned prefixed with the query parameter name, so add it to the expected error message + .map(field -> "multiFieldParameterObject." + field) + .toList(); + verifySwaggerFieldRequirementsMatchJavaValidation(filteredFields, expectedErrors); + } + } + + private void verifySwaggerFieldRequirementsMatchJavaValidation(Collection requestFields, Collection expectedErrorFields) throws Exception { + MockHttpServletRequestBuilder request = get("/optional-parent"); + for (String mandatoryField : requestFields) { + request.queryParam(mandatoryField, mandatoryField + ".value"); + } + + mockMvc.perform(request) + .andExpect(result -> { + + Set errorFields = Optional.ofNullable(result.getResolvedException()) + .map(MethodArgumentNotValidException.class::cast) + .map(MethodArgumentNotValidException::getBindingResult) + .map(BindingResult::getFieldErrors) + .stream() + .flatMap(Collection::stream) + .map(field -> field.getObjectName() + "." + field.getField()) + .collect(Collectors.toSet()); + + + assertThat(errorFields).containsExactlyElementsOf(expectedErrorFields); + + assertThat(result.getResponse().getStatus()).isEqualTo(expectedErrorFields.isEmpty() ? 200 : 400); + }); + } + + + @SpringBootApplication + static class SpringDocTestApp { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/HelloController.java new file mode 100644 index 000000000..e6cb4e638 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/HelloController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app234; + +import test.org.springdoc.api.v31.app179.MyObj; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + @GetMapping("/test") + String test(MyObj obj) { + return obj.getContent(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/MyObj.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/MyObj.java new file mode 100644 index 000000000..9cd0bcdc1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/MyObj.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app234; + +public class MyObj { + private final String id; + + private final String content; + + public MyObj(String id, String content) { + this.id = id; + this.content = content; + } + + public String getId() { + return id; + } + + public String getContent() { + return content; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/MyPathParameterCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/MyPathParameterCustomizer.java new file mode 100644 index 000000000..df9cd708d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/MyPathParameterCustomizer.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app234; + +import io.swagger.v3.oas.models.parameters.Parameter; +import org.springdoc.core.customizers.ParameterCustomizer; + +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; + +@Component +public class MyPathParameterCustomizer implements ParameterCustomizer { + @Override + public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/SpringDocApp234Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/SpringDocApp234Test.java new file mode 100644 index 000000000..7790c7a0e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/SpringDocApp234Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app234; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp234Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/MyDebugController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/MyDebugController.java new file mode 100644 index 000000000..a2115c209 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/MyDebugController.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app235; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@Validated +@RestController +@RequestMapping("/api") +@Tag(name = "Lorem ipsum") +public class MyDebugController { + @GetMapping(value = "/debug/{*wildcard}") + public ResponseEntity getWildcard(String wildcard) { + return new ResponseEntity<>("", HttpStatus.NO_CONTENT); + } + + // THIS ONE IS MISSING + @PostMapping(value = "/debug/{*wildcard}") + public ResponseEntity postWildcard(String wildcard) { + return new ResponseEntity<>("", HttpStatus.NO_CONTENT); + } + + @GetMapping(value = "/debug/{simple}") + public ResponseEntity get(String simple) { + return new ResponseEntity<>("", HttpStatus.NO_CONTENT); + } + + @PostMapping(value = "/debug/{simple}") + public ResponseEntity post(String simple) { + return new ResponseEntity<>("", HttpStatus.NO_CONTENT); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/SpringDocApp235Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/SpringDocApp235Test.java new file mode 100644 index 000000000..0e89e9469 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/SpringDocApp235Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app235; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp235Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/ClassOne.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/ClassOne.java new file mode 100644 index 000000000..054d4a5f9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/ClassOne.java @@ -0,0 +1,18 @@ +package test.org.springdoc.api.v31.app236; + + +import jakarta.validation.Valid; + +public class ClassOne { + + @Valid + private ClassTwo description; + + public @Valid ClassTwo getDescription() { + return description; + } + + public void setDescription(@Valid ClassTwo description) { + this.description = description; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/ClassTwo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/ClassTwo.java new file mode 100644 index 000000000..86d1dd233 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/ClassTwo.java @@ -0,0 +1,20 @@ +package test.org.springdoc.api.v31.app236; + + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import jakarta.validation.constraints.NotNull; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ClassTwo { + + @NotNull + private String name; + + public @NotNull String getName() { + return name; + } + + public void setName(@NotNull String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/HelloController.java new file mode 100644 index 000000000..6cf7040bb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/HelloController.java @@ -0,0 +1,25 @@ +package test.org.springdoc.api.v31.app236; + + +import jakarta.validation.Valid; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(path = "/testOne", consumes = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity testOne(@ParameterObject @Valid ClassOne test) { + return ResponseEntity.ok("ok"); + } + + @PostMapping(path = "/testTwo", consumes = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity testTwo(@RequestBody ClassOne test) { + return ResponseEntity.ok("ok"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/SpringDocApp236Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/SpringDocApp236Test.java new file mode 100644 index 000000000..a1ed6d0e3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/SpringDocApp236Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2024 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app236; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp236Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/HelloController.java new file mode 100644 index 000000000..529ffc068 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", description = "A core-auth Bearer token") +public class HelloController { + + @Operation(summary = "Add a new person to the store", description = "", security = { + @SecurityRequirement(name = "Authorization") }) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java new file mode 100644 index 000000000..86cc7a42f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +public class SpringDocApp24Test extends AbstractSpringDocV31Test { + + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocTestApp.java new file mode 100644 index 000000000..67e043d42 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocTestApp.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.headers.Header; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components() + .addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic")) + .addParameters("myHeader1", + new Parameter().in("header").schema(new StringSchema()).name("myHeader1")) + .addHeaders("myHeader2", + new Header().description("myHeader2 header").schema(new StringSchema()))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/HelloController.java new file mode 100644 index 000000000..8fa1ee14a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/HelloController.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25; + +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/check") + @ResponseStatus(HttpStatus.OK) + void check() { + } + + @GetMapping(value = "/list") + void list( + + @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")) @PathVariable String trackerId, + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, + @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")) @RequestParam(value = "end", required = false) Instant endDate) { + } + + @GetMapping(value = "/secondlist/{trackerId}") + void secondlist( + @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")) @PathVariable String trackerId, + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, + @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")) @RequestParam(value = "end", required = false) Instant endDate) { + + } + + @Operation(description = "Get last data from a tracker", parameters = { + @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")), + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")), + @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")), + @Parameter(name = "limit", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "number", required = false, example = "10")) }, responses = { + @ApiResponse(responseCode = "200") }) + + @GetMapping(value = "/values/{trackerId}/data") + void thirdList(@PathVariable String trackerId, @RequestParam(value = "start", required = false) Instant start, + @RequestParam(value = "end", required = false) Instant end, + @RequestParam(value = "limit", required = false) Integer limit) { + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java new file mode 100644 index 000000000..0f6206665 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp25Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/Bar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/Bar.java new file mode 100644 index 000000000..b706f8483 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/Bar.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +public class Bar { + private String bar; + + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/Foo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/Foo.java new file mode 100644 index 000000000..3eae111cb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/Foo.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +public class Foo { + + private String foo; + + public String getFoo() { + return foo; + } + + public void setFoo(String foo) { + this.foo = foo; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/HelloController.java new file mode 100644 index 000000000..9e42a4959 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/HelloController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/persons") + public MyModel persons(MyModel myModel) { + return new MyModel(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/MyModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/MyModel.java new file mode 100644 index 000000000..e2b15d437 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/MyModel.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import io.swagger.v3.oas.annotations.media.Schema; + +public class MyModel { + + @Schema(description = "Hello", type = "object", oneOf = { Foo.class, Bar.class }) + private Object thing; + + public Object getThing() { + return thing; + } + + public void setThing(Object thing) { + this.thing = thing; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java new file mode 100644 index 000000000..cf44ab1a9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp26Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Advice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Advice.java new file mode 100644 index 000000000..785148d1f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Advice.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.WebRequest; + +@RestControllerAdvice +public class Advice { + + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + public Foo handleException(Exception ex, WebRequest request) { + return new Foo(); + } + + @ExceptionHandler(MyException.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + public Bar handleMyException(MyException ex, WebRequest request) { + return new Bar(); + } + + @Hidden + @ExceptionHandler(Throwable.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public Bar handleMyException2(MyException ex, WebRequest request) { + return new Bar(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Bar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Bar.java new file mode 100644 index 000000000..7582a54e3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Bar.java @@ -0,0 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +public class Bar { + public String bar = "bar"; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Foo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Foo.java new file mode 100644 index 000000000..758d71814 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/Foo.java @@ -0,0 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +public class Foo { + public String foo = "foo"; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java new file mode 100644 index 000000000..e87130a9b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + private boolean flag = false; + + @RequestMapping("/") + public String index() { + return ""; + } + + @GetMapping("/test") + public String test() { + flag = !flag; + throw flag ? new MyException() : new RuntimeException(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/MyException.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/MyException.java new file mode 100644 index 000000000..2d9f6d84d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/MyException.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +public class MyException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java new file mode 100644 index 000000000..d45525ff0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp27Test extends AbstractSpringDocV31Test { + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/Bar", + "#/components/schemas/Foo"))); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java new file mode 100644 index 000000000..0f9d05ffd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app28; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class HelloController { + + @PostMapping(value = "/upload2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String upload2(@RequestPart("one") MultipartFile one, @RequestPart("two") MultipartFile two) { + return "Ok"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java new file mode 100644 index 000000000..5f0838323 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app28; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp28Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/HelloController.java new file mode 100644 index 000000000..43c6b023d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/post-entity") + @Operation(description = "Post entity", + requestBody = @RequestBody(content = @Content(mediaType = "application/json", schema = @Schema(implementation = TrackerData.class))), + responses = + { @ApiResponse(responseCode = "200", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = TrackerData.class)))) }) + List postEntity(@RequestBody TrackerData postEntity) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java new file mode 100644 index 000000000..158519a89 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp29Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/TrackerData.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/TrackerData.java new file mode 100644 index 000000000..fb238b51d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/TrackerData.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import java.time.Instant; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(name = "TrackerData") +public class TrackerData { + + @Schema(name = "trackerId", type = "string", required = true, example = "the-tracker-id") + @JsonProperty("trackerId") + String trackerId; + + @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") + @JsonProperty("timestamp") + Instant timestamp; + + @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") + @JsonProperty("value") + Double value; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java new file mode 100644 index 000000000..7f193e983 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app30; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test") + public String echo(@RequestParam(name = "text", defaultValue = "Hello, World!") String text) { + return text; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java new file mode 100644 index 000000000..6190ed802 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app30; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp30Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java new file mode 100644 index 000000000..a7b2be713 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app31; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.callbacks.Callback; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/test") + @Callback(callbackUrlExpression = "http://$request.query.url", name = "subscription", operation = { + @Operation(method = "post", description = "payload data will be sent", parameters = { + @Parameter(in = ParameterIn.PATH, name = "subscriptionId", required = true, schema = @Schema(type = "string", format = "uuid", description = "the generated UUID", accessMode = Schema.AccessMode.READ_ONLY)) }, responses = { + @ApiResponse(responseCode = "200", description = "Return this code if the callback was received and processed successfully"), + @ApiResponse(responseCode = "205", description = "Return this code to unsubscribe from future data updates"), + @ApiResponse(responseCode = "default", description = "All other response codes will disable this callback subscription") }) }) + @Operation(description = "subscribes a client to updates relevant to the requestor's account, as " + + "identified by the input token. The supplied url will be used as the delivery address for response payloads") + public SubscriptionResponse subscribe(@Schema(required = true, description = "the authentication token " + + "provided after initially authenticating to the application") @RequestHeader("x-auth-token") String token, + @Schema(required = true, description = "the URL to call with response " + + "data") @RequestParam("url") String url) { + return null; + } + + static class SubscriptionResponse { + private String subscriptionUuid; + + public String getSubscriptionUuid() { + return subscriptionUuid; + } + + public void setSubscriptionUuid(String subscriptionUuid) { + this.subscriptionUuid = subscriptionUuid; + } + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java new file mode 100644 index 000000000..a34f35e18 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app31; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp31Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java new file mode 100644 index 000000000..44414a980 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app32; + +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @RequestMapping(value = "/filter", method = RequestMethod.POST) + @ResponseStatus(value = HttpStatus.OK) + public String filterPost(@RequestBody final MyTestDto filter) { + return "OK"; + } + + class MyTestDto { + public String object1; + + public String object2; + + public String object3; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java new file mode 100644 index 000000000..b452bfcba --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app32; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp32Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java new file mode 100644 index 000000000..06fe82a0d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app33; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java new file mode 100644 index 000000000..f1adc727b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app33; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp33Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/HelloController.java new file mode 100644 index 000000000..96a105556 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/MyExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/MyExceptionHandler.java new file mode 100644 index 000000000..ccab1fc80 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/MyExceptionHandler.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; + +@RestControllerAdvice +@Hidden +public class MyExceptionHandler extends ResponseEntityExceptionHandler { + @ExceptionHandler(IllegalArgumentException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Object bad(IllegalArgumentException e) { + return null; + } + + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java new file mode 100644 index 000000000..2683450cf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp34Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/HelloController.java new file mode 100644 index 000000000..7363a2a19 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app35; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@Controller +@RequestMapping("/api/v1/poc/") +public class HelloController { + + @Operation(summary = "Get thing", responses = { + @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "404", description = "Not found", content = @Content), + @ApiResponse(responseCode = "401", description = "Authentication Failure", content = @Content(schema = @Schema(hidden = true))) }) + @RequestMapping(path = "/testme", method = RequestMethod.GET) + ResponseEntity testme() { + return ResponseEntity.ok("Hello"); + } + + @Operation(summary = "Get thing", responses = { + @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "404", description = "Not found", content = @Content(schema = @Schema(hidden = true))), + @ApiResponse(responseCode = "401", description = "Authentication Failure", content = @Content(schema = @Schema(hidden = true))) }) + @RequestMapping(path = "/test", method = RequestMethod.GET) + ResponseEntity test() { + return ResponseEntity.ok("Hello"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java new file mode 100644 index 000000000..220cad3e4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app35; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.springdoc.core.utils.SpringDocUtils.getConfig; + +public class SpringDocApp35Test extends AbstractSpringDocV31Test { + + static { + getConfig().addRestControllers(HelloController.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Bar.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Bar.java new file mode 100644 index 000000000..bb65863ce --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Bar.java @@ -0,0 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +public class Bar { + public String bar = "bar"; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Car.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Car.java new file mode 100644 index 000000000..e995fd9ab --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Car.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +public class Car { + public String car = "car"; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Foo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Foo.java new file mode 100644 index 000000000..59b3095c9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Foo.java @@ -0,0 +1,29 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +public class Foo { + public String foo = "foo"; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/HelloController.java new file mode 100644 index 000000000..047c60d0b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/HelloController.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import jakarta.validation.Valid; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController("/api") +public class HelloController { + + @PostMapping(path = "/bar/baz", consumes = "application/x.a+json", produces = MediaType.TEXT_PLAIN_VALUE) + public Foo process(@RequestBody Foo a) { + return a; + } + + @PostMapping(path = "/bar/baz", consumes = "application/x.b+json", produces = MediaType.TEXT_PLAIN_VALUE) + public Bar process(@RequestBody Bar b) { + return b; + } + + @PostMapping(path = "/bar/baz", consumes = "application/x.c+json", produces = MediaType.APPLICATION_JSON_VALUE) + public Car process(@RequestBody Car c) { + return c; + } + + @PostMapping(value = "/pets", consumes = "application/json") + public ResponseEntity petsPost(@Valid @RequestBody Pet pet) { + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } + + @PostMapping(value = "/pets", consumes = "text/plain") + public ResponseEntity petsPost(@Valid @RequestBody String pet) { + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Pet.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Pet.java new file mode 100644 index 000000000..e92842605 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/Pet.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +public class Pet { + public String pet = "pet"; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java new file mode 100644 index 000000000..6940d6550 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp37Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/HelloController.java new file mode 100644 index 000000000..6b5c12fa7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/HelloController.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app38; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@RestController("/api") +public class HelloController { + + @RequestMapping(value = "/npe_error", method = RequestMethod.GET) + public ResponseEntity getModelResource() { + return new ResponseEntity<>(new byte[0], HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java new file mode 100644 index 000000000..53eb32da4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app38; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp38Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java new file mode 100644 index 000000000..97c4451e1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app39; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @Operation(summary = "test Request") + @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) + @PostMapping("/test") + public void searchEmployee(String test) { + } + + @GetMapping("/hello") + public String hello() { + return "hello"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java new file mode 100644 index 000000000..bbf9cb18c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app39; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +public class SpringDocApp39Test extends AbstractSpringDocV31Test { + + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java new file mode 100644 index 000000000..7a2c4f100 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app39; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.HeaderParameter; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + StringSchema schema = new StringSchema(); + return new OpenAPI() + .components(new Components().addParameters("myGlobalHeader", new HeaderParameter().required(true).name("My-Global-Header").description("My Global Header").schema(schema))); + } + + @Bean + public OpenApiCustomizer customerGlobalHeaderOpenApiCustomizer() { + return openApi -> openApi.getPaths().values().stream().flatMap(pathItem -> pathItem.readOperations().stream()) + .forEach(operation -> operation.addParametersItem(new HeaderParameter().$ref("#/components/parameters/myGlobalHeader"))); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/HelloController.java new file mode 100644 index 000000000..921bdfae3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/HelloController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app40; + +import com.fasterxml.jackson.databind.node.ObjectNode; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@RestController("/api") +public class HelloController { + + @RequestMapping(value = "/iae_error", method = RequestMethod.GET) + public ObjectNode getStartFormProperties() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java new file mode 100644 index 000000000..574cf12ae --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app40; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp40Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/HelloController.java new file mode 100644 index 000000000..2c44a1ca0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app41; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController("/api") +public class HelloController { + + @Operation(description = "Download file") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "File resource", content = @Content(schema = @Schema(implementation = java.io.File.class))), + @ApiResponse(responseCode = "400", description = "Wrong request", content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) }) + @GetMapping(value = "/file", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity getFile( + @NotNull @Parameter(description = "File path", required = true) @Valid @RequestParam(value = "path") String path) { + return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java new file mode 100644 index 000000000..5ab88f36e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app41; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp411Test extends AbstractSpringDocV31Test { + + @Test + protected void testApp() throws Exception { + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + // Test result consistency + mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.1.0/app41.json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, false); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java new file mode 100644 index 000000000..92c71fedc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app41; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = "springdoc.cache.disabled=true") +public class SpringDocApp41Test extends AbstractSpringDocV31Test { + + @Test + protected void testApp() throws Exception { + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + // Test result consistency + mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.1.0/app" + testNumber + ".json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, false); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/HelloController.java new file mode 100644 index 000000000..50cd75ae9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/HelloController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app42; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + + +@RestController("/api") +public class HelloController { + + @GetMapping(value = "/tweets/{id}") + public void tweets(@PathVariable TweetId id) { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java new file mode 100644 index 000000000..a22993b25 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app42; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.StringSchema; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp42Test extends AbstractSpringDocV31Test { + + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI().components(new Components().addSchemas("TweetId", new StringSchema())); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/TweetId.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/TweetId.java new file mode 100644 index 000000000..c19cfd02f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/TweetId.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app42; + +public class TweetId { + private final String value; + + public TweetId(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/HelloController.java new file mode 100644 index 000000000..2124651d0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app43; + +import java.util.List; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class HelloController { + + @PostMapping(path = "/documents", consumes = "multipart/form-data") + public ResponseEntity uploadDocuments(@RequestPart("doc") List multipartFiles) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java new file mode 100644 index 000000000..d263624ec --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app43; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp43Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/HelloController.java new file mode 100644 index 000000000..8e2dfe7d1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/HelloController.java @@ -0,0 +1,131 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app44; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController("/api") +public class HelloController { + + @PostMapping(value = "/helloworld", produces = "application/json", consumes = "application/vnd.v1+json") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "Successful operation", content = @Content(schema = @Schema(implementation = HelloDTO1.class))), + @ApiResponse(responseCode = "400", description = "Bad name", content = @Content(schema = @Schema(implementation = ErrorDTO.class))) }) + public ResponseEntity hello(@RequestBody RequestV1 request) { + final String name = request.getNameV1(); + if ("error".equalsIgnoreCase(name)) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ErrorDTO("invalid name: " + name)); + } + return ResponseEntity.ok(new HelloDTO1("Greetings from Spring Boot v1! " + name)); + } + + @PostMapping(value = "/helloworld", produces = "application/json", consumes = "application/vnd.v2+json") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "Successful operation", content = @Content(schema = @Schema(implementation = HelloDTO2.class))), + @ApiResponse(responseCode = "400", description = "Bad name", content = @Content(schema = @Schema(implementation = ErrorDTO.class))) }) + public ResponseEntity hello(@RequestBody RequestV2 request) { + final String name = request.getNameV2(); + if ("error".equalsIgnoreCase(name)) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ErrorDTO("invalid name: " + name)); + } + return ResponseEntity.ok(new HelloDTO2("Greetings from Spring Boot v2! " + name)); + } + + static class RequestV1 { + private String nameV1; + + public RequestV1() { + } + + public String getNameV1() { + return nameV1; + } + + public void setNameV1(String nameV1) { + this.nameV1 = nameV1; + } + } + + static class RequestV2 { + private String nameV2; + + public RequestV2() { + } + + public String getNameV2() { + return nameV2; + } + + public void setNameV2(String nameV2) { + this.nameV2 = nameV2; + } + } + + class HelloDTO1 { + private final String message; + + public HelloDTO1(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + } + + class HelloDTO2 { + private final String message; + + public HelloDTO2(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + } + + class ErrorDTO { + private final String errorMessage; + + public ErrorDTO(String errorMessage) { + this.errorMessage = errorMessage; + } + + public String getErrorMessage() { + return errorMessage; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java new file mode 100644 index 000000000..806597b82 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app44; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp44Test extends AbstractSpringDocV31Test { + + @Test + public void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/HelloDTO2", + "#/components/schemas/HelloDTO1"))) + .andExpect(jsonPath("$.paths./helloworld.post.requestBody.content.['application/vnd.v1+json'].schema.$ref", is("#/components/schemas/RequestV1"))) + .andExpect(jsonPath("$.paths./helloworld.post.requestBody.content.['application/vnd.v2+json'].schema.$ref", is("#/components/schemas/RequestV2"))) + .andExpect(jsonPath("$.paths./helloworld.post.responses.400.content.['application/json'].schema.$ref", is("#/components/schemas/ErrorDTO"))); + + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/HelloController.java new file mode 100644 index 000000000..1e1d428c8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/HelloController.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +import java.util.Collections; +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@Tag(name = "People", description = "Use this resource to serve all requests and initiate all operations related to people") +@RestController +@RequestMapping(value = "/v1/people") +public class HelloController { + + + @Operation(description = "List all persons") + @SecurityRequirement(name = "bearer") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/list", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List list() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + + @Operation(description = "List all persons") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/listTwo", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List listTwo() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/HelloController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/HelloController2.java new file mode 100644 index 000000000..580d6ef45 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/HelloController2.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +import java.util.Collections; +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@Tag(name = "People", description = "Use this resource to serve all requests and initiate all operations related to people") +@SecurityRequirement(name = "bearer") +@RestController +@RequestMapping(value = "/v1/people2") +public class HelloController2 { + + + @Operation(description = "List all persons") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/list", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List list() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + + @Operation(description = "List all persons") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/listTwo", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List listTwo() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/OpenApiConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/OpenApiConfig.java new file mode 100644 index 000000000..beaa2b4da --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/OpenApiConfig.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.security.SecurityScheme; + +@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) +@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") +public class OpenApiConfig { +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/PersonDTO.java new file mode 100644 index 000000000..468d3d0f0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/PersonDTO.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java new file mode 100644 index 000000000..244f337d2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp45Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/HelloController.java new file mode 100644 index 000000000..6c6592093 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app46; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons/{subscriptionId}") + @Operation(operationId = "operationId", summary = "Operation Summary", description = "Operation Description", tags = { + "Example Tag" }, externalDocs = @ExternalDocumentation(description = "External documentation description", url = "http://url.com"), parameters = { + @Parameter(in = ParameterIn.PATH, name = "subscriptionId", required = true, description = "parameter description", allowEmptyValue = true, allowReserved = true, schema = @Schema(type = "string", format = "uuid", description = "the generated UUID", accessMode = Schema.AccessMode.READ_ONLY)) }, responses = { + @ApiResponse(responseCode = "200", description = "voila!", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) }) + public String persons(String subscriptionId) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java new file mode 100644 index 000000000..5a7595e2f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app46; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp46Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/BasicController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/BasicController.java new file mode 100644 index 000000000..ae9c68ff0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/BasicController.java @@ -0,0 +1,26 @@ +package test.org.springdoc.api.v31.app47; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(path = "/") +public class BasicController { + + @GetMapping(headers = { "foo=bar" }) + public String get1() { + return null; + } + + @GetMapping(headers = { "fi=ri" }) + public String get2() { + return null; + } + + @GetMapping( + headers = { "User-Agent=" + "MyUserAgent" }) + public String get3() { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/HelloController.java new file mode 100644 index 000000000..461bbe435 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app47; + +import java.util.Locale; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + @GetMapping(path = "/documents/{locale}") + public ResponseEntity getDocumentsWithLocale( + @Parameter(schema = @Schema(type = "string")) @PathVariable("locale") Locale locale) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java new file mode 100644 index 000000000..ff4f11ec7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app47; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp47Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/AbstractHelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/AbstractHelloController.java new file mode 100644 index 000000000..a9d80cd43 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/AbstractHelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app48; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; + +@ApiResponse(responseCode = "410") +@ApiResponses({ + @ApiResponse(responseCode = "411") +}) +public class AbstractHelloController { + + @GetMapping(path = "/documents/{locale}") + @ApiResponse(responseCode = "412") + @ApiResponses({ + @ApiResponse(responseCode = "413") + }) + public ResponseEntity getDocuments() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/HelloController.java new file mode 100644 index 000000000..b3fbf0a53 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app48; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController + +@ApiResponse(responseCode = "400") +@ApiResponses({ + @ApiResponse(responseCode = "401") +}) +public class HelloController extends AbstractHelloController { + + @Override + @GetMapping(path = "/documents/{locale}") + @ApiResponse(responseCode = "402") + @ApiResponses({ + @ApiResponse(responseCode = "403") + }) + public ResponseEntity getDocuments() { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java new file mode 100644 index 000000000..49fb83e85 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app48; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp48Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/HelloController.java new file mode 100644 index 000000000..3c05e2883 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app49; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @Operation(description = "Obtain the list of services available in the system") + @ApiResponses({ @ApiResponse(responseCode = "401", ref = "Unauthorized") }) + @GetMapping(value = "/hello", produces = MediaType.APPLICATION_JSON_VALUE) + List list() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java new file mode 100644 index 000000000..f0ccb5f87 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app49; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +public class SpringDocApp49Test extends AbstractSpringDocV31Test { + + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocTestApp.java new file mode 100644 index 000000000..b3474f833 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocTestApp.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app49; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.responses.ApiResponse; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI defineOpenApi() { + OpenAPI api = new OpenAPI(); + api.components(new Components().addResponses("Unauthorized", + new ApiResponse().description("Unauthorized") + .content(new Content().addMediaType(MediaType.APPLICATION_JSON_VALUE, + new io.swagger.v3.oas.models.media.MediaType().schema(new StringSchema()))))); + return api; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/HelloController.java new file mode 100644 index 000000000..a0fb94d3e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app50; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @Operation(description = "Some operation", responses = { @ApiResponse(responseCode = "401") }) + //@ApiResponse(responseCode = "401", content = @Content()) + @GetMapping(value = "/hello", produces = MediaType.APPLICATION_JSON_VALUE) + List list() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java new file mode 100644 index 000000000..cbfe6386d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app50; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +public class SpringDocApp50Test extends AbstractSpringDocV31Test { + + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocTestApp.java new file mode 100644 index 000000000..401f73097 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocTestApp.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app50; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.responses.ApiResponse; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI defineOpenApi() { + OpenAPI api = new OpenAPI(); + api.components(new Components().addResponses("Unauthorized", + new ApiResponse().description("Unauthorized") + .content(new Content().addMediaType(MediaType.APPLICATION_JSON_VALUE, + new io.swagger.v3.oas.models.media.MediaType().schema(new StringSchema()))))); + return api; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/HelloController.java new file mode 100644 index 000000000..922ef35df --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/HelloController.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app51; + +import java.util.HashMap; +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @Operation(parameters = { + @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")) }) + @GetMapping("/test1") + public String test1() { + return "test"; + } + + @Operation(parameters = { + @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")) }) + @GetMapping("/test2") + public String test2(@RequestParam(name = "param1") String param1) { + return "test"; + } + + @Operation(parameters = { + @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")), + @Parameter(description = "desc1", in = ParameterIn.QUERY, name = "param1", required = true, schema = @Schema(type = "string", example = "something")) }) + @GetMapping("/test3") + public String test3( + @RequestParam(name = "param1") @Parameter(description = "desc2", in = ParameterIn.QUERY) String param1) { + return "test"; + } + + @GetMapping("/test/{path}") + public String get( + @PathVariable String path, + @RequestParam(required = false) Map params) { + return null; + } + + @PostMapping + public ResponseEntity> hello(@RequestBody HashMap map) { + return ResponseEntity.ok(map); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java new file mode 100644 index 000000000..63a94b2ae --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app51; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp51Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/HelloController.java new file mode 100644 index 000000000..4ebff61bd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/HelloController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app52; + +import java.util.List; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class HelloController { + + @PostMapping(value = "/test1/{username}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String createTest1(@PathVariable String username, @RequestPart("test") MyTestDto test, + @RequestPart("image") MultipartFile imageFile) { + return null; + } + + @PostMapping(value = "/test2/{username}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String createTest2(@PathVariable String username, @RequestPart("image") MultipartFile imageFile, + @RequestPart("test") MyTestDto test, @RequestHeader("My-Header") String workspaceId) { + return null; + } + + @PostMapping(value = "/test3", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String createTest3(@RequestPart("test") MyTestDto test, + @RequestPart("doc") List multipartFiles) { + return null; + } + + class MyTestDto { + public String object1; + + public String object2; + + public String object3; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java new file mode 100644 index 000000000..9d363ec42 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app52; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp52Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/HelloController.java new file mode 100644 index 000000000..9a1fd4432 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app53; + + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @Operation(description = "Some operation") + @GetMapping(value = "/hello1", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithNoApiResponse() { + return null; + } + + @Operation(description = "Some operation") + @ApiResponse + @GetMapping(value = "/hello2", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithEmptyApiResponse() { + return null; + } + + @Operation(description = "Some operation") + @GetMapping(value = "/hello3", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.NO_CONTENT) + List listWithExplicitResponseStatus() { + return null; + } + + @Operation(description = "Some operation") + @GetMapping(value = "/hello4", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.NO_CONTENT) + HelloDTO1 getDTOWithExplicitResponseStatus() { + return null; + } + + @Operation(description = "Some operation") + @GetMapping(value = "/hello5", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithDefaultResponseStatus() { + return null; + } + + @Operation(description = "Some operation") + @GetMapping(value = "/hello6", produces = MediaType.APPLICATION_JSON_VALUE) + HelloDTO1 getDTOWithDefaultResponseStatus() { + return null; + } + + @Operation(description = "Some operation") + @GetMapping(value = "/hello7", produces = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity getNestedDTOWithDefaultResponseStatus() { + return null; + } + + static class HelloDTO1 { + private final String message; + + public HelloDTO1(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/HelloControllerWithGlobalApiResponse.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/HelloControllerWithGlobalApiResponse.java new file mode 100644 index 000000000..5537e70d3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/HelloControllerWithGlobalApiResponse.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app53; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(path = "/global") +public class HelloControllerWithGlobalApiResponse { + + @Operation(description = "Some operation", responses = { + @ApiResponse(responseCode = "204", description = "Explicit description for this response") }) + @ResponseStatus(HttpStatus.NO_CONTENT) + @GetMapping(value = "/hello1", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithNoApiResponse() { + return null; + } + + @Operation(description = "Some operation") + @ApiResponse(responseCode = "200", description = "Explicit description for this response") + @GetMapping(value = "/hello2", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithDefaultResponseStatus() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java new file mode 100644 index 000000000..c482f7efb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app53; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp53Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/HelloController.java new file mode 100644 index 000000000..283a7cd0e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app54; + +import com.fasterxml.jackson.annotation.JsonView; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/parties/{id}") + @JsonView(Views.Public.class) + @Operation(summary = "Gets meal party details [Meal party admin restricted]") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Successfully retrieved the meal party") }) + public MealParty getMealParty(@PathVariable("id") long mealPartyId) { + return null; + } + + @JsonView(Views.MealPartyAdmin.class) + @PostMapping(value = "/parties") + public ResponseEntity saveMealParty(@JsonView(Views.Public.class) @RequestBody MealParty p) { + return null; + } + + @JsonView(Views.MealPartyAdmin.class) + @PostMapping(value = "/new-parties") + public ResponseEntity saveMealNewParty(@JsonView(Views.Public.class) @org.springframework.web.bind.annotation.RequestBody MealParty p) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/MealParty.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/MealParty.java new file mode 100644 index 000000000..0379dc1d4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/MealParty.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app54; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonView; + +public class MealParty { + @JsonView(Views.MealPartyAdmin.class) + private final List members = new ArrayList<>(); + + @JsonView(Views.Public.class) + private String name; +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java new file mode 100644 index 000000000..4d52e5a9a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app54; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp54Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/Views.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/Views.java new file mode 100644 index 000000000..7264a5bcb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/Views.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app54; + +public interface Views { + interface Public { + } + + interface MealPartyAdmin extends Public { + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/HelloController.java new file mode 100644 index 000000000..676cf54a8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app55; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +@Controller +@Tag(name = "health") +public class HelloController { + + /** + * Ping endpoint used for health checks. + */ + @RequestMapping(value = "/ping", method = RequestMethod.GET) + @Operation(summary = "Simple health check") + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) + @ResponseBody + @ResponseStatus(HttpStatus.OK) + public Boolean ping() { + return true; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java new file mode 100644 index 000000000..995e5e975 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app55; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp55Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/GlobalExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/GlobalExceptionHandler.java new file mode 100644 index 000000000..c6983f6f3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/GlobalExceptionHandler.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app56; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class GlobalExceptionHandler { + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ApiResponse( + responseCode = "500", + description = "Internal server error", + content = @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ErrorDTO.class) + ) + ) + ErrorDTO handleUnhandledError() { + return new ErrorDTO("internal error: "); + } + + class ErrorDTO { + private final String errorMessage; + + ErrorDTO(String errorMessage) { + this.errorMessage = errorMessage; + } + + public String getErrorMessage() { + return errorMessage; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/HelloController.java new file mode 100644 index 000000000..a2617b8bd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/HelloController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app56; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java new file mode 100644 index 000000000..0f0d4b4ad --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app56; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp56Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/HelloController.java new file mode 100644 index 000000000..99e8232dd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app57; + +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/{name:.+}") + public ResponseEntity getText(@Parameter(description = "desc", required = true) @PathVariable String name) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java new file mode 100644 index 000000000..102bb08b9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app57; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp57Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/HelloController.java new file mode 100644 index 000000000..1eea3a517 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/HelloController.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app58; + +import com.fasterxml.jackson.databind.JsonNode; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/examplePost") + @Operation(summary = "schema example") + public Object example(@Parameter(schema = @Schema(hidden = true)) JsonNode json) { + return null; + } + + @GetMapping("/example") + public void test(@Parameter(schema = @Schema(hidden = true)) JsonNode json) { + } + + @GetMapping(value = "/foo") + public void foobar(@Parameter(description = "User", name = "user", + schema = @Schema(implementation = PersonDTO.class)) @RequestParam("bar") String bar) { + + } + + @GetMapping(value = "/foo1") + public void foobar1(@Parameter(description = "User", name = "user", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PersonDTO.class))) @RequestParam("bar") String bar) { + + } + + class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java new file mode 100644 index 000000000..d396b1590 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app58; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp58Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloBody.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloBody.java new file mode 100644 index 000000000..c024dce86 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloBody.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app59; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; + +public class HelloBody { + + @NotNull + @JsonProperty + private String helloValue; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloController.java new file mode 100644 index 000000000..db31565ea --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app59; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + @Deprecated + @GetMapping("/example") + public void test() { + } + + @PostMapping("/hello") + @ApiResponse(responseCode = "200", description = "The server accepted your hello.") + String hello(@Validated @RequestBody final HelloBody helloBody) { + return "World!"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloController2.java new file mode 100644 index 000000000..ecb43ffa3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloController2.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app59; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Deprecated +public class HelloController2 { + + @GetMapping("/example2") + public void test() { + } + + @PostMapping("/hello2") + @ApiResponse(responseCode = "200", description = "The server accepted your hello.") + String hello(@Validated @RequestBody final HelloBody helloBody) { + return "World!"; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloExceptionHandler.java new file mode 100644 index 000000000..9818d9dfd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/HelloExceptionHandler.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app59; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.WebRequest; +import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; + +@Order(Ordered.HIGHEST_PRECEDENCE) +@RestControllerAdvice +public class HelloExceptionHandler extends ResponseEntityExceptionHandler { + + @ExceptionHandler(Exception.class) + @ResponseBody + @ApiResponse(responseCode = "500", + description = "An unknown error occurred" + ) + protected ResponseEntity handleException() { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + + @Override + @ApiResponse(responseCode = "400", + description = "The request is malformed or information is missing." + ) + protected ResponseEntity handleMethodArgumentNotValid( + MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) { + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java new file mode 100644 index 000000000..11a838af5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app59; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp59Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/HelloController.java new file mode 100644 index 000000000..9f9ebbd5a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app60; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/hello1") + @Operation(summary = "summary1") + @Parameters({ + @Parameter(name = "page", description = "The page"), + @Parameter(name = "size", description = "The size") + }) + public List list1(String page, String size) { + return null; + } + + @GetMapping("/hello2") + @Operation(summary = "summary2") + @QuerySort + @QueryPaging + public List list2(String page, String size, String sort) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/QueryPaging.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/QueryPaging.java new file mode 100644 index 000000000..91393c2e9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/QueryPaging.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app60; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.METHOD }) +@Parameters({ + @Parameter(name = "page", description = "desc page from Annotated interface"), + @Parameter(name = "size", description = "desc page from Annotated interface") +}) +public @interface QueryPaging { +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/QuerySort.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/QuerySort.java new file mode 100644 index 000000000..f79562efd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/QuerySort.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app60; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.METHOD }) +@Parameter(name = "sort", description = "desc sort from Annotated interface") +public @interface QuerySort { +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java new file mode 100644 index 000000000..45c8365a6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app60; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp60Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/HelloController.java new file mode 100644 index 000000000..88213f80d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app61; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @Operation(description = "List", parameters = { + @Parameter(description = "Name", name = "name", in = ParameterIn.QUERY), + @Parameter(description = "Phone", name = "phone", in = ParameterIn.QUERY), + @Parameter(description = "createdFrom", name = "createdFrom", in = ParameterIn.QUERY, content = @Content(array = @ArraySchema(schema = @Schema(type = "string")))), + @Parameter(description = "createdRange", name = "createdRange", in = ParameterIn.QUERY, array = @ArraySchema(schema = @Schema(type = "string", format = "date"), minItems = 2, maxItems = 2)) + }) + @GetMapping(value = "/persons-with-user") + public String persons(String name, String phone, String createdFrom, String createdRange) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java new file mode 100644 index 000000000..2f1feeff3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app61; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp61Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/BaseController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/BaseController.java new file mode 100644 index 000000000..a7c654c73 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/BaseController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app62; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@RestController +@RequestMapping +public @interface BaseController { + @AliasFor(annotation = RequestMapping.class) + String[] value() default {}; + + @AliasFor(annotation = RequestMapping.class) + String[] produces() default { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }; +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java new file mode 100644 index 000000000..34d2dd007 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app62; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp62Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/TestController.java new file mode 100644 index 000000000..bfa5839cd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/TestController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app62; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@BaseController +@Tag(name = "Test Controller") +public class TestController { + + @RequestMapping(value = "/test", method = RequestMethod.GET) + @Operation(summary = "This is the test endpoint") + public String test(@RequestHeader("Accept") String accept) { + return "This is a test"; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java new file mode 100644 index 000000000..1c9d80c6b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app63; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java new file mode 100644 index 000000000..1f40a7c40 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app63; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +@TestPropertySource(properties = { + "springdoc.packagesToScan=hell,hello1, hello.me", + "springdoc.packagesToExclude=test.org.springdoc.api.app63.65" }) +public class SpringDocApp63Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java new file mode 100644 index 000000000..9400093ac --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app64; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/v1/test") + public void test1(String hello) { + } + + @GetMapping(value = "/api/balance/abcd") + @Operation(summary = "This is the test endpoint") + public String test2(String from) { + return "This is a fake test"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java new file mode 100644 index 000000000..8646ab74a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app64; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.paths-to-match=/v1, /api/**") +public class SpringDocApp64Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java new file mode 100644 index 000000000..fe338b5f5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app65; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "Health", description = "Health check / ping API") +@RestController +public class HelloController { + + @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") + @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) + public ResponseEntity ping() { + return ResponseEntity.ok("Healthy"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java new file mode 100644 index 000000000..1e712e6b9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app65; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp65Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/DefaultHealthCheckApi.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/DefaultHealthCheckApi.java new file mode 100644 index 000000000..223169b55 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/DefaultHealthCheckApi.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import java.time.LocalDate; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@Hidden +public class DefaultHealthCheckApi { + + @GetMapping("/test/date/echo/{date}") + public String testDateEcho(@DateTimeFormat(pattern = "yyyyMMdd") @PathVariable LocalDate date) { + return date.toString(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/HelloController.java new file mode 100644 index 000000000..b8c76bcff --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/HelloController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "Health", description = "Health check / ping API") +@RestController +public class HelloController { + + @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") + @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) + public ResponseEntity ping(UndocumentedClass possiblyInjectedByAspect) { + return ResponseEntity.ok("Healthy"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java new file mode 100644 index 000000000..247d3f71f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp66Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/UndocumentedClass.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/UndocumentedClass.java new file mode 100644 index 000000000..f02776e6d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/UndocumentedClass.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import io.swagger.v3.oas.annotations.Hidden; + +@Hidden +public class UndocumentedClass { + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java new file mode 100644 index 000000000..f939c5fe0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java @@ -0,0 +1,110 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app67; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(path = "/demo", + produces = MediaType.TEXT_PLAIN_VALUE) +public class HelloController { + + @GetMapping("operation1") + @Operation(summary = "Operation 1 (expected result - no parameters)") + public String operation1() { + return "operation1"; + } + + @GetMapping("operation2") + @Operation(summary = "Operation 2 (expected result - 3 parameters)", parameters = { + @Parameter(name = "pageNumber", description = "page number", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "pageSize", description = "page size", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "sort", description = "sort specification", + in = ParameterIn.QUERY, schema = @Schema(type = "string")) + }) + public String operation2() { + return "operation2"; + } + + @GetMapping("operation3") + @Operation(summary = "Operation 3 (expected result - 3 parameters)") + @Parameters({ + @Parameter(name = "pageNumber", description = "page number", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "pageSize", description = "page size", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "sort", description = "sort specification", + in = ParameterIn.QUERY, schema = @Schema(type = "string")) + }) + public String operation3() { + return "operation3"; + } + + @GetMapping("operation4") + @Operation(summary = "Operation 4 (expected result - 3 parameters)") + @QueryPaging + @QuerySort + public String operation4() { + return "operation4"; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target({ ElementType.METHOD }) + @Parameters({ + @Parameter(name = "pageNumber", description = "page number", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "pageSize", description = "page size", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")) + }) + public @interface QueryPaging { + + } + + @Retention(RetentionPolicy.RUNTIME) + @Target({ ElementType.METHOD }) + @Parameters({ + @Parameter(name = "sort", description = "sort specification", + in = ParameterIn.QUERY, schema = @Schema(type = "string")) + }) + public @interface QuerySort { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java new file mode 100644 index 000000000..a3f287387 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app67; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp67Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/HelloController.java new file mode 100644 index 000000000..2a4d72ed6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +import java.util.concurrent.Callable; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @RequestMapping(value = "/tasks", method = RequestMethod.GET) + private Callable> getTasks(String str) { + return null; + } + + @GetMapping(value = "/testRecord") + private Callable> getInfo(@ParameterObject PersonDTO personDTO) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/PersonDTO.java new file mode 100644 index 000000000..db1b0c64b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/PersonDTO.java @@ -0,0 +1,28 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +public record PersonDTO(String email, String firstName, String lastName) { +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java new file mode 100644 index 000000000..b91110de9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp69Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/HelloController.java new file mode 100644 index 000000000..9b45423f3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import test.org.springdoc.api.v31.app70.customizer.CustomizedOperation; +import test.org.springdoc.api.v31.app70.customizer.CustomizedParameter; +import test.org.springdoc.api.v31.app70.model.ApiType; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @CustomizedOperation + @Operation(description = "Some operation") + @GetMapping("/example/{test}") + public ApiType test(@PathVariable @CustomizedParameter @Parameter(description = "Parameter description") String test) { + return new ApiType(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java new file mode 100644 index 000000000..b8c67fd30 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp70Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedOperation.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedOperation.java new file mode 100644 index 000000000..3915ec3f8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedOperation.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedOperation { + String addition() default "customized operation!"; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedParameter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedParameter.java new file mode 100644 index 000000000..f608abbb2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedParameter.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedParameter { + String addition() default "customized parameter!"; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedProperty.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedProperty.java new file mode 100644 index 000000000..bdb863618 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedProperty.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedProperty { + String addition() default "customized property!"; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/OperationCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/OperationCustomizer.java new file mode 100644 index 000000000..9563709eb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/OperationCustomizer.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import io.swagger.v3.oas.models.Operation; + +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; + +@Component +public class OperationCustomizer implements org.springdoc.core.customizers.OperationCustomizer { + @Override + public Operation customize(Operation operation, HandlerMethod handlerMethod) { + CustomizedOperation annotation = handlerMethod.getMethodAnnotation(CustomizedOperation.class); + if (annotation != null) { + operation.description(operation.getDescription() + ", " + annotation.addition()); + } + return operation; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/ParameterCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/ParameterCustomizer.java new file mode 100644 index 000000000..8129c9baa --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/ParameterCustomizer.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import io.swagger.v3.oas.models.parameters.Parameter; + +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; + +@Component +public class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { + @Override + public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { + CustomizedParameter annotation = methodParameter.getParameterAnnotation(CustomizedParameter.class); + if (annotation != null) { + parameterModel.description(parameterModel.getDescription() + ", " + annotation.addition()); + } + return parameterModel; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/PropertyCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/PropertyCustomizer.java new file mode 100644 index 000000000..884febf89 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/customizer/PropertyCustomizer.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.Collections; +import java.util.Optional; +import java.util.stream.Stream; + +import com.fasterxml.jackson.databind.JavaType; +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; +import org.springdoc.core.providers.ObjectMapperProvider; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class PropertyCustomizer implements org.springdoc.core.customizers.PropertyCustomizer { + + @Autowired + ObjectMapperProvider objectMapperProvider; + + @Override + public Schema customize(Schema property, AnnotatedType type) { + Annotation[] ctxAnnotations = type.getCtxAnnotations(); + if (ctxAnnotations == null) { + return property; + } + + Optional propertyAnnotation = Stream.of(ctxAnnotations) + .filter(CustomizedProperty.class::isInstance) + .findFirst() + .map(CustomizedProperty.class::cast); + + JavaType javaType = objectMapperProvider.jsonMapper().constructType(type.getType()); + if (javaType.getRawClass().equals(Duration.class)) { + property = new StringSchema().format("duration").properties(Collections.emptyMap()); + } + return property; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/model/ApiType.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/model/ApiType.java new file mode 100644 index 000000000..15e9392b5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/model/ApiType.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.model; + +import java.time.Duration; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import test.org.springdoc.api.v31.app70.customizer.CustomizedProperty; + +public class ApiType { + @CustomizedProperty + @Schema(description = "Test description") + @JsonProperty("someProperty") + private Duration someProperty; + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/Dog.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/Dog.java new file mode 100644 index 000000000..068a6d733 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/Dog.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + + +@Schema(name = "Dog") +public class Dog { + + @JsonProperty("display_name") + @Schema( + name = "display_name", + description = "A name given to the Dog", + example = "Fido" + ) + String displayName; + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/HelloController.java new file mode 100644 index 000000000..87219ac22 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/HelloController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/persons") + public String persons(Dog dog) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java new file mode 100644 index 000000000..bf0126c5f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp71Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java new file mode 100644 index 000000000..d2bda66d5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java @@ -0,0 +1,113 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.FilteredClassLoader; +import org.springframework.boot.test.context.runner.ApplicationContextRunner; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +class BlockingAutoConfigurationTest { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void configurations_successfully_loaded() { + contextRunner + .withPropertyValues("springdoc.show-actuator=true") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("actuatorProvider") + .hasBean("multipleOpenApiResource") + ); + } + + @Test + void configurations_not_loaded_when_application_is_not_web() { + new ApplicationContextRunner() + .withUserConfiguration(TestApp.class) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void actuator_configuration_not_loaded_when_not_enabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("actuatorPprrovider") + .hasBean("multipleOpenApiResource") + ); + } + + @Test + void configurations_not_loaded_when_disabled() { + contextRunner + .withPropertyValues("springdoc.api-docs.enabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void configurations_not_loaded_when_mvc_is_not_on_class_path() { + contextRunner + .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + + } + + @SpringBootApplication + static class TestApp { + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java new file mode 100644 index 000000000..0c62bdf47 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import org.junit.jupiter.api.Test; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +public class CacheAutoConfigurationTest1 { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void cache_configuration_loaded_when_not_disabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void cache_configuration_loaded_when_disabled_explicitly() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void cache_configurations_successfully_disabled() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=true") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void group_configuration_loaded() { + contextRunner + .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("multipleOpenApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + ); + } + + + @EnableAutoConfiguration + static class TestApp { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java new file mode 100644 index 000000000..da9aadf80 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +public class GroupAutoConfigurationTest { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void group_configuration_loaded() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .hasBean("multipleOpenApiResource") + ); + } + + @EnableAutoConfiguration + static class TestApp { + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/HelloController.java new file mode 100644 index 000000000..3b804b6bf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app73; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequestMapping({ "/{country_code}/persons/", "/persons" }) +public class HelloController { + + @DeleteMapping("/{id}") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void delete(@Parameter(name = "country_code", in = ParameterIn.QUERY) String countryCode, @PathVariable("id") String id) { + + } + + @GetMapping("/{id}") + public String get(@Parameter(name = "country_code", in = ParameterIn.QUERY) String countryCode, @PathVariable("id") String id) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java new file mode 100644 index 000000000..5dedb91e1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app73; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp73Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/HelloController.java new file mode 100644 index 000000000..eaf056cc2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app74; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + @PostMapping("/test") + @RequestBody( + content = @Content( + examples = @ExampleObject( + value = "sample" + ) + ) + ) + public String postMyRequestBody( + String myRequestBody) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java new file mode 100644 index 000000000..596d5ff8d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app74; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp74Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/HelloController.java new file mode 100644 index 000000000..1999d6a34 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/HelloController.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/test1/{uuid}") + @Operation(summary = "Example api that realize an ECHO operation", + description = "The result of the echo is the input value of the api", + parameters = { @Parameter(in = ParameterIn.PATH, + name = "uuid", + required = true, + description = "Is the identification of the document", + schema = @Schema(type = "string", + example = "uuid")) } + + + ) + @ApiResponses(value = { + @ApiResponse(description = "Successful Operation", + responseCode = "200", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PersonDTO.class))), + @ApiResponse(responseCode = "201", + description = "other possible response") + }) + public String postMyRequestBody1() { + return null; + } + + @PostMapping("/test2/{uuid}") + @Operation(summary = "Example api that realize an ECHO operation", + description = "The result of the echo is the input value of the api", + responses = { + @ApiResponse(description = "Successful Operation", + responseCode = "200", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PersonDTO.class))), + @ApiResponse(responseCode = "201", + description = "other possible response") + }, + parameters = { @Parameter(in = ParameterIn.PATH, + name = "uuid", + required = true, + description = "Is the identification of the document", + schema = @Schema(type = "string", + example = "uuid")) } + + + ) + public String postMyRequestBody2() { + return null; + } + + @PostMapping("/test3/{uuid}") + @Operation(summary = "Example api that realize an ECHO operation", + description = "The result of the echo is the input value of the api", + parameters = { @Parameter(in = ParameterIn.PATH, + name = "uuid", + required = true, + description = "Is the identification of the document", + schema = @Schema(type = "string", + example = "uuid")) } + + + ) + @ApiResponse(responseCode = "201", + description = "other possible response") + public String postMyRequestBody3() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/PersonDTO.java new file mode 100644 index 000000000..ea6b1f956 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/PersonDTO.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/RestResponseEntityExceptionHandler.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/RestResponseEntityExceptionHandler.java new file mode 100644 index 000000000..bdfb02166 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/RestResponseEntityExceptionHandler.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import java.util.List; + +import jakarta.servlet.http.HttpServletRequest; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; + +@ControllerAdvice +public class RestResponseEntityExceptionHandler + extends ResponseEntityExceptionHandler { + @ResponseStatus(value = HttpStatus.OK) + @ExceptionHandler({ Exception.class }) + public ResponseEntity> badRequest(HttpServletRequest req, Exception exception) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java new file mode 100644 index 000000000..ad236b208 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp75Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java new file mode 100644 index 000000000..152c2a188 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app76; + +import io.swagger.v3.oas.annotations.security.SecurityRequirements; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + @GetMapping("/secure") + @ResponseBody + public String secured() { + return "It works!"; + } + + @GetMapping("/open") + @ResponseBody + @SecurityRequirements + public String open() { + return "It works!"; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java new file mode 100644 index 000000000..087424658 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app76; + +import java.util.Arrays; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp76Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OpenAPI openAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("bearer-jwt", + new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT")) + ) + .addSecurityItem( + new SecurityRequirement().addList("bearer-jwt", Arrays.asList("read", "write"))); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/HelloController.java new file mode 100644 index 000000000..299b58067 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app77; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.extensions.Extension; +import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import org.hibernate.validator.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + @ApiResponse(content = @Content(schema = @Schema(type = "string")), extensions = @Extension(properties = @ExtensionProperty(name = "x-is-file", value = "true"))) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + + + @Operation(responses = @ApiResponse(content = @Content(schema = @Schema(type = "string")), extensions = @Extension(properties = @ExtensionProperty(name = "x-is-file", value = "true")))) + @GetMapping(value = "/persons2") + public void persons2(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java new file mode 100644 index 000000000..4f0da18f1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app77; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp77Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java new file mode 100644 index 000000000..bdca1c374 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app78; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @RequestMapping(value = "/person1", method = RequestMethod.GET) + private CompletionStage> getPerson1(String str) { + return null; + } + + @RequestMapping(value = "/person2", method = RequestMethod.GET) + private CompletableFuture getPerson2(String str) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/PersonDTO.java new file mode 100644 index 000000000..b2bb06bb7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/PersonDTO.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app78; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java new file mode 100644 index 000000000..be455c17c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app78; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp78Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/HelloController.java new file mode 100644 index 000000000..d0f659e3f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app79; + +import java.util.Optional; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test") + public String echo(@RequestParam Optional text) { + return text.orElse("not-specified"); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java new file mode 100644 index 000000000..358b6ddf3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app79; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp79Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/HelloController.java new file mode 100644 index 000000000..ec10b4461 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +import java.net.URISyntaxException; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class HelloController { + + + @RequestMapping(value = "/testpost1", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity testpost1(@RequestBody TestObject dto) throws URISyntaxException { + return ResponseEntity.ok(dto); + } + + @RequestMapping(value = "/testpost2", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity testpost2(@RequestBody TestObject dto) throws URISyntaxException { + return ResponseEntity.ok(dto); + } + + @RequestMapping(value = "/hello", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity hello() throws URISyntaxException { + return ResponseEntity.ok("Hello World"); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java new file mode 100644 index 000000000..8cb0c2a04 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +@ActiveProfiles("80") +public class SpringDocApp80Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/TestObject.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/TestObject.java new file mode 100644 index 000000000..6cff64ec0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/TestObject.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +import java.time.LocalDateTime; + +public class TestObject { + public String stringValue; + + public LocalDateTime localDateTime; + + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + public LocalDateTime getLocalDateTime() { + return localDateTime; + } + + public void setLocalDateTime(LocalDateTime localDateTime) { + this.localDateTime = localDateTime; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/HelloController.java new file mode 100644 index 000000000..91d36af6e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/HelloController.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app81; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class HelloController { + + @RequestMapping + public String test() { + return "ok"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java new file mode 100644 index 000000000..6d6e86d0f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app81; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.startsWith; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp81Test extends AbstractSpringDocV31Test { + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.paths./api.get.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.get.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.get.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.post.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.post.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.post.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.put.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.put.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.put.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.patch.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.patch.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.patch.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.delete.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.delete.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.delete.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.options.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.options.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.options.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.head.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.head.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.head.responses.200.content.['*/*'].schema.type", is("string"))); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/HelloController.java new file mode 100644 index 000000000..be37dc924 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @PutMapping(value = "/test") + public ResponseEntity put( + String configuration, + String second, PersonDTO personDTO) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/PersonDTO.java new file mode 100644 index 000000000..4a5c1a872 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/PersonDTO.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java new file mode 100644 index 000000000..f37ee6793 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp82Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/HelloController.java new file mode 100644 index 000000000..7ea6da218 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/HelloController.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.SchemaProperty; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +public class HelloController { + + + @RequestMapping(value = "/{config}", + method = RequestMethod.PUT, + consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }, + produces = { MediaType.APPLICATION_JSON_VALUE } + ) + public ResponseEntity put( + @PathVariable("config") final String config, + @Parameter(name = "configuration", schema = @Schema(name = "configuration", type = "string", format = "binary")) @RequestPart(value = "configuration") final PersonDTO configuration, + @RequestPart(value = "file") final MultipartFile aFile) { + return null; + } + + @RequestMapping(value = "/test", + method = RequestMethod.PUT, + consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }, + produces = { MediaType.APPLICATION_JSON_VALUE } + ) + @RequestBody(content = @Content(schema = @Schema(requiredProperties = "file", type = "object") + , schemaProperties = @SchemaProperty(name = "file", schema = @Schema(type = "string", format = "binary")) + )) + public ResponseEntity put2() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/PersonDTO.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/PersonDTO.java new file mode 100644 index 000000000..885cb2d26 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/PersonDTO.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java new file mode 100644 index 000000000..1092d262c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp83Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/HelloController.java new file mode 100644 index 000000000..1ad167410 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/HelloController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app84; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + @GetMapping("/persons1") + public String persons(String toto) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java new file mode 100644 index 000000000..378619bc3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app84; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp84Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/HelloController.java new file mode 100644 index 000000000..30f4994f0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class HelloController { + + @PostMapping("/test/{id}") + @Operation( + parameters = { + @Parameter(ref = "#/components/parameters/paramA"), + @Parameter(ref = "#/components/parameters/paramB") + } + ) + public void testme(@PathVariable("id") String id) { + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java new file mode 100644 index 000000000..5fea0fe0c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp85Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/HelloController.java new file mode 100644 index 000000000..77a7c4498 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java new file mode 100644 index 000000000..7d959e496 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "springdoc.packagesToScan=test.org.springdoc.api.v31.app86", + "springdoc.packagesToExclude=test.org.springdoc.api.v31.app86.test" }) +public class SpringDocApp86Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/test/HelloController2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/test/HelloController2.java new file mode 100644 index 000000000..18f3c2ffe --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/test/HelloController2.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86.test; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController2 { + + @GetMapping("/test2") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/HelloController.java new file mode 100644 index 000000000..4383f598a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/HelloController.java @@ -0,0 +1,96 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app87; + +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + + +@RestController("cookie") +public class HelloController { + + @PutMapping("/{itemId}") + @Operation + public ResponseEntity putItem( + @CookieValue( + name = "cookie" + ) String cookie, + @PathVariable UUID itemId, + @RequestBody Item item + ) { + return ResponseEntity.ok(item); + } + + /** + * List tracker data. + * + * @return the tracker data + */ + @GetMapping(value = "/values/data") + void list(@RequestHeader(value = "access_token", required = false) + @Parameter(name = "access_token", in = ParameterIn.HEADER, description = "token in header", schema = @Schema(implementation = String.class)) + String tokenInHeader, @CookieValue(value = "access_token", required = false) + @Parameter(name = "access_token", in = ParameterIn.COOKIE, description = "token in cookie", schema = @Schema(implementation = String.class)) + String tokenInCookie) { + + } + + @GetMapping("/duplicate_param") + @Operation(summary = "Duplicate param") + @Parameter(name = "sample", required = true, in = ParameterIn.HEADER, description = "sample Header") + @Parameter(name = "sample", required = true, in = ParameterIn.QUERY, description = "sample query") + public String duplicateParam(@RequestParam String sample, @RequestHeader("sample") String sampleHeader) { + return "duplicateParam"; + } + + @GetMapping("/duplicate_param2") + @Operation(summary = "Duplicate param") + @Parameter(name = "sample", required = true, description = "sample") + public String duplicateParam2(@RequestParam String sample) { + return "duplicateParam"; + } + + @GetMapping("/duplicate_param3") + @Operation(summary = "Duplicate param") + @Parameter(name = "sample", required = true, description = "sample") + public String duplicateParam3(@RequestHeader String sample) { + return "duplicateParam"; + } + + public static class Item { + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java new file mode 100644 index 000000000..305875fab --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app87; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp87Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/HelloController.java new file mode 100644 index 000000000..69c8d069c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/HelloController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app88; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/persons") + public String persons() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java new file mode 100644 index 000000000..b6e44b556 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app88; + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.auto-tag-classes=false") +public class SpringDocApp88Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/HelloController.java new file mode 100644 index 000000000..04c79a068 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/HelloController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2024 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app89; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +@RestController +public class HelloController { + + @Operation(summary = "Get Status") + @GetMapping(value = "/status", produces = MediaType.TEXT_HTML_VALUE) + public ModelAndView getAddress(String id) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java new file mode 100644 index 000000000..c89cfb36e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app89; + + +import io.swagger.v3.oas.models.media.ObjectSchema; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.servlet.ModelAndView; + +import static org.springdoc.core.utils.SpringDocUtils.getConfig; + +@TestPropertySource(properties = "springdoc.model-and-view-allowed=true") +public class SpringDocApp89Test extends AbstractSpringDocV31Test { + + static { + getConfig().replaceWithSchema(ModelAndView.class, new ObjectSchema()); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/HelloController.java new file mode 100644 index 000000000..91f7d5ccc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/HelloController.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test") + @ApiResponses(value = { @ApiResponse(description = "successful operation", content = { @Content(examples = @ExampleObject(name = "500", ref = "#/components/examples/http500Example"), mediaType = "application/json", schema = @Schema(implementation = User.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)) }) }) + public void test1(String hello) { + } + + @PostMapping("/test2") + @RequestBody( + description = "Details of the Item to be created", + required = true, + content = @Content( + schema = @Schema(implementation = User.class), + mediaType = MediaType.APPLICATION_JSON_VALUE, + examples = { + @ExampleObject( + name = "An example request with the minimum required fields to create.", + value = "min", + summary = "Minimal request"), + @ExampleObject( + name = "An example request with all fields provided with example values.", + value = "full", + summary = "Full request") })) + public void test2(String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java new file mode 100644 index 000000000..4cd61de46 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +public class SpringDocApp90Test extends AbstractSpringDocV31Test { + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocTestApp.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocTestApp.java new file mode 100644 index 000000000..b98641328 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocTestApp.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.util.AbstractMap; +import java.util.Collection; +import java.util.Map.Entry; + +import io.swagger.v3.oas.models.examples.Example; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.core.io.Resource; +import org.springframework.util.FileCopyUtils; + +@SpringBootApplication +class SpringDocTestApp { + + @Value("classpath:/500-90.txt") + private Resource http500ExampleResource; + + public static String asString(Resource resource) { + try (Reader reader = new InputStreamReader(resource.getInputStream())) { + return FileCopyUtils.copyToString(reader); + } + catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + @Bean + public OpenApiCustomizer openApiCustomizer(Collection> examples) { + return openAPI -> { + examples.forEach(example -> { + openAPI.getComponents().addExamples(example.getKey(), example.getValue()); + }); + }; + } + + @Bean + public Entry http500Example() { + Example http500Example = new Example(); + Entry entry = new AbstractMap.SimpleEntry("http500Example", http500Example); + http500Example.setSummary("HTTP 500 JSON Body response example"); + http500Example.setDescription( + "An example of HTTP response in case an error occurs on server side. instance attribute reference a traceId to ease server side analysis."); + http500Example.setValue(asString(http500ExampleResource)); + return entry; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/User.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/User.java new file mode 100644 index 000000000..7b444795a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/User.java @@ -0,0 +1,317 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * User + */ + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-11-30T09:49:26.034469-01:00[Atlantic/Azores]") + + +public class User { + + @JsonProperty("id") + + private Long id; + + + @JsonProperty("username") + + private String username; + + + @JsonProperty("firstName") + + private String firstName; + + + @JsonProperty("lastName") + + private String lastName; + + + @JsonProperty("email") + + private String email; + + + @JsonProperty("password") + + private String password; + + + @JsonProperty("phone") + + private String phone; + + + @JsonProperty("userStatus") + + private Integer userStatus; + + + public User id(Long id) { + this.id = id; + return this; + } + + + /** + * Get id + * + * @return id + */ + @Schema(example = "10", description = "") + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + public User username(String username) { + this.username = username; + return this; + } + + + /** + * Get username + * + * @return username + */ + @Schema(example = "theUser", description = "") + + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + /** + * Get firstName + * + * @return firstName + */ + @Schema(example = "John", description = "") + + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + + /** + * Get lastName + * + * @return lastName + */ + @Schema(example = "James", description = "") + + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public User email(String email) { + this.email = email; + return this; + } + + + /** + * Get email + * + * @return email + */ + @Schema(example = "john@email.com", description = "") + + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public User password(String password) { + this.password = password; + return this; + } + + + /** + * Get password + * + * @return password + */ + @Schema(example = "12345", description = "") + + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + + public User phone(String phone) { + this.phone = phone; + return this; + } + + + /** + * Get phone + * + * @return phone + */ + @Schema(example = "12345", description = "") + + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + /** + * User Status + * + * @return userStatus + */ + @Schema(example = "1", description = "User Status") + + + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/Advice.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/Advice.java new file mode 100644 index 000000000..a0d3dbfe3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/Advice.java @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.servlet.http.HttpServletRequest; + +import org.springframework.beans.TypeMismatchException; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class Advice { + + @ExceptionHandler(TypeMismatchException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ApiResponse( + responseCode = "400", + description = "Bad Request", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ApiError.class), + examples = { + @ExampleObject( + name = "Service-400", + summary = "400 from the service directly", + value = + "{\"status\": 400," + + "\"errorCode\": \"ERROR_001\"," + + "\"message\": \"An example message...\"" + + "}") + })) + public ResponseEntity badRequest(HttpServletRequest req, Exception exception) { + ApiError erroObj = new ApiError(400, "A code", "A message"); + return new ResponseEntity<>(erroObj, HttpStatus.BAD_REQUEST); + } + + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ApiResponse( + responseCode = "500", + description = "Internal Server Error", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ApiError.class), + examples = { + @ExampleObject( + name = "Service-500", + summary = "500 from the service directly", + value = + "{\"status\": 500," + + "\"errorCode\": \"ERROR_002\"," + + "\"message\": \"Another example message...\"" + + "}") + })) + public ResponseEntity internalServerError(HttpServletRequest req, Exception exception) { + ApiError erroObj = new ApiError(500, "A different code", "A different message"); + return new ResponseEntity<>(erroObj, HttpStatus.INTERNAL_SERVER_ERROR); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/ApiError.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/ApiError.java new file mode 100644 index 000000000..b836f0dc7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/ApiError.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema( + type = "object", + name = "ApiError", + title = "ApiError", + description = "A consistent response object for sending errors over the wire.") +public class ApiError { + + @Schema(name = "status", description = "The Http Status value", type = "int", nullable = true) + @JsonProperty("status") + private int status; + + @Schema( + name = "errorCode", + description = "An Error Code which can help with identifying issues.", + type = "string", + nullable = true) + @JsonProperty("errorCode") + private String errorCode; + + @Schema(name = "message", description = "The Error Message.", type = "string", nullable = false) + @JsonProperty("message") + private String message; + + public ApiError(int status, String errorCode, String message) { + this.status = status; + this.errorCode = errorCode; + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/Greeting.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/Greeting.java new file mode 100644 index 000000000..7bf31bbc5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/Greeting.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema( + type = "object", + name = "Greeting", + title = "Greeting", + description = "An object containing a greeting message") +public class Greeting { + + + @Schema( + name = "payload", + description = "The greeting value", + type = "string", + nullable = false, + example = "sdfsdfs") + @JsonProperty("payload") + private String payload; + + public Greeting(String payload) { + this.payload = payload; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/GreetingController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/GreetingController.java new file mode 100644 index 000000000..01ae2cd94 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/GreetingController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.apache.commons.lang3.RandomStringUtils; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; + +@RestController +@Tag(name = "Demo", description = "The Demo API") +public class GreetingController { + + @GetMapping(produces = APPLICATION_JSON_VALUE) + @Operation(summary = "This API will return a random greeting.") + public ResponseEntity sayHello() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + + @GetMapping("/test") + @ApiResponses(value = { @ApiResponse(responseCode = "201", description = "item created"), + @ApiResponse(responseCode = "400", description = "invalid input, object invalid"), + @ApiResponse(responseCode = "409", description = "an existing item already exists") }) + public ResponseEntity sayHello2() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java new file mode 100644 index 000000000..bba9b1674 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.override-with-generic-response=false") +public class SpringDocApp91Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/HelloController.java new file mode 100644 index 000000000..60c5cd2f0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app92; + +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/test") +public class HelloController { + + @GetMapping + String index(@NotNull String test) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/ParameterCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/ParameterCustomizer.java new file mode 100644 index 000000000..b308744e9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/ParameterCustomizer.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app92; + +import io.swagger.v3.oas.models.parameters.Parameter; +import jakarta.validation.constraints.NotNull; + +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; + +@Component +public class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { + @Override + public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { + NotNull annotation = methodParameter.getParameterAnnotation(NotNull.class); + if (annotation != null) { + parameterModel.required(false); + } + return parameterModel; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java new file mode 100644 index 000000000..bf2c4fa88 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app92; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp92Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/BaseClientModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/BaseClientModel.java new file mode 100644 index 000000000..7cd33b188 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/BaseClientModel.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public abstract class BaseClientModel { + @JsonProperty("id") + int id; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/BaseController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/BaseController.java new file mode 100644 index 000000000..988d8cf9d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/BaseController.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; + +public abstract class BaseController { + @Operation + @GetMapping + TClientModel get(TClientModel param) { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpecificClientModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpecificClientModel.java new file mode 100644 index 000000000..4ab100f3c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpecificClientModel.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class SpecificClientModel extends BaseClientModel { + @JsonProperty("name") + String name; +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpecificController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpecificController.java new file mode 100644 index 000000000..70162533e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpecificController.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class SpecificController extends BaseController {} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java new file mode 100644 index 000000000..135a61f4e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp93Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java new file mode 100644 index 000000000..01677475b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java @@ -0,0 +1,125 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app94; + +import java.util.Collections; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.apache.commons.lang3.RandomStringUtils; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.SpringDocCustomizers; +import org.springdoc.core.properties.SpringDocConfigProperties; +import org.springdoc.core.providers.SpringDocProviders; +import org.springdoc.core.service.AbstractRequestService; +import org.springdoc.core.service.GenericResponseService; +import org.springdoc.core.service.OpenAPIService; +import org.springdoc.core.service.OperationService; +import org.springdoc.webmvc.api.OpenApiWebMvcResource; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.app91.Greeting; + +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.ObjectFactory; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import static org.springdoc.core.utils.Constants.DEFAULT_GROUP_NAME; +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; + +@TestPropertySource(properties = "springdoc.default-produces-media-type=application/json") +public class SpringDocApp94Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp implements ApplicationContextAware { + + private ApplicationContext applicationContext; + + @Bean + public GreetingController greetingController() { + return new GreetingController(); + } + + @Bean + public OpenApiBuilderCustomizer customOpenAPI() { + return openApiBuilder -> openApiBuilder.addMappings(Collections.singletonMap("greetingController", new GreetingController())); + } + + @Bean + public RequestMappingHandlerMapping defaultTestHandlerMapping(GreetingController greetingController) throws NoSuchMethodException { + RequestMappingHandlerMapping result = new RequestMappingHandlerMapping(); + RequestMappingInfo requestMappingInfo = + RequestMappingInfo.paths("/test").methods(RequestMethod.GET).produces(MediaType.APPLICATION_JSON_VALUE).build(); + + result.setApplicationContext(this.applicationContext); + result.registerMapping(requestMappingInfo, "greetingController", GreetingController.class.getDeclaredMethod("sayHello2")); + return result; + } + + @Bean(name = "openApiResource") + public OpenApiWebMvcResource openApiResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, + OperationService operationParser,SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers) { + return new OpenApiWebMvcResource(DEFAULT_GROUP_NAME, openAPIBuilderObjectFactory, requestBuilder, responseBuilder, operationParser, + springDocConfigProperties, springDocProviders,springDocCustomizers); + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } + } + + @ResponseBody + @Tag(name = "Demo", description = "The Demo API") + public static class GreetingController { + + @GetMapping(produces = APPLICATION_JSON_VALUE) + @Operation(summary = "This API will return a random greeting.") + public ResponseEntity sayHello() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + + @GetMapping("/test") + @ApiResponses(value = { @ApiResponse(responseCode = "201", description = "item created"), + @ApiResponse(responseCode = "400", description = "invalid input, object invalid"), + @ApiResponse(responseCode = "409", description = "an existing item already exists") }) + public ResponseEntity sayHello2() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/HelloController.java new file mode 100644 index 000000000..73a8830ed --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/HelloController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app95; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/persons") +public class HelloController { + + @GetMapping + @Operation(summary = "${test.app95.operation.persons.summary}", + description = "${test.app95.operation.persons.description}") + public void persons(@Parameter(description = "${test.app95.param.name.description}") String name) { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java new file mode 100644 index 000000000..542c13970 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app95; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +@ActiveProfiles("95") +public class SpringDocApp95Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/HelloController.java new file mode 100644 index 000000000..28edd0676 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app96; + +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @PostMapping("/api1") + String test1(@RequestBody @Min(2) int test) { + return null; + } + + @PostMapping("/api2") + String test2(@RequestBody String test) { + return null; + } + + @PostMapping("/api3") + String test3(@NotNull String test) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java new file mode 100644 index 000000000..920025d73 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app96; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp96Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/HelloController.java new file mode 100644 index 000000000..f2843de51 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class HelloController { + + @GetMapping(value = "/student/header1", headers = "X-API-VERSION=1") + public StudentV1 headerV1() { + return new StudentV1("Bob Charlie"); + } + + @GetMapping(value = "/student/header2", headers = "X-API-VERSION=2") + public StudentV2 headerV2() { + return new StudentV2("Charlie"); + } + + @GetMapping(value = "/student/header3", headers = "X-API-VERSION") + public StudentV3 headerV3() { + return new StudentV3("Tom Charlie"); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java new file mode 100644 index 000000000..5b697407e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp97Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV1.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV1.java new file mode 100644 index 000000000..918722d23 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV1.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class StudentV1 { + + @JsonProperty("name") + private String name; + + public StudentV1(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV2.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV2.java new file mode 100644 index 000000000..af14d2e91 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV2.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class StudentV2 { + + @JsonProperty("name") + private String name; + + public StudentV2(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV3.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV3.java new file mode 100644 index 000000000..c5baea920 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/StudentV3.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class StudentV3 { + + @JsonProperty("name") + private String name; + + public StudentV3(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/HelloController.java new file mode 100644 index 000000000..3cc58cb1b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/HelloController.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app98; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public void persons(@IgnoredAnnotationParameter String name) { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/IgnoredAnnotationParameter.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/IgnoredAnnotationParameter.java new file mode 100644 index 000000000..db7916956 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/IgnoredAnnotationParameter.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app98; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface IgnoredAnnotationParameter { + String addition() default "customized parameter!"; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java new file mode 100644 index 000000000..c01a3567b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app98; + + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp98Test extends AbstractSpringDocV31Test { + + static { + SpringDocUtils.getConfig().addAnnotationsToIgnore(IgnoredAnnotationParameter.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/HelloController.java new file mode 100644 index 000000000..b25fc0550 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app99; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/persons") +public class HelloController { + + @GetMapping + @ApiResponses({ + @ApiResponse(responseCode = "202", description = "${test.app99.operation.persons.response.202.description}") + }) + public void persons() { + + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java new file mode 100644 index 000000000..0fb89eb58 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app99; + + +import test.org.springdoc.api.v31.AbstractSpringDocV31Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +@ActiveProfiles("99") +public class SpringDocApp99Test extends AbstractSpringDocV31Test { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app100.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app100.json new file mode 100644 index 000000000..ad9497ddd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app100.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-ap1", + "hello-ap2" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "toto", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app101.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app101.json new file mode 100644 index 000000000..eea1fe64e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app101.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello":{"get":{"tags":["hello-controller"],"operationId":"hello","responses":{"default":{"description":"default response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/HelloDTO","description":"${test.app101.operation.hello.response.schema.description}"}}}}}}}},"components":{"schemas":{"HelloDTO":{"type":"object","description":"Description of schema of hello entity","properties":{"id":{"type":"string","description":"Description of schema of param id for api hello"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app102.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app102.json new file mode 100644 index 000000000..35eeb5ea9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app102.json @@ -0,0 +1,135 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "test-controller" + ], + "operationId": "getTest", + "parameters": [ + { + "name": "param", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "childParam", + "in": "query", + "description": "parameter from child of RequestParams", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam1", + "in": "query", + "required": false, + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam2", + "in": "query", + "description": "string parameter2", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "intParam", + "in": "query", + "description": "int parameter", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "intParam2", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "intParam3", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param1", + "in": "query", + "description": "nested string parameter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param2", + "in": "query", + "description": "nested BigInteger parameter", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "nestedList", + "in": "query", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Nested" + } + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Nested": { + "type": "object", + "properties": { + "param1": { + "type": "string" + }, + "param2": { + "type": "integer" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app103.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app103.json new file mode 100644 index 000000000..2d73bdc48 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app103.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test/103": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "postMyRequestBody", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "body", + "file" + ], + "type": "object", + "properties": { + "body": { + "$ref": "#/components/schemas/ExampleBody" + }, + "file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "body": { + "contentType": "application/json" + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ExampleBody": { + "type": "object", + "properties": { + "stringParam": { + "type": "string" + }, + "intParam": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app104.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app104.json new file mode 100644 index 000000000..a93c0b114 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app104.json @@ -0,0 +1,79 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/design": { + "get": { + "tags": [ + "design" + ], + "description": "Receive a list of objects", + "operationId": "list", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Design" + } + } + } + } + } + } + } + }, + "/design/{id}": { + "get": { + "tags": [ + "design" + ], + "description": "Get single object", + "operationId": "get", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The id to get.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Design" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Design": { + "type": "object" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-1.json new file mode 100644 index 000000000..fcc8b3feb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-1.json @@ -0,0 +1,263 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "store", + "description": "the store API" + } + ], + "paths": { + "/store/order": { + "post": { + "tags": [ + "store" + ], + "summary": "Place an order for a pet", + "operationId": "placeOrder", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid Order", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + } + } + } + }, + "/store/order/{orderId}": { + "get": { + "tags": [ + "store" + ], + "summary": "Find purchase order by ID", + "operationId": "getOrderById", + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of pet that needs to be fetched", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "maximum": 5, + "minimum": 1 + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "404": { + "description": "Order not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + } + } + }, + "delete": { + "tags": [ + "store" + ], + "summary": "Delete purchase order by ID", + "operationId": "deleteOrder", + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of the order that needs to be deleted", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "404": { + "description": "Order not found" + } + } + } + }, + "/store/inventory": { + "get": { + "tags": [ + "store" + ], + "summary": "Returns pet inventories by status", + "description": "Returns a map of status codes to quantities", + "operationId": "getInventory", + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": {} + } + } + } + } + }, + "security": [ + { + "api_key": [] + } + ] + } + } + }, + "components": { + "schemas": { + "Order": { + "type": "object", + "properties": { + "complete": { + "type": "boolean" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "petId": { + "type": "integer", + "format": "int64" + }, + "quantity": { + "type": "integer", + "format": "int32" + }, + "shipDate": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order Status" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-2.json new file mode 100644 index 000000000..e386419da --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-2.json @@ -0,0 +1,418 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "user", + "description": "the user API" + } + ], + "paths": { + "/user/{username}": { + "get": { + "tags": [ + "user" + ], + "summary": "Get user by user name", + "operationId": "getUserByName", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "The name that needs to be fetched. Use user1 for testing.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid username supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "404": { + "description": "User not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + }, + "put": { + "tags": [ + "user" + ], + "summary": "Updated user", + "operationId": "updateUser", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "name that need to be deleted", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Updated user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid user supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "404": { + "description": "User not found" + } + } + }, + "delete": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "operationId": "deleteUser", + "parameters": [ + { + "name": "username", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user": { + "post": { + "tags": [ + "user" + ], + "summary": "Create user", + "operationId": "createUser", + "requestBody": { + "description": "Created user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/createWithList": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "operationId": "createUsersWithListInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/createWithArray": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "operationId": "createUsersWithArrayInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/logout": { + "get": { + "tags": [ + "user" + ], + "summary": "Logs out current logged in user session", + "operationId": "logoutUser", + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/login": { + "get": { + "tags": [ + "user" + ], + "summary": "Logs user into the system", + "operationId": "loginUser", + "parameters": [ + { + "name": "username", + "in": "query", + "description": "The user name for login", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "password", + "in": "query", + "description": "The password for login in clear text", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid username/password supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "username": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + }, + "password": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "userStatus": { + "type": "integer", + "format": "int32", + "description": "User Status" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-3.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-3.json new file mode 100644 index 000000000..12f49ef26 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-3.json @@ -0,0 +1,623 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "pet", + "description": "the pet API" + } + ], + "paths": { + "/pet": { + "put": { + "tags": [ + "pet" + ], + "summary": "Update an existing pet", + "operationId": "updatePet", + "requestBody": { + "description": "Pet object that needs to be added to the store", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "404": { + "description": "Pet not found" + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + }, + "post": { + "tags": [ + "pet" + ], + "summary": "Add a new pet to the store", + "operationId": "addPet", + "requestBody": { + "description": "Pet object that needs to be added to the store", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/{petId}": { + "get": { + "tags": [ + "pet" + ], + "summary": "Find pet by ID", + "description": "Returns a single pet", + "operationId": "getPetById", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to return", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "404": { + "description": "Pet not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "post": { + "tags": [ + "pet" + ], + "summary": "Updates a pet in the store with form data", + "operationId": "updatePetWithForm", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet that needs to be updated", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + }, + "delete": { + "tags": [ + "pet" + ], + "summary": "Deletes a pet", + "operationId": "deletePet", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "Pet id to delete", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "api_key", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "404": { + "description": "Pet not found" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/{petId}/uploadImage": { + "post": { + "tags": [ + "pet" + ], + "summary": "uploads an image", + "operationId": "uploadFile", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to update", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "additionalMetadata", + "in": "query", + "description": "Additional data to pass to server", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "file detail" + } + }, + "required": [ + "file" + ] + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModelApiResponse" + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByTags": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by tags", + "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId": "findPetsByTags", + "parameters": [ + { + "name": "tags", + "in": "query", + "description": "Tags to filter by", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "400": { + "description": "Invalid tag value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByStatus": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by status", + "description": "Multiple status values can be provided with comma separated strings", + "operationId": "findPetsByStatus", + "parameters": [ + { + "name": "status", + "in": "query", + "description": "Status values that need to be considered for filter", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "400": { + "description": "Invalid status value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "name": { + "type": "string", + "example": "doggie" + }, + "photoUrls": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tag" + } + }, + "status": { + "type": "string", + "description": "pet status in the store", + "enum": [ + "available", + "pending", + "sold" + ] + } + }, + "required": [ + "name", + "photoUrls" + ] + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "ModelApiResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json new file mode 100644 index 000000000..71f333acb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "store", + "description": "the store API" + } + ], + "paths": { + "/v1/stores": { + "get": { + "tags": [ + "store" + ], + "operationId": "stores", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app106.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app106.json new file mode 100644 index 000000000..58a416c8c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app106.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "find-articles", + "operationId": "findArticles", + "parameters": [ + { + "name": "If-Modified-Since", + "in": "header", + "description": "DateTime", + "required": false, + "schema": { + "format": "date-time" + }, + "example": "2020-01-01T00:00:00.000Z" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app107.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app107.json new file mode 100644 index 000000000..d13824968 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app107.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/entity-b": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getEntityB", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityB" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/EntityB" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "EntityA": { + "required": [ + "fieldA" + ], + "type": "object", + "properties": { + "fieldA": { + "type": "string" + } + } + }, + "EntityB": { + "required": [ + "entityA", + "fieldB" + ], + "type": "object", + "properties": { + "fieldB": { + "type": "string" + }, + "entityA": { + "$ref": "#/components/schemas/EntityA" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app108.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app108.json new file mode 100644 index 000000000..c6640eaaf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app108.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/":{"post":{"tags":["hello-controller"],"operationId":"update","parameters":[{"name":"toto","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ActionResultVoid"}}}}}}}},"components":{"schemas":{"ActionResultVoid":{"type":"object","properties":{"value":{"type":"object"},"success":{"type":"boolean"},"errorCode":{"type":"string"},"message":{"type":"string"},"errorValue":{},"targetUrl":{"type":"string"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app109.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app109.json new file mode 100644 index 000000000..bcc81417a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app109.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/api/v1/resource":{"get":{"tags":["hello-controller"],"operationId":"getResource","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v1/bytearray":{"get":{"tags":["hello-controller"],"operationId":"getByteArray","responses":{"default":{"description":"default response","content":{"*/*":{"schema":{"format":"binary"}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app11.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app11.json new file mode 100644 index 000000000..95e12663e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app11.json @@ -0,0 +1,95 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/documents": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "uploadDocuments", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "doc" + ], + "type": "object", + "properties": { + "doc": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/tracks": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "postTrack", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "file" + ], + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app110.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app110.json new file mode 100644 index 000000000..afb60ad05 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app110.json @@ -0,0 +1,275 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "sample application API", + "description": "description", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/personByLastName": { + "get": { + "tags": [ + "person-controller" + ], + "operationId": "findByLastName", + "parameters": [ + { + "name": "lastName", + "in": "query", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "415": { + "description": "Unsupported Media Type", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/person": { + "post": { + "tags": [ + "person-controller" + ], + "operationId": "person", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "415": { + "description": "Unsupported Media Type", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/personByLastName2": { + "get": { + "tags": [ + "person-controller-2" + ], + "operationId": "findByLastName_1", + "parameters": [ + { + "name": "lastName", + "in": "query", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/person2": { + "post": { + "tags": [ + "person-controller-2" + ], + "operationId": "person_1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorMessage": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Problem": { + "type": "object", + "properties": { + "logRef": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "Person": { + "required": [ + "lastName" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "maxLength": 2147483647, + "minLength": 2, + "type": "string" + }, + "lastName": { + "maxLength": 10, + "minLength": 0, + "type": "string" + }, + "email": { + "pattern": ".+@.+\\..+", + "type": "string" + }, + "email1": { + "type": "string" + }, + "age": { + "maximum": 30, + "minimum": 18, + "type": "integer", + "format": "int32" + }, + "creditCardNumber": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app111.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app111.json new file mode 100644 index 000000000..1ea58db5d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app111.json @@ -0,0 +1,193 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "sample application API", + "description": "description", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/personByLastName": { + "get": { + "tags": [ + "person-controller" + ], + "operationId": "findByLastName", + "parameters": [ + { + "name": "lastName", + "in": "query", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/person": { + "post": { + "tags": [ + "person-controller" + ], + "operationId": "person", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/personByLastName2": { + "get": { + "tags": [ + "person-controller-2" + ], + "operationId": "findByLastName_1", + "parameters": [ + { + "name": "lastName", + "in": "query", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/person2": { + "post": { + "tags": [ + "person-controller-2" + ], + "operationId": "person_1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "required": [ + "lastName" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "maxLength": 2147483647, + "minLength": 2, + "type": "string" + }, + "lastName": { + "maxLength": 10, + "minLength": 0, + "type": "string" + }, + "email": { + "pattern": ".+@.+\\..+", + "type": "string" + }, + "email1": { + "type": "string" + }, + "age": { + "maximum": 30, + "minimum": 18, + "type": "integer", + "format": "int32" + }, + "creditCardNumber": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app112.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app112.json new file mode 100644 index 000000000..7ac383dcc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app112.json @@ -0,0 +1,275 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "sample application API", + "description": "description", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/personByLastName": { + "get": { + "tags": [ + "person-controller" + ], + "operationId": "findByLastName", + "parameters": [ + { + "name": "lastName", + "in": "query", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/person": { + "post": { + "tags": [ + "person-controller" + ], + "operationId": "person", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/personByLastName2": { + "get": { + "tags": [ + "person-controller-2" + ], + "operationId": "findByLastName_1", + "parameters": [ + { + "name": "lastName", + "in": "query", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "415": { + "description": "Unsupported Media Type", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/person2": { + "post": { + "tags": [ + "person-controller-2" + ], + "operationId": "person_1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "415": { + "description": "Unsupported Media Type", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorMessage": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Problem": { + "type": "object", + "properties": { + "logRef": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "Person": { + "required": [ + "lastName" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "maxLength": 2147483647, + "minLength": 2, + "type": "string" + }, + "lastName": { + "maxLength": 10, + "minLength": 0, + "type": "string" + }, + "email": { + "pattern": ".+@.+\\..+", + "type": "string" + }, + "email1": { + "type": "string" + }, + "age": { + "maximum": 30, + "minimum": 18, + "type": "integer", + "format": "int32" + }, + "creditCardNumber": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app113.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app113.json new file mode 100644 index 000000000..56ca7a64c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app113.json @@ -0,0 +1,71 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/lol": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/lol2": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "test2", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Body": { + "type": "object", + "properties": { + "field": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app114.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app114.json new file mode 100644 index 000000000..abd416fb2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app114.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/foos1": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "getCurrency", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CarDTO" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MonetaryAmount" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CarDTO": { + "type": "object", + "properties": { + "price": { + "$ref": "#/components/schemas/MonetaryAmount" + } + } + }, + "MonetaryAmount": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "example": 99.96 + }, + "currency": { + "type": "string", + "example": "USD" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app115.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app115.json new file mode 100644 index 000000000..79dea40bf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app115.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/v2/timeout": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "timeouts", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app116.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app116.json new file mode 100644 index 000000000..60da78309 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app116.json @@ -0,0 +1,51 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "API Examples", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Operations" + } + ], + "paths": { + "/api/foo": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "create", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app117.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app117.json new file mode 100644 index 000000000..5a8a32632 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app117.json @@ -0,0 +1,144 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/greet/{name}": { + "get": { + "tags": [ + "greetings-rest-controller" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/people": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "all", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "person-service" + ], + "operationId": "save", + "parameters": [ + { + "name": "p", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/people/{id}": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "byId", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app118.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app118.json new file mode 100644 index 000000000..1592778dc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app118.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/class-hierarchy/concrete-parent":{"post":{"tags":["controller"],"operationId":"concreteParent","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ConcreteParent"},{"$ref":"#/components/schemas/ChildOfConcrete1"},{"$ref":"#/components/schemas/ChildOfConcrete2"}]}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}},"/class-hierarchy/abstract-parent":{"post":{"tags":["controller"],"operationId":"abstractParent","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ChildOfAbstract1"},{"$ref":"#/components/schemas/ChildOfAbstract2"}]}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}},"components":{"schemas":{"ChildOfConcrete1":{"allOf":[{"$ref":"#/components/schemas/ConcreteParent"},{"type":"object","properties":{"concreteChild1Param":{"type":"string"}}}]},"ChildOfConcrete2":{"allOf":[{"$ref":"#/components/schemas/ConcreteParent"},{"type":"object","properties":{"concreteChild2Param":{"type":"string"}}}]},"ConcreteParent":{"type":"object","discriminator":{"propertyName":"type"},"properties":{"id":{"type":"integer","format":"int32"},"type":{"type":"string"}},"required":["type"]},"AbstractParent":{"type":"object","discriminator":{"propertyName":"type"},"properties":{"id":{"type":"integer","format":"int32"},"type":{"type":"string"}},"required":["type"]},"ChildOfAbstract1":{"allOf":[{"$ref":"#/components/schemas/AbstractParent"},{"type":"object","properties":{"abstrachChild1Param":{"type":"string"}}}]},"ChildOfAbstract2":{"allOf":[{"$ref":"#/components/schemas/AbstractParent"},{"type":"object","properties":{"abstractChild2Param":{"type":"string"}}}]},"Response":{"type":"object","properties":{"abstractParent":{"oneOf":[{"$ref":"#/components/schemas/ChildOfAbstract1"},{"$ref":"#/components/schemas/ChildOfAbstract2"}]},"concreteParents":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/ConcreteParent"},{"$ref":"#/components/schemas/ChildOfConcrete1"},{"$ref":"#/components/schemas/ChildOfConcrete2"}]}}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app119.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app119.json new file mode 100644 index 000000000..beaf56a5e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app119.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/multi": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Multiple files and JSON payloads as multi part request", + "operationId": "multiFilesInMultiPart", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "params" + ], + "type": "object", + "properties": { + "file1": { + "type": "string", + "description": "This is file1", + "format": "binary" + }, + "file2": { + "type": "string", + "description": "This is file2", + "format": "binary" + }, + "params": { + "$ref": "#/components/schemas/JsonRequest" + } + } + }, + "encoding": { + "params": { + "contentType": "application/json" + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "JsonRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "description": "This is the configuration" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app12.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app12.json new file mode 100644 index 000000000..5c0456f30 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app12.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app120.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app120.json new file mode 100644 index 000000000..3fe7093a3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app120.json @@ -0,0 +1,258 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/testTopLevelParamAnnotationOverrides/{id}": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "operationId": "testTopLevelParamAnnotationOverrides", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testQueryParam": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "operationId": "testQueryParam", + "parameters": [ + { + "name": "accountId", + "in": "query", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": 123456 + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testNoAliasFors/": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "operationId": "testNoAliasFors", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "desc", + "required": true, + "deprecated": true, + "allowEmptyValue": true, + "style": "deepObject", + "explode": true, + "allowReserved": true, + "schema": { + "type": "boolean" + }, + "example": 1234 + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testMetaMetaAnnotation/{accountId}": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "operationId": "testMetaMetaAnnotation", + "parameters": [ + { + "name": "queryAccountId", + "in": "query", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": 123456 + }, + { + "name": "accountId", + "in": "path", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": 123456 + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testAllAttributesAsAlias/": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "operationId": "testAllAttributesAsAlias", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "desc", + "required": true, + "deprecated": true, + "allowEmptyValue": true, + "style": "deepObject", + "explode": true, + "allowReserved": true, + "schema": { + "type": "boolean" + }, + "example": 1234 + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testAliasFor": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "operationId": "testAliasFor", + "parameters": [ + { + "name": "accountId", + "in": "query", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": "OVERRIDDEN EXAMPLE" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/simpleTest/{accountId}": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "operationId": "simpleTest", + "parameters": [ + { + "name": "accountId", + "in": "path", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": 123456 + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app121.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app121.json new file mode 100644 index 000000000..372afd5c5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app121.json @@ -0,0 +1,191 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "test-controller" + ], + "operationId": "getTest", + "parameters": [ + { + "name": "param", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "childParam", + "in": "query", + "description": "parameter from child of RequestParams", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam", + "in": "query", + "description": "string parameter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam1", + "in": "query", + "required": false, + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam2", + "in": "query", + "description": "string parameter2", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "intParam", + "in": "query", + "description": "int parameter", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "intParam2", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "intParam3", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param1", + "in": "query", + "description": "nested string parameter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param2", + "in": "query", + "description": "nested BigInteger parameter", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "nestedList", + "in": "query", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Nested" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/InheritedRequestParams" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Nested": { + "type": "object", + "properties": { + "param1": { + "type": "string" + }, + "param2": { + "type": "integer" + } + } + }, + "InheritedRequestParams": { + "required": [ + "childParam" + ], + "type": "object", + "properties": { + "stringParam": { + "type": "string" + }, + "stringParam1": { + "type": "string", + "deprecated": true + }, + "stringParam2": { + "type": "string" + }, + "intParam": { + "type": "integer", + "format": "int32" + }, + "intParam2": { + "type": "string" + }, + "intParam3": { + "type": "string" + }, + "nested": { + "$ref": "#/components/schemas/Nested" + }, + "nestedList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Nested" + } + }, + "childParam": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app122.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app122.json new file mode 100644 index 000000000..5a13da0b0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app122.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "example" + ], + "summary": "create", + "operationId": "create", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WrapperCustomerDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CustomerDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "WrapperCustomerDto": { + "type": "object", + "properties": { + "wrapper": { + "type": "string" + } + } + }, + "CustomerDto": { + "type": "object", + "properties": { + "baseStr": { + "type": "string" + }, + "customerName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app123.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app123.json new file mode 100644 index 000000000..e0df022c4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app123.json @@ -0,0 +1,64 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello/{numTelco}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GET Persons", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "Not here" + }, + "502": { + "description": "Bad Gateway", + "content": { + "*/*": { + "schema": {} + } + } + }, + "418": { + "description": "I'm a teapot", + "content": { + "*/*": { + "schema": {} + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app124.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app124.json new file mode 100644 index 000000000..c7b77c0d0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app124.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello/{numTelco}":{"get":{"tags":["hello-controller"],"summary":"GET Persons","operationId":"index","parameters":[{"name":"numTelco","in":"path","required":true,"schema":{"type":"string"}},{"name":"adresse","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not here"},"502":{"description":"Bad Gateway","content":{"*/*":{"schema":{}}}},"418":{"description":"I'm a teapot","content":{"*/*":{"schema":{}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json new file mode 100644 index 000000000..d330aab33 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json @@ -0,0 +1,109 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "getAllCurrencies", + "description": "Get all currencies", + "operationId": "getAllCurrencies", + "responses": { + "401": { + "$ref": "#/components/responses/http401NoToken" + }, + "403": { + "$ref": "#/components/responses/http403" + }, + "200": { + "description": "All currencies returned", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Problem": { + "type": "object", + "properties": { + "instance": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "format": "uri" + }, + "parameters": { + "type": "object", + "additionalProperties": {} + }, + "title": { + "type": "string" + }, + "detail": { + "type": "string" + }, + "status": { + "type": "integer", + "format": "int32" + } + } + } + }, + "responses": { + "http401NoToken": { + "description": "Invalid authentication.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "http401BadToken": { + "description": "Invalid authentication.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "http403": { + "description": "Missing authorities.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app129.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app129.json new file mode 100644 index 000000000..d6e5547d1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app129.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/test": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "update", + "parameters": [ + { + "name": "userId", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "registrationId", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActualReturnedEntity" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/OperationResponseActualReturnedEntity" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ActualReturnedEntity": { + "type": "object", + "properties": { + "result": { + "type": "string" + } + } + }, + "OperationResponseActualReturnedEntity": { + "type": "object", + "properties": { + "operationResult": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app13.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app13.json new file mode 100644 index 000000000..7b4004a13 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app13.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "parameters": [ + { + "name": "dto", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app130.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app130.json new file mode 100644 index 000000000..407bb4f4f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app130.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/values/datakk": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "get", + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/values/data": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "list", + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app131.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app131.json new file mode 100644 index 000000000..4953bbd7e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app131.json @@ -0,0 +1,104 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/organizations": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create the organization", + "description": "Create the organization", + "operationId": "createOrganization", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + }, + "required": true + }, + "responses": { + "409": { + "description": "An organization with the specified ID already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + }, + "500": { + "description": "An error has occurred and the request could not be processed at this time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + }, + "204": { + "description": "The organization was created successfully" + }, + "400": { + "description": "Invalid argument", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Organization": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Universally Unique Identifier (UUID) uniquely identifying the organization", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "The name of the organization" + } + }, + "description": "This is the description being overwritten" + }, + "RestControllerError": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app132.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app132.json new file mode 100644 index 000000000..b2b360a97 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app132.json @@ -0,0 +1,104 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/organizations": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create the organization", + "description": "Create the organization", + "operationId": "createOrganization", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid argument", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + }, + "500": { + "description": "An error has occurred and the request could not be processed at this time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + }, + "204": { + "description": "The organization was created successfully" + }, + "409": { + "description": "An organization with the specified ID already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Organization": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Universally Unique Identifier (UUID) uniquely identifying the organization", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "The name of the organization" + } + }, + "description": "i want to override the description of this object" + }, + "RestControllerError": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app133.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app133.json new file mode 100644 index 000000000..ef679bb99 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app133.json @@ -0,0 +1,108 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getMessageFromHeader3", + "parameters": [ + { + "name": "myHeader", + "in": "header", + "description": "A header", + "required": true, + "schema": {} + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getMessageFromHeader2", + "parameters": [ + { + "name": "myHeader", + "in": "header", + "description": "A header", + "required": true, + "schema": {} + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getMessageFromHeader1", + "parameters": [ + { + "name": "myHeader", + "in": "header", + "description": "A header", + "required": true, + "schema": { + "enum": [ + "foo", + "bar" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-1.json new file mode 100644 index 000000000..b905be535 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-1.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{id}": { + "get": { + "tags": [ + "The sample resource" + ], + "description": "Get the sample by its id.", + "operationId": "getSampleV1", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The sample's id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.samples.v1+json": { + "schema": { + "$ref": "#/components/schemas/SampleV1" + } + } + } + } + }, + "deprecated": true + } + } + }, + "components": { + "schemas": { + "SampleV1": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-2.json new file mode 100644 index 000000000..a10c50674 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-2.json @@ -0,0 +1,132 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "post": { + "tags": [ + "The sample resource" + ], + "description": "Searches for sample objects using the given search request.", + "operationId": "searchSamples", + "requestBody": { + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "$ref": "#/components/schemas/SampleSearchRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SampleV2" + } + } + } + } + } + } + } + }, + "/{id}": { + "get": { + "tags": [ + "The sample resource" + ], + "description": "Get the sample by its id. This represents V2.", + "operationId": "getSampleV2", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The sample's id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "Accept-version", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "v2" + ] + } + }, + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "$ref": "#/components/schemas/SampleV1" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SampleSearchRequest": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "SampleV2": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "SampleV1": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-3.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-3.json new file mode 100644 index 000000000..b905be535 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-3.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{id}": { + "get": { + "tags": [ + "The sample resource" + ], + "description": "Get the sample by its id.", + "operationId": "getSampleV1", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The sample's id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.samples.v1+json": { + "schema": { + "$ref": "#/components/schemas/SampleV1" + } + } + } + } + }, + "deprecated": true + } + } + }, + "components": { + "schemas": { + "SampleV1": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-4.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-4.json new file mode 100644 index 000000000..62365fc09 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-4.json @@ -0,0 +1,80 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{id}": { + "get": { + "tags": [ + "The sample resource" + ], + "description": "Get the sample by its id. This represents V2.", + "operationId": "getSampleV2", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The sample's id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "Accept-version", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "v2" + ] + } + }, + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "$ref": "#/components/schemas/SampleV1" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SampleV1": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-5.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-5.json new file mode 100644 index 000000000..8dbf4c332 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app134-5.json @@ -0,0 +1,71 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "post": { + "tags": [ + "The sample resource" + ], + "description": "Searches for sample objects using the given search request.", + "operationId": "searchSamples", + "requestBody": { + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "$ref": "#/components/schemas/SampleSearchRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SampleV2" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SampleSearchRequest": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "SampleV2": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app135.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app135.json new file mode 100644 index 000000000..91207c47f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app135.json @@ -0,0 +1,393 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_1", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_1", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_2", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_2", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_3", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_3", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_4", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_4", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app136.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app136.json new file mode 100644 index 000000000..56b29f1ca --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app136.json @@ -0,0 +1,127 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test_3": { + "get": { + "tags": [ + "operation-id-controller" + ], + "operationId": "opIdTest", + "parameters": [ + { + "name": "param", + "in": "query", + "required": true, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test_2": { + "get": { + "tags": [ + "operation-id-controller" + ], + "operationId": "opIdTest_1", + "parameters": [ + { + "name": "param", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test_1": { + "get": { + "tags": [ + "operation-id-controller" + ], + "operationId": "opIdTest_2", + "parameters": [ + { + "name": "param", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test_0": { + "get": { + "tags": [ + "operation-id-controller" + ], + "operationId": "opIdTest_3", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app137.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app137.json new file mode 100644 index 000000000..6a4a4ec0f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app137.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "My App", + "description": "Some long and useful description", + "version": "v1" + }, + "servers": [ + { + "url": "http://test.toto.com", + "description": "toto desc" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "hello", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "security_auth": [] + } + ] + } + } + }, + "components": { + "securitySchemes": { + "security_auth": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "http://authorization.url", + "tokenUrl": "http://token.url", + "scopes": {} + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app138.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app138.json new file mode 100644 index 000000000..29733ee9b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app138.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/testA":{"get":{"operationId":"testA","parameters":[{"in":"query","name":"hello","required":true,"schema":{"type":["string"],"example":null}}],"responses":{"200":{"description":"OK"}},"tags":["hello-controller"]}},"/testB":{"get":{"operationId":"testB","parameters":[{"in":"query","name":"hello","required":true,"schema":{"type":["string"],"example":null}}],"responses":{"200":{"description":"OK"}},"tags":["hello-controller"]}}},"components":{},"x-my-vendor-extensions":{"property1":"value1","property2":null}} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app139.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app139.json new file mode 100644 index 000000000..72b1c7d6e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app139.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "echo2", + "parameters": [ + { + "name": "text", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "default-text" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "echo1", + "parameters": [ + { + "name": "text", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "default-text" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app14.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app14.json new file mode 100644 index 000000000..e2bb2165d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app14.json @@ -0,0 +1,66 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website!", + "description": "This is a test message" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Change the language", + "Hello! Welcome to our website!" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app140.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app140.json new file mode 100644 index 000000000..5a8a32632 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app140.json @@ -0,0 +1,144 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/greet/{name}": { + "get": { + "tags": [ + "greetings-rest-controller" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/people": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "all", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "person-service" + ], + "operationId": "save", + "parameters": [ + { + "name": "p", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/people/{id}": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "byId", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app141.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app141.json new file mode 100644 index 000000000..be568423a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app141.json @@ -0,0 +1,393 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_1", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_1", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_2", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_2", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_3", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_3", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_4", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_4", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app142.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app142.json new file mode 100644 index 000000000..5a8a32632 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app142.json @@ -0,0 +1,144 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/greet/{name}": { + "get": { + "tags": [ + "greetings-rest-controller" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/people": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "all", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "person-service" + ], + "operationId": "save", + "parameters": [ + { + "name": "p", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/people/{id}": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "byId", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app143.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app143.json new file mode 100644 index 000000000..317ac46a4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app143.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"tags":[{"name":"Actuator","description":"Monitor and interact","externalDocs":{"description":"Spring Boot Actuator Web API Documentation","url":"https://docs.spring.io/spring-boot/docs/current/actuator-api/html/"}}],"paths":{"/actuator":{"get":{"tags":["Actuator"],"summary":"Actuator root web endpoint","operationId":"links","responses":{"200":{"description":"OK","content":{"application/vnd.spring-boot.actuator.v3+json":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Link"}}}},"application/vnd.spring-boot.actuator.v2+json":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Link"}}}},"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Link"}}}}}}}}},"/actuator/health":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'health'","operationId":"health","responses":{"200":{"description":"OK","content":{"application/vnd.spring-boot.actuator.v3+json":{"schema":{}},"application/vnd.spring-boot.actuator.v2+json":{"schema":{}},"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Link":{"type":"object","properties":{"href":{"type":"string"},"templated":{"type":"boolean"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app149.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app149.json new file mode 100644 index 000000000..2dc12efb7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app149.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloMessage" + } + } + } + } + } + } + }, + "/message": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "message", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloMessage" + } + } + } + } + } + } + }, + "/helloModelAndView": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "helloModelAndView", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloMessage" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloMessage": { + "type": "object", + "properties": { + "number": { + "type": "integer", + "format": "int32" + }, + "text": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app15.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app15.json new file mode 100644 index 000000000..df4de8e17 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app15.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "My title", + "description": "My description", + "termsOfService": "My terms", + "contact": { + "name": "My contact name", + "url": "My contact url", + "email": "My contact email" + }, + "license": { + "name": "My license name", + "url": "My license url" + }, + "version": "My version" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "My Desc", + "operationId": "persons", + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app150.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app150.json new file mode 100644 index 000000000..f6cba6c41 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app150.json @@ -0,0 +1,118 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test4": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test4", + "parameters": [ + { + "name": "localDate", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date" + } + } + ], + "responses": { + "204": { + "description": "No content" + } + } + } + }, + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test3", + "parameters": [ + { + "name": "toto", + "in": "query", + "required": false, + "schema": { + "type": "array", + "default": [ + "users", + "123" + ], + "items": { + "type": "string" + } + } + } + ], + "responses": { + "204": { + "description": "No content" + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test1", + "parameters": [ + { + "name": "toto", + "in": "query", + "required": true, + "schema": { + "default": false + } + } + ], + "responses": { + "204": { + "description": "No content" + } + } + } + }, + "/test/": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "toto", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app151.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app151.json new file mode 100644 index 000000000..76c68458d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app151.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app152.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app152.json new file mode 100644 index 000000000..e9b64d965 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app152.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "helloWorld", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} + \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app153.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app153.json new file mode 100644 index 000000000..f2b2c06ae --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app153.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/orders":{"get":{"tags":["test-controller"],"operationId":"method","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"finished","enum":["finished","new"]}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app154.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app154.json new file mode 100644 index 000000000..bc0505787 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app154.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"toto","version":"1.0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"security":[{"basicAuth":[]},{"bearerToken":[]}],"paths":{"/personsone":{"post":{"tags":["hello-controller"],"operationId":"createone","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/persons":{"post":{"tags":["hello-controller"],"operationId":"create","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/createtwo":{"post":{"tags":["hello-controller"],"operationId":"createtwo","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK"}}}},"/createthree":{"post":{"tags":["hello-controller"],"operationId":"createthree","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK"}}}},"/":{"get":{"tags":["hello-controller"],"operationId":"hello","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}}},"components":{"securitySchemes":{"bearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"basicAuth":{"type":"http","scheme":"basic"}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app155.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app155.json new file mode 100644 index 000000000..50d513314 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app155.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "sayHello", + "parameters": [ + { + "name": "primitiveConcreteField", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "primitiveBaseField", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "genericField", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "sayHello_1", + "parameters": [ + { + "name": "primitiveConcreteField", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "primitiveBaseField", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "genericField", + "in": "query", + "required": false, + "schema": { + "enum": [ + "ONE", + "TWO" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app156.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app156.json new file mode 100644 index 000000000..71cfa6b19 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app156.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "parameters": [ + { + "name": "someEnums", + "in": "query", + "description": "SomeEum decs", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "FIRST", + "SECOND" + ] + } + } + }, + { + "name": "textSet", + "in": "query", + "description": "First decs", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "someText", + "in": "query", + "description": "Second decs", + "schema": {} + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app157.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app157.json new file mode 100644 index 000000000..2df4c0fd2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app157.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/foo": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getFoo", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Foo" + } + } + } + } + } + } + }, + "/bar": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getBar", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Bar" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Foo": { + "type": "object", + "properties": { + "child": { + "type": "string" + } + }, + "required": [ + "stringy" + ] + }, + "Bar": { + "type": "object", + "properties": { + "child": {} + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app158.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app158.json new file mode 100644 index 000000000..cf4bea57e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app158.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "API Examples", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Operations" + } + ], + "paths": { + "/api/foo": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorDTO" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SimpleDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorDTO": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "SimpleDTO": { + "type": "object", + "properties": { + "payload": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app159.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app159.json new file mode 100644 index 000000000..a8308c78c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app159.json @@ -0,0 +1,95 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "API Examples", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Operations" + } + ], + "paths": { + "/api/foo": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "create", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/FooBean_View1" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/FooBean_View2" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "FooBean_View1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + } + } + }, + "FooBean_View2": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app160-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app160-1.json new file mode 100644 index 000000000..148c6c72a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app160-1.json @@ -0,0 +1,57 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "doSomethingInteresting", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorResponse": { + "required": [ + "errorCode" + ], + "type": "object", + "properties": { + "errorMessage": { + "type": "string", + "description": "tata" + }, + "errorCode": { + "type": "integer", + "description": "titi", + "format": "int32" + } + }, + "description": "toto" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app160.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app160.json new file mode 100644 index 000000000..148c6c72a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app160.json @@ -0,0 +1,57 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "doSomethingInteresting", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorResponse": { + "required": [ + "errorCode" + ], + "type": "object", + "properties": { + "errorMessage": { + "type": "string", + "description": "tata" + }, + "errorCode": { + "type": "integer", + "description": "titi", + "format": "int32" + } + }, + "description": "toto" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app161.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app161.json new file mode 100644 index 000000000..03a6f0263 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app161.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/add": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "add", + "operationId": "add", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "content" + ], + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "content" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/add2": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "add2", + "operationId": "add2", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "content", + "type" + ], + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "content" + }, + "type": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "This is a test message", + "operationId": "test", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "intValue", + "strValue" + ], + "type": "object", + "properties": { + "strValue": { + "type": "string" + }, + "intValue": { + "type": "integer", + "format": "int32" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app162.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app162.json new file mode 100644 index 000000000..38f787e69 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app162.json @@ -0,0 +1,14 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v1" + }, + "servers": [ + { + "url": "" + } + ], + "paths": {}, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app163.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app163.json new file mode 100644 index 000000000..f47635b50 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app163.json @@ -0,0 +1,105 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{id}": { + "put": { + "tags": [ + "commissions-resource" + ], + "summary": "Update a commission", + "description": "updateCommission", + "operationId": "updateCommission", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Commission's id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "A commission to update", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommissionDto" + }, + "examples": { + "requestExample": { + "$ref": "#/components/examples/httpPutCommissionRequestBodyExample" + } + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "Commission updated", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CommissionDto" + }, + "examples": { + "202": { + "$ref": "#/components/examples/httpPutCommissionResponseBodyExample" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CommissionDto": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + }, + "examples": { + "httpPutCommissionRequestBodyExample": { + "summary": "HTTP 202 JSON Body request example for updateCommission operation", + "value": { + "email": "esteban@dugueperoux.com", + "firstName": "Esteban", + "lastName": "DUGUEPEROUX" + } + }, + "httpPutCommissionResponseBodyExample": { + "summary": "HTTP 202 JSON Body response example for updateCommission operation", + "value": { + "email": "esteban@dugueperoux.com", + "firstName": "Esteban", + "lastName": "DUGUEPEROUX" + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app164.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app164.json new file mode 100644 index 000000000..e747ff02b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app164.json @@ -0,0 +1,62 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "test-api-controller" + ], + "operationId": "getInvoices", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SampleResponseClass" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SampleResponseClass": { + "type": "object", + "properties": { + "idAsFirstParameter": { + "type": "string" + }, + "nameAsSecondParamater": { + "type": "string" + }, + "lastNameAsThirdParameter": { + "type": "string" + }, + "booleanValueAsFourthParameter": { + "type": "boolean" + }, + "listBlah": { + "type": "array", + "items": { + "description": "${blahDescription.value}" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app165.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app165.json new file mode 100644 index 000000000..bc9d14703 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app165.json @@ -0,0 +1,114 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/sample3": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "I want here another some custom config", + "operationId": "sample3", + "parameters": [ + { + "name": "id", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "/swagger-ui.html" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/sample2": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "I want here another some custom config", + "operationId": "sample2", + "parameters": [ + { + "name": "value", + "in": "query", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/sample1/{springdoc}": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "I want here some custom config", + "operationId": "sample1", + "parameters": [ + { + "name": "springdoc", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app166.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app166.json new file mode 100644 index 000000000..09e475eda --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app166.json @@ -0,0 +1,57 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "test-api-controller" + ], + "operationId": "throwError", + "responses": { + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/LocalErrorResponseDto" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "LocalErrorResponseDto": { + "type": "object", + "properties": { + "localMessage": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app167.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app167.json new file mode 100644 index 000000000..161dedad9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app167.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/sample1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "sample1", + "parameters": [ + { + "name": "mySample", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app168.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app168.json new file mode 100644 index 000000000..d8126e7bb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app168.json @@ -0,0 +1,129 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/class-hierarchy/concrete-parent": { + "post": { + "tags": [ + "controller" + ], + "operationId": "concreteParent", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConcreteParent" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + }, + "/class-hierarchy/abstract-parent": { + "post": { + "tags": [ + "controller" + ], + "operationId": "abstractParent", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AbstractParent" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ConcreteParent": { + "type": "object", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + "AbstractParent": { + "type": "object", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + "Response": { + "type": "object", + "properties": { + "abstractParent": { + "$ref": "#/components/schemas/AbstractParent" + }, + "concreteParents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConcreteParent" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app169.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app169.json new file mode 100644 index 000000000..98e9f4d40 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app169.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/echo": { + "post": { + "tags": [ + "test-controller" + ], + "operationId": "echo", + "parameters": [ + { + "name": "content", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app17.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app17.json new file mode 100644 index 000000000..a47631a23 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app17.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "maxLength": 6, + "minLength": 4, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app170.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app170.json new file mode 100644 index 000000000..22a7e4334 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app170.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "URL", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-GB.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-GB.json new file mode 100644 index 000000000..f84f883a3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-GB.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "This is a test message[EN_GB]", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website![EN_GB]", + "description": "This is a test message[EN_GB]" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Hello! Welcome to our website![EN_GB]" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website![EN_GB]" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-US.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-US.json new file mode 100644 index 000000000..e32639950 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-US.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "This is a test message", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website!", + "description": "This is a test message" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-fr-FR.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-fr-FR.json new file mode 100644 index 000000000..37e48614e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-fr-FR.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "This is a test message[FR]", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website![FR]", + "description": "This is a test message[FR]" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Hello! Welcome to our website![FR]" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website![FR]" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app172.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app172.json new file mode 100644 index 000000000..3af5295d6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app172.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/customer/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getTenantById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app173.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app173.json new file mode 100644 index 000000000..6167fa514 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app173.json @@ -0,0 +1,29 @@ +{ + "openapi": "3.1.0", + "info": { + "TEST": "HELLO" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "printHello", + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {}, + "TEST": "HELLO" +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-1.json new file mode 100644 index 000000000..8594622ac --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-1.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/annotated": { + "get": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedGet", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPost", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-2.json new file mode 100644 index 000000000..659051922 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-2.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/annotated": { + "put": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPut", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-3.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-3.json new file mode 100644 index 000000000..0f76a96fc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-3.json @@ -0,0 +1,72 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/annotated": { + "get": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedGet", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPut", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPost", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177.json new file mode 100644 index 000000000..62e2837e8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/annotated": { + "put": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPut", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPost", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-1.json new file mode 100644 index 000000000..0b0365e20 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-1.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/annotated": { + "get": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedGet", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPost", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-2.json new file mode 100644 index 000000000..99e914caa --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-2.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/annotated": { + "put": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPut", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-3.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-3.json new file mode 100644 index 000000000..f060a7a7c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178-3.json @@ -0,0 +1,72 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/annotated": { + "get": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedGet", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPut", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPost", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178.json new file mode 100644 index 000000000..0f76a96fc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app178.json @@ -0,0 +1,72 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/annotated": { + "get": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedGet", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPut", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "annotated-controller" + ], + "operationId": "annotatedPost", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app179.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app179.json new file mode 100644 index 000000000..005584472 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app179.json @@ -0,0 +1,48 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test/{objId}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "objId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": {} + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app18.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app18.json new file mode 100644 index 000000000..7381cc07d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app18.json @@ -0,0 +1,203 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons3", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "persons name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons5": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons5", + "parameters": [ + { + "name": "age", + "in": "query", + "required": true, + "schema": { + "maximum": 0, + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons4": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons4", + "parameters": [ + { + "name": "age", + "in": "query", + "required": true, + "schema": { + "minimum": 0, + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons2", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "persons name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons6": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons6", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "persons name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app180.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app180.json new file mode 100644 index 000000000..bb6457b04 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app180.json @@ -0,0 +1,94 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/testWithoutSchema": { + "post": { + "tags": [ + "REST Service" + ], + "summary": "Test Request Body type Schema usage [Error]", + "operationId": "withoutSchema", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/testWithSchema": { + "post": { + "tags": [ + "REST Service" + ], + "summary": "Test Request Body type Schema usage [Correct]", + "operationId": "withSchema", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Body": { + "type": "object", + "additionalProperties": { + "description": "Body", + "example": { + "key": "value" + } + }, + "description": "Body", + "example": { + "key": "value" + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app181.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app181.json new file mode 100644 index 000000000..cdb34c985 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app181.json @@ -0,0 +1,64 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "sayHello", + "parameters": [ + { + "name": "primitiveConcreteField", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "primitiveBaseField", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "genericField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app182.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app182.json new file mode 100644 index 000000000..c7b77c0d0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app182.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello/{numTelco}":{"get":{"tags":["hello-controller"],"summary":"GET Persons","operationId":"index","parameters":[{"name":"numTelco","in":"path","required":true,"schema":{"type":"string"}},{"name":"adresse","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not here"},"502":{"description":"Bad Gateway","content":{"*/*":{"schema":{}}}},"418":{"description":"I'm a teapot","content":{"*/*":{"schema":{}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app183.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app183.json new file mode 100644 index 000000000..d09220475 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app183.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "NetworkServices", + "description": "the NetworkServices API" + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "controller" + ], + "operationId": "test", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ObjectA" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/{userId}": { + "get": { + "tags": [ + "NetworkServices" + ], + "operationId": "doSomething", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ObjectA": { + "type": "object", + "properties": { + "aa": { + "type": "string" + }, + "aaa": { + "type": "string" + } + } + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "toto": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-1.json new file mode 100644 index 000000000..1fbcc7b17 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-1.json @@ -0,0 +1,97 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + }, + { + "url": "urlGlobalBean" + } + ], + "paths": { + "/group3Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group3Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group2Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group2Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/beanFiltered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "beanFiltered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-2.json new file mode 100644 index 000000000..8549e8163 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-2.json @@ -0,0 +1,112 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + }, + { + "url": "urlGlobalBean" + }, + { + "url": "urlGroup2" + } + ], + "paths": { + "/group3Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group3Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup2", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group1Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group1Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup2", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/beanFiltered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "beanFiltered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup2", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-3.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-3.json new file mode 100644 index 000000000..9aa5cfab2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184-3.json @@ -0,0 +1,112 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + }, + { + "url": "urlGlobalBean" + }, + { + "url": "urlGroup3" + } + ], + "paths": { + "/group2Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group2Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup3", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group1Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group1Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup3", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/beanFiltered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "beanFiltered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup3", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184.json new file mode 100644 index 000000000..677e538be --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app184.json @@ -0,0 +1,112 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + }, + { + "url": "urlGlobalBean" + }, + { + "url": "urlBean" + } + ], + "paths": { + "/group3Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group3Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group2Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group2Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group1Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group1Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app185.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app185.json new file mode 100644 index 000000000..454615946 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app185.json @@ -0,0 +1,117 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/dog": { + "get": { + "tags": [ + "pet-controller" + ], + "operationId": "getDog", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Dog" + } + } + } + } + } + } + }, + "/any": { + "get": { + "tags": [ + "pet-controller" + ], + "operationId": "getAnyPet", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Pet" + }, + { + "$ref": "#/components/schemas/Cat" + }, + { + "$ref": "#/components/schemas/Dog" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Dog": { + "allOf": [ + { + "$ref": "#/components/schemas/Pet" + }, + { + "type": "object", + "properties": { + "barks": { + "type": "boolean" + } + } + } + ] + }, + "Cat": { + "allOf": [ + { + "$ref": "#/components/schemas/Pet" + }, + { + "type": "object", + "properties": { + "meows": { + "type": "boolean" + } + } + } + ] + }, + "Pet": { + "type": "object", + "description": "This is a Pet", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app187.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app187.json new file mode 100644 index 000000000..d4b54de97 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app187.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.1.0", + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Definition Second Tag full", + "description": "desc definition" + }, + { + "name": "Fifth Tag Full", + "description": "desc class", + "externalDocs": { + "description": "docs desc class" + } + }, + { + "name": "Definition First Tag" + }, + { + "name": "Fourth Tag Full", + "description": "desc", + "externalDocs": { + "description": "docs desc" + } + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "Sixth Tag", + "Second Tag", + "Example Tag", + "Third Tag", + "Fifth Tag Full", + "Fourth Tag Full" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app188.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app188.json new file mode 100644 index 000000000..b7d58f899 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app188.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test":{"get":{"tags":["hello-controller"],"operationId":"test","responses":{"200":{"description":"OK"},"5xx":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/example/{fooBar}":{"get":{"tags":["hello-controller"],"operationId":"getFooBar","parameters":[{"name":"fooBar","in":"path","required":true,"schema":{"type":"string","enum":["foo","bar"]}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}},"5xx":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"properties":{"timestamp":{"type":"string","format":"date-time","example":"2022-05-09T00:00:00Z"},"data":{"type":"object","additionalProperties":{"type":"object","example":{"param1":"val1","param2":"val2"}},"example":{"param1":"val1","param2":"val2"}}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app189.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app189.json new file mode 100644 index 000000000..d2010242b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app189.json @@ -0,0 +1,111 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/create": { + "post": { + "tags": [ + "Article Api" + ], + "operationId": "create", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "file" + ], + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + }, + "title": { + "description": "title" + }, + "content": { + "description": "content" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ArticleDto" + } + } + } + } + } + } + }, + "/query": { + "get": { + "tags": [ + "Article Api" + ], + "operationId": "query", + "parameters": [ + { + "name": "title", + "in": "query", + "description": "title", + "required": false, + "schema": { + "type": "string", + "description": "title" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ArticleDto" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ArticleDto": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "title" + }, + "content": { + "type": "string", + "description": "content" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app19.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app19.json new file mode 100644 index 000000000..c67f34545 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app19.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons3": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "persons3", + "requestBody": { + "description": "requestBody inside operation annotation", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons2": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "persons2", + "requestBody": { + "description": "requestBody description outside", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "requestBody": { + "description": "requestBody description as parameter", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app190.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app190.json new file mode 100644 index 000000000..41799251d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app190.json @@ -0,0 +1,165 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/nested": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "nested", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "innerClass.innerInnerClass.name", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "innerClass.innerInnerClass.maxNumber", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "innerClass.name", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "innerClass.maxNumber", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/nestedTypeErasureGeneric": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "nestedTypeErasureGeneric", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/nestedReifiableGeneric": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "nestedReifiableGeneric", + "parameters": [ + { + "name": "topName", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "child.firstName", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "child.maxNumber", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app192.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app192.json new file mode 100644 index 000000000..dcb8467f5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app192.json @@ -0,0 +1,244 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/postWithoutAnyResponse": { + "post": { + "tags": [ + "hello-controller" + ], + "description": "Adds 200 as api response, because there are nothing defined to get another response", + "operationId": "postWithoutAnyResponse", + "requestBody": { + "description": "test value", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/postWithResponseStatusOnly": { + "post": { + "tags": [ + "hello-controller" + ], + "description": "Adds 201 as api response, because it defined by @ResponseStatus", + "operationId": "postWithResponseStatusOnly", + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/withoutResponseStatus": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Doesn't creates the default 200 Response, because there are explicit declared api responses.This test ensures that the current default handling is not changed, because otherwise very many tests will fail.", + "operationId": "withoutResponseStatus", + "responses": { + "422": { + "description": "Test", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Test 2", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/withoutAnyResponseInformation": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Results in the default handling like before", + "operationId": "withoutAnyResponseInformation", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/withResponseStatus": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Adds 200 as additional api response, because it defined by @ResponseStatus", + "operationId": "withResponseStatus", + "responses": { + "422": { + "description": "Test", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Test 2", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/withResponseStatusOnly": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Adds 200 as api response, because it defined by @ResponseStatus", + "operationId": "withResponseStatusOnly", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/overwrite200InOperation": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Overwrites the 200 @ResponseStatus-Information by the explicit declared @ApiResponse", + "operationId": "overwrite200InOperation", + "responses": { + "200": { + "description": "Test2" + }, + "422": { + "description": "Test", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Test 2", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/overwrite200InDoc": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Overwrites the 200 @ResponseStatus-Information by the explicit declared @ApiResponse", + "operationId": "overwrite200InDoc", + "responses": { + "422": { + "description": "Test", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Test 2", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "Test2" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193-1.json new file mode 100644 index 000000000..2e5ae2d85 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193-1.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test":{"get":{"tags":["basic-controller"],"summary":"get","description":"Provides a list of books.","operationId":"get","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Books"}]}}}}}}},"/test1":{"get":{"tags":["basic-controller"],"summary":"get1","description":"Provides an animal.","operationId":"get1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Cat"},{"$ref":"#/components/schemas/Dog"}]}}}}}}}},"components":{"schemas":{"Book":{"type":"object","description":"Represents a Book.","properties":{"title":{"type":"string"}}},"Books":{"allOf":[{"$ref":"#/components/schemas/Knowledge"},{"type":"object","properties":{"empty":{"type":"boolean"},"first":{"$ref":"#/components/schemas/Book"},"last":{"$ref":"#/components/schemas/Book"}}}],"description":"Represents a list of Books."},"Knowledge":{"type":"object","description":"Represents the knowledge."},"Animal":{"type":"object","description":"Represents an Animal class."},"Cat":{"allOf":[{"$ref":"#/components/schemas/Animal"},{"type":"object","properties":{"speed":{"type":"integer","format":"int32"}}}],"description":"Represents a Cat class."},"Dog":{"allOf":[{"$ref":"#/components/schemas/Animal"},{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer","format":"int32"}}}],"description":"Represents a Dog class."}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193.json new file mode 100644 index 000000000..a4d76d380 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193.json @@ -0,0 +1,138 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "basic-controller" + ], + "summary": "get", + "description": "Provides a list of books.", + "operationId": "get", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Books" + } + ] + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "basic-controller" + ], + "summary": "get1", + "description": "Provides an animal.", + "operationId": "get1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Cat" + }, + { + "$ref": "#/components/schemas/Dog" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Books": { + "type": "array", + "description": "Represents a list of Books.", + "allOf": [ + { + "$ref": "#/components/schemas/Knowledge" + }, + { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + } + } + } + ] + }, + "Knowledge": { + "type": "object", + "description": "Represents the knowledge." + }, + "Animal": { + "type": "object", + "description": "Represents an Animal class." + }, + "Cat": { + "type": "object", + "description": "Represents a Cat class.", + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "speed": { + "type": "integer", + "format": "int32" + } + } + } + ] + }, + "Dog": { + "type": "object", + "description": "Represents a Dog class.", + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + } + } + ] + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app194.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app194.json new file mode 100644 index 000000000..43fcc9730 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app194.json @@ -0,0 +1,127 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/create": { + "post": { + "tags": [ + "Article Api" + ], + "operationId": "create", + "parameters": [ + { + "name": "title", + "in": "query", + "description": "title", + "required": false, + "schema": { + "type": "string", + "description": "title" + } + }, + { + "name": "content", + "in": "query", + "description": "content", + "required": false, + "schema": { + "type": "string", + "description": "content" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "file" + ], + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ArticleDto" + } + } + } + } + } + } + }, + "/query": { + "get": { + "tags": [ + "Article Api" + ], + "operationId": "query", + "parameters": [ + { + "name": "title", + "in": "query", + "description": "title", + "required": false, + "schema": { + "type": "string", + "description": "title" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ArticleDto" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ArticleDto": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "title" + }, + "content": { + "type": "string", + "description": "content" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app195.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app195.json new file mode 100644 index 000000000..13d23f96a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app195.json @@ -0,0 +1,66 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/example2/500": { + "get": { + "tags": [ + "example2" + ], + "summary": "Example2 method", + "description": "This method is an example2", + "operationId": "test", + "responses": { + "500": { + "description": "ExceptionHandler in example2", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK" + } + } + } + }, + "/example/500": { + "get": { + "tags": [ + "example" + ], + "summary": "Example method", + "description": "This method is an example", + "operationId": "test_1", + "responses": { + "500": { + "description": "ExceptionHandler in example", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app196.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app196.json new file mode 100644 index 000000000..979345088 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app196.json @@ -0,0 +1,134 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/json": { + "get": { + "tags": [ + "json-controller" + ], + "operationId": "listTemplates", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/actuator": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + }, + "/actuator/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": {} + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": {} + }, + "application/json": { + "schema": {} + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app197.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app197.json new file mode 100644 index 000000000..e510d4be3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app197.json @@ -0,0 +1,84 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/example2/": { + "get": { + "tags": [ + "example-2-controller" + ], + "operationId": "index", + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "OK" + } + } + } + }, + "/example/": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "index_1", + "responses": { + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app198.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app198.json new file mode 100644 index 000000000..d231502d1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app198.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/":{"get":{"tags":["hello-controller"],"operationId":"test","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}},"components":{"schemas":{"Response":{"type":"object","properties":{"val1":{"format":"decimal","deprecated":true},"val2":{"format":"decimal"},"val3":{"format":"decimal"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app199.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app199.json new file mode 100644 index 000000000..434313063 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app199.json @@ -0,0 +1,87 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/second": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "second", + "responses": { + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorDto" + }, + "examples": { + "Second case example": { + "value": { + "message": "An ErrorDto sample specific to /second endpoint" + } + } + } + } + } + }, + "200": { + "description": "OK" + } + } + } + }, + "/first": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "first", + "responses": { + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorDto" + }, + "examples": { + "First case example": { + "value": { + "message": "An ErrorDto sample specific to /first endpoint" + } + } + } + } + } + }, + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "ErrorDto": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app20.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app20.json new file mode 100644 index 000000000..16823bacd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app20.json @@ -0,0 +1,15 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": {}, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app200.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app200.json new file mode 100644 index 000000000..9dfe85744 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app200.json @@ -0,0 +1,50 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/example/{fooBar}": { + "get": { + "tags": [ + "foo-bar-controller" + ], + "operationId": "getFooBar", + "parameters": [ + { + "name": "fooBar", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "foo", + "bar" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app201.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app201.json new file mode 100644 index 000000000..19bde93b3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app201.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/example2/500": { + "get": { + "tags": [ + "example2" + ], + "summary": "Example2 method", + "description": "This method is an example2", + "operationId": "test", + "responses": { + "500": { + "description": "ExceptionHandler in example2", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app202.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app202.json new file mode 100644 index 000000000..61ab97f67 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app202.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/example2/":{"get":{"tags":["example-2-controller"],"operationId":"index","responses":{"400":{"description":"Bad Request","content":{"*/*":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}},"200":{"description":"OK"}}}},"/example/":{"get":{"tags":["example-controller"],"operationId":"index_1","responses":{"404":{"description":"Not Found","content":{"*/*":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}},"200":{"description":"OK"}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app203.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app203.json new file mode 100644 index 000000000..ee45a56b8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app203.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "1" + }, + { + "name": "2" + }, + { + "name": "3" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "my-controller" + ], + "operationId": "testingMethod", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app204.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app204.json new file mode 100644 index 000000000..d8410b8bd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app204.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test1": { + "get": { + "tags": [ + "default-flat-param-object-controller" + ], + "operationId": "test1", + "parameters": [ + { + "name": "email", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "firstName", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "lastName", + "in": "query", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app205.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app205.json new file mode 100644 index 000000000..21a8f7e28 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app205.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test/{param}": { + "get": { + "tags": [ + "my-controller" + ], + "operationId": "testingMethod", + "parameters": [ + { + "name": "param", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app206.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app206.json new file mode 100644 index 000000000..17534ca8c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app206.json @@ -0,0 +1,115 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "required-mode-controller" + ], + "operationId": "index", + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "firstName", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "lastName", + "in": "query", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + }, + { + "name": "email", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "age", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonResponse": { + "required": [ + "age", + "email", + "firstName", + "lastName" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "maxLength": 10, + "minLength": 0, + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app207.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app207.json new file mode 100644 index 000000000..85f77be51 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app207.json @@ -0,0 +1,109 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/sysUser/page/{current}/{size}": { + "get": { + "tags": [ + "sys-user-controller" + ], + "operationId": "findPage", + "parameters": [ + { + "name": "current", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "size", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "params", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/SysUser" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SuperEntityObject" + } + } + } + } + } + } + } + }, + "/api/sysUser/page": { + "get": { + "tags": [ + "sys-user-controller" + ], + "operationId": "findPage_1", + "parameters": [ + { + "name": "params", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/SysUser" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SuperEntityObject" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SysUser": { + "type": "object" + }, + "SuperEntityObject": { + "type": "object" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app208.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app208.json new file mode 100644 index 000000000..43302de17 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app208.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test1", + "parameters": [ + { + "name": "id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "test2", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestObject" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "RequestObject": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app209.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app209.json new file mode 100644 index 000000000..7381cc07d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app209.json @@ -0,0 +1,203 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons3", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "persons name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons5": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons5", + "parameters": [ + { + "name": "age", + "in": "query", + "required": true, + "schema": { + "maximum": 0, + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons4": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons4", + "parameters": [ + { + "name": "age", + "in": "query", + "required": true, + "schema": { + "minimum": 0, + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons2", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "persons name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons6": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons6", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "persons name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app21.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app21.json new file mode 100644 index 000000000..136b34d94 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app21.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "person" + ], + "summary": "Add a new person to the store", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "personstore_auth": [ + "write:persons", + "read:persons" + ] + } + ] + } + } + }, + "components": { + "securitySchemes": { + "personstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://personstore.swagger.io/oauth/dialog", + "scopes": { + "write:persons": "modify persons in your account", + "read:persons": "read your persons" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app211.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app211.json new file mode 100644 index 000000000..40f7f80e3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app211.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/":{"get":{"tags":["hello-controller"],"operationId":"index","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PagedObject"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}}}}},"components":{"schemas":{"PagedObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"Paging":{"type":"object","properties":{"page":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int32"},"lastPage":{"type":"integer","format":"int32"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app212-grouped.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app212-grouped.json new file mode 100644 index 000000000..95f7c4f06 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app212-grouped.json @@ -0,0 +1,127 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "ApiGroupName info title", + "description": "ApiGroupName info description", + "version": "ApiGroupName info version" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "security": [ + { + "basicScheme": [] + } + ], + "paths": { + "/persons3": { + "get": { + "tags": [ + "hello" + ], + "summary": "Summary of Get operationId 'persons'", + "description": "Description of Get operationId 'persons'", + "operationId": "persons3", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "post": { + "tags": [ + "hello" + ], + "summary": "Summary of Post operationId 'persons'", + "description": "Description of Post operationId 'persons'", + "operationId": "persons33", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/persons2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Summary of operationId 'persons' in ApiGroupName", + "description": "Description of operationId 'persons' in ApiGroupName", + "operationId": "persons2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/persons1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Description for 'name' property in ApiGroupName", + "example": "Example value for 'name' property in ApiGroupName" + } + }, + "description": "Description for PersonDTO component in ApiGroupName" + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app212.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app212.json new file mode 100644 index 000000000..94b7a3348 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app212.json @@ -0,0 +1,125 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Api info title", + "description": "Api info description", + "version": "Api info version" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "security": [ + { + "basicScheme": [] + } + ], + "paths": { + "/persons3": { + "get": { + "tags": [ + "hello" + ], + "summary": "Summary of Get operationId 'persons'", + "description": "Description of Get operationId 'persons'", + "operationId": "persons3", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "post": { + "tags": [ + "hello" + ], + "summary": "Summary of Post operationId 'persons'", + "description": "Description of Post operationId 'persons'", + "operationId": "persons33", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/persons2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/persons1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Description for 'name' property", + "example": "Example value for 'name' property" + } + }, + "description": "Description for PersonDTO component" + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app213.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app213.json new file mode 100644 index 000000000..534280009 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app213.json @@ -0,0 +1,71 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "MKMTestWS (Test Microservice API)", + "description": "This API exposes endpoints for testing anything", + "termsOfService": "https://www.test.ca/terms", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost:8080", + "description": "API Server" + } + ], + "tags": [ + { + "name": "Test Rest API", + "description": "Test Rest API" + } + ], + "paths": { + "/testcontroller/": { + "post": { + "tags": [ + "Test Rest API" + ], + "summary": "Get Test", + "description": "Get Test", + "operationId": "queryMyDto", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + }, + "x-amazon-apigateway-integration": { + "passthroughBehavior": "when_no_match", + "connectionId": "1rqafw", + "type": "http_proxy", + "httpMethod": "GET", + "uri": "http://my-vpc/nlb-link/testcontroller/getTest", + "connectionType": "VPC_LINK" + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app216.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app216.json new file mode 100644 index 000000000..952084309 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app216.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "a", + "operationId": "b", + "responses": { + "200": { + "description": "OK", + "content": { + "b/b": { + "schema": { + "type": "string" + } + }, + "a/a": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-1.json new file mode 100644 index 000000000..bcf9a4ebf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-1.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"Example Interfaces","description":"List of Example Interfaces","termsOfService":"http://localhost:8080/","license":{"name":"Apache 2.0"},"version":"v1.0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{},"components":{"schemas":{"PersonDTO":{"description":"Description for PersonDTO component","properties":{"name":{"description":"Description for 'name' property","example":"Example value for 'name' property"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-2.json new file mode 100644 index 000000000..a51dd73bf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-2.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"User Interfaces","description":"List of User Interfaces","termsOfService":"http://localhost:8080/","license":{"name":"Apache 2.0"},"version":"v1.0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{},"components":{"schemas":{"PersonDTO":{"description":"Description for PersonDTO component","properties":{"name":{"description":"Description for 'name' property","example":"Example value for 'name' property"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217.json new file mode 100644 index 000000000..d43e54b96 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217.json @@ -0,0 +1,51 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Api info title", + "description": "Api info description", + "version": "Api info version" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Description for 'name' property", + "example": "Example value for 'name' property" + } + }, + "description": "Description for PersonDTO component" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app218.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app218.json new file mode 100644 index 000000000..16a8a864c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app218.json @@ -0,0 +1,48 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "Sample" + ], + "summary": "Summary", + "description": "This is description.", + "operationId": "get", + "responses": { + "201": { + "description": "201 (Created)", + "headers": { + "Location": { + "description": "Sample endpoint", + "style": "simple", + "schema": { + "type": "string", + "format": "uri" + } + } + }, + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app219.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app219.json new file mode 100644 index 000000000..a322d4b8a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app219.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/testpost": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "testpost", + "requestBody": { + "content": { + "application/json;charset=UTF-8": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + }, + "application/json; charset=UTF-8": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TestObject": { + "type": "object", + "properties": { + "stringValue": { + "type": "string" + }, + "localDateTime": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app22.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app22.json new file mode 100644 index 000000000..8e24c86b4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app22.json @@ -0,0 +1,59 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "doGet", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app220.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app220.json new file mode 100644 index 000000000..4b15bda0d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app220.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/parent":{"post":{"tags":["hello-controller"],"operationId":"parentEndpoint","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Superclass"},{"$ref":"#/components/schemas/IntermediateClass"},{"$ref":"#/components/schemas/Image"},{"$ref":"#/components/schemas/Mail"},{"$ref":"#/components/schemas/Home"}]}}},"required":true},"responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"Home":{"allOf":[{"$ref":"#/components/schemas/Mail"}]},"Image":{"allOf":[{"$ref":"#/components/schemas/IntermediateClass"}]},"IntermediateClass":{"allOf":[{"$ref":"#/components/schemas/Superclass"},{"type":"object","properties":{"@type":{"type":"string"}}}],"discriminator":{"propertyName":"@type"},"required":["@type"]},"Mail":{"allOf":[{"$ref":"#/components/schemas/IntermediateClass"},{"type":"object","properties":{"@type":{"type":"string"}}}],"discriminator":{"propertyName":"@type"},"required":["@type"]},"Superclass":{"type":"object","discriminator":{"propertyName":"@type"},"properties":{"@type":{"type":"string"}},"required":["@type"]}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app221.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app221.json new file mode 100644 index 000000000..be093e540 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app221.json @@ -0,0 +1,83 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello World Api", + "description": "This is a test api" + } + ], + "paths": { + "/api/hello": { + "post": { + "tags": [ + "Hello World Api" + ], + "summary": "Upload new content", + "description": "Upload test content", + "operationId": "uploadContent", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/HelloUploadDto" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloUploadDto": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "file": { + "type": "string", + "format": "binary" + } + } + }, + "HelloDto": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "file": { + "type": "string", + "format": "byte" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app222.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app222.json new file mode 100644 index 000000000..8c39e0b28 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app222.json @@ -0,0 +1,121 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getItems2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SecondHierarchyUser" + } + } + } + } + } + } + }, + "/hello1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getItems1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/FirstHierarchyUser" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CommonImplementor": { + "allOf": [ + { + "$ref": "#/components/schemas/SecondHierarchy" + }, + { + "$ref": "#/components/schemas/FirstHierarchy" + } + ] + }, + "SecondHierarchy": { + "type": "object", + "discriminator": { + "propertyName": "@type" + }, + "properties": { + "@type": { + "type": "string" + } + }, + "required": [ + "@type" + ] + }, + "SecondHierarchyUser": { + "type": "object", + "properties": { + "secondHierarchy": { + "oneOf": [ + { + "$ref": "#/components/schemas/CommonImplementor" + } + ] + } + } + }, + "FirstHierarchy": { + "type": "object", + "discriminator": { + "propertyName": "@type" + }, + "properties": { + "@type": { + "type": "string" + } + }, + "required": [ + "@type" + ] + }, + "FirstHierarchyUser": { + "type": "object", + "properties": { + "firstHierarchy": { + "oneOf": [ + { + "$ref": "#/components/schemas/CommonImplementor" + } + ] + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app223.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app223.json new file mode 100644 index 000000000..4692e7ccf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app223.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/parent":{"post":{"tags":["a-rest-controller"],"operationId":"parentEndpoint","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ParentType1"},{"$ref":"#/components/schemas/ParentType2"}]}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}},"/child":{"post":{"tags":["a-rest-controller"],"operationId":"childEndpoint","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ChildType1"},{"$ref":"#/components/schemas/ChildType2"}]}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}},"components":{"schemas":{"AbstractChild":{"type":"object","discriminator":{"propertyName":"type"},"properties":{"id":{"type":"integer","format":"int32"},"type":{"type":"string"}},"required":["type"]},"AbstractParent":{"type":"object","discriminator":{"propertyName":"type"},"properties":{"id":{"type":"integer","format":"int32"},"type":{"type":"string"}},"required":["type"]},"ChildType1":{"allOf":[{"$ref":"#/components/schemas/AbstractChild"},{"type":"object","properties":{"childType1Param":{"type":"string"}}}]},"ChildType2":{"allOf":[{"$ref":"#/components/schemas/AbstractChild"},{"type":"object","properties":{"childType2Param":{"type":"string"}}}]},"ParentType1":{"allOf":[{"$ref":"#/components/schemas/AbstractParent"},{"type":"object","properties":{"parentType1Param":{"type":"string"},"abstractChild":{"oneOf":[{"$ref":"#/components/schemas/ChildType1"},{"$ref":"#/components/schemas/ChildType2"}]}}}]},"ParentType2":{"allOf":[{"$ref":"#/components/schemas/AbstractParent"},{"type":"object","properties":{"parentType2Param":{"type":"string"}}}]},"Response":{"type":"object","properties":{"abstractParent":{"oneOf":[{"$ref":"#/components/schemas/ParentType1"},{"$ref":"#/components/schemas/ParentType2"}]},"abstractChild":{"oneOf":[{"$ref":"#/components/schemas/ChildType1"},{"$ref":"#/components/schemas/ChildType2"}]}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app224.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app224.json new file mode 100644 index 000000000..0ef50ddff --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app224.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api": { + "get": { + "tags": [ + "test-controller" + ], + "operationId": "getRootModel", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/RootModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "RootModel": { + "type": "object", + "properties": { + "rootProperty": { + "type": "integer", + "format": "int32" + }, + "unwrappedProperty": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app225.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app225.json new file mode 100644 index 000000000..379439aa1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app225.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/testBoolean": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "HelloController", + "parameters": [ + { + "name": "PERSONAL_NUMBER", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app226.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app226.json new file mode 100644 index 000000000..f0053119b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app226.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/testBoolean": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "HelloController", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "examples": { + "success": { + "description": "success", + "value": "..." + } + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app227.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app227.json new file mode 100644 index 000000000..8679b56ab --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app227.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ItemString" + } + } + } + } + } + } + }, + "/persons2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ItemString" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ItemString": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "resource": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app228.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app228.json new file mode 100644 index 000000000..a60d4d146 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app228.json @@ -0,0 +1,126 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/swaggerTest": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "swaggerTest", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MyRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Child1": { + "allOf": [ + { + "$ref": "#/components/schemas/Parent" + }, + { + "type": "object", + "properties": { + "childProperty1": { + "type": "string" + } + } + } + ] + }, + "Child2": { + "allOf": [ + { + "$ref": "#/components/schemas/Parent" + }, + { + "type": "object", + "properties": { + "childProperty2": { + "type": "string" + } + } + } + ] + }, + "Child3": { + "allOf": [ + { + "$ref": "#/components/schemas/Parent" + }, + { + "type": "object", + "properties": { + "childProperty3": { + "type": "string" + } + } + } + ] + }, + "MyRequest": { + "type": "object", + "properties": { + "parent": { + "oneOf": [ + { + "$ref": "#/components/schemas/Child1" + }, + { + "$ref": "#/components/schemas/Child2" + }, + { + "$ref": "#/components/schemas/Child3" + }, + { + "$ref": "#/components/schemas/Child1" + }, + { + "$ref": "#/components/schemas/Child2" + } + ] + } + } + }, + "Parent": { + "type": "object", + "properties": { + "parentProperty": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app229.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app229.json new file mode 100644 index 000000000..cf799c997 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app229.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/":{"get":{"tags":["x-controller"],"operationId":"manualTranslationUpdateRun","parameters":[{"name":"locale","in":"query","required":true,"schema":{"type":"string","maxLength":16,"minLength":2,"pattern":"\\w+([-.]?\\w+)*"},"examples":{"el-gr":{"description":"el-gr"},"pl-pl":{"description":"pl-pl"},"de-de":{"description":"de-de"},"hu-hu":{"description":"hu-hu"},"en-us.src":{"description":"en-us.src"},"ro-ro":{"description":"ro-ro"},"sk-sk":{"description":"sk-sk"},"bg-bg":{"description":"bg-bg"},"ar-ae":{"description":"ar-ae"},"cs-cz":{"description":"cs-cz"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app23.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app23.json new file mode 100644 index 000000000..25d752698 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app23.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Add a new person to the store", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "Authorization": [] + } + ] + } + } + }, + "components": { + "securitySchemes": { + "Authorization": { + "type": "apiKey", + "description": "A core-auth Bearer token", + "name": "JWT", + "in": "header" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app230.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app230.json new file mode 100644 index 000000000..bccaea26a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app230.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "app-230-controller" + ], + "operationId": "swaggerTest", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MyRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "MyRequest": { + "properties": { + "id": { + "format": "int32", + "type": "integer" + } + }, + "type": "object" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app231.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app231.json new file mode 100644 index 000000000..658792ac6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app231.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/applications/parameter-object": { + "post": { + "tags": [ + "applications-rest-controller" + ], + "summary": "Parameter object", + "operationId": "createWithParameterObject", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Overriding the description in sub class", + "required": false, + "schema": { + "maxLength": 30, + "minLength": 1, + "type": "string", + "description": "Overriding the description in sub class" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Application" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Application": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "clusterName": { + "type": "string" + }, + "shardName": { + "type": "string" + }, + "customTags": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app232.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app232.json new file mode 100644 index 000000000..9ea5dbd0f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app232.json @@ -0,0 +1,137 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "options": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "head": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "patch": { + "tags": [ + "hello-controller" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app233.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app233.json new file mode 100644 index 000000000..627e6b909 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app233.json @@ -0,0 +1,381 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/renamed-parent": { + "get": { + "tags": [ + "parameter-controller" + ], + "operationId": "nestedParameterObjectWithRenamedParentField", + "parameters": [ + { + "name": "schemaRenamed.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "parameterRenamed.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "originalNameNestedParameterObject.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/optional-parent": { + "get": { + "tags": [ + "parameter-controller" + ], + "operationId": "nestedParameterObjectWithOptionalParentField", + "parameters": [ + { + "name": "requiredNotNullParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.noSchemaNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNotNullParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.noSchemaNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "requiredNoValidationParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.noSchemaNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNotNullParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.noSchemaNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notRequiredNoValidationParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.noSchemaNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNotNullParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.requiredNotNullField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.requiredNoValidationField", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.notRequiredNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.notRequiredNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.noSchemaNotNullField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "noSchemaNoValidationParameterObject.noSchemaNoValidationField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/hidden-parent": { + "get": { + "tags": [ + "parameter-controller" + ], + "operationId": "nestedParameterObjectWithHiddenParentField", + "parameters": [ + { + "name": "visibleNestedParameterObject.parameterField", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app234.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app234.json new file mode 100644 index 000000000..a8456d304 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app234.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": {} + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app235.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app235.json new file mode 100644 index 000000000..a221edccc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app235.json @@ -0,0 +1,132 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/debug/{simple}": { + "get": { + "tags": [ + "Lorem ipsum" + ], + "operationId": "get", + "parameters": [ + { + "name": "simple", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "Lorem ipsum" + ], + "operationId": "post", + "parameters": [ + { + "name": "simple", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/debug/{wildcard}": { + "get": { + "tags": [ + "Lorem ipsum" + ], + "operationId": "getWildcard", + "parameters": [ + { + "name": "wildcard", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "Lorem ipsum" + ], + "operationId": "postWildcard", + "parameters": [ + { + "name": "wildcard", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app236.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app236.json new file mode 100644 index 000000000..776cac81d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app236.json @@ -0,0 +1,98 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/testTwo": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "testTwo", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClassOne" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testOne": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "testOne", + "parameters": [ + { + "name": "description.name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ClassOne": { + "type": "object", + "properties": { + "description": { + "$ref": "#/components/schemas/ClassTwo" + } + } + }, + "ClassTwo": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app24.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app24.json new file mode 100644 index 000000000..fd8082586 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app24.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Add a new person to the store", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "Authorization": [] + } + ] + } + } + }, + "components": { + "parameters": { + "myHeader1": { + "name": "myHeader1", + "in": "header", + "schema": { + "type": "string" + } + } + }, + "headers": { + "myHeader2": { + "description": "myHeader2 header", + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "Authorization": { + "type": "apiKey", + "description": "A core-auth Bearer token", + "name": "Authorization", + "in": "header" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app25.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app25.json new file mode 100644 index 000000000..50fbba377 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app25.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/values/{trackerId}/data":{"get":{"tags":["hello-controller"],"description":"Get last data from a tracker","operationId":"thirdList","parameters":[{"name":"trackerId","in":"path","required":true,"schema":{"example":"the-tracker-id"}},{"name":"start","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:00:00.000Z"}},{"name":"end","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:10:00.000Z"}},{"name":"limit","in":"query","required":false,"schema":{"example":10}}],"responses":{"200":{"description":"OK"}}}},"/secondlist/{trackerId}":{"get":{"tags":["hello-controller"],"operationId":"secondlist","parameters":[{"name":"trackerId","in":"path","required":true,"schema":{"example":"the-tracker-id"}},{"name":"start","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:00:00.000Z"}},{"name":"end","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:10:00.000Z"}}],"responses":{"200":{"description":"OK"}}}},"/list":{"get":{"tags":["hello-controller"],"operationId":"list","parameters":[{"name":"start","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:00:00.000Z"}},{"name":"end","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:10:00.000Z"}}],"responses":{"200":{"description":"OK"}}}},"/check":{"get":{"tags":["hello-controller"],"operationId":"check","responses":{"200":{"description":"OK"}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app26.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app26.json new file mode 100644 index 000000000..626e35c37 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app26.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "parameters": [ + { + "name": "myModel", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/MyModel" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MyModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Bar": { + "type": "object", + "properties": { + "bar": { + "type": "string" + } + } + }, + "Foo": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + }, + "MyModel": { + "type": "object", + "properties": { + "thing": { + "type": "object", + "description": "Hello", + "oneOf": [ + { + "$ref": "#/components/schemas/Foo" + }, + { + "$ref": "#/components/schemas/Bar" + }, + { + "$ref": "#/components/schemas/Foo" + }, + { + "$ref": "#/components/schemas/Bar" + } + ] + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app27.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app27.json new file mode 100644 index 000000000..2ebe908a1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app27.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "operationId": "test", + "responses": { + "500": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Bar" + }, + { + "$ref": "#/components/schemas/Foo" + } + ] + } + } + } + }, + "200": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Foo": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + }, + "Bar": { + "type": "object", + "properties": { + "bar": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app28.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app28.json new file mode 100644 index 000000000..413366ae0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app28.json @@ -0,0 +1,59 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/upload2": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "upload2", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "one", + "two" + ], + "type": "object", + "properties": { + "one": { + "type": "string", + "format": "binary" + }, + "two": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app29.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app29.json new file mode 100644 index 000000000..327c7ecbf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app29.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/post-entity": { + "post": { + "tags": [ + "hello-controller" + ], + "description": "Post entity", + "operationId": "postEntity", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrackerData" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TrackerData" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TrackerData": { + "required": [ + "timestamp", + "trackerId", + "value" + ], + "type": "object", + "properties": { + "trackerId": { + "type": "string", + "example": "the-tracker-id" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "example": "2018-01-01T00:00:00Z" + }, + "value": { + "type": "number", + "description": "The data value", + "format": "double", + "example": 19.0 + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app30.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app30.json new file mode 100644 index 000000000..70a646894 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app30.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "echo", + "parameters": [ + { + "name": "text", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "Hello, World!" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app31.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app31.json new file mode 100644 index 000000000..4d9c39eb1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app31.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test":{"post":{"tags":["hello-controller"],"description":"subscribes a client to updates relevant to the requestor's account, as identified by the input token. The supplied url will be used as the delivery address for response payloads","operationId":"subscribe","parameters":[{"name":"x-auth-token","in":"header","description":"the authentication token provided after initially authenticating to the application","required":true,"schema":{"type":"string","description":"the authentication token provided after initially authenticating to the application"}},{"name":"url","in":"query","description":"the URL to call with response data","required":true,"schema":{"type":"string","description":"the URL to call with response data"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}}},"callbacks":{"subscription":{"http://$request.query.url":{"post":{"description":"payload data will be sent","parameters":[{"name":"subscriptionId","in":"path","required":true,"schema":{"format":"uuid","description":"the generated UUID","readOnly":true}}],"responses":{"200":{"description":"Return this code if the callback was received and processed successfully"},"205":{"description":"Return this code to unsubscribe from future data updates"},"default":{"description":"All other response codes will disable this callback subscription"}}}}}}}}},"components":{"schemas":{"SubscriptionResponse":{"type":"object","properties":{"subscriptionUuid":{"type":"string"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app32.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app32.json new file mode 100644 index 000000000..fae4f254c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app32.json @@ -0,0 +1,62 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/filter": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "filterPost", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MyTestDto" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "MyTestDto": { + "type": "object", + "properties": { + "object1": { + "type": "string" + }, + "object2": { + "type": "string" + }, + "object3": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app33.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app33.json new file mode 100644 index 000000000..582e2aa8f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app33.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello/{numTelco}":{"get":{"tags":["hello-controller"],"summary":"GET Persons","operationId":"index","parameters":[{"name":"numTelco","in":"path","required":true,"schema":{"type":"string"}},{"name":"adresse","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"418":{"description":"I'm a teapot","content":{"*/*":{"schema":{}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app34.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app34.json new file mode 100644 index 000000000..582e2aa8f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app34.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello/{numTelco}":{"get":{"tags":["hello-controller"],"summary":"GET Persons","operationId":"index","parameters":[{"name":"numTelco","in":"path","required":true,"schema":{"type":"string"}},{"name":"adresse","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"418":{"description":"I'm a teapot","content":{"*/*":{"schema":{}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app35.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app35.json new file mode 100644 index 000000000..d90c1a83d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app35.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/v1/poc/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get thing", + "operationId": "test", + "responses": { + "200": { + "description": "Successful Operation", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + }, + "401": { + "description": "Authentication Failure" + } + } + } + }, + "/api/v1/poc/testme": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get thing", + "operationId": "testme", + "responses": { + "200": { + "description": "Successful Operation", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + }, + "401": { + "description": "Authentication Failure" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app37.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app37.json new file mode 100644 index 000000000..0df8a91a1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app37.json @@ -0,0 +1,129 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/pets": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "petsPost", + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/bar/baz": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "process", + "requestBody": { + "content": { + "application/x.c+json": { + "schema": { + "$ref": "#/components/schemas/Car" + } + }, + "application/x.b+json": { + "schema": { + "$ref": "#/components/schemas/Bar" + } + }, + "application/x.a+json": { + "schema": { + "$ref": "#/components/schemas/Foo" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Car" + } + }, + "text/plain": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Foo" + }, + { + "$ref": "#/components/schemas/Bar" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Pet": { + "type": "object", + "properties": { + "pet": { + "type": "string" + } + } + }, + "Car": { + "type": "object", + "properties": { + "car": { + "type": "string" + } + } + }, + "Bar": { + "type": "object", + "properties": { + "bar": { + "type": "string" + } + } + }, + "Foo": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app38.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app38.json new file mode 100644 index 000000000..0b397144e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app38.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/npe_error": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getModelResource", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "byte" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app39.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app39.json new file mode 100644 index 000000000..07e4fe189 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app39.json @@ -0,0 +1,85 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "test Request", + "operationId": "searchEmployee", + "parameters": [ + { + "in": "header", + "$ref": "#/components/parameters/myGlobalHeader" + } + ], + "requestBody": { + "description": "test value", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "parameters": [ + { + "in": "header", + "$ref": "#/components/parameters/myGlobalHeader" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "parameters": { + "myGlobalHeader": { + "name": "My-Global-Header", + "in": "header", + "description": "My Global Header", + "required": true, + "schema": { + "type": "string" + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app40.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app40.json new file mode 100644 index 000000000..596f29079 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app40.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/iae_error": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getStartFormProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app41.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app41.json new file mode 100644 index 000000000..d20756135 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app41.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/file":{"get":{"tags":["hello-controller"],"description":"Download file","operationId":"getFile","parameters":[{"name":"path","in":"query","description":"File path","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Wrong request","content":{"application/json":{"schema":{}}}},"200":{"description":"File resource","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app42.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app42.json new file mode 100644 index 000000000..af54faab6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app42.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/tweets/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "tweets", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/TweetId" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "TweetId": { + "type": "string" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app43.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app43.json new file mode 100644 index 000000000..939b2a513 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app43.json @@ -0,0 +1,57 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/documents": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "uploadDocuments", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "doc" + ], + "type": "object", + "properties": { + "doc": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app44.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app44.json new file mode 100644 index 000000000..f9b750dc4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app44.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/helloworld": { + "post": { + "operationId": "hello_1", + "requestBody": { + "content": { + "application/vnd.v1+json": { + "schema": { + "$ref": "#/components/schemas/RequestV1" + } + }, + "application/vnd.v2+json": { + "schema": { + "$ref": "#/components/schemas/RequestV2" + } + } + } + }, + "responses": { + "400": { + "description": "Bad name", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDTO" + } + } + } + }, + "200": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/HelloDTO2" + }, + { + "$ref": "#/components/schemas/HelloDTO1" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "RequestV1": { + "type": "object", + "properties": { + "nameV1": { + "type": "string" + } + } + }, + "ErrorDTO": { + "type": "object", + "properties": { + "errorMessage": { + "type": "string" + } + } + }, + "HelloDTO1": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "RequestV2": { + "type": "object", + "properties": { + "nameV2": { + "type": "string" + } + } + }, + "HelloDTO2": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app45.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app45.json new file mode 100644 index 000000000..95e0b36d0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app45.json @@ -0,0 +1,162 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "My App", + "description": "Some long and useful description", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "People", + "description": "Use this resource to serve all requests and initiate all operations related to people" + } + ], + "paths": { + "/v1/people/list": { + "get": { + "tags": [ + "People" + ], + "description": "List all persons", + "operationId": "list_1", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/v1/people/listTwo": { + "get": { + "tags": [ + "People" + ], + "description": "List all persons", + "operationId": "listTwo_1", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "/v1/people2/list": { + "get": { + "tags": [ + "People" + ], + "description": "List all persons", + "operationId": "list", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/v1/people2/listTwo": { + "get": { + "tags": [ + "People" + ], + "description": "List all persons", + "operationId": "listTwo", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "bearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app46.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app46.json new file mode 100644 index 000000000..33102e5a5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app46.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/persons/{subscriptionId}":{"get":{"tags":["Example Tag"],"summary":"Operation Summary","description":"Operation Description","externalDocs":{"description":"External documentation description","url":"http://url.com"},"operationId":"operationId","parameters":[{"name":"subscriptionId","in":"path","description":"parameter description","required":true,"allowEmptyValue":true,"allowReserved":true,"schema":{"format":"uuid","description":"the generated UUID","readOnly":true}}],"responses":{"200":{"description":"voila!","content":{"application/json":{"schema":{"type":"string"}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app47.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app47.json new file mode 100644 index 000000000..db3d4bf63 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app47.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/documents/{locale}":{"get":{"tags":["hello-controller"],"operationId":"getDocumentsWithLocale","parameters":[{"name":"locale","in":"path","required":true,"schema":{}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/":{"get":{"tags":["basic-controller"],"operationId":"get1","parameters":[{"name":"foo","in":"header","schema":{"type":"string","enum":["bar"]}},{"name":"fi","in":"header","schema":{"type":"string","enum":["ri"]}},{"name":"User-Agent","in":"header","schema":{"type":"string","enum":["MyUserAgent"]}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app48.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app48.json new file mode 100644 index 000000000..9cfa30067 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app48.json @@ -0,0 +1,106 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/documents/{locale}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getDocuments", + "responses": { + "410": { + "description": "Gone", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "412": { + "description": "Precondition Failed", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "413": { + "description": "Payload Too Large", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "402": { + "description": "Payment Required", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "411": { + "description": "Length Required", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app49.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app49.json new file mode 100644 index 000000000..ce32149c6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app49.json @@ -0,0 +1,43 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Obtain the list of services available in the system", + "operationId": "list", + "responses": { + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + } + } + }, + "components": { + "responses": { + "Unauthorized": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app50.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app50.json new file mode 100644 index 000000000..f3217f44a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app50.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "list", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "components": { + "responses": { + "Unauthorized": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app51.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app51.json new file mode 100644 index 000000000..16c0f1719 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app51.json @@ -0,0 +1,185 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + } + } + } + } + }, + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test3", + "parameters": [ + { + "name": "test_header", + "in": "header", + "required": true, + "schema": { + "example": "rherherherherh" + } + }, + { + "name": "param1", + "in": "query", + "description": "desc1", + "required": true, + "schema": { + "example": "something" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test2", + "parameters": [ + { + "name": "test_header", + "in": "header", + "required": true, + "schema": { + "example": "rherherherherh" + } + }, + { + "name": "param1", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test1", + "parameters": [ + { + "name": "test_header", + "in": "header", + "required": true, + "schema": { + "example": "rherherherherh" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test/{path}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "get", + "parameters": [ + { + "name": "path", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app52.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app52.json new file mode 100644 index 000000000..d5fa1e9bf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app52.json @@ -0,0 +1,190 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test3": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "createTest3", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "doc", + "test" + ], + "type": "object", + "properties": { + "test": { + "$ref": "#/components/schemas/MyTestDto" + }, + "doc": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2/{username}": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "createTest2", + "parameters": [ + { + "name": "username", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "My-Header", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "image", + "test" + ], + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary" + }, + "test": { + "$ref": "#/components/schemas/MyTestDto" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1/{username}": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "createTest1", + "parameters": [ + { + "name": "username", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "image", + "test" + ], + "type": "object", + "properties": { + "test": { + "$ref": "#/components/schemas/MyTestDto" + }, + "image": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "MyTestDto": { + "type": "object", + "properties": { + "object1": { + "type": "string" + }, + "object2": { + "type": "string" + }, + "object3": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app53.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app53.json new file mode 100644 index 000000000..0c926e5dc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app53.json @@ -0,0 +1,234 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello5": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "listWithDefaultResponseStatus", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/hello2": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "listWithEmptyApiResponse", + "responses": { + "default": { + "description": "default response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/hello1": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "listWithNoApiResponse", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/hello4": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "getDTOWithExplicitResponseStatus", + "responses": { + "204": { + "description": "No Content", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloDTO1" + } + } + } + } + } + } + }, + "/hello3": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "listWithExplicitResponseStatus", + "responses": { + "204": { + "description": "No Content", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/hello6": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "getDTOWithDefaultResponseStatus", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloDTO1" + } + } + } + } + } + } + }, + "/hello7": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "getNestedDTOWithDefaultResponseStatus", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloDTO1" + } + } + } + } + } + } + }, + "/global/hello2": { + "get": { + "tags": [ + "hello-controller-with-global-api-response" + ], + "description": "Some operation", + "operationId": "listWithDefaultResponseStatus_1", + "responses": { + "200": { + "description": "Explicit description for this response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/global/hello1": { + "get": { + "tags": [ + "hello-controller-with-global-api-response" + ], + "description": "Some operation", + "operationId": "listWithNoApiResponse_1", + "responses": { + "204": { + "description": "Explicit description for this response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloDTO1": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app54.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app54.json new file mode 100644 index 000000000..1f8c1eb5d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app54.json @@ -0,0 +1,132 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/parties": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "saveMealParty", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MealParty_Public" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MealParty_MealPartyAdmin" + } + } + } + } + } + } + }, + "/parties/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets meal party details [Meal party admin restricted]", + "operationId": "getMealParty", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the meal party", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MealParty_Public" + } + } + } + } + } + } + }, + "/new-parties": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "saveMealNewParty", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MealParty_Public" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MealParty_MealPartyAdmin" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "MealParty_Public": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "MealParty_MealPartyAdmin": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "members": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app55.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app55.json new file mode 100644 index 000000000..671c76e19 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app55.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/ping": { + "get": { + "tags": [ + "health" + ], + "summary": "Simple health check", + "operationId": "ping", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app56.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app56.json new file mode 100644 index 000000000..3e8bf2c98 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app56.json @@ -0,0 +1,57 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDTO" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorDTO": { + "type": "object", + "properties": { + "errorMessage": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app57.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app57.json new file mode 100644 index 000000000..ab723857d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app57.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{name}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getText", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "desc", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app58.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app58.json new file mode 100644 index 000000000..5bda4b078 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app58.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/examplePost":{"post":{"tags":["hello-controller"],"summary":"schema example","operationId":"example","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{}}}}}}},"/foo":{"get":{"tags":["hello-controller"],"operationId":"foobar","parameters":[{"name":"user","in":"query","description":"User","required":true,"schema":{"$ref":"#/components/schemas/PersonDTO"}}],"responses":{"200":{"description":"OK"}}}},"/foo1":{"get":{"tags":["hello-controller"],"operationId":"foobar1","parameters":[{"name":"user","in":"query","description":"User","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonDTO"}}}}],"responses":{"200":{"description":"OK"}}}},"/example":{"get":{"tags":["hello-controller"],"operationId":"test","responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"PersonDTO":{"type":"object","properties":{"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app59.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app59.json new file mode 100644 index 000000000..a5f0edb21 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app59.json @@ -0,0 +1,183 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloBody" + } + } + }, + "required": true + }, + "responses": { + "500": { + "description": "An unknown error occurred", + "content": { + "*/*": { + "schema": {} + } + } + }, + "400": { + "description": "The request is malformed or information is missing.", + "content": { + "*/*": { + "schema": {} + } + } + }, + "200": { + "description": "The server accepted your hello.", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/hello2": { + "post": { + "tags": [ + "hello-controller-2" + ], + "operationId": "hello_1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloBody" + } + } + }, + "required": true + }, + "responses": { + "500": { + "description": "An unknown error occurred", + "content": { + "*/*": { + "schema": {} + } + } + }, + "400": { + "description": "The request is malformed or information is missing.", + "content": { + "*/*": { + "schema": {} + } + } + }, + "200": { + "description": "The server accepted your hello.", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + }, + "deprecated": true + } + }, + "/example": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "responses": { + "500": { + "description": "An unknown error occurred", + "content": { + "*/*": { + "schema": {} + } + } + }, + "400": { + "description": "The request is malformed or information is missing.", + "content": { + "*/*": { + "schema": {} + } + } + }, + "200": { + "description": "OK" + } + }, + "deprecated": true + } + }, + "/example2": { + "get": { + "tags": [ + "hello-controller-2" + ], + "operationId": "test_1", + "responses": { + "500": { + "description": "An unknown error occurred", + "content": { + "*/*": { + "schema": {} + } + } + }, + "400": { + "description": "The request is malformed or information is missing.", + "content": { + "*/*": { + "schema": {} + } + } + }, + "200": { + "description": "OK" + } + }, + "deprecated": true + } + } + }, + "components": { + "schemas": { + "HelloBody": { + "type": "object", + "properties": { + "helloValue": { + "type": "string" + } + }, + "required": [ + "helloValue" + ] + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app60.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app60.json new file mode 100644 index 000000000..d239d9164 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app60.json @@ -0,0 +1,109 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "summary2", + "operationId": "list2", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "desc page from Annotated interface", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "desc page from Annotated interface", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "sort", + "in": "query", + "description": "desc sort from Annotated interface", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": {} + } + } + } + } + } + } + }, + "/hello1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "summary1", + "operationId": "list1", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "The page", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "The size", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": {} + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app61.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app61.json new file mode 100644 index 000000000..e28ff3499 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app61.json @@ -0,0 +1,85 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons-with-user": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "List", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "phone", + "in": "query", + "description": "Phone", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "createdFrom", + "in": "query", + "description": "createdFrom", + "required": true, + "content": { + "*/*": { + "schema": { + "type": "array", + "items": {} + } + } + } + }, + { + "name": "createdRange", + "in": "query", + "description": "createdRange", + "required": true, + "schema": { + "type": "array", + "items": { + "format": "date" + }, + "maxItems": 2, + "minItems": 2 + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app62.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app62.json new file mode 100644 index 000000000..0de332814 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app62.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Test Controller" + ], + "summary": "This is the test endpoint", + "operationId": "test", + "parameters": [ + { + "name": "Accept", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app63.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app63.json new file mode 100644 index 000000000..16823bacd --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app63.json @@ -0,0 +1,15 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": {}, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app64.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app64.json new file mode 100644 index 000000000..4b13830d7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app64.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/balance/abcd": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "This is the test endpoint", + "operationId": "test2", + "parameters": [ + { + "name": "from", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app65.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app65.json new file mode 100644 index 000000000..95bfab036 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app65.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Health", + "description": "Health check / ping API" + } + ], + "paths": { + "/health": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ping": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_1", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_2", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app66.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app66.json new file mode 100644 index 000000000..d87020215 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app66.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Health", + "description": "Health check / ping API" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_2", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/health": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ping": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_1", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app67.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app67.json new file mode 100644 index 000000000..7f4ef7ef6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app67.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/demo/operation4":{"get":{"tags":["hello-controller"],"summary":"Operation 4 (expected result - 3 parameters)","operationId":"operation4","parameters":[{"name":"pageNumber","in":"query","description":"page number","schema":{}},{"name":"pageSize","in":"query","description":"page size","schema":{}},{"name":"sort","in":"query","description":"sort specification","schema":{}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/demo/operation3":{"get":{"tags":["hello-controller"],"summary":"Operation 3 (expected result - 3 parameters)","operationId":"operation3","parameters":[{"name":"pageNumber","in":"query","description":"page number","schema":{}},{"name":"pageSize","in":"query","description":"page size","schema":{}},{"name":"sort","in":"query","description":"sort specification","schema":{}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/demo/operation2":{"get":{"tags":["hello-controller"],"summary":"Operation 2 (expected result - 3 parameters)","operationId":"operation2","parameters":[{"name":"pageNumber","in":"query","description":"page number","schema":{}},{"name":"pageSize","in":"query","description":"page size","schema":{}},{"name":"sort","in":"query","description":"sort specification","schema":{}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/demo/operation1":{"get":{"tags":["hello-controller"],"summary":"Operation 1 (expected result - no parameters)","operationId":"operation1","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app69.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app69.json new file mode 100644 index 000000000..e0f778dd9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app69.json @@ -0,0 +1,109 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/testRecord": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getInfo", + "parameters": [ + { + "name": "email", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "firstName", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "lastName", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getTasks", + "parameters": [ + { + "name": "str", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app70.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app70.json new file mode 100644 index 000000000..e396f47a2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app70.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/example/{test}":{"get":{"tags":["hello-controller"],"description":"Some operation, customized operation!","operationId":"test","parameters":[{"name":"test","in":"path","description":"Parameter description, customized parameter!","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiType"}}}}}}}},"components":{"schemas":{"ApiType":{"type":"object","properties":{"someProperty":{"type":"string","format":"duration","description":"Test description","properties":{}}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app71.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app71.json new file mode 100644 index 000000000..e55dd46e8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app71.json @@ -0,0 +1,59 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "parameters": [ + { + "name": "dog", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Dog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Dog": { + "type": "object", + "properties": { + "display_name": { + "type": "string", + "description": "A name given to the Dog", + "example": "Fido" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app73.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app73.json new file mode 100644 index 000000000..d55781656 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app73.json @@ -0,0 +1,150 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{country_code}/persons/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "get", + "parameters": [ + { + "name": "country_code", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "hello-controller" + ], + "operationId": "delete", + "parameters": [ + { + "name": "country_code", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/persons/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "get_1", + "parameters": [ + { + "name": "country_code", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "hello-controller" + ], + "operationId": "delete_1", + "parameters": [ + { + "name": "country_code", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app74.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app74.json new file mode 100644 index 000000000..538726643 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app74.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "postMyRequestBody", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + }, + "example": "sample" + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app75.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app75.json new file mode 100644 index 000000000..e36b96f3a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app75.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test3/{uuid}":{"post":{"tags":["hello-controller"],"summary":"Example api that realize an ECHO operation","description":"The result of the echo is the input value of the api","operationId":"postMyRequestBody3","parameters":[{"name":"uuid","in":"path","description":"Is the identification of the document","required":true,"schema":{"example":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{}}}}},"201":{"description":"other possible response","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/test2/{uuid}":{"post":{"tags":["hello-controller"],"summary":"Example api that realize an ECHO operation","description":"The result of the echo is the input value of the api","operationId":"postMyRequestBody2","parameters":[{"name":"uuid","in":"path","description":"Is the identification of the document","required":true,"schema":{"example":"uuid"}}],"responses":{"200":{"description":"Successful Operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonDTO"}}}},"201":{"description":"other possible response","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/test1/{uuid}":{"post":{"tags":["hello-controller"],"summary":"Example api that realize an ECHO operation","description":"The result of the echo is the input value of the api","operationId":"postMyRequestBody1","parameters":[{"name":"uuid","in":"path","description":"Is the identification of the document","required":true,"schema":{"example":"uuid"}}],"responses":{"200":{"description":"Successful Operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonDTO"}}}},"201":{"description":"other possible response","content":{"*/*":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"PersonDTO":{"type":"object","properties":{"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"}}}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app76.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app76.json new file mode 100644 index 000000000..d0d682187 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app76.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "security": [ + { + "bearer-jwt": [ + "read", + "write" + ] + } + ], + "paths": { + "/open": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "open", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [] + } + }, + "/secure": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "secured", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "bearer-jwt": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app77.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app77.json new file mode 100644 index 000000000..338fcfc64 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app77.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/persons":{"get":{"tags":["hello-controller"],"operationId":"persons","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"default response","content":{"*/*":{"schema":{}}},"x-is-file":"true"}}}},"/persons2":{"get":{"tags":["hello-controller"],"operationId":"persons2","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"default response","content":{"*/*":{"schema":{}}},"x-is-file":"true"}}}}},"components":{}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app78.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app78.json new file mode 100644 index 000000000..d013a11d2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app78.json @@ -0,0 +1,93 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/person1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPerson1", + "parameters": [ + { + "name": "str", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/person2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPerson2", + "parameters": [ + { + "name": "str", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app79.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app79.json new file mode 100644 index 000000000..0b1b60991 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app79.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "echo", + "parameters": [ + { + "name": "text", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app80.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app80.json new file mode 100644 index 000000000..1b48b63aa --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app80.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/testpost1": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "testpost1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TestObject": { + "type": "object", + "properties": { + "stringValue": { + "type": "string" + }, + "localDateTime": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app82.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app82.json new file mode 100644 index 000000000..6efed1a5f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app82.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "put": { + "tags": [ + "hello-controller" + ], + "operationId": "put", + "parameters": [ + { + "name": "configuration", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "second", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "personDTO", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": {} + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app83.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app83.json new file mode 100644 index 000000000..6b92220a2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app83.json @@ -0,0 +1,100 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{config}": { + "put": { + "tags": [ + "hello-controller" + ], + "operationId": "put", + "parameters": [ + { + "name": "config", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "configuration": { + "format": "binary" + }, + "file": { + "type": "string", + "format": "binary" + } + }, + "required": [ + "configuration", + "file" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/test": { + "put": { + "tags": [ + "hello-controller" + ], + "operationId": "put2", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "format": "binary" + } + }, + "required": [ + "file" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app84.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app84.json new file mode 100644 index 000000000..e47f4dfbf --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app84.json @@ -0,0 +1,66 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/persons1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons_1", + "parameters": [ + { + "name": "toto", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app85.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app85.json new file mode 100644 index 000000000..65526b91c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app85.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/test/{id}": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "testme", + "parameters": [ + { + "$ref": "#/components/parameters/paramA" + }, + { + "$ref": "#/components/parameters/paramB" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app86.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app86.json new file mode 100644 index 000000000..ba0d2d830 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app86.json @@ -0,0 +1,39 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "hello", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app87.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app87.json new file mode 100644 index 000000000..d460805eb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app87.json @@ -0,0 +1,208 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{itemId}": { + "put": { + "tags": [ + "hello-controller" + ], + "operationId": "putItem", + "parameters": [ + { + "name": "cookie", + "in": "cookie", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + }, + "/values/data": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "list", + "parameters": [ + { + "name": "access_token", + "in": "header", + "description": "token in header", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "access_token", + "in": "cookie", + "description": "token in cookie", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/duplicate_param": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Duplicate param", + "operationId": "duplicateParam", + "parameters": [ + { + "name": "sample", + "in": "query", + "description": "sample query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "sample", + "in": "header", + "description": "sample Header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/duplicate_param3": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Duplicate param", + "operationId": "duplicateParam3", + "parameters": [ + { + "name": "sample", + "in": "header", + "description": "sample", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/duplicate_param2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Duplicate param", + "operationId": "duplicateParam2", + "parameters": [ + { + "name": "sample", + "in": "query", + "description": "sample", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Item": { + "type": "object" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app88.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app88.json new file mode 100644 index 000000000..44b332fd5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app88.json @@ -0,0 +1,33 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app89.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app89.json new file mode 100644 index 000000000..f77b7068c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app89.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/status": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get Status", + "operationId": "getAddress", + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/html": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app90.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app90.json new file mode 100644 index 000000000..51f49fab1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app90.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test2":{"post":{"tags":["hello-controller"],"operationId":"test2","requestBody":{"description":"Details of the Item to be created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"examples":{"An example request with the minimum required fields to create.":{"summary":"Minimal request","description":"An example request with the minimum required fields to create.","value":"min"},"An example request with all fields provided with example values.":{"summary":"Full request","description":"An example request with all fields provided with example values.","value":"full"}}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/test":{"get":{"tags":["hello-controller"],"operationId":"test1","parameters":[{"name":"hello","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"examples":{"500":{"$ref":"#/components/examples/http500Example"}}},"application/xml":{"schema":{"$ref":"#/components/schemas/User"}}}}}}}},"components":{"schemas":{"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":10},"username":{"type":"string","example":"theUser"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"James"},"email":{"type":"string","example":"john@email.com"},"password":{"type":"string","example":12345},"phone":{"type":"string","example":12345},"userStatus":{"type":"integer","format":"int32","description":"User Status","example":1}}}},"examples":{"http500Example":{"summary":"HTTP 500 JSON Body response example","description":"An example of HTTP response in case an error occurs on server side. instance attribute reference a traceId to ease server side analysis.","value":"{\"500\":{\"$ref\":\"#/components/examples/http500Example\"}}"}}}} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app91.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app91.json new file mode 100644 index 000000000..0a80fbed3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app91.json @@ -0,0 +1,98 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Demo", + "description": "The Demo API" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Demo" + ], + "operationId": "sayHello2", + "responses": { + "201": { + "description": "item created", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + }, + "400": { + "description": "invalid input, object invalid", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + }, + "409": { + "description": "an existing item already exists", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/": { + "get": { + "tags": [ + "Demo" + ], + "summary": "This API will return a random greeting.", + "operationId": "sayHello", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "title": "Greeting", + "type": "object", + "properties": { + "payload": { + "type": "string", + "description": "The greeting value", + "example": "sdfsdfs" + } + }, + "description": "An object containing a greeting message" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app92.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app92.json new file mode 100644 index 000000000..532e80c9b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app92.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "index", + "parameters": [ + { + "name": "test", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app93.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app93.json new file mode 100644 index 000000000..00f9f23f4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app93.json @@ -0,0 +1,61 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "specific-controller" + ], + "operationId": "get", + "parameters": [ + { + "name": "param", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/SpecificClientModel" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SpecificClientModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SpecificClientModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app94.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app94.json new file mode 100644 index 000000000..200d68efa --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app94.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Demo", + "description": "The Demo API" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Demo" + ], + "operationId": "sayHello2", + "responses": { + "400": { + "description": "invalid input, object invalid", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + }, + "201": { + "description": "item created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + }, + "409": { + "description": "an existing item already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "title": "Greeting", + "type": "object", + "properties": { + "payload": { + "type": "string", + "description": "The greeting value", + "example": "sdfsdfs" + } + }, + "description": "An object containing a greeting message" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app95.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app95.json new file mode 100644 index 000000000..768353de3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app95.json @@ -0,0 +1,42 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Summary of operation persons", + "description": "Description of operation persons", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Description of parameter name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app96.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app96.json new file mode 100644 index 000000000..ac2247f21 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app96.json @@ -0,0 +1,108 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api3": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "test3", + "parameters": [ + { + "name": "test", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api2": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "test2", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api1": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "test1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "minimum": 2, + "type": "integer", + "format": "int32" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app97.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app97.json new file mode 100644 index 000000000..2fd0b4d72 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app97.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/student/header3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "headerV3", + "parameters": [ + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/StudentV3" + } + } + } + } + } + } + }, + "/api/student/header2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "headerV2", + "parameters": [ + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "2" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/StudentV2" + } + } + } + } + } + } + }, + "/api/student/header1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "headerV1", + "parameters": [ + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/StudentV1" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "StudentV3": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "StudentV2": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "StudentV1": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app98.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app98.json new file mode 100644 index 000000000..35bf3512c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app98.json @@ -0,0 +1,29 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app99.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app99.json new file mode 100644 index 000000000..7f5aa9b60 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app99.json @@ -0,0 +1,29 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "202": { + "description": "Description of api response 202" + } + } + } + } + }, + "components": {} +} \ No newline at end of file From a218afd352200d78c7a44bcbef49cfec25c414f8 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 3 Jan 2025 22:22:36 +0100 Subject: [PATCH 147/226] prepare for next release 2.8.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b13aaf1b..6033b23fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.7.1] - 2025-01-03 +## [2.8.0] - 2025-01-03 ### Added - #2790 - Moving to OpenAPI 3.1 as the default implementation for springdoc-openapi From dba83a1aebc27d9d6fdaea97d7649be7c7f0728c Mon Sep 17 00:00:00 2001 From: jenkins Date: Fri, 3 Jan 2025 21:27:04 +0000 Subject: [PATCH 148/226] [maven-release-plugin] prepare release v2.8.0 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 27a229dec..c02a4507f 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.7.1-SNAPSHOT + 2.8.0 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.8.0 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 78beac435..6c81f2d81 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.1-SNAPSHOT + 2.8.0 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 42a789769..bd8ed6f45 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.1-SNAPSHOT + 2.8.0 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 1cf059eac..0b2787f54 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.1-SNAPSHOT + 2.8.0 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 5f3fbe0a3..0045426fc 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.1-SNAPSHOT + 2.8.0 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 7cc45360d..c9b6e8c5b 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.7.1-SNAPSHOT + 2.8.0 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 8dfe685b0..685dece5d 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.7.1-SNAPSHOT + 2.8.0 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index dcc2f5211..35053c3be 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.1-SNAPSHOT + 2.8.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 90c4fd377..501ea1fbb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.1-SNAPSHOT + 2.8.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 9baac1d7f..e414f91aa 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.1-SNAPSHOT + 2.8.0 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index aa6723e1e..603757c9f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.1-SNAPSHOT + 2.8.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index 96a41e1c1..a86f11e3a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.1-SNAPSHOT + 2.8.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index d0069a0fc..ac2e29821 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.7.1-SNAPSHOT + 2.8.0 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 59adbf0f4..1f6f4d93b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.1-SNAPSHOT + 2.8.0 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 9fb6c1a2c..85378386d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.7.1-SNAPSHOT + 2.8.0 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index ff103b883..846bfc2d2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.1-SNAPSHOT + 2.8.0 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 164f2eb0a..c09670cad 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.7.1-SNAPSHOT + 2.8.0 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index dcc65d823..463aedad2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.7.1-SNAPSHOT + 2.8.0 springdoc-openapi-security-tests From 0dc9dcf024bf406c703486b5c9ffdd7c49b6f5ea Mon Sep 17 00:00:00 2001 From: jenkins Date: Fri, 3 Jan 2025 21:27:07 +0000 Subject: [PATCH 149/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index c02a4507f..b3d854a6c 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.0 + 2.8.1-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.8.0 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 6c81f2d81..459240359 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.0 + 2.8.1-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index bd8ed6f45..d0ae853ab 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.0 + 2.8.1-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 0b2787f54..b0a3c063b 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.0 + 2.8.1-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 0045426fc..d9f9c3036 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.0 + 2.8.1-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index c9b6e8c5b..6f2b09ef5 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.0 + 2.8.1-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 685dece5d..b174569f9 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.0 + 2.8.1-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 35053c3be..2156889df 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.0 + 2.8.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 501ea1fbb..746068618 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.0 + 2.8.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index e414f91aa..ceaa87088 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.0 + 2.8.1-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 603757c9f..438c73236 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.0 + 2.8.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index a86f11e3a..fbb76df3f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.0 + 2.8.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index ac2e29821..c2a834a48 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.0 + 2.8.1-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 1f6f4d93b..5d5008e5e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.0 + 2.8.1-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 85378386d..3879a9ffc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.0 + 2.8.1-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 846bfc2d2..a7e9026b4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.0 + 2.8.1-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index c09670cad..a313379e7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.0 + 2.8.1-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 463aedad2..9df30685f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.0 + 2.8.1-SNAPSHOT springdoc-openapi-security-tests From ecb3782a463f0b09ca57f4bc15aabcb4f23c6f7f Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 6 Jan 2025 11:04:39 +0100 Subject: [PATCH 150/226] java.lang.ClassNotFoundException: kotlin.reflect.full.KClasses when upgrade from 2.7.0 to 2.8.0. Fixes #2834 --- springdoc-openapi-starter-common/pom.xml | 5 +++++ .../configuration/SpringDocKotlinConfiguration.kt | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 459240359..285b3dc32 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -72,6 +72,11 @@ kotlinx-coroutines-reactor provided + + org.jetbrains.kotlin + kotlin-reflect + provided + org.springframework.boot diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt index 82cd690a5..d11d0cb91 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocKotlinConfiguration.kt @@ -128,10 +128,15 @@ class SpringDocKotlinConfiguration() { return kotlinFunction.parameters[parameterIndex + 1] } - @Bean - @Lazy(false) - @ConditionalOnMissingBean - fun kotlinDeprecatedPropertyCustomizer(objectMapperProvider: ObjectMapperProvider): KotlinDeprecatedPropertyCustomizer { - return KotlinDeprecatedPropertyCustomizer(objectMapperProvider) + @ConditionalOnClass(name = ["kotlin.reflect.full.KClasses"]) + class KotlinReflectDependingConfiguration { + + @Bean + @Lazy(false) + @ConditionalOnMissingBean + fun kotlinDeprecatedPropertyCustomizer(objectMapperProvider: ObjectMapperProvider): KotlinDeprecatedPropertyCustomizer { + return KotlinDeprecatedPropertyCustomizer(objectMapperProvider) + } } + } From f29064c004ae5e79893702e73d9637b3ab025d62 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 6 Jan 2025 11:18:46 +0100 Subject: [PATCH 151/226] CHANGELOG.md update for v2.8.1 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6033b23fc..e8e3f96e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.8.1] - 2025-01-06 + +### Fixed +- #2834 - java.lang.ClassNotFoundException: kotlin.reflect.full.KClasses when upgrade from 2.7.0 to 2.8.0 + ## [2.8.0] - 2025-01-03 ### Added From cf630f763c1e16dc50811df7e65a44d12f5651c3 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 6 Jan 2025 10:20:41 +0000 Subject: [PATCH 152/226] [maven-release-plugin] prepare release v2.8.1 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index b3d854a6c..3bb41f32d 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.1-SNAPSHOT + 2.8.1 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.8.1 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 285b3dc32..59e6527a2 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1-SNAPSHOT + 2.8.1 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index d0ae853ab..809c66428 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1-SNAPSHOT + 2.8.1 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index b0a3c063b..2d4b328b3 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1-SNAPSHOT + 2.8.1 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index d9f9c3036..4242bdc79 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1-SNAPSHOT + 2.8.1 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 6f2b09ef5..a33d39632 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1-SNAPSHOT + 2.8.1 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index b174569f9..c8ea5e5b1 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.1-SNAPSHOT + 2.8.1 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 2156889df..a0ab201c4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1-SNAPSHOT + 2.8.1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 746068618..c120c668c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1-SNAPSHOT + 2.8.1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index ceaa87088..15fa7aef7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1-SNAPSHOT + 2.8.1 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 438c73236..94f84bb86 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1-SNAPSHOT + 2.8.1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index fbb76df3f..c2ca0d6df 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1-SNAPSHOT + 2.8.1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index c2a834a48..e7139e131 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.1-SNAPSHOT + 2.8.1 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 5d5008e5e..881e243ad 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1-SNAPSHOT + 2.8.1 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 3879a9ffc..d78f4a391 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.1-SNAPSHOT + 2.8.1 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index a7e9026b4..82f8098ed 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1-SNAPSHOT + 2.8.1 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index a313379e7..224717cc6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1-SNAPSHOT + 2.8.1 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 9df30685f..d3aad5a71 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.1-SNAPSHOT + 2.8.1 springdoc-openapi-security-tests From 8dc7e733a1d3128840b6f5fe12dfbe332cf6f29e Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 6 Jan 2025 10:20:44 +0000 Subject: [PATCH 153/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 3bb41f32d..2c33dd7bc 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.1 + 2.8.2-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.8.1 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 59e6527a2..3a8925e08 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1 + 2.8.2-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 809c66428..72cf5ee33 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1 + 2.8.2-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 2d4b328b3..06e18b587 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1 + 2.8.2-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 4242bdc79..16845e4ae 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1 + 2.8.2-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index a33d39632..5805fe4a7 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.1 + 2.8.2-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index c8ea5e5b1..316da2ea6 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.1 + 2.8.2-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index a0ab201c4..1302837c5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1 + 2.8.2-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index c120c668c..04a4a874c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1 + 2.8.2-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 15fa7aef7..5783c7975 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1 + 2.8.2-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 94f84bb86..a734361c8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1 + 2.8.2-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index c2ca0d6df..0b988b00f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1 + 2.8.2-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index e7139e131..ac722d583 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.1 + 2.8.2-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 881e243ad..035c372b4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1 + 2.8.2-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index d78f4a391..106a37f9a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.1 + 2.8.2-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 82f8098ed..66edd10d0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1 + 2.8.2-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 224717cc6..16a712c1f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.1 + 2.8.2-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index d3aad5a71..744e14ddb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.1 + 2.8.2-SNAPSHOT springdoc-openapi-security-tests From 88f5da0f74b3b8c89012e4748a94a6a5a862846f Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 12 Jan 2025 01:37:45 +0100 Subject: [PATCH 154/226] Provide better compatibility for projects migrating from OAS 3.0 to OAS 3.1. Fixes #2849 --- .../configuration/SpringDocConfiguration.java | 26 +- .../SpringDocHateoasConfiguration.java | 25 +- .../converters/AdditionalModelsConverter.java | 7 +- .../converters/HateoasLinksConverter.java | 92 + .../core/converters/OAS31ModelConverter.java | 58 + .../core/converters/PageOpenAPIConverter.java | 5 +- .../converters/PageableOpenAPIConverter.java | 5 +- .../converters/PolymorphicModelConverter.java | 17 +- .../RepresentationModelLinksOASMixin.java | 44 - .../core/converters/SortOpenAPIConverter.java | 5 +- .../ActuatorOperationCustomizer.java | 5 +- .../OpenApiHateoasLinksCustomizer.java | 4 +- .../core/mixins/SortedOpenAPIMixin31.java | 3 +- .../core/mixins/SortedSchemaMixin31.java | 15 +- .../core/providers/ObjectMapperProvider.java | 14 + .../core/service/AbstractRequestService.java | 2 +- .../core/service/GenericParameterService.java | 15 +- .../core/service/OpenAPIService.java | 30 +- .../core/utils/SpringDocAnnotationsUtils.java | 16 +- .../core/utils/SpringDocDataRestUtils.java | 58 +- .../springdoc/core/utils/SpringDocUtils.java | 60 + .../org/springdoc/api/AbstractCommonTest.java | 37 - .../springdoc/api/AbstractSpringDocTest.java | 60 - .../api/app102/InheritedRequestParams.java | 18 - .../springdoc/api/app102/RequestParams.java | 122 - .../api/app102/SpringDocApp102Test.java | 14 - .../springdoc/api/app102/TestController.java | 15 - .../springdoc/api/app149/HelloController.java | 65 - .../springdoc/api/app149/HelloMessage.java | 30 - .../api/app149/HiddenHelloController.java | 22 - .../api/app149/SpringDocApp149Test.java | 36 - .../org/springdoc/api/app150/HelloRouter.java | 65 - .../api/app150/SpringDocApp150Test.java | 33 - .../org/springdoc/api/app151/HelloRouter.java | 65 - .../api/app151/SpringDocApp151Test.java | 33 - .../springdoc/api/app152/HelloController.java | 44 - .../api/app152/SpringDocApp152Test.java | 33 - .../DefaultRequestMappingHandlerMapping.java | 42 - .../app153/DefaultWebFluxRegistrations.java | 15 - .../api/app153/SpringDocApp153Test.java | 33 - .../springdoc/api/app153/TestController.java | 13 - .../springdoc/api/app184/HelloController.java | 53 - .../api/app184/SpringDocApp184Test.java | 126 - .../api/app187/DuplicatedPathController.java | 19 - .../api/app187/SpringDocApp187Test.java | 36 - .../org/springdoc/api/app188/OrderDemo.java | 41 - .../api/app188/SpringDocApp188Test.java | 31 - .../springdoc/api/app189/HelloController.java | 47 - .../api/app189/SpringDocApp189Test.java | 55 - .../api/app189/SpringDocTestApp.java | 53 - .../api/app190/SpringDocApp190Test.java | 43 - .../api/app190/SpringDocApp190bisTest.java | 43 - .../api/app191/Handler/BaseHandler.java | 16 - .../api/app191/Handler/GetNameHandler.java | 19 - .../api/app191/Router/GetNameRouter.java | 37 - .../api/app191/SpringDocApp191Test.java | 31 - .../springdoc/api/app3/SpringDocApp3Test.java | 26 - .../springdoc/api/app3/SpringDocTestApp.java | 47 - .../app3/controller/ExceptionTranslator.java | 50 - .../api/app3/controller/TweetController.java | 87 - .../org/springdoc/api/app3/dto/TweetDTO.java | 72 - .../exception/TweetConflictException.java | 34 - .../exception/TweetNotFoundException.java | 34 - .../api/app3/payload/ErrorResponse.java | 38 - .../springdoc/api/app39/HelloController.java | 45 - .../api/app39/SpringDocApp39Test.java | 26 - .../springdoc/api/app39/SpringDocTestApp.java | 52 - .../springdoc/api/app4/HelloController.java | 47 - .../springdoc/api/app4/SpringDocApp4Test.java | 26 - .../springdoc/api/app4/SpringDocTestApp.java | 47 - .../springdoc/api/app5/HelloController.java | 43 - .../springdoc/api/app5/SpringDocApp5Test.java | 26 - .../springdoc/api/app5/SpringDocTestApp.java | 47 - .../test/org/springdoc/api/app5/Tweet.java | 61 - .../springdoc/api/app63/HelloController.java | 31 - .../api/app63/SpringDocApp63Test.java | 33 - .../api/app63/toto/HelloController2.java | 31 - .../springdoc/api/app64/HelloController.java | 39 - .../api/app64/SpringDocApp64Test.java | 33 - .../springdoc/api/app65/HelloController.java | 39 - .../api/app65/SpringDocApp65Test.java | 31 - .../api/app66/SpringDocApp66Test.java | 36 - .../springdoc/api/app66/SpringDocTestApp.java | 57 - .../app66/controller/ExceptionTranslator.java | 50 - .../api/app66/controller/TweetController.java | 87 - .../org/springdoc/api/app66/dto/TweetDTO.java | 72 - .../exception/TweetConflictException.java | 34 - .../exception/TweetNotFoundException.java | 34 - .../api/app66/payload/ErrorResponse.java | 38 - .../springdoc/api/app67/HelloController.java | 33 - .../api/app67/SpringDocApp67Test.java | 53 - .../api/app68/SpringDocApp68Test.java | 56 - .../app68/controller/ExceptionTranslator.java | 50 - .../api/app68/controller/TweetController.java | 87 - .../org/springdoc/api/app68/dto/TweetDTO.java | 72 - .../exception/TweetConflictException.java | 34 - .../exception/TweetNotFoundException.java | 34 - .../api/app68/payload/ErrorResponse.java | 38 - .../api/app69/RoutingConfiguration.java | 36 - .../api/app69/SpringDocApp69Test.java | 31 - .../test/org/springdoc/api/app69/User.java | 59 - .../org/springdoc/api/app69/UserHandler.java | 93 - .../springdoc/api/app69/UserRepository.java | 25 - .../api/app69/UserRepositoryImpl.java | 72 - .../test/org/springdoc/api/app70/Coffee.java | 60 - .../org/springdoc/api/app70/CoffeeOrder.java | 48 - .../springdoc/api/app70/CoffeeRepository.java | 26 - .../springdoc/api/app70/CoffeeService.java | 34 - .../org/springdoc/api/app70/RouteConfig.java | 50 - .../api/app70/SpringDocApp70Test.java | 31 - .../org/springdoc/api/app71/Employee.java | 24 - .../api/app71/EmployeeFunctionalConfig.java | 82 - .../api/app71/EmployeeRepository.java | 32 - .../api/app71/SpringDocApp71Test.java | 31 - .../api/app72/SpringDocApp72Test.java | 33 - .../api/app72/controller/PersonRouter.java | 36 - .../api/app72/controller/PositionRouter.java | 48 - .../springdoc/api/app72/entity/Person.java | 74 - .../springdoc/api/app72/entity/Position.java | 54 - .../org/springdoc/api/app72/entity/Sex.java | 5 - .../exception/PositionNotFoundException.java | 8 - .../api/app72/handler/PersonHandler.java | 52 - .../api/app72/handler/PositionHandler.java | 30 - .../api/app72/payload/ErrorResponse.java | 19 - .../api/app72/service/PersonService.java | 39 - .../test/org/springdoc/api/app73/Quote.java | 82 - .../springdoc/api/app73/QuoteGenerator.java | 89 - .../org/springdoc/api/app73/QuoteHandler.java | 66 - .../org/springdoc/api/app73/QuoteRouter.java | 73 - .../api/app73/SpringDocApp73Test.java | 33 - .../test/org/springdoc/api/app74/Book.java | 60 - .../springdoc/api/app74/BookRepository.java | 38 - .../org/springdoc/api/app74/BookRouter.java | 55 - .../api/app74/SpringDocApp74Test.java | 33 - .../test/org/springdoc/api/app75/Post.java | 73 - .../org/springdoc/api/app75/PostHandler.java | 77 - .../springdoc/api/app75/PostRepository.java | 47 - .../org/springdoc/api/app75/PostRouter.java | 67 - .../api/app75/SpringDocApp75Test.java | 33 - .../springdoc/api/app78/HelloController.java | 55 - .../api/app78/SpringDocApp78Test.java | 36 - .../springdoc/api/app79/BaseClientModel.java | 8 - .../springdoc/api/app79/BaseController.java | 20 - .../api/app79/SpecificClientModel.java | 10 - .../api/app79/SpecificController.java | 6 - .../api/app79/SpringDocApp79Test.java | 36 - .../test/org/springdoc/api/app80/Book.java | 60 - .../springdoc/api/app80/BookRepository.java | 38 - .../org/springdoc/api/app80/BookRouter.java | 107 - .../api/app80/SpringDocApp80Test.java | 36 - .../api/app81/OperationIdController.java | 50 - .../api/app81/SpringDocApp81Test.java | 92 - .../api/app82/RoutingConfiguration.java | 39 - .../api/app82/SpringDocApp82Test.java | 31 - .../test/org/springdoc/api/app82/User.java | 59 - .../org/springdoc/api/app82/UserHandler.java | 93 - .../springdoc/api/app82/UserRepository.java | 25 - .../api/app82/UserRepositoryImpl.java | 72 - .../test/org/springdoc/api/app83/Coffee.java | 60 - .../org/springdoc/api/app83/CoffeeOrder.java | 48 - .../springdoc/api/app83/CoffeeRepository.java | 26 - .../springdoc/api/app83/CoffeeService.java | 34 - .../org/springdoc/api/app83/RouteConfig.java | 52 - .../api/app83/SpringDocApp83Test.java | 31 - .../org/springdoc/api/app84/Employee.java | 24 - .../api/app84/EmployeeFunctionalConfig.java | 81 - .../api/app84/EmployeeRepository.java | 32 - .../api/app84/SpringDocApp84Test.java | 31 - .../api/app85/SpringDocApp85Test.java | 33 - .../api/app85/controller/PersonRouter.java | 39 - .../api/app85/controller/PositionRouter.java | 53 - .../springdoc/api/app85/entity/Person.java | 74 - .../springdoc/api/app85/entity/Position.java | 54 - .../org/springdoc/api/app85/entity/Sex.java | 5 - .../exception/PositionNotFoundException.java | 8 - .../api/app85/handler/PersonHandler.java | 52 - .../api/app85/handler/PositionHandler.java | 30 - .../api/app85/payload/ErrorResponse.java | 19 - .../api/app85/service/PersonService.java | 39 - .../test/org/springdoc/api/app86/Quote.java | 82 - .../springdoc/api/app86/QuoteGenerator.java | 89 - .../org/springdoc/api/app86/QuoteHandler.java | 66 - .../org/springdoc/api/app86/QuoteRouter.java | 73 - .../api/app86/SpringDocApp86Test.java | 33 - .../test/org/springdoc/api/app87/Book.java | 60 - .../springdoc/api/app87/BookRepository.java | 38 - .../org/springdoc/api/app87/BookRouter.java | 54 - .../api/app87/SpringDocApp87Test.java | 33 - .../test/org/springdoc/api/app88/Post.java | 73 - .../org/springdoc/api/app88/PostHandler.java | 77 - .../springdoc/api/app88/PostRepository.java | 47 - .../org/springdoc/api/app88/PostRouter.java | 71 - .../api/app88/SpringDocApp88Test.java | 33 - .../test/org/springdoc/api/app89/Book.java | 60 - .../springdoc/api/app89/BookRepository.java | 38 - .../org/springdoc/api/app89/BookRouter.java | 103 - .../api/app89/SpringDocApp89Test.java | 36 - .../org/springdoc/api/app90/HelloRouter.java | 49 - .../api/app90/SpringDocApp90Test.java | 36 - .../springdoc/api/app90/book/BookRouter.java | 144 - .../api/app90/employee/Employee.java | 24 - .../app90/employee/EmployeeRepository.java | 32 - .../api/app90/employee/EmployeeRouter.java | 52 - .../api/app90/position/PositionRouter.java | 66 - .../api/app90/quotes/QuotesRouter.java | 130 - .../springdoc/api/v30/AbstractCommonTest.java | 63 + .../api/v30/AbstractSpringDocTest.java | 68 + .../v30/app102/InheritedRequestParams.java | 44 + .../api/v30/app102/RequestParams.java | 148 + .../api/v30/app102/SpringDocApp102Test.java | 40 + .../api/v30/app102/TestController.java | 41 + .../api/v30/app149/HelloController.java | 73 + .../api/v30/app149/HelloMessage.java | 38 + .../api/v30/app149/HiddenHelloController.java | 48 + .../api/v30/app149/SpringDocApp149Test.java | 44 + .../springdoc/api/v30/app150/HelloRouter.java | 71 + .../api/v30/app150/SpringDocApp150Test.java | 39 + .../springdoc/api/v30/app151/HelloRouter.java | 71 + .../api/v30/app151/SpringDocApp151Test.java | 39 + .../api/v30/app152/HelloController.java | 52 + .../api/v30/app152/SpringDocApp152Test.java | 39 + .../DefaultRequestMappingHandlerMapping.java | 68 + .../app153/DefaultWebFluxRegistrations.java | 41 + .../api/v30/app153/SpringDocApp153Test.java | 39 + .../api/v30/app153/TestController.java | 39 + .../api/v30/app184/HelloController.java | 61 + .../api/v30/app184/SpringDocApp184Test.java | 132 + .../v30/app187/DuplicatedPathController.java | 45 + .../api/v30/app187/SpringDocApp187Test.java | 62 + .../springdoc/api/v30/app188/OrderDemo.java | 67 + .../api/v30/app188/SpringDocApp188Test.java | 57 + .../api/v30/app189/HelloController.java | 55 + .../api/v30/app189/SpringDocApp189Test.java | 63 + .../api/v30/app189/SpringDocTestApp.java | 61 + .../api/v30/app190/SpringDocApp190Test.java | 51 + .../v30/app190/SpringDocApp190bisTest.java | 51 + .../api/v30/app191/Handler/BaseHandler.java | 42 + .../v30/app191/Handler/GetNameHandler.java | 45 + .../api/v30/app191/Router/GetNameRouter.java | 63 + .../api/v30/app191/SpringDocApp191Test.java | 39 + .../api/v30/app3/SpringDocApp3Test.java | 34 + .../api/v30/app3/SpringDocTestApp.java | 55 + .../app3/controller/ExceptionTranslator.java | 58 + .../v30/app3/controller/TweetController.java | 95 + .../springdoc/api/v30/app3/dto/TweetDTO.java | 80 + .../exception/TweetConflictException.java | 42 + .../exception/TweetNotFoundException.java | 42 + .../api/v30/app3/payload/ErrorResponse.java | 46 + .../api/v30/app39/HelloController.java | 53 + .../api/v30/app39/SpringDocApp39Test.java | 34 + .../api/v30/app39/SpringDocTestApp.java | 60 + .../api/v30/app4/HelloController.java | 55 + .../api/v30/app4/SpringDocApp4Test.java | 34 + .../api/v30/app4/SpringDocTestApp.java | 55 + .../api/v30/app5/HelloController.java | 51 + .../api/v30/app5/SpringDocApp5Test.java | 34 + .../api/v30/app5/SpringDocTestApp.java | 55 + .../org/springdoc/api/v30/app5/Tweet.java | 69 + .../api/v30/app63/HelloController.java | 39 + .../api/v30/app63/SpringDocApp63Test.java | 41 + .../api/v30/app63/toto/HelloController2.java | 39 + .../api/v30/app64/HelloController.java | 47 + .../api/v30/app64/SpringDocApp64Test.java | 41 + .../api/v30/app65/HelloController.java | 47 + .../api/v30/app65/SpringDocApp65Test.java | 39 + .../api/v30/app66/SpringDocApp66Test.java | 44 + .../api/v30/app66/SpringDocTestApp.java | 65 + .../app66/controller/ExceptionTranslator.java | 58 + .../v30/app66/controller/TweetController.java | 95 + .../springdoc/api/v30/app66/dto/TweetDTO.java | 80 + .../exception/TweetConflictException.java | 42 + .../exception/TweetNotFoundException.java | 42 + .../api/v30/app66/payload/ErrorResponse.java | 46 + .../api/v30/app67/HelloController.java | 41 + .../api/v30/app67/SpringDocApp67Test.java | 61 + .../api/v30/app68/SpringDocApp68Test.java | 64 + .../app68/controller/ExceptionTranslator.java | 58 + .../v30/app68/controller/TweetController.java | 95 + .../springdoc/api/v30/app68/dto/TweetDTO.java | 80 + .../exception/TweetConflictException.java | 42 + .../exception/TweetNotFoundException.java | 42 + .../api/v30/app68/payload/ErrorResponse.java | 46 + .../api/v30/app69/RoutingConfiguration.java | 62 + .../api/v30/app69/SpringDocApp69Test.java | 39 + .../org/springdoc/api/v30/app69/User.java | 85 + .../springdoc/api/v30/app69/UserHandler.java | 119 + .../api/v30/app69/UserRepository.java | 51 + .../api/v30/app69/UserRepositoryImpl.java | 98 + .../org/springdoc/api/v30/app70/Coffee.java | 86 + .../springdoc/api/v30/app70/CoffeeOrder.java | 74 + .../api/v30/app70/CoffeeRepository.java | 52 + .../api/v30/app70/CoffeeService.java | 60 + .../springdoc/api/v30/app70/RouteConfig.java | 76 + .../api/v30/app70/SpringDocApp70Test.java | 39 + .../org/springdoc/api/v30/app71/Employee.java | 50 + .../v30/app71/EmployeeFunctionalConfig.java | 108 + .../api/v30/app71/EmployeeRepository.java | 58 + .../api/v30/app71/SpringDocApp71Test.java | 39 + .../api/v30/app72/SpringDocApp72Test.java | 39 + .../v30/app72/controller/PersonRouter.java | 62 + .../v30/app72/controller/PositionRouter.java | 74 + .../api/v30/app72/entity/Person.java | 100 + .../api/v30/app72/entity/Position.java | 80 + .../springdoc/api/v30/app72/entity/Sex.java | 31 + .../exception/PositionNotFoundException.java | 34 + .../api/v30/app72/handler/PersonHandler.java | 78 + .../v30/app72/handler/PositionHandler.java | 56 + .../api/v30/app72/payload/ErrorResponse.java | 45 + .../api/v30/app72/service/PersonService.java | 65 + .../org/springdoc/api/v30/app73/Quote.java | 88 + .../api/v30/app73/QuoteGenerator.java | 95 + .../springdoc/api/v30/app73/QuoteHandler.java | 72 + .../springdoc/api/v30/app73/QuoteRouter.java | 79 + .../api/v30/app73/SpringDocApp73Test.java | 39 + .../org/springdoc/api/v30/app74/Book.java | 66 + .../api/v30/app74/BookRepository.java | 44 + .../springdoc/api/v30/app74/BookRouter.java | 61 + .../api/v30/app74/SpringDocApp74Test.java | 39 + .../org/springdoc/api/v30/app75/Post.java | 79 + .../springdoc/api/v30/app75/PostHandler.java | 83 + .../api/v30/app75/PostRepository.java | 53 + .../springdoc/api/v30/app75/PostRouter.java | 73 + .../api/v30/app75/SpringDocApp75Test.java | 39 + .../api/v30/app78/HelloController.java | 63 + .../api/v30/app78/SpringDocApp78Test.java | 39 + .../api/v30/app79/BaseClientModel.java | 34 + .../api/v30/app79/BaseController.java | 46 + .../api/v30/app79/SpecificClientModel.java | 36 + .../api/v30/app79/SpecificController.java | 32 + .../api/v30/app79/SpringDocApp79Test.java | 39 + .../org/springdoc/api/v30/app80/Book.java | 66 + .../api/v30/app80/BookRepository.java | 44 + .../springdoc/api/v30/app80/BookRouter.java | 113 + .../api/v30/app80/SpringDocApp80Test.java | 39 + .../api/v30/app81/OperationIdController.java | 58 + .../api/v30/app81/SpringDocApp81Test.java | 95 + .../api/v30/app82/RoutingConfiguration.java | 65 + .../api/v30/app82/SpringDocApp82Test.java | 39 + .../org/springdoc/api/v30/app82/User.java | 85 + .../springdoc/api/v30/app82/UserHandler.java | 119 + .../api/v30/app82/UserRepository.java | 51 + .../api/v30/app82/UserRepositoryImpl.java | 98 + .../org/springdoc/api/v30/app83/Coffee.java | 86 + .../springdoc/api/v30/app83/CoffeeOrder.java | 74 + .../api/v30/app83/CoffeeRepository.java | 52 + .../api/v30/app83/CoffeeService.java | 60 + .../springdoc/api/v30/app83/RouteConfig.java | 78 + .../api/v30/app83/SpringDocApp83Test.java | 39 + .../org/springdoc/api/v30/app84/Employee.java | 50 + .../v30/app84/EmployeeFunctionalConfig.java | 107 + .../api/v30/app84/EmployeeRepository.java | 58 + .../api/v30/app84/SpringDocApp84Test.java | 39 + .../api/v30/app85/SpringDocApp85Test.java | 39 + .../v30/app85/controller/PersonRouter.java | 65 + .../v30/app85/controller/PositionRouter.java | 79 + .../api/v30/app85/entity/Person.java | 100 + .../api/v30/app85/entity/Position.java | 80 + .../springdoc/api/v30/app85/entity/Sex.java | 31 + .../exception/PositionNotFoundException.java | 34 + .../api/v30/app85/handler/PersonHandler.java | 78 + .../v30/app85/handler/PositionHandler.java | 56 + .../api/v30/app85/payload/ErrorResponse.java | 45 + .../api/v30/app85/service/PersonService.java | 65 + .../org/springdoc/api/v30/app86/Quote.java | 88 + .../api/v30/app86/QuoteGenerator.java | 95 + .../springdoc/api/v30/app86/QuoteHandler.java | 72 + .../springdoc/api/v30/app86/QuoteRouter.java | 79 + .../api/v30/app86/SpringDocApp86Test.java | 39 + .../org/springdoc/api/v30/app87/Book.java | 66 + .../api/v30/app87/BookRepository.java | 44 + .../springdoc/api/v30/app87/BookRouter.java | 60 + .../api/v30/app87/SpringDocApp87Test.java | 39 + .../org/springdoc/api/v30/app88/Post.java | 79 + .../springdoc/api/v30/app88/PostHandler.java | 83 + .../api/v30/app88/PostRepository.java | 53 + .../springdoc/api/v30/app88/PostRouter.java | 77 + .../api/v30/app88/SpringDocApp88Test.java | 39 + .../org/springdoc/api/v30/app89/Book.java | 66 + .../api/v30/app89/BookRepository.java | 44 + .../springdoc/api/v30/app89/BookRouter.java | 109 + .../api/v30/app89/SpringDocApp89Test.java | 39 + .../springdoc/api/v30/app90/HelloRouter.java | 52 + .../api/v30/app90/SpringDocApp90Test.java | 39 + .../api/v30/app90/book/BookRouter.java | 147 + .../api/v30/app90/employee/Employee.java | 50 + .../app90/employee/EmployeeRepository.java | 58 + .../v30/app90/employee/EmployeeRouter.java | 55 + .../v30/app90/position/PositionRouter.java | 69 + .../api/v30/app90/quotes/QuotesRouter.java | 133 + .../springdoc/api/v31/AbstractCommonTest.java | 61 + .../api/v31/AbstractSpringDocTest.java | 68 + .../v31/app102/InheritedRequestParams.java | 44 + .../api/v31/app102/RequestParams.java | 148 + .../api/v31/app102/SpringDocApp102Test.java | 40 + .../api/v31/app102/TestController.java | 41 + .../api/v31/app149/HelloController.java | 73 + .../api/v31/app149/HelloMessage.java | 38 + .../api/v31/app149/HiddenHelloController.java | 48 + .../api/v31/app149/SpringDocApp149Test.java | 44 + .../springdoc/api/v31/app150/HelloRouter.java | 71 + .../api/v31/app150/SpringDocApp150Test.java | 39 + .../springdoc/api/v31/app151/HelloRouter.java | 71 + .../api/v31/app151/SpringDocApp151Test.java | 39 + .../api/v31/app152/HelloController.java | 52 + .../api/v31/app152/SpringDocApp152Test.java | 39 + .../DefaultRequestMappingHandlerMapping.java | 68 + .../app153/DefaultWebFluxRegistrations.java | 41 + .../api/v31/app153/SpringDocApp153Test.java | 39 + .../api/v31/app153/TestController.java | 39 + .../api/v31/app184/HelloController.java | 61 + .../api/v31/app184/SpringDocApp184Test.java | 132 + .../v31/app187/DuplicatedPathController.java | 45 + .../api/v31/app187/SpringDocApp187Test.java | 62 + .../springdoc/api/v31/app188/OrderDemo.java | 67 + .../api/v31/app188/SpringDocApp188Test.java | 57 + .../api/v31/app189/HelloController.java | 55 + .../api/v31/app189/SpringDocApp189Test.java | 63 + .../api/v31/app189/SpringDocTestApp.java | 61 + .../api/v31/app190/SpringDocApp190Test.java | 51 + .../v31/app190/SpringDocApp190bisTest.java | 51 + .../api/v31/app191/Handler/BaseHandler.java | 42 + .../v31/app191/Handler/GetNameHandler.java | 45 + .../api/v31/app191/Router/GetNameRouter.java | 63 + .../api/v31/app191/SpringDocApp191Test.java | 39 + .../api/v31/app3/SpringDocApp3Test.java | 34 + .../api/v31/app3/SpringDocTestApp.java | 55 + .../app3/controller/ExceptionTranslator.java | 58 + .../v31/app3/controller/TweetController.java | 95 + .../springdoc/api/v31/app3/dto/TweetDTO.java | 80 + .../exception/TweetConflictException.java | 42 + .../exception/TweetNotFoundException.java | 42 + .../api/v31/app3/payload/ErrorResponse.java | 46 + .../api/v31/app39/HelloController.java | 53 + .../api/v31/app39/SpringDocApp39Test.java | 34 + .../api/v31/app39/SpringDocTestApp.java | 60 + .../api/v31/app4/HelloController.java | 55 + .../api/v31/app4/SpringDocApp4Test.java | 34 + .../api/v31/app4/SpringDocTestApp.java | 55 + .../api/v31/app5/HelloController.java | 51 + .../api/v31/app5/SpringDocApp5Test.java | 34 + .../api/v31/app5/SpringDocTestApp.java | 55 + .../org/springdoc/api/v31/app5/Tweet.java | 69 + .../api/v31/app63/HelloController.java | 39 + .../api/v31/app63/SpringDocApp63Test.java | 41 + .../api/v31/app63/toto/HelloController2.java | 39 + .../api/v31/app64/HelloController.java | 47 + .../api/v31/app64/SpringDocApp64Test.java | 41 + .../api/v31/app65/HelloController.java | 47 + .../api/v31/app65/SpringDocApp65Test.java | 39 + .../api/v31/app66/SpringDocApp66Test.java | 44 + .../api/v31/app66/SpringDocTestApp.java | 65 + .../app66/controller/ExceptionTranslator.java | 58 + .../v31/app66/controller/TweetController.java | 95 + .../springdoc/api/v31/app66/dto/TweetDTO.java | 80 + .../exception/TweetConflictException.java | 42 + .../exception/TweetNotFoundException.java | 42 + .../api/v31/app66/payload/ErrorResponse.java | 46 + .../api/v31/app67/HelloController.java | 41 + .../api/v31/app67/SpringDocApp67Test.java | 61 + .../api/v31/app68/SpringDocApp68Test.java | 64 + .../app68/controller/ExceptionTranslator.java | 58 + .../v31/app68/controller/TweetController.java | 95 + .../springdoc/api/v31/app68/dto/TweetDTO.java | 80 + .../exception/TweetConflictException.java | 42 + .../exception/TweetNotFoundException.java | 42 + .../api/v31/app68/payload/ErrorResponse.java | 46 + .../api/v31/app69/RoutingConfiguration.java | 62 + .../api/v31/app69/SpringDocApp69Test.java | 39 + .../org/springdoc/api/v31/app69/User.java | 85 + .../springdoc/api/v31/app69/UserHandler.java | 119 + .../api/v31/app69/UserRepository.java | 51 + .../api/v31/app69/UserRepositoryImpl.java | 98 + .../org/springdoc/api/v31/app70/Coffee.java | 86 + .../springdoc/api/v31/app70/CoffeeOrder.java | 74 + .../api/v31/app70/CoffeeRepository.java | 52 + .../api/v31/app70/CoffeeService.java | 60 + .../springdoc/api/v31/app70/RouteConfig.java | 76 + .../api/v31/app70/SpringDocApp70Test.java | 39 + .../org/springdoc/api/v31/app71/Employee.java | 50 + .../v31/app71/EmployeeFunctionalConfig.java | 108 + .../api/v31/app71/EmployeeRepository.java | 58 + .../api/v31/app71/SpringDocApp71Test.java | 39 + .../api/v31/app72/SpringDocApp72Test.java | 39 + .../v31/app72/controller/PersonRouter.java | 62 + .../v31/app72/controller/PositionRouter.java | 74 + .../api/v31/app72/entity/Person.java | 100 + .../api/v31/app72/entity/Position.java | 80 + .../springdoc/api/v31/app72/entity/Sex.java | 31 + .../exception/PositionNotFoundException.java | 34 + .../api/v31/app72/handler/PersonHandler.java | 78 + .../v31/app72/handler/PositionHandler.java | 56 + .../api/v31/app72/payload/ErrorResponse.java | 45 + .../api/v31/app72/service/PersonService.java | 65 + .../org/springdoc/api/v31/app73/Quote.java | 88 + .../api/v31/app73/QuoteGenerator.java | 95 + .../springdoc/api/v31/app73/QuoteHandler.java | 72 + .../springdoc/api/v31/app73/QuoteRouter.java | 79 + .../api/v31/app73/SpringDocApp73Test.java | 39 + .../org/springdoc/api/v31/app74/Book.java | 66 + .../api/v31/app74/BookRepository.java | 44 + .../springdoc/api/v31/app74/BookRouter.java | 61 + .../api/v31/app74/SpringDocApp74Test.java | 39 + .../org/springdoc/api/v31/app75/Post.java | 79 + .../springdoc/api/v31/app75/PostHandler.java | 83 + .../api/v31/app75/PostRepository.java | 53 + .../springdoc/api/v31/app75/PostRouter.java | 73 + .../api/v31/app75/SpringDocApp75Test.java | 39 + .../api/v31/app78/HelloController.java | 63 + .../api/v31/app78/SpringDocApp78Test.java | 39 + .../api/v31/app79/BaseClientModel.java | 34 + .../api/v31/app79/BaseController.java | 46 + .../api/v31/app79/SpecificClientModel.java | 36 + .../api/v31/app79/SpecificController.java | 32 + .../api/v31/app79/SpringDocApp79Test.java | 39 + .../org/springdoc/api/v31/app80/Book.java | 66 + .../api/v31/app80/BookRepository.java | 44 + .../springdoc/api/v31/app80/BookRouter.java | 113 + .../api/v31/app80/SpringDocApp80Test.java | 39 + .../api/v31/app81/OperationIdController.java | 58 + .../api/v31/app81/SpringDocApp81Test.java | 95 + .../api/v31/app82/RoutingConfiguration.java | 65 + .../api/v31/app82/SpringDocApp82Test.java | 39 + .../org/springdoc/api/v31/app82/User.java | 85 + .../springdoc/api/v31/app82/UserHandler.java | 119 + .../api/v31/app82/UserRepository.java | 51 + .../api/v31/app82/UserRepositoryImpl.java | 98 + .../org/springdoc/api/v31/app83/Coffee.java | 86 + .../springdoc/api/v31/app83/CoffeeOrder.java | 74 + .../api/v31/app83/CoffeeRepository.java | 52 + .../api/v31/app83/CoffeeService.java | 60 + .../springdoc/api/v31/app83/RouteConfig.java | 78 + .../api/v31/app83/SpringDocApp83Test.java | 39 + .../org/springdoc/api/v31/app84/Employee.java | 50 + .../v31/app84/EmployeeFunctionalConfig.java | 107 + .../api/v31/app84/EmployeeRepository.java | 58 + .../api/v31/app84/SpringDocApp84Test.java | 39 + .../api/v31/app85/SpringDocApp85Test.java | 39 + .../v31/app85/controller/PersonRouter.java | 65 + .../v31/app85/controller/PositionRouter.java | 79 + .../api/v31/app85/entity/Person.java | 100 + .../api/v31/app85/entity/Position.java | 80 + .../springdoc/api/v31/app85/entity/Sex.java | 31 + .../exception/PositionNotFoundException.java | 34 + .../api/v31/app85/handler/PersonHandler.java | 78 + .../v31/app85/handler/PositionHandler.java | 56 + .../api/v31/app85/payload/ErrorResponse.java | 45 + .../api/v31/app85/service/PersonService.java | 65 + .../org/springdoc/api/v31/app86/Quote.java | 88 + .../api/v31/app86/QuoteGenerator.java | 95 + .../springdoc/api/v31/app86/QuoteHandler.java | 72 + .../springdoc/api/v31/app86/QuoteRouter.java | 79 + .../api/v31/app86/SpringDocApp86Test.java | 39 + .../org/springdoc/api/v31/app87/Book.java | 66 + .../api/v31/app87/BookRepository.java | 44 + .../springdoc/api/v31/app87/BookRouter.java | 60 + .../api/v31/app87/SpringDocApp87Test.java | 39 + .../org/springdoc/api/v31/app88/Post.java | 79 + .../springdoc/api/v31/app88/PostHandler.java | 83 + .../api/v31/app88/PostRepository.java | 53 + .../springdoc/api/v31/app88/PostRouter.java | 77 + .../api/v31/app88/SpringDocApp88Test.java | 39 + .../org/springdoc/api/v31/app89/Book.java | 66 + .../api/v31/app89/BookRepository.java | 44 + .../springdoc/api/v31/app89/BookRouter.java | 109 + .../api/v31/app89/SpringDocApp89Test.java | 39 + .../springdoc/api/v31/app90/HelloRouter.java | 52 + .../api/v31/app90/SpringDocApp90Test.java | 39 + .../api/v31/app90/book/BookRouter.java | 147 + .../api/v31/app90/employee/Employee.java | 50 + .../app90/employee/EmployeeRepository.java | 58 + .../v31/app90/employee/EmployeeRouter.java | 55 + .../v31/app90/position/PositionRouter.java | 69 + .../api/v31/app90/quotes/QuotesRouter.java | 133 + .../resources/results/{ => 3.0.1}/app102.json | 0 .../resources/results/{ => 3.0.1}/app149.json | 0 .../resources/results/{ => 3.0.1}/app150.json | 0 .../resources/results/{ => 3.0.1}/app151.json | 0 .../resources/results/{ => 3.0.1}/app152.json | 0 .../resources/results/{ => 3.0.1}/app153.json | 0 .../resources/results/{ => 3.0.1}/app154.json | 0 .../results/{ => 3.0.1}/app184-1.json | 0 .../results/{ => 3.0.1}/app184-2.json | 0 .../results/{ => 3.0.1}/app184-3.json | 0 .../resources/results/{ => 3.0.1}/app184.json | 0 .../resources/results/{ => 3.0.1}/app187.json | 0 .../resources/results/{ => 3.0.1}/app188.json | 0 .../resources/results/{ => 3.0.1}/app189.json | 0 .../resources/results/{ => 3.0.1}/app191.json | 0 .../resources/results/{ => 3.0.1}/app3.json | 0 .../resources/results/{ => 3.0.1}/app39.json | 0 .../resources/results/{ => 3.0.1}/app4.json | 0 .../resources/results/{ => 3.0.1}/app5.json | 0 .../resources/results/{ => 3.0.1}/app63.json | 0 .../resources/results/{ => 3.0.1}/app64.json | 0 .../resources/results/{ => 3.0.1}/app65.json | 0 .../resources/results/{ => 3.0.1}/app66.json | 0 .../resources/results/{ => 3.0.1}/app67.json | 0 .../resources/results/{ => 3.0.1}/app68.json | 0 .../resources/results/{ => 3.0.1}/app69.json | 0 .../resources/results/{ => 3.0.1}/app70.json | 0 .../resources/results/{ => 3.0.1}/app71.json | 0 .../resources/results/{ => 3.0.1}/app72.json | 0 .../resources/results/{ => 3.0.1}/app73.json | 0 .../resources/results/{ => 3.0.1}/app74.json | 0 .../resources/results/{ => 3.0.1}/app75.json | 0 .../resources/results/{ => 3.0.1}/app78.json | 0 .../resources/results/{ => 3.0.1}/app79.json | 0 .../resources/results/{ => 3.0.1}/app80.json | 0 .../resources/results/{ => 3.0.1}/app81.json | 0 .../resources/results/{ => 3.0.1}/app82.json | 0 .../resources/results/{ => 3.0.1}/app83.json | 0 .../resources/results/{ => 3.0.1}/app84.json | 0 .../resources/results/{ => 3.0.1}/app85.json | 0 .../resources/results/{ => 3.0.1}/app86.json | 0 .../resources/results/{ => 3.0.1}/app87.json | 0 .../resources/results/{ => 3.0.1}/app88.json | 0 .../resources/results/{ => 3.0.1}/app89.json | 0 .../resources/results/{ => 3.0.1}/app90.json | 0 .../test/resources/results/3.1.0/app102.json | 144 + .../test/resources/results/3.1.0/app149.json | 91 + .../test/resources/results/3.1.0/app150.json | 76 + .../test/resources/results/3.1.0/app151.json | 76 + .../test/resources/results/3.1.0/app152.json | 36 + .../test/resources/results/3.1.0/app153.json | 46 + .../test/resources/results/3.1.0/app154.json | 303 + .../resources/results/3.1.0/app184-1.json | 97 + .../resources/results/3.1.0/app184-2.json | 112 + .../resources/results/3.1.0/app184-3.json | 112 + .../test/resources/results/3.1.0/app184.json | 112 + .../test/resources/results/3.1.0/app187.json | 56 + .../test/resources/results/3.1.0/app188.json | 47 + .../test/resources/results/3.1.0/app189.json | 67 + .../test/resources/results/3.1.0/app191.json | 37 + .../test/resources/results/3.1.0/app3.json | 334 + .../test/resources/results/3.1.0/app39.json | 85 + .../test/resources/results/3.1.0/app4.json | 67 + .../test/resources/results/3.1.0/app5.json | 100 + .../test/resources/results/3.1.0/app63.json | 15 + .../test/resources/results/3.1.0/app64.json | 47 + .../test/resources/results/3.1.0/app65.json | 88 + .../test/resources/results/3.1.0/app66.json | 94 + .../test/resources/results/3.1.0/app67.json | 144 + .../test/resources/results/3.1.0/app68.json | 94 + .../test/resources/results/3.1.0/app69.json | 188 + .../test/resources/results/3.1.0/app70.json | 128 + .../test/resources/results/3.1.0/app71.json | 204 + .../test/resources/results/3.1.0/app72.json | 296 + .../test/resources/results/3.1.0/app73.json | 114 + .../test/resources/results/3.1.0/app74.json | 105 + .../test/resources/results/3.1.0/app75.json | 166 + .../test/resources/results/3.1.0/app78.json | 52 + .../test/resources/results/3.1.0/app79.json | 77 + .../test/resources/results/3.1.0/app80.json | 393 + .../test/resources/results/3.1.0/app81.json | 127 + .../test/resources/results/3.1.0/app82.json | 188 + .../test/resources/results/3.1.0/app83.json | 128 + .../test/resources/results/3.1.0/app84.json | 204 + .../test/resources/results/3.1.0/app85.json | 296 + .../test/resources/results/3.1.0/app86.json | 114 + .../test/resources/results/3.1.0/app87.json | 105 + .../test/resources/results/3.1.0/app88.json | 146 + .../test/resources/results/3.1.0/app89.json | 393 + .../test/resources/results/3.1.0/app90.json | 591 ++ .../springdoc/ui/app14/HelloController.java | 2 +- .../springdoc/ui/app16/HelloController.java | 2 +- .../ui/app16/SpringDocApp16Test.java | 2 +- .../springdoc/ui/app18/HelloController.java | 2 +- .../springdoc/ui/app19/HelloController.java | 2 +- .../src/test/resources/results/app16-1.json | 2 +- .../api/v31/AbstractSpringDocTest.java | 55 + .../api/v31/AbstractSpringDocV31Test.java | 55 - .../api/v31/app1/SpringDocApp1Test.java | 4 +- .../api/v31/app10/SpringDocApp10Test.java | 4 +- .../api/v31/app100/SpringDocApp100Test.java | 4 +- .../api/v31/app101/SpringDocApp101Test.java | 4 +- .../api/v31/app102/SpringDocApp102Test.java | 4 +- .../api/v31/app103/SpringDocApp103Test.java | 4 +- .../api/v31/app104/SpringDocApp104Test.java | 4 +- .../api/v31/app105/SpringDocApp105Test.java | 4 +- .../api/v31/app106/SpringDocApp106Test.java | 4 +- .../api/v31/app107/SpringDocApp107Test.java | 4 +- .../api/v31/app108/SpringDocApp108Test.java | 4 +- .../api/v31/app109/SpringDocApp109Test.java | 4 +- .../api/v31/app11/SpringDocApp11Test.java | 4 +- .../api/v31/app110/SpringDocApp110Test.java | 4 +- .../api/v31/app111/SpringDocApp111Test.java | 4 +- .../api/v31/app112/SpringDocApp112Test.java | 4 +- .../api/v31/app113/SpringDocApp113Test.java | 4 +- .../api/v31/app114/SpringDocApp114Test.java | 4 +- .../app115/JavaTimeOperationCustomizer.java | 3 +- .../api/v31/app115/SpringDocApp115Test.java | 4 +- .../api/v31/app116/SpringDocApp116Test.java | 4 +- .../api/v31/app117/SpringDocApp117Test.java | 4 +- .../api/v31/app118/SpringDocApp118Test.java | 4 +- .../api/v31/app119/SpringDocApp119Test.java | 4 +- .../api/v31/app12/SpringDocApp12Test.java | 4 +- .../api/v31/app120/SpringDocApp120Test.java | 4 +- .../api/v31/app121/SpringDocApp121Test.java | 4 +- .../api/v31/app122/SpringDocApp122Test.java | 4 +- .../api/v31/app123/SpringDocApp123Test.java | 4 +- .../api/v31/app124/SpringDocApp124Test.java | 4 +- .../api/v31/app126/SpringDocApp126Test.java | 4 +- .../api/v31/app127/SpringDocApp127Test.java | 4 +- .../api/v31/app129/SpringDocApp129Test.java | 4 +- .../api/v31/app13/SpringDocApp13Test.java | 4 +- .../api/v31/app130/SpringDocApp130Test.java | 4 +- .../api/v31/app131/SpringDocApp131Test.java | 4 +- .../api/v31/app132/SpringDocApp132Test.java | 4 +- .../api/v31/app133/SpringDocApp133Test.java | 4 +- .../api/v31/app134/SpringDocApp134Test.java | 4 +- .../api/v31/app135/SpringDocApp135Test.java | 4 +- .../api/v31/app137/SpringDocApp137Test.java | 4 +- .../api/v31/app138/SpringDocApp138Test.java | 4 +- .../api/v31/app139/SpringDocApp139Test.java | 4 +- .../api/v31/app14/SpringDocApp14Test.java | 4 +- .../api/v31/app140/SpringDocApp140Test.java | 4 +- .../api/v31/app141/SpringDocApp141Test.java | 4 +- .../api/v31/app142/SpringDocApp142Test.java | 4 +- .../api/v31/app143/SpringDocApp143Test.java | 4 +- .../api/v31/app149/SpringDocApp149Test.java | 4 +- .../api/v31/app15/SpringDocApp15Test.java | 4 +- .../api/v31/app150/SpringDocApp150Test.java | 4 +- .../api/v31/app151/SpringDocApp151Test.java | 4 +- .../api/v31/app152/SpringDocApp152Test.java | 4 +- .../api/v31/app153/SpringDocApp153Test.java | 4 +- .../api/v31/app154/SpringDocApp154Test.java | 4 +- .../api/v31/app155/SpringDocApp155Test.java | 4 +- .../api/v31/app156/SpringDocApp156Test.java | 4 +- .../api/v31/app157/SpringDocApp157Test.java | 4 +- .../api/v31/app158/SpringDocApp158Test.java | 4 +- .../api/v31/app159/SpringDocApp159Test.java | 4 +- .../api/v31/app16/SpringDocApp16Test.java | 4 +- .../api/v31/app160/SpringDocApp160Test.java | 4 +- .../api/v31/app161/SpringDocApp161Test.java | 4 +- .../api/v31/app162/SpringDocApp162Test.java | 4 +- .../api/v31/app163/SpringDocApp163Test.java | 4 +- .../api/v31/app164/SpringDocApp164Test.java | 4 +- .../api/v31/app165/SpringDocApp165Test.java | 4 +- .../api/v31/app166/SpringDocApp166Test.java | 4 +- .../api/v31/app167/SpringDocApp167Test.java | 4 +- .../api/v31/app168/SpringDocApp168Test.java | 4 +- .../api/v31/app169/SpringDocApp169Test.java | 4 +- .../api/v31/app17/SpringDocApp17Test.java | 4 +- .../api/v31/app170/SpringDocApp170Test.java | 4 +- .../api/v31/app171/SpringDocApp171Test.java | 4 +- .../api/v31/app172/SpringDocApp172Test.java | 4 +- .../api/v31/app173/SpringDocApp173Test.java | 4 +- .../api/v31/app177/SpringDocApp177Test.java | 4 +- .../api/v31/app178/SpringDocApp178Test.java | 4 +- .../api/v31/app179/SpringDocApp179Test.java | 4 +- .../api/v31/app18/SpringDocApp18Test.java | 4 +- .../api/v31/app180/SpringDocApp180Test.java | 4 +- .../api/v31/app181/SpringDocApp181Test.java | 4 +- .../api/v31/app182/SpringDocApp182Test.java | 4 +- .../api/v31/app183/SpringDocApp183Test.java | 4 +- .../api/v31/app184/SpringDocApp184Test.java | 4 +- .../api/v31/app185/SpringDocApp185Test.java | 4 +- .../api/v31/app187/SpringDocApp187Test.java | 4 +- .../api/v31/app188/HelloController.java | 2 +- .../api/v31/app188/SpringDocApp188Test.java | 4 +- .../api/v31/app189/SpringDocApp189Test.java | 4 +- .../api/v31/app19/SpringDocApp19Test.java | 4 +- .../api/v31/app190/SpringDocApp190Test.java | 4 +- .../api/v31/app192/SpringDocApp192Test.java | 4 +- .../api/v31/app194/SpringDocApp194Test.java | 4 +- .../api/v31/app195/SpringDocApp195Test.java | 4 +- .../api/v31/app196/SpringDocApp196Test.java | 4 +- .../api/v31/app197/SpringDocApp197Test.java | 4 +- .../api/v31/app198/SpringDocApp198Test.java | 4 +- .../api/v31/app199/SpringDocApp199Test.java | 4 +- .../api/v31/app2/SpringDocApp2Test.java | 4 +- .../api/v31/app20/SpringDocApp20Test.java | 4 +- .../api/v31/app200/SpringDocApp200Test.java | 4 +- .../api/v31/app201/SpringDocApp201Test.java | 4 +- .../api/v31/app202/SpringDocApp202Test.java | 4 +- .../api/v31/app203/SpringDocApp203Test.java | 4 +- .../api/v31/app204/SpringDocApp204Test.java | 4 +- .../api/v31/app205/SpringdocApp205Test.java | 4 +- .../api/v31/app206/SpringdocApp206Test.java | 4 +- .../api/v31/app207/SpringdocApp207Test.java | 4 +- .../api/v31/app208/SpringdocApp208Test.java | 4 +- .../api/v31/app21/SpringDocApp21Test.java | 4 +- .../api/v31/app211/SpringDocApp211Test.java | 4 +- .../api/v31/app212/SpringDocApp212Test.java | 4 +- .../api/v31/app213/SpringDocApp213Test.java | 4 +- .../api/v31/app216/SpringDocApp216Test.java | 4 +- .../api/v31/app217/SpringDocApp217Test.java | 4 +- .../api/v31/app218/SpringDocApp218Test.java | 4 +- .../api/v31/app219/SpringDocApp219Test.java | 4 +- .../api/v31/app22/SpringDocApp22Test.java | 4 +- .../api/v31/app220/SpringDocApp220Test.java | 4 +- .../api/v31/app221/SpringDocApp221Test.java | 4 +- .../api/v31/app222/SpringDocApp222Test.java | 4 +- .../api/v31/app223/SpringDocApp223Test.java | 4 +- .../api/v31/app224/SpringDocApp224Test.java | 4 +- .../api/v31/app225/SpringDocApp225Test.java | 4 +- .../api/v31/app226/SpringDocApp226Test.java | 4 +- .../api/v31/app227/SpringDocApp227Test.java | 4 +- .../api/v31/app228/SpringDocApp228Test.java | 4 +- .../api/v31/app229/SpringDocApp229Test.java | 4 +- .../api/v31/app23/SpringDocApp23Test.java | 4 +- .../api/v31/app230/SpringDocApp230Test.java | 4 +- .../api/v31/app231/SpringDocApp231Test.java | 4 +- .../api/v31/app232/SpringDocApp232Test.java | 4 +- .../api/v31/app233/SpringDocApp233Test.java | 4 +- .../api/v31/app234/SpringDocApp234Test.java | 4 +- .../api/v31/app235/SpringDocApp235Test.java | 4 +- .../api/v31/app236/SpringDocApp236Test.java | 4 +- .../api/v31/app24/SpringDocApp24Test.java | 4 +- .../api/v31/app25/SpringDocApp25Test.java | 4 +- .../api/v31/app26/SpringDocApp26Test.java | 4 +- .../api/v31/app27/SpringDocApp27Test.java | 4 +- .../api/v31/app28/SpringDocApp28Test.java | 4 +- .../api/v31/app29/SpringDocApp29Test.java | 4 +- .../api/v31/app30/SpringDocApp30Test.java | 4 +- .../api/v31/app31/SpringDocApp31Test.java | 4 +- .../api/v31/app32/SpringDocApp32Test.java | 4 +- .../api/v31/app33/SpringDocApp33Test.java | 4 +- .../api/v31/app34/SpringDocApp34Test.java | 4 +- .../api/v31/app35/SpringDocApp35Test.java | 4 +- .../api/v31/app37/SpringDocApp37Test.java | 4 +- .../api/v31/app38/SpringDocApp38Test.java | 4 +- .../api/v31/app39/SpringDocApp39Test.java | 4 +- .../api/v31/app4/SpringDocApp4Test.java | 4 +- .../api/v31/app40/SpringDocApp40Test.java | 4 +- .../api/v31/app41/SpringDocApp411Test.java | 4 +- .../api/v31/app41/SpringDocApp41Test.java | 4 +- .../api/v31/app42/SpringDocApp42Test.java | 4 +- .../api/v31/app43/SpringDocApp43Test.java | 4 +- .../api/v31/app44/SpringDocApp44Test.java | 4 +- .../api/v31/app45/SpringDocApp45Test.java | 4 +- .../api/v31/app46/SpringDocApp46Test.java | 4 +- .../api/v31/app47/SpringDocApp47Test.java | 4 +- .../api/v31/app48/SpringDocApp48Test.java | 4 +- .../api/v31/app49/SpringDocApp49Test.java | 4 +- .../api/v31/app5/SpringDocApp5Test.java | 4 +- .../api/v31/app50/SpringDocApp50Test.java | 4 +- .../api/v31/app51/SpringDocApp51Test.java | 4 +- .../api/v31/app52/SpringDocApp52Test.java | 4 +- .../api/v31/app53/SpringDocApp53Test.java | 4 +- .../api/v31/app54/SpringDocApp54Test.java | 4 +- .../api/v31/app55/SpringDocApp55Test.java | 4 +- .../api/v31/app56/SpringDocApp56Test.java | 4 +- .../api/v31/app57/SpringDocApp57Test.java | 4 +- .../api/v31/app58/SpringDocApp58Test.java | 4 +- .../api/v31/app59/SpringDocApp59Test.java | 4 +- .../api/v31/app6/SpringDocApp6Test.java | 4 +- .../api/v31/app60/SpringDocApp60Test.java | 4 +- .../api/v31/app61/SpringDocApp61Test.java | 4 +- .../api/v31/app62/SpringDocApp62Test.java | 4 +- .../api/v31/app63/SpringDocApp63Test.java | 4 +- .../api/v31/app64/SpringDocApp64Test.java | 4 +- .../api/v31/app65/SpringDocApp65Test.java | 4 +- .../api/v31/app66/SpringDocApp66Test.java | 4 +- .../api/v31/app67/SpringDocApp67Test.java | 4 +- .../api/v31/app69/SpringDocApp69Test.java | 4 +- .../api/v31/app7/SpringDocApp7Test.java | 4 +- .../api/v31/app70/SpringDocApp70Test.java | 4 +- .../api/v31/app71/SpringDocApp71Test.java | 4 +- .../api/v31/app73/SpringDocApp73Test.java | 4 +- .../api/v31/app74/SpringDocApp74Test.java | 4 +- .../api/v31/app75/SpringDocApp75Test.java | 4 +- .../api/v31/app76/SpringDocApp76Test.java | 4 +- .../api/v31/app77/SpringDocApp77Test.java | 4 +- .../api/v31/app78/SpringDocApp78Test.java | 4 +- .../api/v31/app79/SpringDocApp79Test.java | 4 +- .../api/v31/app8/SpringDocApp8Test.java | 4 +- .../api/v31/app80/SpringDocApp80Test.java | 4 +- .../api/v31/app81/SpringDocApp81Test.java | 4 +- .../api/v31/app82/SpringDocApp82Test.java | 4 +- .../api/v31/app83/SpringDocApp83Test.java | 4 +- .../api/v31/app84/SpringDocApp84Test.java | 4 +- .../api/v31/app85/SpringDocApp85Test.java | 4 +- .../api/v31/app86/SpringDocApp86Test.java | 4 +- .../api/v31/app87/SpringDocApp87Test.java | 4 +- .../api/v31/app88/SpringDocApp88Test.java | 4 +- .../api/v31/app89/SpringDocApp89Test.java | 4 +- .../api/v31/app9/SpringDocApp9Test.java | 4 +- .../api/v31/app90/SpringDocApp90Test.java | 4 +- .../api/v31/app91/SpringDocApp91Test.java | 4 +- .../api/v31/app92/SpringDocApp92Test.java | 4 +- .../api/v31/app93/SpringDocApp93Test.java | 4 +- .../api/v31/app94/SpringDocApp94Test.java | 4 +- .../api/v31/app95/SpringDocApp95Test.java | 4 +- .../api/v31/app96/SpringDocApp96Test.java | 4 +- .../api/v31/app97/SpringDocApp97Test.java | 4 +- .../api/v31/app98/SpringDocApp98Test.java | 4 +- .../api/v31/app99/SpringDocApp99Test.java | 4 +- .../src/test/resources/application-217.yml | 2 + .../test/resources/results/3.1.0/app1.json | 57 +- .../test/resources/results/3.1.0/app10.json | 6 +- .../test/resources/results/3.1.0/app101.json | 51 +- .../resources/results/3.1.0/app105-1.json | 126 +- .../resources/results/3.1.0/app105-2.json | 258 +- .../resources/results/3.1.0/app105-3.json | 62 +- .../resources/results/3.1.0/app105-4.json | 4 +- .../test/resources/results/3.1.0/app106.json | 1 + .../test/resources/results/3.1.0/app108.json | 73 +- .../test/resources/results/3.1.0/app109.json | 59 +- .../test/resources/results/3.1.0/app115.json | 2 +- .../test/resources/results/3.1.0/app118.json | 224 +- .../test/resources/results/3.1.0/app123.json | 14 +- .../test/resources/results/3.1.0/app124.json | 69 +- .../test/resources/results/3.1.0/app126.json | 12 +- .../test/resources/results/3.1.0/app133.json | 25 +- .../test/resources/results/3.1.0/app138.json | 2 +- .../test/resources/results/3.1.0/app143.json | 121 +- .../test/resources/results/3.1.0/app150.json | 9 +- .../test/resources/results/3.1.0/app153.json | 52 +- .../test/resources/results/3.1.0/app154.json | 173 +- .../test/resources/results/3.1.0/app155.json | 1 + .../test/resources/results/3.1.0/app156.json | 4 +- .../test/resources/results/3.1.0/app157.json | 48 +- .../test/resources/results/3.1.0/app164.json | 2 +- .../test/resources/results/3.1.0/app168.json | 26 +- .../resources/results/3.1.0/app177-1.json | 2 +- .../resources/results/3.1.0/app177-2.json | 2 +- .../resources/results/3.1.0/app177-3.json | 2 +- .../test/resources/results/3.1.0/app180.json | 1 + .../test/resources/results/3.1.0/app182.json | 69 +- .../test/resources/results/3.1.0/app188.json | 105 +- .../resources/results/3.1.0/app193-1.json | 151 +- .../test/resources/results/3.1.0/app196.json | 12 +- .../test/resources/results/3.1.0/app197.json | 20 +- .../test/resources/results/3.1.0/app198.json | 58 +- .../test/resources/results/3.1.0/app2.json | 124 +- .../test/resources/results/3.1.0/app202.json | 89 +- .../test/resources/results/3.1.0/app211.json | 80 +- .../test/resources/results/3.1.0/app213.json | 10 +- .../resources/results/3.1.0/app217-1.json | 56 +- .../resources/results/3.1.0/app217-2.json | 56 +- .../test/resources/results/3.1.0/app219.json | 8 +- .../test/resources/results/3.1.0/app220.json | 129 +- .../test/resources/results/3.1.0/app223.json | 225 +- .../test/resources/results/3.1.0/app228.json | 24 - .../test/resources/results/3.1.0/app229.json | 82 +- .../test/resources/results/3.1.0/app233.json | 2 +- .../test/resources/results/3.1.0/app25.json | 163 +- .../test/resources/results/3.1.0/app31.json | 104 +- .../test/resources/results/3.1.0/app33.json | 56 +- .../test/resources/results/3.1.0/app34.json | 56 +- .../test/resources/results/3.1.0/app4.json | 14 +- .../test/resources/results/3.1.0/app41.json | 70 +- .../test/resources/results/3.1.0/app46.json | 59 +- .../test/resources/results/3.1.0/app47.json | 99 +- .../test/resources/results/3.1.0/app51.json | 12 +- .../test/resources/results/3.1.0/app58.json | 120 +- .../test/resources/results/3.1.0/app59.json | 72 +- .../test/resources/results/3.1.0/app60.json | 46 +- .../test/resources/results/3.1.0/app61.json | 11 +- .../test/resources/results/3.1.0/app67.json | 179 +- .../test/resources/results/3.1.0/app70.json | 63 +- .../test/resources/results/3.1.0/app75.json | 169 +- .../test/resources/results/3.1.0/app77.json | 79 +- .../test/resources/results/3.1.0/app82.json | 4 +- .../test/resources/results/3.1.0/app83.json | 29 +- .../test/resources/results/3.1.0/app90.json | 143 +- .../ui/app1/SpringDocSwaggerConfigTest.java | 2 +- ...rConfigWithBothFileGeneratedSpecsTest.java | 2 +- .../ui/app13/SpringDocApp13Test.java | 2 +- .../springdoc/ui/app14/HelloController.java | 2 +- .../ui/app14/SpringDocApp14Test.java | 2 +- .../ui/app15/SpringDocApp15Test.java | 2 +- .../springdoc/ui/app16/HelloController.java | 2 +- .../ui/app16/SpringDocApp16Test.java | 2 +- .../ui/app17/SpringDocApp17Test.java | 2 +- .../src/test/resources/results/app13-1.json | 2 +- .../src/test/resources/results/app14-1.json | 2 +- .../src/test/resources/results/app15-1.json | 2 +- .../src/test/resources/results/app16-1.json | 2 +- .../org/springdoc/api/AbstractCommonTest.java | 56 - .../api/AbstractSpringDocActuatorTest.java | 62 - .../springdoc/api/AbstractSpringDocTest.java | 37 - .../springdoc/api/app144/HelloController.java | 32 - .../api/app144/SpringDocApp144Test.java | 58 - .../springdoc/api/app145/HelloController.java | 34 - .../api/app145/SpringDocApp1451Test.java | 77 - .../api/app145/SpringDocApp1452Test.java | 59 - .../api/app145/SpringDocApp145Test.java | 70 - .../springdoc/api/app146/HelloController.java | 32 - .../api/app146/SpringDocApp146Test.java | 52 - .../springdoc/api/app147/HelloController.java | 43 - .../api/app147/SpringDocApp147Test.java | 59 - .../springdoc/api/app148/HelloController.java | 47 - .../api/app148/SpringDocApp148Test.java | 73 - .../api/app186/SpringDocApp186Test.java | 102 - .../springdoc/api/app76/HelloController.java | 52 - .../api/app76/SpringDocApp76Test.java | 45 - .../springdoc/api/app76/SpringDocTestApp.java | 71 - .../springdoc/api/v30/AbstractCommonTest.java | 82 + .../v30/AbstractSpringDocActuatorTest.java | 64 + .../api/v30/AbstractSpringDocTest.java | 45 + .../api/v30/app144/HelloController.java | 32 + .../api/v30/app144/SpringDocApp144Test.java | 58 + .../api/v30/app145/HelloController.java | 34 + .../api/v30/app145/SpringDocApp1451Test.java | 77 + .../api/v30/app145/SpringDocApp1452Test.java | 59 + .../api/v30/app145/SpringDocApp145Test.java | 70 + .../api/v30/app146/HelloController.java | 32 + .../api/v30/app146/SpringDocApp146Test.java | 52 + .../api/v30/app147/HelloController.java | 43 + .../api/v30/app147/SpringDocApp147Test.java | 59 + .../api/v30/app148/HelloController.java | 47 + .../api/v30/app148/SpringDocApp148Test.java | 73 + .../api/v30/app186/SpringDocApp186Test.java | 102 + .../api/v30/app76/HelloController.java | 52 + .../api/v30/app76/SpringDocApp76Test.java | 45 + .../api/v30/app76/SpringDocTestApp.java | 71 + .../springdoc/api/v31/AbstractCommonTest.java | 82 + .../v31/AbstractSpringDocActuatorTest.java | 64 + .../api/v31/AbstractSpringDocTest.java | 45 + .../api/v31/app144/HelloController.java | 32 + .../api/v31/app144/SpringDocApp144Test.java | 58 + .../api/v31/app145/HelloController.java | 34 + .../api/v31/app145/SpringDocApp1451Test.java | 77 + .../api/v31/app145/SpringDocApp1452Test.java | 59 + .../api/v31/app145/SpringDocApp145Test.java | 70 + .../api/v31/app146/HelloController.java | 32 + .../api/v31/app146/SpringDocApp146Test.java | 52 + .../api/v31/app147/HelloController.java | 43 + .../api/v31/app147/SpringDocApp147Test.java | 59 + .../api/v31/app148/HelloController.java | 47 + .../api/v31/app148/SpringDocApp148Test.java | 73 + .../api/v31/app186/SpringDocApp186Test.java | 102 + .../api/v31/app76/HelloController.java | 52 + .../api/v31/app76/SpringDocApp76Test.java | 45 + .../api/v31/app76/SpringDocTestApp.java | 71 + .../resources/results/{ => 3.0.1}/app144.json | 0 .../results/{ => 3.0.1}/app145-1.json | 0 .../results/{ => 3.0.1}/app145-2.json | 0 .../resources/results/{ => 3.0.1}/app145.json | 0 .../results/{ => 3.0.1}/app146-1.json | 0 .../results/{ => 3.0.1}/app146-2.json | 0 .../resources/results/3.0.1/app147-1.json | 891 ++ .../resources/results/3.0.1/app147-2.json | 891 ++ .../results/{ => 3.0.1}/app148-1.json | 0 .../results/{ => 3.0.1}/app148-2.json | 0 .../resources/results/{ => 3.0.1}/app186.json | 0 .../test/resources/results/3.1.0/app144.json | 36 + .../resources/results/3.1.0/app145-1.json | 36 + .../resources/results/3.1.0/app145-2.json | 36 + .../test/resources/results/3.1.0/app145.json | 36 + .../resources/results/3.1.0/app146-1.json | 891 ++ .../resources/results/3.1.0/app146-2.json | 36 + .../resources/results/3.1.0/app147-1.json | 891 ++ .../resources/results/3.1.0/app147-2.json | 891 ++ .../resources/results/3.1.0/app148-1.json | 36 + .../resources/results/3.1.0/app148-2.json | 891 ++ .../test/resources/results/3.1.0/app186.json | 938 +++ .../src/test/resources/results/app147-1.json | 891 -- .../src/test/resources/results/app147-2.json | 891 -- .../org/springdoc/api/AbstractCommonTest.java | 32 - .../api/AbstractSpringDocActuatorTest.java | 71 - .../springdoc/api/AbstractSpringDocTest.java | 48 - .../springdoc/api/app128/HelloController.java | 35 - .../api/app128/SpringDocApp128Test.java | 65 - .../springdoc/api/app144/HelloController.java | 32 - .../api/app144/SpringDocApp144Test.java | 58 - .../springdoc/api/app145/HelloController.java | 32 - .../api/app145/SpringDocApp145Test.java | 90 - .../springdoc/api/app147/HelloController.java | 44 - .../api/app147/SpringDocApp147Test.java | 70 - .../springdoc/api/app148/HelloController.java | 44 - .../api/app148/SpringDocApp148Test.java | 73 - .../api/app186/SpringDocApp186Test.java | 106 - .../springdoc/api/app36/HelloController.java | 32 - .../api/app36/SpringDocApp36Test.java | 52 - .../api/app68/CustomizedOperation.java | 27 - .../api/app68/SpringDocApp68Test.java | 97 - .../api/app68/SpringDocConfiguration.java | 117 - .../org/springdoc/api/app68/api/ApiUtil.java | 46 - .../api/app68/api/ExceptionTranslator.java | 49 - .../api/app68/api/HomeController.java | 42 - .../springdoc/api/app68/api/pet/PetApi.java | 161 - .../api/app68/api/pet/PetApiController.java | 44 - .../api/app68/api/pet/PetApiDelegate.java | 141 - .../api/app68/api/pet/PetApiDelegateImpl.java | 27 - .../api/app68/api/store/StoreApi.java | 104 - .../app68/api/store/StoreApiController.java | 44 - .../api/app68/api/store/StoreApiDelegate.java | 93 - .../app68/api/store/StoreApiDelegateImpl.java | 27 - .../springdoc/api/app68/api/user/UserApi.java | 132 - .../api/app68/api/user/UserApiController.java | 44 - .../api/app68/api/user/UserApiDelegate.java | 122 - .../app68/api/user/UserApiDelegateImpl.java | 27 - .../api/app68/api/user/UserClient.java | 18 - .../org/springdoc/api/app68/model/Body.java | 97 - .../org/springdoc/api/app68/model/Body1.java | 99 - .../springdoc/api/app68/model/Category.java | 91 - .../api/app68/model/ModelApiResponse.java | 114 - .../org/springdoc/api/app68/model/Order.java | 226 - .../org/springdoc/api/app68/model/Pet.java | 240 - .../org/springdoc/api/app68/model/Tag.java | 91 - .../org/springdoc/api/app68/model/User.java | 232 - .../app72/BlockingAutoConfigurationTest.java | 107 - .../app72/CacheAutoConfigurationTest1.java | 85 - .../api/app72/GroupAutoConfigurationTest.java | 56 - .../springdoc/api/v30/AbstractCommonTest.java | 58 + .../v30/AbstractSpringDocActuatorTest.java | 73 + .../api/v30/AbstractSpringDocTest.java | 56 + .../api/v30/app128/HelloController.java | 43 + .../api/v30/app128/SpringDocApp128Test.java | 68 + .../api/v30/app144/HelloController.java | 32 + .../api/v30/app144/SpringDocApp144Test.java | 58 + .../api/v30/app145/HelloController.java | 32 + .../api/v30/app145/SpringDocApp145Test.java | 90 + .../api/v30/app147/HelloController.java | 44 + .../api/v30/app147/SpringDocApp147Test.java | 70 + .../api/v30/app148/HelloController.java | 44 + .../api/v30/app148/SpringDocApp148Test.java | 73 + .../api/v30/app186/SpringDocApp186Test.java | 106 + .../api/v30/app36/HelloController.java | 40 + .../api/v30/app36/SpringDocApp36Test.java | 60 + .../api/v30/app68/CustomizedOperation.java | 35 + .../api/v30/app68/SpringDocApp68Test.java | 105 + .../api/v30/app68/SpringDocConfiguration.java | 125 + .../springdoc/api/v30/app68/api/ApiUtil.java | 54 + .../v30/app68/api/ExceptionTranslator.java | 57 + .../api/v30/app68/api/HomeController.java | 50 + .../api/v30/app68/api/pet/PetApi.java | 169 + .../v30/app68/api/pet/PetApiController.java | 52 + .../api/v30/app68/api/pet/PetApiDelegate.java | 149 + .../v30/app68/api/pet/PetApiDelegateImpl.java | 35 + .../api/v30/app68/api/store/StoreApi.java | 112 + .../app68/api/store/StoreApiController.java | 52 + .../v30/app68/api/store/StoreApiDelegate.java | 101 + .../app68/api/store/StoreApiDelegateImpl.java | 35 + .../api/v30/app68/api/user/UserApi.java | 140 + .../v30/app68/api/user/UserApiController.java | 52 + .../v30/app68/api/user/UserApiDelegate.java | 130 + .../app68/api/user/UserApiDelegateImpl.java | 35 + .../api/v30/app68/api/user/UserClient.java | 44 + .../springdoc/api/v30/app68/model/Body.java | 105 + .../springdoc/api/v30/app68/model/Body1.java | 107 + .../api/v30/app68/model/Category.java | 99 + .../api/v30/app68/model/ModelApiResponse.java | 122 + .../springdoc/api/v30/app68/model/Order.java | 234 + .../springdoc/api/v30/app68/model/Pet.java | 248 + .../springdoc/api/v30/app68/model/Tag.java | 99 + .../springdoc/api/v30/app68/model/User.java | 240 + .../app72/BlockingAutoConfigurationTest.java | 115 + .../app72/CacheAutoConfigurationTest1.java | 93 + .../v30/app72/GroupAutoConfigurationTest.java | 64 + .../springdoc/api/v31/AbstractCommonTest.java | 58 + .../v31/AbstractSpringDocActuatorTest.java | 73 + .../api/v31/AbstractSpringDocTest.java | 56 + .../api/v31/app128/HelloController.java | 43 + .../api/v31/app128/SpringDocApp128Test.java | 68 + .../api/v31/app144/HelloController.java | 32 + .../api/v31/app144/SpringDocApp144Test.java | 58 + .../api/v31/app145/HelloController.java | 32 + .../api/v31/app145/SpringDocApp145Test.java | 90 + .../api/v31/app147/HelloController.java | 44 + .../api/v31/app147/SpringDocApp147Test.java | 70 + .../api/v31/app148/HelloController.java | 44 + .../api/v31/app148/SpringDocApp148Test.java | 73 + .../api/v31/app186/SpringDocApp186Test.java | 106 + .../api/v31/app36/HelloController.java | 40 + .../api/v31/app36/SpringDocApp36Test.java | 60 + .../api/v31/app68/CustomizedOperation.java | 35 + .../api/v31/app68/SpringDocApp68Test.java | 105 + .../api/v31/app68/SpringDocConfiguration.java | 125 + .../springdoc/api/v31/app68/api/ApiUtil.java | 54 + .../v31/app68/api/ExceptionTranslator.java | 57 + .../api/v31/app68/api/HomeController.java | 50 + .../api/v31/app68/api/pet/PetApi.java | 169 + .../v31/app68/api/pet/PetApiController.java | 52 + .../api/v31/app68/api/pet/PetApiDelegate.java | 149 + .../v31/app68/api/pet/PetApiDelegateImpl.java | 35 + .../api/v31/app68/api/store/StoreApi.java | 112 + .../app68/api/store/StoreApiController.java | 52 + .../v31/app68/api/store/StoreApiDelegate.java | 101 + .../app68/api/store/StoreApiDelegateImpl.java | 35 + .../api/v31/app68/api/user/UserApi.java | 140 + .../v31/app68/api/user/UserApiController.java | 52 + .../v31/app68/api/user/UserApiDelegate.java | 130 + .../app68/api/user/UserApiDelegateImpl.java | 35 + .../api/v31/app68/api/user/UserClient.java | 44 + .../springdoc/api/v31/app68/model/Body.java | 105 + .../springdoc/api/v31/app68/model/Body1.java | 107 + .../api/v31/app68/model/Category.java | 99 + .../api/v31/app68/model/ModelApiResponse.java | 122 + .../springdoc/api/v31/app68/model/Order.java | 234 + .../springdoc/api/v31/app68/model/Pet.java | 248 + .../springdoc/api/v31/app68/model/Tag.java | 99 + .../springdoc/api/v31/app68/model/User.java | 240 + .../app72/BlockingAutoConfigurationTest.java | 115 + .../app72/CacheAutoConfigurationTest1.java | 93 + .../v31/app72/GroupAutoConfigurationTest.java | 64 + .../resources/results/{ => 3.0.1}/app128.json | 0 .../resources/results/{ => 3.0.1}/app144.json | 0 .../test/resources/results/3.0.1/app145.json | 36 + .../results/{ => 3.0.1}/app146-1.json | 0 .../results/{ => 3.0.1}/app146-2.json | 0 .../results/{ => 3.0.1}/app147-1.json | 0 .../results/{ => 3.0.1}/app147-2.json | 0 .../results/{ => 3.0.1}/app148-1.json | 0 .../results/{ => 3.0.1}/app148-2.json | 0 .../resources/results/{ => 3.0.1}/app186.json | 0 .../results/{ => 3.0.1}/app68-1.json | 0 .../results/{ => 3.0.1}/app68-2.json | 0 .../results/{ => 3.0.1}/app68-3.json | 0 .../results/{ => 3.0.1}/app68-4.json | 0 .../test/resources/results/3.1.0/app128.json | 98 + .../test/resources/results/3.1.0/app144.json | 36 + .../test/resources/results/3.1.0/app145.json | 36 + .../resources/results/3.1.0/app146-1.json | 797 ++ .../resources/results/3.1.0/app146-2.json | 36 + .../resources/results/3.1.0/app147-1.json | 891 ++ .../resources/results/3.1.0/app147-2.json | 36 + .../resources/results/3.1.0/app148-1.json | 36 + .../resources/results/3.1.0/app148-2.json | 891 ++ .../test/resources/results/3.1.0/app186.json | 891 ++ .../test/resources/results/3.1.0/app68-1.json | 273 + .../test/resources/results/3.1.0/app68-2.json | 434 + .../test/resources/results/3.1.0/app68-3.json | 639 ++ .../test/resources/results/3.1.0/app68-4.json | 83 + .../src/test/resources/results/app145.json | 36 - .../springdoc/api/AbstractSpringDocTest.java | 77 - .../test/org/springdoc/api/app10/Account.java | 60 - .../api/app10/AccountRepository.java | 47 - .../org/springdoc/api/app10/Customer.java | 34 - .../api/app10/CustomerRepository.java | 73 - .../api/app10/SpringDocApp10Test.java | 34 - .../test/org/springdoc/api/app11/Person.java | 57 - .../springdoc/api/app11/PersonRepository.java | 37 - .../api/app11/SpringDocApp11Test.java | 34 - .../springdoc/api/app12/HelloController.java | 77 - .../api/app12/SpringDocApp12Test.java | 48 - .../springdoc/api/app13/HelloController.java | 76 - .../org/springdoc/api/app13/PersonDTO.java | 63 - .../api/app13/SpringDocApp13Test.java | 35 - .../springdoc/api/app14/HelloController.java | 38 - .../org/springdoc/api/app14/PersonDTO.java | 63 - .../api/app14/SpringDocApp14Test.java | 64 - .../springdoc/api/app15/HelloController.java | 38 - .../org/springdoc/api/app15/PersonDTO.java | 63 - .../api/app15/SpringDocApp15Test.java | 37 - .../test/org/springdoc/api/app16/Account.java | 60 - .../api/app16/AccountRepository.java | 52 - .../org/springdoc/api/app16/Customer.java | 34 - .../api/app16/CustomerRepository.java | 63 - .../springdoc/api/app16/OpenApiConfig.java | 30 - .../api/app16/SpringDocApp16Test.java | 46 - .../springdoc/api/app17/ChildProperty.java | 34 - .../api/app17/ChildPropertyRepository.java | 6 - .../org/springdoc/api/app17/Property.java | 48 - .../api/app17/PropertyRepository.java | 6 - .../api/app17/SpringDocApp17Test.java | 33 - .../springdoc/api/app18/HelloController.java | 27 - .../springdoc/api/app18/HelloWorldModel.java | 37 - .../api/app18/SpringDocApp18Test.java | 33 - .../org/springdoc/api/app19/Application.java | 80 - .../api/app19/ApplicationPredicate.java | 18 - .../api/app19/GreetingController.java | 19 - .../org/springdoc/api/app19/QApplication.java | 55 - .../api/app19/SpringDocApp19Test.java | 33 - .../springdoc/api/app2/HelloController.java | 38 - .../org/springdoc/api/app2/PersonDTO.java | 63 - .../springdoc/api/app2/SpringDocApp2Test.java | 30 - .../test/org/springdoc/api/app20/Bank.java | 81 - .../springdoc/api/app20/BankRepository.java | 10 - .../api/app20/CodeLookupRepository.java | 12 - .../springdoc/api/app20/DemoApplication.java | 21 - .../springdoc/api/app20/EntityDefinition.java | 12 - .../api/app20/SpringDocApp20Test.java | 33 - .../test/org/springdoc/api/app21/Person.java | 57 - .../springdoc/api/app21/PersonRepository.java | 56 - .../api/app21/SpringDocApp21Test.java | 34 - .../test/org/springdoc/api/app22/Person.java | 57 - .../org/springdoc/api/app22/PersonApi.java | 37 - .../springdoc/api/app22/PersonRepository.java | 32 - .../api/app22/SpringDocApp22Test.java | 35 - .../test/org/springdoc/api/app23/Clinic.java | 31 - .../org/springdoc/api/app23/ClinicRepo.java | 8 - .../test/org/springdoc/api/app23/Doctor.java | 40 - .../org/springdoc/api/app23/DoctorRepo.java | 8 - .../api/app23/SpringDocApp23Test.java | 35 - .../test/org/springdoc/api/app24/QUser.java | 44 - .../api/app24/SpringDocApp24Test.java | 35 - .../springdoc/api/app24/TesteResource.java | 21 - .../test/org/springdoc/api/app24/User.java | 24 - .../springdoc/api/app24/UserPredicate.java | 15 - .../api/app25/SpringDocApp25Test.java | 35 - .../springdoc/api/app25/model/Address.java | 28 - .../springdoc/api/app25/model/BaseEntity.java | 30 - .../org/springdoc/api/app25/model/Cat.java | 33 - .../org/springdoc/api/app25/model/Clinic.java | 30 - .../org/springdoc/api/app25/model/Doctor.java | 38 - .../org/springdoc/api/app25/model/Dog.java | 32 - .../org/springdoc/api/app25/model/Owner.java | 37 - .../org/springdoc/api/app25/model/Pet.java | 44 - .../springdoc/api/app25/model/Specialty.java | 79 - .../springdoc/api/app25/repo/ClinicRepo.java | 13 - .../springdoc/api/app25/repo/DoctorRepo.java | 16 - .../springdoc/api/app25/repo/OwnerRepo.java | 13 - .../org/springdoc/api/app25/repo/PetRepo.java | 13 - .../test/org/springdoc/api/app26/Person.java | 65 - .../springdoc/api/app26/PersonRepository.java | 41 - .../api/app26/SpringDocApp26Test.java | 36 - .../api/app26/SpringRestConfiguration.java | 14 - .../springdoc/api/app27/HelloController.java | 38 - .../org/springdoc/api/app27/PersonDTO.java | 63 - .../api/app27/SpringDocApp27Test.java | 43 - .../springdoc/api/app28/ExamplePageable.java | 59 - .../api/app28/ExamplePageableReplacement.java | 30 - .../springdoc/api/app28/HelloController.java | 21 - .../api/app28/SpringDocApp28Test.java | 34 - .../test/org/springdoc/api/app29/Person.java | 57 - .../org/springdoc/api/app29/PersonApi.java | 37 - .../springdoc/api/app29/PersonRepository.java | 32 - .../api/app29/SpringDocApp29Test.java | 35 - .../springdoc/api/app3/HelloController.java | 46 - .../springdoc/api/app3/SpringDocApp3Test.java | 30 - .../springdoc/api/app30/HelloController.java | 17 - .../test/org/springdoc/api/app30/QUser.java | 42 - .../api/app30/SpringDocApp30Test.java | 35 - .../test/org/springdoc/api/app30/User.java | 24 - .../springdoc/api/app30/UserPredicate.java | 16 - .../test/org/springdoc/api/app301/Person.java | 57 - .../org/springdoc/api/app301/PersonApi.java | 37 - .../api/app301/PersonRepository.java | 32 - .../api/app301/SpringDocApp301Test.java | 76 - .../springdoc/api/app31/HelloController.java | 69 - .../org/springdoc/api/app31/PersonDTO.java | 63 - .../api/app31/SpringDocApp31Test.java | 35 - .../springdoc/api/app32/HelloController.java | 38 - .../org/springdoc/api/app32/PersonDTO.java | 63 - .../api/app32/SpringDocApp32Test.java | 59 - .../org/springdoc/api/app33/ExampleSort.java | 19 - .../api/app33/ExampleSortReplacement.java | 28 - .../springdoc/api/app33/HelloController.java | 18 - .../api/app33/SpringDocApp33Test.java | 34 - .../test/org/springdoc/api/app34/Account.java | 61 - .../api/app34/AccountRepository.java | 52 - .../org/springdoc/api/app34/Customer.java | 49 - .../api/app34/CustomerRepository.java | 63 - .../springdoc/api/app34/OpenApiConfig.java | 30 - .../api/app34/SpringDocApp34Test.java | 34 - .../api/app34/SpringRestConfiguration.java | 15 - .../springdoc/api/app35/ChildProperty.java | 35 - .../api/app35/ChildPropertyRepository.java | 9 - .../org/springdoc/api/app35/Property.java | 49 - .../api/app35/PropertyRepository.java | 9 - .../api/app35/SpringDocApp35Test.java | 33 - .../springdoc/api/app36/EnumFieldHolder.java | 52 - .../api/app36/EnumFieldHolderRepository.java | 35 - .../api/app36/SpringDocApp36Test.java | 32 - .../org/springdoc/api/app37/BaseEntity.java | 44 - .../springdoc/api/app37/ProductEntity.java | 60 - .../api/app37/ProductRepository.java | 89 - .../api/app37/SpringDocApp37Test.java | 32 - .../DefaultFlatParamObjectController.java | 14 - .../api/app38/SpringDocApp38Test.java | 34 - .../springdoc/api/app4/DatabaseLoader.java | 47 - .../test/org/springdoc/api/app4/Employee.java | 69 - .../api/app4/EmployeeController.java | 127 - .../api/app4/EmployeeRepository.java | 28 - .../springdoc/api/app4/SpringDocApp4Test.java | 26 - .../springdoc/api/app4/SpringDocTestApp.java | 38 - .../test/org/springdoc/api/app5/Country.java | 94 - .../springdoc/api/app5/CountryPredicate.java | 13 - .../api/app5/GreetingController.java | 22 - .../test/org/springdoc/api/app5/QCountry.java | 50 - .../springdoc/api/app5/SpringDocApp5Test.java | 18 - .../springdoc/api/app6/DatabaseLoader.java | 47 - .../test/org/springdoc/api/app6/Employee.java | 69 - .../api/app6/EmployeeController.java | 46 - .../api/app6/EmployeeRepository.java | 28 - .../springdoc/api/app6/SpringDocApp6Test.java | 29 - .../springdoc/api/app6/SpringDocTestApp.java | 38 - .../springdoc/api/app7/HelloController.java | 39 - .../org/springdoc/api/app7/PersonDTO.java | 63 - .../springdoc/api/app7/SpringDocApp7Test.java | 30 - .../test/org/springdoc/api/app8/Album.java | 29 - .../springdoc/api/app8/AlbumController.java | 32 - .../api/app8/AlbumModelAssembler.java | 20 - .../springdoc/api/app8/SpringDocApp8Test.java | 30 - .../springdoc/api/app9/SpringDocApp9Test.java | 77 - .../controller/ComponentsController.java | 78 - .../hateoas/ComponentDtoModelAssembler.java | 26 - .../DemoComponentDtoModelProcessor.java | 26 - .../app9/component/dto/DemoComponentDto.java | 25 - .../dto/converter/DemoComponentConverter.java | 25 - .../app9/component/model/DemoComponent.java | 21 - .../component/service/ComponentsService.java | 28 - .../core/config/OpenAPIConfiguration.java | 18 - .../core/config/SpringRestConfiguration.java | 16 - .../app9/core/config/WebMvcConfiguration.java | 51 - .../core/exception/BadArgumentException.java | 15 - .../core/exception/BusinessException.java | 11 - .../api/app9/core/model/ExceptionDto.java | 26 - .../springdoc/api/app9/utils/Converter.java | 7 - .../api/v30/AbstractSpringDocTest.java | 85 + .../org/springdoc/api/v30/app10/Account.java | 63 + .../api/v30/app10/AccountRepository.java | 50 + .../org/springdoc/api/v30/app10/Customer.java | 60 + .../api/v30/app10/CustomerRepository.java | 76 + .../api/v30/app10/SpringDocApp10Test.java | 37 + .../org/springdoc/api/v30/app11/Person.java | 60 + .../api/v30/app11/PersonRepository.java | 40 + .../api/v30/app11/SpringDocApp11Test.java | 37 + .../api/v30/app12/HelloController.java | 85 + .../api/v30/app12/SpringDocApp12Test.java | 51 + .../api/v30/app13/HelloController.java | 84 + .../springdoc/api/v30/app13/PersonDTO.java | 71 + .../api/v30/app13/SpringDocApp13Test.java | 38 + .../api/v30/app14/HelloController.java | 46 + .../springdoc/api/v30/app14/PersonDTO.java | 71 + .../api/v30/app14/SpringDocApp14Test.java | 67 + .../api/v30/app15/HelloController.java | 46 + .../springdoc/api/v30/app15/PersonDTO.java | 71 + .../api/v30/app15/SpringDocApp15Test.java | 40 + .../org/springdoc/api/v30/app16/Account.java | 63 + .../api/v30/app16/AccountRepository.java | 55 + .../org/springdoc/api/v30/app16/Customer.java | 60 + .../api/v30/app16/CustomerRepository.java | 66 + .../api/v30/app16/OpenApiConfig.java | 38 + .../api/v30/app16/SpringDocApp16Test.java | 49 + .../api/v30/app17/ChildProperty.java | 60 + .../v30/app17/ChildPropertyRepository.java | 32 + .../org/springdoc/api/v30/app17/Property.java | 74 + .../api/v30/app17/PropertyRepository.java | 32 + .../api/v30/app17/SpringDocApp17Test.java | 37 + .../api/v30/app18/HelloController.java | 53 + .../api/v30/app18/HelloWorldModel.java | 63 + .../api/v30/app18/SpringDocApp18Test.java | 37 + .../springdoc/api/v30/app19/Application.java | 106 + .../api/v30/app19/ApplicationPredicate.java | 44 + .../api/v30/app19/GreetingController.java | 45 + .../springdoc/api/v30/app19/QApplication.java | 81 + .../api/v30/app19/SpringDocApp19Test.java | 37 + .../api/v30/app2/HelloController.java | 46 + .../org/springdoc/api/v30/app2/PersonDTO.java | 71 + .../api/v30/app2/SpringDocApp2Test.java | 38 + .../org/springdoc/api/v30/app20/Bank.java | 107 + .../api/v30/app20/BankRepository.java | 36 + .../api/v30/app20/CodeLookupRepository.java | 38 + .../api/v30/app20/DemoApplication.java | 47 + .../api/v30/app20/EntityDefinition.java | 38 + .../api/v30/app20/SpringDocApp20Test.java | 37 + .../org/springdoc/api/v30/app21/Person.java | 60 + .../api/v30/app21/PersonRepository.java | 59 + .../api/v30/app21/SpringDocApp21Test.java | 37 + .../org/springdoc/api/v30/app22/Person.java | 60 + .../springdoc/api/v30/app22/PersonApi.java | 40 + .../api/v30/app22/PersonRepository.java | 35 + .../api/v30/app22/SpringDocApp22Test.java | 38 + .../org/springdoc/api/v30/app23/Clinic.java | 57 + .../springdoc/api/v30/app23/ClinicRepo.java | 34 + .../org/springdoc/api/v30/app23/Doctor.java | 66 + .../springdoc/api/v30/app23/DoctorRepo.java | 34 + .../api/v30/app23/SpringDocApp23Test.java | 38 + .../org/springdoc/api/v30/app24/QUser.java | 70 + .../api/v30/app24/SpringDocApp24Test.java | 38 + .../api/v30/app24/TesteResource.java | 47 + .../org/springdoc/api/v30/app24/User.java | 50 + .../api/v30/app24/UserPredicate.java | 41 + .../api/v30/app25/SpringDocApp25Test.java | 38 + .../api/v30/app25/model/Address.java | 54 + .../api/v30/app25/model/BaseEntity.java | 56 + .../springdoc/api/v30/app25/model/Cat.java | 59 + .../springdoc/api/v30/app25/model/Clinic.java | 56 + .../springdoc/api/v30/app25/model/Doctor.java | 64 + .../springdoc/api/v30/app25/model/Dog.java | 58 + .../springdoc/api/v30/app25/model/Owner.java | 63 + .../springdoc/api/v30/app25/model/Pet.java | 70 + .../api/v30/app25/model/Specialty.java | 105 + .../api/v30/app25/repo/ClinicRepo.java | 39 + .../api/v30/app25/repo/DoctorRepo.java | 42 + .../api/v30/app25/repo/OwnerRepo.java | 39 + .../springdoc/api/v30/app25/repo/PetRepo.java | 39 + .../org/springdoc/api/v30/app26/Person.java | 68 + .../api/v30/app26/PersonRepository.java | 44 + .../api/v30/app26/SpringDocApp26Test.java | 39 + .../v30/app26/SpringRestConfiguration.java | 40 + .../api/v30/app27/HelloController.java | 46 + .../springdoc/api/v30/app27/PersonDTO.java | 71 + .../api/v30/app27/SpringDocApp27Test.java | 51 + .../api/v30/app28/ExamplePageable.java | 85 + .../v30/app28/ExamplePageableReplacement.java | 56 + .../api/v30/app28/HelloController.java | 47 + .../api/v30/app28/SpringDocApp28Test.java | 42 + .../org/springdoc/api/v30/app29/Person.java | 60 + .../springdoc/api/v30/app29/PersonApi.java | 40 + .../api/v30/app29/PersonRepository.java | 35 + .../api/v30/app29/SpringDocApp29Test.java | 38 + .../api/v30/app3/HelloController.java | 54 + .../api/v30/app3/SpringDocApp3Test.java | 38 + .../api/v30/app30/HelloController.java | 43 + .../org/springdoc/api/v30/app30/QUser.java | 68 + .../api/v30/app30/SpringDocApp30Test.java | 38 + .../org/springdoc/api/v30/app30/User.java | 50 + .../api/v30/app30/UserPredicate.java | 42 + .../org/springdoc/api/v30/app301/Person.java | 60 + .../springdoc/api/v30/app301/PersonApi.java | 40 + .../api/v30/app301/PersonRepository.java | 35 + .../api/v30/app301/SpringDocApp301Test.java | 78 + .../api/v30/app31/HelloController.java | 77 + .../springdoc/api/v30/app31/PersonDTO.java | 71 + .../api/v30/app31/SpringDocApp31Test.java | 38 + .../api/v30/app32/HelloController.java | 46 + .../springdoc/api/v30/app32/PersonDTO.java | 71 + .../api/v30/app32/SpringDocApp32Test.java | 62 + .../springdoc/api/v30/app33/ExampleSort.java | 45 + .../api/v30/app33/ExampleSortReplacement.java | 54 + .../api/v30/app33/HelloController.java | 44 + .../api/v30/app33/SpringDocApp33Test.java | 42 + .../org/springdoc/api/v30/app34/Account.java | 64 + .../api/v30/app34/AccountRepository.java | 55 + .../org/springdoc/api/v30/app34/Customer.java | 75 + .../api/v30/app34/CustomerRepository.java | 66 + .../api/v30/app34/OpenApiConfig.java | 38 + .../api/v30/app34/SpringDocApp34Test.java | 37 + .../v30/app34/SpringRestConfiguration.java | 41 + .../api/v30/app35/ChildProperty.java | 61 + .../v30/app35/ChildPropertyRepository.java | 35 + .../org/springdoc/api/v30/app35/Property.java | 75 + .../api/v30/app35/PropertyRepository.java | 35 + .../api/v30/app35/SpringDocApp35Test.java | 37 + .../api/v30/app36/EnumFieldHolder.java | 60 + .../v30/app36/EnumFieldHolderRepository.java | 43 + .../api/v30/app36/SpringDocApp36Test.java | 40 + .../springdoc/api/v30/app37/BaseEntity.java | 70 + .../api/v30/app37/ProductEntity.java | 86 + .../api/v30/app37/ProductRepository.java | 115 + .../api/v30/app37/SpringDocApp37Test.java | 40 + .../DefaultFlatParamObjectController.java | 40 + .../api/v30/app38/SpringDocApp38Test.java | 42 + .../api/v30/app4/DatabaseLoader.java | 55 + .../org/springdoc/api/v30/app4/Employee.java | 77 + .../api/v30/app4/EmployeeController.java | 135 + .../api/v30/app4/EmployeeRepository.java | 36 + .../api/v30/app4/SpringDocApp4Test.java | 34 + .../api/v30/app4/SpringDocTestApp.java | 46 + .../org/springdoc/api/v30/app5/Country.java | 120 + .../api/v30/app5/CountryPredicate.java | 39 + .../api/v30/app5/GreetingController.java | 48 + .../org/springdoc/api/v30/app5/QCountry.java | 76 + .../api/v30/app5/SpringDocApp5Test.java | 44 + .../api/v30/app6/DatabaseLoader.java | 55 + .../org/springdoc/api/v30/app6/Employee.java | 77 + .../api/v30/app6/EmployeeController.java | 54 + .../api/v30/app6/EmployeeRepository.java | 36 + .../api/v30/app6/SpringDocApp6Test.java | 37 + .../api/v30/app6/SpringDocTestApp.java | 46 + .../api/v30/app7/HelloController.java | 47 + .../org/springdoc/api/v30/app7/PersonDTO.java | 71 + .../api/v30/app7/SpringDocApp7Test.java | 38 + .../org/springdoc/api/v30/app8/Album.java | 55 + .../api/v30/app8/AlbumController.java | 58 + .../api/v30/app8/AlbumModelAssembler.java | 46 + .../api/v30/app8/SpringDocApp8Test.java | 38 + .../api/v30/app9/SpringDocApp9Test.java | 79 + .../controller/ComponentsController.java | 104 + .../hateoas/ComponentDtoModelAssembler.java | 52 + .../DemoComponentDtoModelProcessor.java | 52 + .../app9/component/dto/DemoComponentDto.java | 51 + .../dto/converter/DemoComponentConverter.java | 51 + .../app9/component/model/DemoComponent.java | 47 + .../component/service/ComponentsService.java | 54 + .../core/config/OpenAPIConfiguration.java | 44 + .../core/config/SpringRestConfiguration.java | 42 + .../app9/core/config/WebMvcConfiguration.java | 57 + .../core/exception/BadArgumentException.java | 41 + .../core/exception/BusinessException.java | 37 + .../api/v30/app9/core/model/ExceptionDto.java | 52 + .../api/v30/app9/utils/Converter.java | 33 + .../api/v31/AbstractSpringDocTest.java | 83 + .../org/springdoc/api/v31/app10/Account.java | 63 + .../api/v31/app10/AccountRepository.java | 50 + .../org/springdoc/api/v31/app10/Customer.java | 60 + .../api/v31/app10/CustomerRepository.java | 76 + .../api/v31/app10/SpringDocApp10Test.java | 37 + .../org/springdoc/api/v31/app11/Person.java | 60 + .../api/v31/app11/PersonRepository.java | 40 + .../api/v31/app11/SpringDocApp11Test.java | 37 + .../api/v31/app12/HelloController.java | 85 + .../api/v31/app12/SpringDocApp12Test.java | 51 + .../api/v31/app13/HelloController.java | 84 + .../springdoc/api/v31/app13/PersonDTO.java | 71 + .../api/v31/app13/SpringDocApp13Test.java | 38 + .../api/v31/app14/HelloController.java | 46 + .../springdoc/api/v31/app14/PersonDTO.java | 71 + .../api/v31/app14/SpringDocApp14Test.java | 67 + .../api/v31/app15/HelloController.java | 46 + .../springdoc/api/v31/app15/PersonDTO.java | 71 + .../api/v31/app15/SpringDocApp15Test.java | 40 + .../org/springdoc/api/v31/app16/Account.java | 63 + .../api/v31/app16/AccountRepository.java | 55 + .../org/springdoc/api/v31/app16/Customer.java | 60 + .../api/v31/app16/CustomerRepository.java | 66 + .../api/v31/app16/OpenApiConfig.java | 38 + .../api/v31/app16/SpringDocApp16Test.java | 49 + .../api/v31/app17/ChildProperty.java | 60 + .../v31/app17/ChildPropertyRepository.java | 32 + .../org/springdoc/api/v31/app17/Property.java | 74 + .../api/v31/app17/PropertyRepository.java | 32 + .../api/v31/app17/SpringDocApp17Test.java | 37 + .../api/v31/app18/HelloController.java | 53 + .../api/v31/app18/HelloWorldModel.java | 63 + .../api/v31/app18/SpringDocApp18Test.java | 37 + .../springdoc/api/v31/app19/Application.java | 106 + .../api/v31/app19/ApplicationPredicate.java | 44 + .../api/v31/app19/GreetingController.java | 45 + .../springdoc/api/v31/app19/QApplication.java | 81 + .../api/v31/app19/SpringDocApp19Test.java | 37 + .../api/v31/app2/HelloController.java | 46 + .../org/springdoc/api/v31/app2/PersonDTO.java | 71 + .../api/v31/app2/SpringDocApp2Test.java | 38 + .../org/springdoc/api/v31/app20/Bank.java | 107 + .../api/v31/app20/BankRepository.java | 36 + .../api/v31/app20/CodeLookupRepository.java | 38 + .../api/v31/app20/DemoApplication.java | 47 + .../api/v31/app20/EntityDefinition.java | 38 + .../api/v31/app20/SpringDocApp20Test.java | 37 + .../org/springdoc/api/v31/app21/Person.java | 60 + .../api/v31/app21/PersonRepository.java | 59 + .../api/v31/app21/SpringDocApp21Test.java | 37 + .../org/springdoc/api/v31/app22/Person.java | 60 + .../springdoc/api/v31/app22/PersonApi.java | 40 + .../api/v31/app22/PersonRepository.java | 35 + .../api/v31/app22/SpringDocApp22Test.java | 38 + .../org/springdoc/api/v31/app23/Clinic.java | 57 + .../springdoc/api/v31/app23/ClinicRepo.java | 34 + .../org/springdoc/api/v31/app23/Doctor.java | 66 + .../springdoc/api/v31/app23/DoctorRepo.java | 34 + .../api/v31/app23/SpringDocApp23Test.java | 38 + .../org/springdoc/api/v31/app24/QUser.java | 70 + .../api/v31/app24/SpringDocApp24Test.java | 38 + .../api/v31/app24/TesteResource.java | 47 + .../org/springdoc/api/v31/app24/User.java | 50 + .../api/v31/app24/UserPredicate.java | 41 + .../api/v31/app25/SpringDocApp25Test.java | 38 + .../api/v31/app25/model/Address.java | 54 + .../api/v31/app25/model/BaseEntity.java | 56 + .../springdoc/api/v31/app25/model/Cat.java | 59 + .../springdoc/api/v31/app25/model/Clinic.java | 56 + .../springdoc/api/v31/app25/model/Doctor.java | 64 + .../springdoc/api/v31/app25/model/Dog.java | 58 + .../springdoc/api/v31/app25/model/Owner.java | 63 + .../springdoc/api/v31/app25/model/Pet.java | 70 + .../api/v31/app25/model/Specialty.java | 105 + .../api/v31/app25/repo/ClinicRepo.java | 39 + .../api/v31/app25/repo/DoctorRepo.java | 42 + .../api/v31/app25/repo/OwnerRepo.java | 39 + .../springdoc/api/v31/app25/repo/PetRepo.java | 39 + .../org/springdoc/api/v31/app26/Person.java | 68 + .../api/v31/app26/PersonRepository.java | 44 + .../api/v31/app26/SpringDocApp26Test.java | 39 + .../v31/app26/SpringRestConfiguration.java | 40 + .../api/v31/app27/HelloController.java | 46 + .../springdoc/api/v31/app27/PersonDTO.java | 71 + .../api/v31/app27/SpringDocApp27Test.java | 51 + .../api/v31/app28/ExamplePageable.java | 85 + .../v31/app28/ExamplePageableReplacement.java | 56 + .../api/v31/app28/HelloController.java | 47 + .../api/v31/app28/SpringDocApp28Test.java | 42 + .../org/springdoc/api/v31/app29/Person.java | 60 + .../springdoc/api/v31/app29/PersonApi.java | 40 + .../api/v31/app29/PersonRepository.java | 35 + .../api/v31/app29/SpringDocApp29Test.java | 38 + .../api/v31/app3/HelloController.java | 54 + .../api/v31/app3/SpringDocApp3Test.java | 38 + .../api/v31/app30/HelloController.java | 43 + .../org/springdoc/api/v31/app30/QUser.java | 68 + .../api/v31/app30/SpringDocApp30Test.java | 38 + .../org/springdoc/api/v31/app30/User.java | 50 + .../api/v31/app30/UserPredicate.java | 42 + .../org/springdoc/api/v31/app301/Person.java | 60 + .../springdoc/api/v31/app301/PersonApi.java | 40 + .../api/v31/app301/PersonRepository.java | 35 + .../api/v31/app301/SpringDocApp301Test.java | 78 + .../api/v31/app31/HelloController.java | 77 + .../springdoc/api/v31/app31/PersonDTO.java | 71 + .../api/v31/app31/SpringDocApp31Test.java | 38 + .../api/v31/app32/HelloController.java | 46 + .../springdoc/api/v31/app32/PersonDTO.java | 71 + .../api/v31/app32/SpringDocApp32Test.java | 62 + .../springdoc/api/v31/app33/ExampleSort.java | 45 + .../api/v31/app33/ExampleSortReplacement.java | 54 + .../api/v31/app33/HelloController.java | 44 + .../api/v31/app33/SpringDocApp33Test.java | 42 + .../org/springdoc/api/v31/app34/Account.java | 64 + .../api/v31/app34/AccountRepository.java | 55 + .../org/springdoc/api/v31/app34/Customer.java | 75 + .../api/v31/app34/CustomerRepository.java | 66 + .../api/v31/app34/OpenApiConfig.java | 38 + .../api/v31/app34/SpringDocApp34Test.java | 37 + .../v31/app34/SpringRestConfiguration.java | 41 + .../api/v31/app35/ChildProperty.java | 61 + .../v31/app35/ChildPropertyRepository.java | 35 + .../org/springdoc/api/v31/app35/Property.java | 75 + .../api/v31/app35/PropertyRepository.java | 35 + .../api/v31/app35/SpringDocApp35Test.java | 37 + .../api/v31/app36/EnumFieldHolder.java | 60 + .../v31/app36/EnumFieldHolderRepository.java | 43 + .../api/v31/app36/SpringDocApp36Test.java | 40 + .../springdoc/api/v31/app37/BaseEntity.java | 70 + .../api/v31/app37/ProductEntity.java | 86 + .../api/v31/app37/ProductRepository.java | 115 + .../api/v31/app37/SpringDocApp37Test.java | 40 + .../DefaultFlatParamObjectController.java | 40 + .../api/v31/app38/SpringDocApp38Test.java | 42 + .../api/v31/app4/DatabaseLoader.java | 55 + .../org/springdoc/api/v31/app4/Employee.java | 77 + .../api/v31/app4/EmployeeController.java | 135 + .../api/v31/app4/EmployeeRepository.java | 36 + .../api/v31/app4/SpringDocApp4Test.java | 34 + .../api/v31/app4/SpringDocTestApp.java | 46 + .../org/springdoc/api/v31/app5/Country.java | 120 + .../api/v31/app5/CountryPredicate.java | 39 + .../api/v31/app5/GreetingController.java | 48 + .../org/springdoc/api/v31/app5/QCountry.java | 76 + .../api/v31/app5/SpringDocApp5Test.java | 44 + .../api/v31/app6/DatabaseLoader.java | 55 + .../org/springdoc/api/v31/app6/Employee.java | 77 + .../api/v31/app6/EmployeeController.java | 54 + .../api/v31/app6/EmployeeRepository.java | 36 + .../api/v31/app6/SpringDocApp6Test.java | 37 + .../api/v31/app6/SpringDocTestApp.java | 46 + .../api/v31/app7/HelloController.java | 47 + .../org/springdoc/api/v31/app7/PersonDTO.java | 71 + .../api/v31/app7/SpringDocApp7Test.java | 38 + .../org/springdoc/api/v31/app8/Album.java | 55 + .../api/v31/app8/AlbumController.java | 58 + .../api/v31/app8/AlbumModelAssembler.java | 46 + .../api/v31/app8/SpringDocApp8Test.java | 38 + .../api/v31/app9/SpringDocApp9Test.java | 79 + .../controller/ComponentsController.java | 104 + .../hateoas/ComponentDtoModelAssembler.java | 52 + .../DemoComponentDtoModelProcessor.java | 52 + .../app9/component/dto/DemoComponentDto.java | 51 + .../dto/converter/DemoComponentConverter.java | 51 + .../app9/component/model/DemoComponent.java | 47 + .../component/service/ComponentsService.java | 54 + .../core/config/OpenAPIConfiguration.java | 44 + .../core/config/SpringRestConfiguration.java | 42 + .../app9/core/config/WebMvcConfiguration.java | 57 + .../core/exception/BadArgumentException.java | 41 + .../core/exception/BusinessException.java | 37 + .../api/v31/app9/core/model/ExceptionDto.java | 52 + .../api/v31/app9/utils/Converter.java | 33 + .../resources/results/{ => 3.0.1}/app10.json | 0 .../resources/results/{ => 3.0.1}/app11.json | 0 .../resources/results/{ => 3.0.1}/app12.json | 0 .../resources/results/{ => 3.0.1}/app13.json | 0 .../resources/results/{ => 3.0.1}/app14.json | 0 .../resources/results/{ => 3.0.1}/app15.json | 0 .../resources/results/{ => 3.0.1}/app16.json | 0 .../resources/results/{ => 3.0.1}/app17.json | 0 .../resources/results/{ => 3.0.1}/app18.json | 0 .../resources/results/{ => 3.0.1}/app19.json | 0 .../resources/results/{ => 3.0.1}/app2.json | 0 .../resources/results/{ => 3.0.1}/app20.json | 0 .../resources/results/{ => 3.0.1}/app21.json | 0 .../resources/results/{ => 3.0.1}/app22.json | 0 .../resources/results/{ => 3.0.1}/app23.json | 0 .../resources/results/{ => 3.0.1}/app24.json | 0 .../resources/results/{ => 3.0.1}/app25.json | 0 .../resources/results/{ => 3.0.1}/app26.json | 0 .../resources/results/{ => 3.0.1}/app27.json | 0 .../resources/results/{ => 3.0.1}/app28.json | 0 .../resources/results/{ => 3.0.1}/app29.json | 0 .../resources/results/{ => 3.0.1}/app3.json | 0 .../resources/results/{ => 3.0.1}/app30.json | 0 .../resources/results/{ => 3.0.1}/app301.json | 0 .../resources/results/{ => 3.0.1}/app31.json | 0 .../resources/results/{ => 3.0.1}/app32.json | 0 .../resources/results/{ => 3.0.1}/app33.json | 0 .../resources/results/{ => 3.0.1}/app34.json | 0 .../resources/results/{ => 3.0.1}/app35.json | 0 .../resources/results/{ => 3.0.1}/app36.json | 0 .../resources/results/{ => 3.0.1}/app37.json | 0 .../resources/results/{ => 3.0.1}/app38.json | 0 .../resources/results/{ => 3.0.1}/app4.json | 0 .../resources/results/{ => 3.0.1}/app5.json | 0 .../resources/results/{ => 3.0.1}/app6.json | 0 .../resources/results/{ => 3.0.1}/app7.json | 0 .../resources/results/{ => 3.0.1}/app8.json | 0 .../resources/results/{ => 3.0.1}/app9.json | 0 .../test/resources/results/3.1.0/app10.json | 960 +++ .../test/resources/results/3.1.0/app11.json | 353 + .../test/resources/results/3.1.0/app12.json | 120 + .../test/resources/results/3.1.0/app13.json | 388 + .../test/resources/results/3.1.0/app14.json | 100 + .../test/resources/results/3.1.0/app15.json | 100 + .../test/resources/results/3.1.0/app16.json | 1236 +++ .../test/resources/results/3.1.0/app17.json | 452 + .../test/resources/results/3.1.0/app18.json | 123 + .../test/resources/results/3.1.0/app19.json | 62 + .../test/resources/results/3.1.0/app2.json | 95 + .../test/resources/results/3.1.0/app20.json | 563 ++ .../test/resources/results/3.1.0/app21.json | 432 + .../test/resources/results/3.1.0/app22.json | 343 + .../test/resources/results/3.1.0/app23.json | 1026 +++ .../test/resources/results/3.1.0/app24.json | 188 + .../test/resources/results/3.1.0/app25.json | 2718 ++++++ .../test/resources/results/3.1.0/app26.json | 373 + .../test/resources/results/3.1.0/app27.json | 114 + .../test/resources/results/3.1.0/app28.json | 77 + .../test/resources/results/3.1.0/app29.json | 333 + .../test/resources/results/3.1.0/app3.json | 102 + .../test/resources/results/3.1.0/app30.json | 73 + .../test/resources/results/3.1.0/app301.json | 17 + .../test/resources/results/3.1.0/app31.json | 275 + .../test/resources/results/3.1.0/app32.json | 78 + .../test/resources/results/3.1.0/app33.json | 55 + .../test/resources/results/3.1.0/app34.json | 1477 ++++ .../test/resources/results/3.1.0/app35.json | 17 + .../test/resources/results/3.1.0/app36.json | 167 + .../test/resources/results/3.1.0/app37.json | 835 ++ .../test/resources/results/3.1.0/app38.json | 55 + .../test/resources/results/3.1.0/app4.json | 223 + .../test/resources/results/3.1.0/app5.json | 102 + .../test/resources/results/3.1.0/app6.json | 124 + .../test/resources/results/3.1.0/app7.json | 100 + .../test/resources/results/3.1.0/app8.json | 131 + .../test/resources/results/3.1.0/app9.json | 218 + .../org/springdoc/api/AbstractCommonTest.java | 37 - .../api/AbstractSpringDocFunctionTest.java | 61 - .../org/springdoc/api/app154/PersonDTO.java | 60 - .../api/app154/SpringDocApp154Test.java | 71 - .../springdoc/api/v30/AbstractCommonTest.java | 63 + .../v30/AbstractSpringDocFunctionTest.java | 69 + .../springdoc/api/v30/app154/PersonDTO.java | 60 + .../api/v30/app154/SpringDocApp154Test.java | 71 + .../springdoc/api/v31/AbstractCommonTest.java | 61 + .../v31/AbstractSpringDocFunctionTest.java | 69 + .../springdoc/api/v31/app154/PersonDTO.java | 60 + .../api/v31/app154/SpringDocApp154Test.java | 71 + .../resources/results/{ => 3.0.1}/app154.json | 0 .../test/resources/results/3.1.0/app154.json | 303 + .../org/springdoc/api/AbstractCommonTest.java | 32 - .../springdoc/api/AbstractSpringDocTest.java | 48 - .../springdoc/api/app174/HelloController.java | 44 - .../org/springdoc/api/app174/PersonDTO.java | 60 - .../api/app174/SpringDocApp174Test.java | 85 - .../org/springdoc/api/app175/PersonDTO.java | 60 - .../api/app175/SpringDocApp175Test.java | 86 - .../springdoc/api/v30/AbstractCommonTest.java | 58 + .../api/v30/AbstractSpringDocTest.java | 56 + .../api/v30/app174/HelloController.java | 44 + .../springdoc/api/v30/app174/PersonDTO.java | 60 + .../api/v30/app174/SpringDocApp174Test.java | 85 + .../springdoc/api/v30/app175/PersonDTO.java | 60 + .../api/v30/app175/SpringDocApp175Test.java | 86 + .../springdoc/api/v31/AbstractCommonTest.java | 56 + .../api/v31/AbstractSpringDocTest.java | 56 + .../api/v31/app174/HelloController.java | 44 + .../springdoc/api/v31/app174/PersonDTO.java | 60 + .../api/v31/app174/SpringDocApp174Test.java | 85 + .../springdoc/api/v31/app175/PersonDTO.java | 60 + .../api/v31/app175/SpringDocApp175Test.java | 86 + .../resources/results/{ => 3.0.1}/app174.json | 0 .../resources/results/{ => 3.0.1}/app175.json | 0 .../test/resources/results/3.1.0/app174.json | 379 + .../test/resources/results/3.1.0/app175.json | 15 + .../springdoc/api/AbstractSpringDocTest.java | 79 - .../test/org/springdoc/api/app1/Car.groovy | 27 - .../springdoc/api/app1/CarController.groovy | 51 - .../org/springdoc/api/app1/CarService.groovy | 44 - .../api/app1/OpenApiConfiguration.groovy | 45 - .../springdoc/api/app1/SpringDocApp1Test.java | 26 - .../springdoc/api/app10/HelloController.java | 60 - .../org/springdoc/api/app10/PersonDTO.java | 63 - .../api/app10/SpringDocApp10Test.java | 35 - .../api/app11/SpringDocApp11Test.java | 35 - .../springdoc/api/app11/TestController.java | 25 - .../org/springdoc/api/app11/TestRequest.java | 22 - .../api/app191/GlobalExceptionHandler.java | 19 - .../springdoc/api/app191/HelloController.java | 94 - .../org/springdoc/api/app191/MyException.java | 7 - .../org/springdoc/api/app191/PersonDTO.java | 67 - .../api/app191/SpringDocApp191Test.java | 35 - .../test/org/springdoc/api/app2/Car.groovy | 27 - .../springdoc/api/app2/CarController.groovy | 51 - .../org/springdoc/api/app2/CarService.groovy | 44 - .../api/app2/OpenApiConfiguration.groovy | 45 - .../springdoc/api/app2/SpringDocApp2Test.java | 11 - .../springdoc/api/app9/DeprecatedEntity.java | 32 - .../springdoc/api/app9/HelloController.java | 24 - .../springdoc/api/app9/SpringDocApp9Test.java | 63 - .../api/v30/AbstractSpringDocTest.java | 83 + .../org/springdoc/api/v30/app1/Car.groovy | 33 + .../api/v30/app1/CarController.groovy | 57 + .../springdoc/api/v30/app1/CarService.groovy | 50 + .../api/v30/app1/OpenApiConfiguration.groovy | 51 + .../api/v30/app1/SpringDocApp1Test.java | 52 + .../api/v30/app10/HelloController.java | 68 + .../springdoc/api/v30/app10/PersonDTO.java | 71 + .../api/v30/app10/SpringDocApp10Test.java | 38 + .../api/v30/app11/SpringDocApp11Test.java | 38 + .../api/v30/app11/TestController.java | 51 + .../springdoc/api/v30/app11/TestRequest.java | 48 + .../v30/app191/GlobalExceptionHandler.java | 45 + .../api/v30/app191/HelloController.java | 98 + .../springdoc/api/v30/app191/MyException.java | 33 + .../springdoc/api/v30/app191/PersonDTO.java | 71 + .../api/v30/app191/SpringDocApp191Test.java | 39 + .../org/springdoc/api/v30/app2/Car.groovy | 33 + .../api/v30/app2/CarController.groovy | 57 + .../springdoc/api/v30/app2/CarService.groovy | 50 + .../api/v30/app2/OpenApiConfiguration.groovy | 51 + .../api/v30/app2/SpringDocApp2Test.java | 37 + .../api/v30/app9/DeprecatedEntity.java | 58 + .../api/v30/app9/HelloController.java | 50 + .../api/v30/app9/SpringDocApp9Test.java | 66 + .../api/v31/AbstractSpringDocTest.java | 81 + .../org/springdoc/api/v31/app1/Car.groovy | 33 + .../api/v31/app1/CarController.groovy | 57 + .../springdoc/api/v31/app1/CarService.groovy | 50 + .../api/v31/app1/OpenApiConfiguration.groovy | 51 + .../api/v31/app1/SpringDocApp1Test.java | 52 + .../api/v31/app10/HelloController.java | 68 + .../springdoc/api/v31/app10/PersonDTO.java | 71 + .../api/v31/app10/SpringDocApp10Test.java | 38 + .../api/v31/app11/SpringDocApp11Test.java | 38 + .../api/v31/app11/TestController.java | 51 + .../springdoc/api/v31/app11/TestRequest.java | 48 + .../v31/app191/GlobalExceptionHandler.java | 45 + .../api/v31/app191/HelloController.java | 98 + .../springdoc/api/v31/app191/MyException.java | 33 + .../springdoc/api/v31/app191/PersonDTO.java | 71 + .../api/v31/app191/SpringDocApp191Test.java | 39 + .../org/springdoc/api/v31/app2/Car.groovy | 33 + .../api/v31/app2/CarController.groovy | 57 + .../springdoc/api/v31/app2/CarService.groovy | 50 + .../api/v31/app2/OpenApiConfiguration.groovy | 51 + .../api/v31/app2/SpringDocApp2Test.java | 37 + .../api/v31/app9/DeprecatedEntity.java | 58 + .../api/v31/app9/HelloController.java | 50 + .../api/v31/app9/SpringDocApp9Test.java | 66 + .../resources/results/{ => 3.0.1}/app1.json | 0 .../resources/results/{ => 3.0.1}/app10.json | 0 .../resources/results/{ => 3.0.1}/app11.json | 0 .../resources/results/{ => 3.0.1}/app191.json | 0 .../resources/results/{ => 3.0.1}/app2.json | 0 .../resources/results/{ => 3.0.1}/app9.json | 0 .../test/resources/results/3.1.0/app1.json | 7275 +++++++++++++++++ .../test/resources/results/3.1.0/app10.json | 278 + .../test/resources/results/3.1.0/app11.json | 58 + .../test/resources/results/3.1.0/app191.json | 416 + .../test/resources/results/3.1.0/app2.json | 95 + .../test/resources/results/3.1.0/app9.json | 115 + .../springdoc/api/AbstractSpringDocTest.java | 83 - .../springdoc/api/app1/DatabaseLoader.java | 47 - .../test/org/springdoc/api/app1/Employee.java | 69 - .../api/app1/EmployeeController.java | 131 - .../api/app1/EmployeeRepository.java | 28 - .../springdoc/api/app1/SpringDocApp1Test.java | 30 - .../test/org/springdoc/api/app10/Dummy.java | 34 - .../springdoc/api/app10/HelloController.java | 75 - .../api/app10/SpringDocApp10DirectTest.java | 55 - .../app10/SpringDocApp10NotSpecifiedTest.java | 68 - .../api/app10/SpringDocApp10ViaDtoTest.java | 55 - .../springdoc/api/app2/SpringDocApp2Test.java | 32 - .../api/app2/config/DatabaseConfig.java | 32 - .../api/app2/controller/PostController.java | 29 - .../org/springdoc/api/app2/entities/Post.java | 30 - .../app2/hateoas/PostResourceAssembler.java | 22 - .../api/app2/repositories/PostRepository.java | 14 - .../api/app2/service/PostService.java | 35 - .../springdoc/api/app3/DatabaseLoader.java | 47 - .../test/org/springdoc/api/app3/Employee.java | 69 - .../api/app3/EmployeeController.java | 46 - .../api/app3/EmployeeRepository.java | 28 - .../springdoc/api/app3/SpringDocApp3Test.java | 29 - .../springdoc/api/app3/SpringDocTestApp.java | 31 - .../test/org/springdoc/api/app4/Album.java | 29 - .../springdoc/api/app4/AlbumController.java | 32 - .../api/app4/AlbumModelAssembler.java | 20 - .../springdoc/api/app4/SpringDocApp4Test.java | 30 - .../springdoc/api/app5/SpringDocApp5Test.java | 42 - .../app5/controller/CompanyController.java | 31 - .../springdoc/api/app5/entities/Company.java | 29 - .../api/app5/entities/CompanyDto.java | 29 - .../app5/hateoas/CompanyModelAssembler.java | 29 - .../springdoc/api/app6/SpringDocApp6Test.java | 78 - .../api/app6/controller/ItemController.java | 37 - .../org/springdoc/api/app6/model/Item.java | 32 - .../springdoc/api/app7/FooConfiguration.java | 16 - .../springdoc/api/app7/SpringDocApp7Test.java | 31 - .../springdoc/api/app7/application/Foo.java | 10 - .../api/app7/application/FooController.java | 33 - .../application/FooResourceAssembler.java | 35 - .../api/app7/application/FooService.java | 13 - .../springdoc/api/app8/DatabaseLoader.java | 47 - .../test/org/springdoc/api/app8/Employee.java | 69 - .../api/app8/EmployeeController.java | 131 - .../api/app8/EmployeeRepository.java | 28 - .../springdoc/api/app8/SpringDocApp8Test.java | 76 - .../springdoc/api/app9/FooConfiguration.java | 57 - .../springdoc/api/app9/SpringDocApp9Test.java | 31 - .../api/app9/application/FooController.java | 37 - .../app9/application/dto/FeedResponse.java | 39 - .../app9/application/dto/ResponseData.java | 20 - .../api/v30/AbstractSpringDocTest.java | 85 + .../api/v30/app1/DatabaseLoader.java | 55 + .../org/springdoc/api/v30/app1/Employee.java | 77 + .../api/v30/app1/EmployeeController.java | 139 + .../api/v30/app1/EmployeeRepository.java | 36 + .../api/v30/app1/SpringDocApp1Test.java | 38 + .../org/springdoc/api/v30/app10/Dummy.java | 38 + .../api/v30/app10/HelloController.java | 79 + .../v30/app10/SpringDocApp10DirectTest.java | 59 + .../app10/SpringDocApp10NotSpecifiedTest.java | 72 + .../v30/app10/SpringDocApp10ViaDtoTest.java | 59 + .../api/v30/app2/SpringDocApp2Test.java | 40 + .../api/v30/app2/config/DatabaseConfig.java | 58 + .../v30/app2/controller/PostController.java | 55 + .../springdoc/api/v30/app2/entities/Post.java | 56 + .../app2/hateoas/PostResourceAssembler.java | 48 + .../v30/app2/repositories/PostRepository.java | 40 + .../api/v30/app2/service/PostService.java | 61 + .../api/v30/app3/DatabaseLoader.java | 55 + .../org/springdoc/api/v30/app3/Employee.java | 77 + .../api/v30/app3/EmployeeController.java | 54 + .../api/v30/app3/EmployeeRepository.java | 36 + .../api/v30/app3/SpringDocApp3Test.java | 37 + .../api/v30/app3/SpringDocTestApp.java | 39 + .../org/springdoc/api/v30/app4/Album.java | 55 + .../api/v30/app4/AlbumController.java | 58 + .../api/v30/app4/AlbumModelAssembler.java | 46 + .../api/v30/app4/SpringDocApp4Test.java | 38 + .../api/v30/app5/SpringDocApp5Test.java | 50 + .../app5/controller/CompanyController.java | 57 + .../api/v30/app5/entities/Company.java | 55 + .../api/v30/app5/entities/CompanyDto.java | 55 + .../app5/hateoas/CompanyModelAssembler.java | 55 + .../api/v30/app6/SpringDocApp6Test.java | 80 + .../v30/app6/controller/ItemController.java | 63 + .../springdoc/api/v30/app6/model/Item.java | 58 + .../api/v30/app7/FooConfiguration.java | 42 + .../api/v30/app7/SpringDocApp7Test.java | 39 + .../api/v30/app7/application/Foo.java | 36 + .../v30/app7/application/FooController.java | 59 + .../application/FooResourceAssembler.java | 61 + .../api/v30/app7/application/FooService.java | 39 + .../api/v30/app8/DatabaseLoader.java | 55 + .../org/springdoc/api/v30/app8/Employee.java | 77 + .../api/v30/app8/EmployeeController.java | 139 + .../api/v30/app8/EmployeeRepository.java | 36 + .../api/v30/app8/SpringDocApp8Test.java | 78 + .../api/v30/app9/FooConfiguration.java | 83 + .../api/v30/app9/SpringDocApp9Test.java | 39 + .../v30/app9/application/FooController.java | 63 + .../app9/application/dto/FeedResponse.java | 65 + .../app9/application/dto/ResponseData.java | 46 + .../api/v31/AbstractSpringDocTest.java | 83 + .../api/v31/app1/DatabaseLoader.java | 55 + .../org/springdoc/api/v31/app1/Employee.java | 77 + .../api/v31/app1/EmployeeController.java | 139 + .../api/v31/app1/EmployeeRepository.java | 36 + .../api/v31/app1/SpringDocApp1Test.java | 38 + .../org/springdoc/api/v31/app10/Dummy.java | 38 + .../api/v31/app10/HelloController.java | 79 + .../v31/app10/SpringDocApp10DirectTest.java | 59 + .../app10/SpringDocApp10NotSpecifiedTest.java | 72 + .../v31/app10/SpringDocApp10ViaDtoTest.java | 59 + .../api/v31/app2/SpringDocApp2Test.java | 40 + .../api/v31/app2/config/DatabaseConfig.java | 58 + .../v31/app2/controller/PostController.java | 55 + .../springdoc/api/v31/app2/entities/Post.java | 56 + .../app2/hateoas/PostResourceAssembler.java | 48 + .../v31/app2/repositories/PostRepository.java | 40 + .../api/v31/app2/service/PostService.java | 61 + .../api/v31/app3/DatabaseLoader.java | 55 + .../org/springdoc/api/v31/app3/Employee.java | 77 + .../api/v31/app3/EmployeeController.java | 54 + .../api/v31/app3/EmployeeRepository.java | 36 + .../api/v31/app3/SpringDocApp3Test.java | 37 + .../api/v31/app3/SpringDocTestApp.java | 39 + .../org/springdoc/api/v31/app4/Album.java | 55 + .../api/v31/app4/AlbumController.java | 58 + .../api/v31/app4/AlbumModelAssembler.java | 46 + .../api/v31/app4/SpringDocApp4Test.java | 38 + .../api/v31/app5/SpringDocApp5Test.java | 50 + .../app5/controller/CompanyController.java | 57 + .../api/v31/app5/entities/Company.java | 55 + .../api/v31/app5/entities/CompanyDto.java | 55 + .../app5/hateoas/CompanyModelAssembler.java | 55 + .../api/v31/app6/SpringDocApp6Test.java | 80 + .../v31/app6/controller/ItemController.java | 63 + .../springdoc/api/v31/app6/model/Item.java | 58 + .../api/v31/app7/FooConfiguration.java | 42 + .../api/v31/app7/SpringDocApp7Test.java | 39 + .../api/v31/app7/application/Foo.java | 36 + .../v31/app7/application/FooController.java | 59 + .../application/FooResourceAssembler.java | 61 + .../api/v31/app7/application/FooService.java | 39 + .../api/v31/app8/DatabaseLoader.java | 55 + .../org/springdoc/api/v31/app8/Employee.java | 77 + .../api/v31/app8/EmployeeController.java | 139 + .../api/v31/app8/EmployeeRepository.java | 36 + .../api/v31/app8/SpringDocApp8Test.java | 78 + .../api/v31/app9/FooConfiguration.java | 83 + .../api/v31/app9/SpringDocApp9Test.java | 39 + .../v31/app9/application/FooController.java | 63 + .../app9/application/dto/FeedResponse.java | 65 + .../app9/application/dto/ResponseData.java | 46 + .../resources/results/{ => 3.0.1}/app1.json | 0 .../results/{ => 3.0.1}/app10-direct.json | 0 .../results/{ => 3.0.1}/app10-via_dto.json | 0 .../resources/results/{ => 3.0.1}/app2.json | 0 .../resources/results/{ => 3.0.1}/app3.json | 0 .../resources/results/{ => 3.0.1}/app4.json | 0 .../resources/results/{ => 3.0.1}/app5.json | 0 .../resources/results/{ => 3.0.1}/app6.json | 0 .../resources/results/{ => 3.0.1}/app7.json | 0 .../resources/results/{ => 3.0.1}/app8.json | 0 .../resources/results/{ => 3.0.1}/app9.json | 0 .../results/{ => 3.0.1}/app9wrong.json | 0 .../test/resources/results/3.1.0/app1.json | 223 + .../resources/results/3.1.0/app10-direct.json | 391 + .../results/3.1.0/app10-via_dto.json | 213 + .../test/resources/results/3.1.0/app2.json | 170 + .../test/resources/results/3.1.0/app3.json | 124 + .../test/resources/results/3.1.0/app4.json | 131 + .../test/resources/results/3.1.0/app5.json | 116 + .../test/resources/results/3.1.0/app6.json | 109 + .../test/resources/results/3.1.0/app7.json | 96 + .../test/resources/results/3.1.0/app8.json | 221 + .../test/resources/results/3.1.0/app9.json | 142 + .../resources/results/3.1.0/app9wrong.json | 122 + .../springdoc/api/AbstractSpringDocTest.java | 103 - .../org/springdoc/api/app1/ApiException.java | 48 - .../springdoc/api/app1/ApiOriginFilter.java | 69 - .../api/app1/ApiResponseMessage.java | 160 - .../org/springdoc/api/app1/ErrorMessage.java | 83 - .../api/app1/ExceptionTranslator.java | 67 - .../springdoc/api/app1/HelloController.java | 50 - .../springdoc/api/app1/HomeController.java | 50 - .../springdoc/api/app1/ItemController.java | 81 - .../test/org/springdoc/api/app1/ItemDTO.java | 156 - .../org/springdoc/api/app1/ItemLightDTO.java | 121 - .../org/springdoc/api/app1/PersonDTO.java | 112 - .../springdoc/api/app1/SpringDocApp1Test.java | 57 - .../springdoc/api/app10/HelloController.java | 61 - .../api/app10/SpringDocApp10Test.java | 35 - .../springdoc/api/app100/HelloController.java | 47 - .../org/springdoc/api/app100/PersonDTO.java | 115 - .../api/app100/SpringDocApp100Test.java | 37 - .../springdoc/api/app101/HelloController.java | 31 - .../org/springdoc/api/app101/HelloDTO.java | 37 - .../api/app101/SpringDocApp101Test.java | 39 - .../api/app102/InheritedRequestParams.java | 34 - .../springdoc/api/app102/RequestParams.java | 258 - .../api/app102/SpringDocApp102Test.java | 16 - .../springdoc/api/app102/TestController.java | 24 - .../org/springdoc/api/app103/ExampleBody.java | 52 - .../springdoc/api/app103/HelloController.java | 61 - .../api/app103/SpringDocApp103Test.java | 16 - .../springdoc/api/app104/CrudController.java | 47 - .../test/org/springdoc/api/app104/Design.java | 7 - .../api/app104/DesignController.java | 17 - .../org/springdoc/api/app104/HavingPK.java | 7 - .../api/app104/SpringDocApp104Test.java | 16 - .../api/app105/SpringDocApp105Test.java | 136 - .../org/springdoc/api/app105/api/ApiUtil.java | 61 - .../api/app105/api/ExceptionTranslator.java | 66 - .../api/app105/api/HomeController.java | 50 - .../springdoc/api/app105/api/pet/PetApi.java | 219 - .../api/app105/api/pet/PetApiController.java | 60 - .../api/app105/api/pet/PetApiDelegate.java | 185 - .../app105/api/pet/PetApiDelegateImpl.java | 30 - .../api/app105/api/store/StoreApi.java | 140 - .../app105/api/store/StoreApiController.java | 60 - .../app105/api/store/StoreApiDelegate.java | 116 - .../api/store/StoreApiDelegateImpl.java | 30 - .../api/app105/api/user/UserApi.java | 189 - .../app105/api/user/UserApiController.java | 60 - .../api/app105/api/user/UserApiDelegate.java | 160 - .../app105/api/user/UserApiDelegateImpl.java | 30 - .../springdoc/api/app105/model/Category.java | 129 - .../api/app105/model/ModelApiResponse.java | 166 - .../org/springdoc/api/app105/model/Order.java | 356 - .../org/springdoc/api/app105/model/Pet.java | 384 - .../org/springdoc/api/app105/model/Tag.java | 129 - .../org/springdoc/api/app105/model/User.java | 354 - .../springdoc/api/app106/HelloController.java | 40 - .../api/app106/SpringDocApp106Test.java | 16 - .../springdoc/api/app107/HelloController.java | 59 - .../api/app107/SpringDocApp107Test.java | 16 - .../springdoc/api/app108/ActionResult.java | 147 - .../springdoc/api/app108/HelloController.java | 23 - .../api/app108/SpringDocApp108Test.java | 16 - .../springdoc/api/app109/HelloController.java | 38 - .../api/app109/SpringDocApp109Test.java | 16 - .../springdoc/api/app11/HelloController.java | 63 - .../api/app11/SpringDocApp11Test.java | 36 - .../springdoc/api/app110/ErrorMessage.java | 68 - .../api/app110/GlobalControllerAdvice.java | 166 - .../test/org/springdoc/api/app110/Person.java | 186 - .../api/app110/PersonController.java | 70 - .../api/app110/PersonController2.java | 69 - .../org/springdoc/api/app110/Problem.java | 73 - .../api/app110/SpringDocApp110Test.java | 46 - .../springdoc/api/app111/ErrorMessage.java | 68 - .../api/app111/GlobalControllerAdvice.java | 166 - .../test/org/springdoc/api/app111/Person.java | 186 - .../api/app111/PersonController.java | 69 - .../api/app111/PersonController2.java | 69 - .../org/springdoc/api/app111/Problem.java | 73 - .../api/app111/SpringDocApp111Test.java | 45 - .../springdoc/api/app112/ErrorMessage.java | 68 - .../api/app112/GlobalControllerAdvice.java | 166 - .../test/org/springdoc/api/app112/Person.java | 186 - .../api/app112/PersonController.java | 69 - .../org/springdoc/api/app112/Problem.java | 73 - .../api/app112/SpringDocApp112Test.java | 45 - .../api/app112/sample/PersonController2.java | 71 - .../springdoc/api/app113/HelloController.java | 60 - .../api/app113/SpringDocApp113Test.java | 18 - .../springdoc/api/app114/HelloController.java | 58 - .../api/app114/SpringDocApp114Test.java | 25 - .../springdoc/api/app115/HelloController.java | 45 - .../app115/JavaTimeOperationCustomizer.java | 42 - .../api/app115/SpringDocApp115Test.java | 19 - .../springdoc/api/app116/FooErrorHandler.java | 24 - .../springdoc/api/app116/HelloController.java | 32 - .../api/app116/SpringDocApp116Test.java | 19 - .../api/app117/HelloApplication.java | 278 - .../api/app117/SpringDocApp117Test.java | 18 - .../springdoc/api/app118/AbstractParent.java | 95 - .../springdoc/api/app118/ConcreteParent.java | 95 - .../org/springdoc/api/app118/Controller.java | 88 - .../api/app118/SpringDocApp118Test.java | 18 - .../springdoc/api/app119/HelloController.java | 59 - .../org/springdoc/api/app119/JsonRequest.java | 30 - .../api/app119/SpringDocApp119Test.java | 18 - .../springdoc/api/app12/HelloController.java | 47 - .../api/app12/SpringDocApp12Test.java | 35 - .../org/springdoc/api/app120/AccountId.java | 73 - .../api/app120/SpringDocApp120Test.java | 35 - .../api/app121/InheritedRequestParams.java | 33 - .../springdoc/api/app121/RequestParams.java | 255 - .../api/app121/SpringDocApp121Test.java | 40 - .../springdoc/api/app121/TestController.java | 26 - .../springdoc/api/app122/BaseController.java | 52 - .../org/springdoc/api/app122/BaseObject.java | 38 - .../org/springdoc/api/app122/CustomerDto.java | 38 - .../springdoc/api/app122/FirstController.java | 37 - .../api/app122/SpringDocApp122Test.java | 40 - .../org/springdoc/api/app122/Wrapper.java | 42 - .../springdoc/api/app123/HelloController.java | 48 - .../api/app123/MyExceptionHandler.java | 58 - .../api/app123/SpringDocApp123Test.java | 40 - .../springdoc/api/app124/HelloController.java | 65 - .../api/app124/MyExceptionHandler.java | 43 - .../api/app124/SpringDocApp124Test.java | 40 - .../api/app125/DeprecatedEntity.java | 60 - .../springdoc/api/app125/HelloController.java | 26 - .../api/app125/SpringDocApp125Test.java | 55 - .../springdoc/api/app126/HelloController.java | 72 - .../org/springdoc/api/app126/Problem.java | 79 - .../api/app126/SpringDocApp126Test.java | 67 - .../springdoc/api/app127/AbstractObject.java | 57 - .../springdoc/api/app127/ConcreteObjectA.java | 32 - .../springdoc/api/app127/ConcreteType.java | 38 - .../org/springdoc/api/app127/Controller.java | 36 - .../api/app127/SpringDocApp127Test.java | 61 - .../org/springdoc/api/app127/Umbrella.java | 33 - .../api/app129/ActualReturnedEntity.java | 16 - .../springdoc/api/app129/HelloController.java | 50 - .../api/app129/OperationResponse.java | 17 - .../api/app129/SpringDocApp129Test.java | 41 - .../springdoc/api/app13/HelloController.java | 41 - .../org/springdoc/api/app13/PersonDTO.java | 116 - .../api/app13/SpringDocApp13Test.java | 35 - .../springdoc/api/app130/HelloController.java | 52 - .../api/app130/SpringDocApp130Test.java | 41 - .../org/springdoc/api/app130/TrackerData.java | 53 - .../springdoc/api/app131/HelloController.java | 91 - .../springdoc/api/app131/Organization.java | 78 - .../api/app131/RestControllerError.java | 22 - .../api/app131/SpringDocApp131Test.java | 41 - .../springdoc/api/app132/HelloController.java | 91 - .../springdoc/api/app132/Organization.java | 78 - .../api/app132/RestControllerError.java | 22 - .../api/app132/SpringDocApp132Test.java | 41 - .../springdoc/api/app133/HelloController.java | 75 - .../api/app133/SpringDocApp133Test.java | 41 - .../springdoc/api/app134/HelloController.java | 220 - .../springdoc/api/app134/OpenApiConfig.java | 73 - .../api/app134/SpringDocApp134Test.java | 113 - .../test/org/springdoc/api/app135/Book.java | 109 - .../springdoc/api/app135/BookRepository.java | 54 - .../org/springdoc/api/app135/BookRouter.java | 134 - .../api/app135/SpringDocApp135Test.java | 41 - .../springdoc/api/app137/HelloController.java | 41 - .../springdoc/api/app137/OpenApiConfig.java | 38 - .../api/app137/SpringDocApp137Test.java | 43 - .../springdoc/api/app138/HelloController.java | 47 - .../api/app138/SpringDocApp138Test.java | 43 - .../springdoc/api/app139/HelloController.java | 54 - .../api/app139/SpringDocApp139Test.java | 43 - .../springdoc/api/app14/HelloController.java | 53 - .../api/app14/SpringDocApp14Test.java | 35 - .../api/app140/HelloApplication.java | 311 - .../api/app140/SpringDocApp140Test.java | 41 - .../test/org/springdoc/api/app141/Book.java | 112 - .../springdoc/api/app141/BookRepository.java | 57 - .../org/springdoc/api/app141/BookRouter.java | 132 - .../api/app141/SpringDocApp141Test.java | 41 - .../api/app142/HelloApplication.java | 293 - .../api/app142/SpringDocApp142Test.java | 41 - .../springdoc/api/app149/HelloController.java | 83 - .../springdoc/api/app149/HelloMessage.java | 45 - .../api/app149/SpringDocApp149Test.java | 37 - .../springdoc/api/app15/HelloController.java | 47 - .../api/app15/SpringDocApp15Test.java | 67 - .../springdoc/api/app150/HelloController.java | 91 - .../api/app150/SpringDocApp150Test.java | 37 - .../springdoc/api/app151/HelloController.java | 45 - .../api/app151/SpringDocApp151Test.java | 37 - .../springdoc/api/app152/HelloController.java | 46 - .../api/app152/SpringDocApp152Test.java | 37 - .../org/springdoc/api/app153/OrderState.java | 42 - .../api/app153/OrderStateMapper.java | 27 - .../api/app153/SpringDocApp153Test.java | 37 - .../springdoc/api/app153/TestController.java | 36 - .../springdoc/api/app154/HelloController.java | 89 - .../api/app154/OpenApiConfiguration.java | 30 - .../api/app154/SpringDocApp154Test.java | 37 - .../app155/AbstractIntParameterObject.java | 55 - .../api/app155/AbstractParameterObject.java | 59 - .../springdoc/api/app155/ConcreteEnum.java | 17 - .../app155/ConcreteIntParameterObject.java | 30 - .../api/app155/ConcreteParameterObject.java | 30 - .../springdoc/api/app155/HelloController.java | 58 - .../api/app155/SpringDocApp155Test.java | 37 - .../springdoc/api/app156/HelloController.java | 54 - .../org/springdoc/api/app156/SomeEnum.java | 15 - .../api/app156/SpringDocApp156Test.java | 37 - .../test/org/springdoc/api/app156/User.java | 77 - .../test/org/springdoc/api/app157/Bar.java | 20 - .../test/org/springdoc/api/app157/Foo.java | 20 - .../springdoc/api/app157/HelloController.java | 53 - .../api/app157/SpringDocApp157Test.java | 89 - .../api/app157/StringyConverter.java | 62 - .../api/app158/CommonFooErrorHandler.java | 23 - .../org/springdoc/api/app158/ErrorDTO.java | 44 - .../springdoc/api/app158/HelloController.java | 46 - .../org/springdoc/api/app158/SimpleDTO.java | 46 - .../api/app158/SpecificFooErrorHandler.java | 10 - .../api/app158/SpringDocApp158Test.java | 18 - .../springdoc/api/app159/CustomException.java | 15 - .../org/springdoc/api/app159/FooBean.java | 67 - .../springdoc/api/app159/FooErrorHandler.java | 42 - .../springdoc/api/app159/HelloController.java | 31 - .../api/app159/SpringDocApp159Test.java | 18 - .../test/org/springdoc/api/app159/Views.java | 18 - .../springdoc/api/app16/HelloController.java | 40 - .../api/app16/SpringDocApp16Test.java | 53 - .../springdoc/api/app160/HelloController.java | 103 - .../api/app160/SpringDocApp160Test.java | 20 - .../springdoc/api/app161/HelloController.java | 78 - .../api/app161/SpringDocApp161Test.java | 18 - .../api/app162/SpringDocApp162Test.java | 38 - .../app162/exception/NoResultException.java | 4 - .../exception/NonUniqueResultException.java | 7 - .../app162/rest/dto/JavadocOnlyRestDto.java | 59 - .../rest/util/RestExceptionHandler.java | 45 - .../api/app163/SpringDocApp163Test.java | 38 - .../app163/exception/NoResultException.java | 4 - .../exception/NonUniqueResultException.java | 7 - .../AnnotationOverrideForJavadocRestDto.java | 60 - .../AnnotationOverrideForJavadocRestDto2.java | 20 - .../AnnotationOverrideForJavadocRestDto3.java | 20 - .../rest/util/RestExceptionHandler.java | 45 - .../api/app164/SpringDocApp164Test.java | 36 - .../app164/SpringDocJavadocProviderTest.java | 61 - .../app164/exception/NoResultException.java | 4 - .../exception/NonUniqueResultException.java | 7 - .../rest/NoGenericOverrideRestController.java | 49 - .../rest/util/RestExceptionHandler.java | 45 - .../app166/ConcreteSubclassFromGeneric.java | 13 - .../springdoc/api/app166/HelloController.java | 49 - .../test/org/springdoc/api/app166/MyData.java | 22 - .../springdoc/api/app166/SimpleGeneric.java | 22 - .../api/app166/SimpleInnerClass.java | 31 - .../api/app166/SimpleInnerInnerClass.java | 21 - .../api/app166/SimpleOuterClass.java | 22 - .../api/app166/SpringDocApp166Test.java | 36 - .../springdoc/api/app167/HelloController.java | 34 - .../api/app167/SpringDocApp167Test.java | 36 - ...ionFieldInRequestBodyIsNullController.java | 45 - .../test/org/springdoc/api/app168/Person.java | 29 - .../api/app168/SpringDocApp168Test.java | 36 - .../api/app169/RecordController.java | 16 - .../api/app169/SimpleInnerClass.java | 10 - .../api/app169/SimpleOuterClass.java | 10 - .../api/app169/SpringDocApp169Test.java | 36 - .../springdoc/api/app17/HelloController.java | 44 - .../api/app17/SpringDocApp17Test.java | 35 - .../test/org/springdoc/api/app170/Animal.java | 17 - .../springdoc/api/app170/BasicController.java | 19 - .../test/org/springdoc/api/app170/Cat.java | 22 - .../test/org/springdoc/api/app170/Dog.java | 33 - .../api/app170/SpringDocApp170Test.java | 37 - .../springdoc/api/app171/HelloController.java | 40 - .../org/springdoc/api/app171/PersonDTO.java | 73 - .../api/app171/PersonProjection.java | 42 - .../api/app171/SpringDocApp171Test.java | 37 - .../org/springdoc/api/app173/Example.java | 21 - .../api/app173/ExampleController.java | 39 - .../api/app173/SpringDocApp173Test.java | 21 - .../api/app174/ExampleController.java | 24 - .../org/springdoc/api/app174/Question.java | 42 - .../api/app174/SpringDocApp174Test.java | 19 - .../test/org/springdoc/api/app174/Test.java | 44 - .../springdoc/api/app174/TestQuestion.java | 42 - .../springdoc/api/app174/TextQuestion.java | 28 - .../springdoc/api/app18/HelloController.java | 103 - .../api/app18/SpringDocApp18Test.java | 37 - .../springdoc/api/app19/HelloController.java | 69 - .../api/app19/SpringDocApp19Test.java | 35 - .../springdoc/api/app2/SpringDocApp2Test.java | 57 - .../org/springdoc/api/app2/api/ApiUtil.java | 61 - .../api/app2/api/ExceptionTranslator.java | 66 - .../api/app2/api/HomeController.java | 50 - .../org/springdoc/api/app2/api/PetApi.java | 221 - .../api/app2/api/PetApiController.java | 60 - .../api/app2/api/PetApiDelegate.java | 184 - .../api/app2/api/PetApiDelegateImpl.java | 30 - .../org/springdoc/api/app2/api/StoreApi.java | 135 - .../api/app2/api/StoreApiController.java | 60 - .../api/app2/api/StoreApiDelegate.java | 115 - .../api/app2/api/StoreApiDelegateImpl.java | 30 - .../org/springdoc/api/app2/api/UserApi.java | 189 - .../api/app2/api/UserApiController.java | 62 - .../api/app2/api/UserApiDelegate.java | 159 - .../api/app2/api/UserApiDelegateImpl.java | 30 - .../springdoc/api/app2/model/Category.java | 126 - .../api/app2/model/ModelApiResponse.java | 162 - .../org/springdoc/api/app2/model/Order.java | 352 - .../org/springdoc/api/app2/model/Pet.java | 384 - .../org/springdoc/api/app2/model/Tag.java | 129 - .../org/springdoc/api/app2/model/User.java | 350 - .../springdoc/api/app20/HelloController.java | 45 - .../api/app20/SpringDocApp20Test.java | 35 - .../springdoc/api/app21/HelloController.java | 56 - .../api/app21/SpringDocApp21Test.java | 37 - .../springdoc/api/app22/HelloController.java | 44 - .../org/springdoc/api/app22/PersonDTO.java | 112 - .../api/app22/SpringDocApp22Test.java | 35 - .../springdoc/api/app23/HelloController.java | 51 - .../api/app23/SpringDocApp23Test.java | 35 - .../springdoc/api/app24/HelloController.java | 51 - .../api/app24/SpringDocApp24Test.java | 29 - .../springdoc/api/app24/SpringDocTestApp.java | 69 - .../springdoc/api/app25/HelloController.java | 101 - .../api/app25/SpringDocApp25Test.java | 35 - .../test/org/springdoc/api/app26/Bar.java | 48 - .../test/org/springdoc/api/app26/Foo.java | 49 - .../springdoc/api/app26/HelloController.java | 41 - .../test/org/springdoc/api/app26/MyModel.java | 51 - .../api/app26/SpringDocApp26Test.java | 35 - .../test/org/springdoc/api/app27/Advice.java | 74 - .../test/org/springdoc/api/app27/Bar.java | 29 - .../test/org/springdoc/api/app27/Foo.java | 29 - .../springdoc/api/app27/HelloController.java | 57 - .../org/springdoc/api/app27/MyException.java | 31 - .../api/app27/SpringDocApp27Test.java | 55 - .../springdoc/api/app28/HelloController.java | 44 - .../api/app28/SpringDocApp28Test.java | 35 - .../springdoc/api/app29/HelloController.java | 54 - .../api/app29/SpringDocApp29Test.java | 35 - .../org/springdoc/api/app29/TrackerData.java | 53 - .../springdoc/api/app3/HelloController.java | 44 - .../org/springdoc/api/app3/PersonDTO.java | 113 - .../org/springdoc/api/app3/PlayingCard.java | 125 - .../springdoc/api/app3/SpringDocApp3Test.java | 16 - .../springdoc/api/app30/HelloController.java | 43 - .../api/app30/SpringDocApp30Test.java | 35 - .../springdoc/api/app31/HelloController.java | 91 - .../api/app31/SpringDocApp31Test.java | 35 - .../springdoc/api/app32/HelloController.java | 67 - .../api/app32/SpringDocApp32Test.java | 35 - .../springdoc/api/app33/HelloController.java | 48 - .../api/app33/SpringDocApp33Test.java | 35 - .../springdoc/api/app34/HelloController.java | 48 - .../api/app34/MyExceptionHandler.java | 58 - .../api/app34/SpringDocApp34Test.java | 35 - .../springdoc/api/app35/HelloController.java | 65 - .../api/app35/SpringDocApp35Test.java | 41 - .../test/org/springdoc/api/app37/Bar.java | 29 - .../test/org/springdoc/api/app37/Car.java | 30 - .../test/org/springdoc/api/app37/Foo.java | 29 - .../springdoc/api/app37/HelloController.java | 91 - .../test/org/springdoc/api/app37/Pet.java | 30 - .../api/app37/SpringDocApp37Test.java | 35 - .../springdoc/api/app38/HelloController.java | 43 - .../api/app38/SpringDocApp38Test.java | 35 - .../springdoc/api/app39/HelloController.java | 56 - .../api/app39/SpringDocApp39Test.java | 29 - .../springdoc/api/app39/SpringDocTestApp.java | 68 - .../springdoc/api/app4/HelloController.java | 42 - .../springdoc/api/app4/SpringDocApp4Test.java | 47 - .../org/springdoc/api/app4/TrackerData.java | 52 - .../springdoc/api/app40/HelloController.java | 42 - .../api/app40/SpringDocApp40Test.java | 35 - .../springdoc/api/app41/HelloController.java | 60 - .../api/app41/SpringDocApp411Test.java | 70 - .../api/app41/SpringDocApp41Test.java | 72 - .../springdoc/api/app42/HelloController.java | 42 - .../api/app42/SpringDocApp42Test.java | 50 - .../test/org/springdoc/api/app42/TweetId.java | 47 - .../springdoc/api/app43/HelloController.java | 46 - .../api/app43/SpringDocApp43Test.java | 35 - .../springdoc/api/app44/HelloController.java | 226 - .../api/app44/SpringDocApp44Test.java | 60 - .../springdoc/api/app45/HelloController.java | 76 - .../springdoc/api/app45/HelloController2.java | 76 - .../springdoc/api/app45/OpenApiConfig.java | 33 - .../org/springdoc/api/app45/PersonDTO.java | 112 - .../api/app45/SpringDocApp45Test.java | 35 - .../springdoc/api/app46/HelloController.java | 53 - .../api/app46/SpringDocApp46Test.java | 35 - .../springdoc/api/app47/HelloController.java | 47 - .../api/app47/SpringDocApp47Test.java | 35 - .../api/app48/AbstractHelloController.java | 50 - .../springdoc/api/app48/HelloController.java | 53 - .../api/app48/SpringDocApp48Test.java | 35 - .../springdoc/api/app49/HelloController.java | 49 - .../api/app49/SpringDocApp49Test.java | 29 - .../springdoc/api/app49/SpringDocTestApp.java | 62 - .../api/app5/CustomOpenAPIConfig.java | 43 - ...penApiResourceCustomConfigurationTest.java | 65 - .../OpenApiResourceNoConfigurationTest.java | 60 - .../springdoc/api/app50/HelloController.java | 48 - .../api/app50/SpringDocApp50Test.java | 29 - .../springdoc/api/app50/SpringDocTestApp.java | 62 - .../springdoc/api/app51/HelloController.java | 107 - .../api/app51/SpringDocApp51Test.java | 35 - .../springdoc/api/app52/HelloController.java | 96 - .../api/app52/SpringDocApp52Test.java | 35 - .../springdoc/api/app53/HelloController.java | 147 - .../HelloControllerWithGlobalApiResponse.java | 64 - .../api/app53/SpringDocApp53Test.java | 35 - .../springdoc/api/app54/HelloController.java | 76 - .../org/springdoc/api/app54/MealParty.java | 41 - .../api/app54/SpringDocApp54Test.java | 35 - .../test/org/springdoc/api/app54/Views.java | 36 - .../springdoc/api/app55/HelloController.java | 52 - .../api/app55/SpringDocApp55Test.java | 35 - .../api/app56/GlobalExceptionHandler.java | 82 - .../springdoc/api/app56/HelloController.java | 40 - .../api/app56/SpringDocApp56Test.java | 35 - .../springdoc/api/app57/HelloController.java | 45 - .../api/app57/SpringDocApp57Test.java | 35 - .../springdoc/api/app58/HelloController.java | 175 - .../api/app58/SpringDocApp58Test.java | 35 - .../springdoc/api/app59/HelloController.java | 36 - .../api/app59/SpringDocApp59Test.java | 35 - .../springdoc/api/app6/HelloController.java | 53 - .../springdoc/api/app6/SpringDocApp6Test.java | 36 - .../springdoc/api/app60/HelloController.java | 68 - .../org/springdoc/api/app60/QueryPaging.java | 39 - .../org/springdoc/api/app60/QuerySort.java | 35 - .../api/app60/SpringDocApp60Test.java | 35 - .../springdoc/api/app61/HelloController.java | 58 - .../api/app61/SpringDocApp61Test.java | 35 - .../springdoc/api/app62/BaseController.java | 54 - .../api/app62/SpringDocApp62Test.java | 35 - .../springdoc/api/app62/TestController.java | 46 - .../springdoc/api/app63/HelloController.java | 50 - .../api/app63/SpringDocApp63Test.java | 40 - .../springdoc/api/app64/HelloController.java | 53 - .../api/app64/SpringDocApp64Test.java | 37 - .../springdoc/api/app65/HelloController.java | 47 - .../api/app65/SpringDocApp65Test.java | 35 - .../api/app66/DefaultHealthCheckApi.java | 49 - .../springdoc/api/app66/HelloController.java | 48 - .../api/app66/SpringDocApp66Test.java | 35 - .../api/app66/UndocumentedClass.java | 29 - .../springdoc/api/app67/HelloController.java | 133 - .../api/app67/SpringDocApp67Test.java | 35 - .../springdoc/api/app69/HelloController.java | 45 - .../org/springdoc/api/app69/PersonDTO.java | 112 - .../api/app69/SpringDocApp69Test.java | 35 - .../springdoc/api/app7/HelloController.java | 45 - .../springdoc/api/app7/SpringDocApp7Test.java | 36 - .../springdoc/api/app70/HelloController.java | 49 - .../api/app70/SpringDocApp70Test.java | 35 - .../app70/customizer/CustomizedOperation.java | 35 - .../app70/customizer/CustomizedParameter.java | 35 - .../app70/customizer/CustomizedProperty.java | 35 - .../app70/customizer/OperationCustomizer.java | 46 - .../app70/customizer/ParameterCustomizer.java | 46 - .../app70/customizer/PropertyCustomizer.java | 76 - .../springdoc/api/app70/model/ApiType.java | 39 - .../test/org/springdoc/api/app71/Dog.java | 42 - .../springdoc/api/app71/HelloController.java | 41 - .../api/app71/SpringDocApp71Test.java | 35 - .../app72/BlockingAutoConfigurationTest.java | 122 - .../app72/CacheAutoConfigurationTest1.java | 106 - .../api/app72/GroupAutoConfigurationTest.java | 73 - .../springdoc/api/app73/HelloController.java | 63 - .../api/app73/SpringDocApp73Test.java | 35 - .../springdoc/api/app74/HelloController.java | 54 - .../api/app74/SpringDocApp74Test.java | 35 - .../springdoc/api/app75/HelloController.java | 119 - .../org/springdoc/api/app75/PersonDTO.java | 112 - .../RestResponseEntityExceptionHandler.java | 50 - .../api/app75/SpringDocApp75Test.java | 36 - .../springdoc/api/app76/HelloController.java | 57 - .../api/app76/SpringDocApp76Test.java | 60 - .../springdoc/api/app77/HelloController.java | 63 - .../api/app77/SpringDocApp77Test.java | 35 - .../springdoc/api/app78/HelloController.java | 57 - .../org/springdoc/api/app78/PersonDTO.java | 112 - .../api/app78/SpringDocApp78Test.java | 35 - .../springdoc/api/app79/HelloController.java | 45 - .../api/app79/SpringDocApp79Test.java | 36 - .../springdoc/api/app8/HelloController.java | 38 - .../springdoc/api/app8/SpringDocApp8Test.java | 52 - .../springdoc/api/app80/HelloController.java | 73 - .../api/app80/SpringDocApp80Test.java | 37 - .../org/springdoc/api/app80/TestObject.java | 54 - .../springdoc/api/app81/HelloController.java | 41 - .../api/app81/SpringDocApp81Test.java | 76 - .../springdoc/api/app82/HelloController.java | 47 - .../org/springdoc/api/app82/PersonDTO.java | 112 - .../api/app82/SpringDocApp82Test.java | 36 - .../springdoc/api/app83/HelloController.java | 60 - .../org/springdoc/api/app83/PersonDTO.java | 112 - .../api/app83/SpringDocApp83Test.java | 36 - .../springdoc/api/app84/HelloController.java | 53 - .../api/app84/SpringDocApp84Test.java | 36 - .../springdoc/api/app85/HelloController.java | 50 - .../api/app85/SpringDocApp85Test.java | 36 - .../springdoc/api/app86/HelloController.java | 50 - .../api/app86/SpringDocApp86Test.java | 39 - .../api/app86/test/HelloController2.java | 50 - .../springdoc/api/app87/HelloController.java | 64 - .../api/app87/SpringDocApp87Test.java | 36 - .../springdoc/api/app88/HelloController.java | 40 - .../api/app88/SpringDocApp88Test.java | 37 - .../springdoc/api/app89/HelloController.java | 46 - .../api/app89/SpringDocApp89Test.java | 46 - .../test/org/springdoc/api/app9/MyApi.java | 46 - .../springdoc/api/app9/MyApiController.java | 54 - .../springdoc/api/app9/SpringDocApp9Test.java | 36 - .../springdoc/api/app90/HelloController.java | 73 - .../api/app90/SpringDocApp90Test.java | 29 - .../springdoc/api/app90/SpringDocTestApp.java | 95 - .../test/org/springdoc/api/app90/User.java | 440 - .../test/org/springdoc/api/app91/Advice.java | 84 - .../org/springdoc/api/app91/ApiError.java | 53 - .../org/springdoc/api/app91/Greeting.java | 37 - .../api/app91/GreetingController.java | 46 - .../api/app91/SpringDocApp91Test.java | 39 - .../springdoc/api/app92/HelloController.java | 45 - .../api/app92/ParameterCustomizer.java | 47 - .../api/app92/SpringDocApp92Test.java | 37 - .../springdoc/api/app93/BaseClientModel.java | 14 - .../springdoc/api/app93/BaseController.java | 24 - .../api/app93/SpecificClientModel.java | 14 - .../api/app93/SpecificController.java | 9 - .../api/app93/SpringDocApp93Test.java | 37 - .../org/springdoc/api/app94/Greeting.java | 37 - .../springdoc/api/app95/HelloController.java | 29 - .../api/app95/SpringDocApp95Test.java | 39 - .../springdoc/api/app96/HelloController.java | 68 - .../api/app96/SpringDocApp96Test.java | 37 - .../springdoc/api/app97/HelloController.java | 61 - .../api/app97/SpringDocApp97Test.java | 37 - .../org/springdoc/api/app97/StudentV1.java | 24 - .../org/springdoc/api/app97/StudentV2.java | 24 - .../org/springdoc/api/app97/StudentV3.java | 24 - .../springdoc/api/app98/HelloController.java | 22 - .../api/app98/IgnoredAnnotationParameter.java | 35 - .../api/app98/SpringDocApp98Test.java | 41 - .../springdoc/api/app99/HelloController.java | 28 - .../api/app99/SpringDocApp99Test.java | 39 - .../api/v30/AbstractSpringDocTest.java | 104 + .../springdoc/api/v30/app1/ApiException.java | 56 + .../api/v30/app1/ApiOriginFilter.java | 77 + .../api/v30/app1/ApiResponseMessage.java | 168 + .../springdoc/api/v30/app1/ErrorMessage.java | 91 + .../api/v30/app1/ExceptionTranslator.java | 75 + .../api/v30/app1/HelloController.java | 58 + .../api/v30/app1/HomeController.java | 58 + .../api/{ => v30}/app1/InventoryApi.java | 34 +- .../app1/InventoryApiController.java | 34 +- .../api/{ => v30}/app1/InventoryItem.java | 34 +- .../api/v30/app1/ItemController.java | 89 + .../org/springdoc/api/v30/app1/ItemDTO.java | 164 + .../springdoc/api/v30/app1/ItemLightDTO.java | 129 + .../api/{ => v30}/app1/Manufacturer.java | 34 +- .../api/{ => v30}/app1/PeopleRestService.java | 34 +- .../org/springdoc/api/v30/app1/PersonDTO.java | 120 + .../api/v30/app1/SpringDocApp1Test.java | 65 + .../api/v30/app10/HelloController.java | 69 + .../api/v30/app10/SpringDocApp10Test.java | 43 + .../api/v30/app100/HelloController.java | 55 + .../springdoc/api/v30/app100/PersonDTO.java | 123 + .../api/v30/app100/SpringDocApp100Test.java | 45 + .../api/v30/app101/HelloController.java | 57 + .../springdoc/api/v30/app101/HelloDTO.java | 63 + .../api/v30/app101/SpringDocApp101Test.java | 47 + .../v30/app102/InheritedRequestParams.java | 60 + .../api/v30/app102/RequestParams.java | 284 + .../api/v30/app102/SpringDocApp102Test.java | 42 + .../api/v30/app102/TestController.java | 50 + .../springdoc/api/v30/app103/ExampleBody.java | 78 + .../api/v30/app103/HelloController.java | 69 + .../api/v30/app103/SpringDocApp103Test.java | 42 + .../api/v30/app104/CrudController.java | 73 + .../org/springdoc/api/v30/app104/Design.java | 33 + .../api/v30/app104/DesignController.java | 43 + .../springdoc/api/v30/app104/HavingPK.java | 33 + .../api/v30/app104/SpringDocApp104Test.java | 42 + .../api/v30/app105/SpringDocApp105Test.java | 144 + .../springdoc/api/v30/app105/api/ApiUtil.java | 69 + .../v30/app105/api/ExceptionTranslator.java | 74 + .../api/v30/app105/api/HomeController.java | 58 + .../api/v30/app105/api/pet/PetApi.java | 227 + .../v30/app105/api/pet/PetApiController.java | 68 + .../v30/app105/api/pet/PetApiDelegate.java | 193 + .../app105/api/pet/PetApiDelegateImpl.java | 38 + .../api/v30/app105/api/store/StoreApi.java | 148 + .../app105/api/store/StoreApiController.java | 68 + .../app105/api/store/StoreApiDelegate.java | 124 + .../api/store/StoreApiDelegateImpl.java | 38 + .../api/v30/app105/api/user/UserApi.java | 197 + .../app105/api/user/UserApiController.java | 68 + .../v30/app105/api/user/UserApiDelegate.java | 168 + .../app105/api/user/UserApiDelegateImpl.java | 38 + .../api/v30/app105/model/Category.java | 137 + .../v30/app105/model/ModelApiResponse.java | 174 + .../springdoc/api/v30/app105/model/Order.java | 364 + .../springdoc/api/v30/app105/model/Pet.java | 392 + .../springdoc/api/v30/app105/model/Tag.java | 137 + .../springdoc/api/v30/app105/model/User.java | 362 + .../api/v30/app106/HelloController.java | 66 + .../api/v30/app106/SpringDocApp106Test.java | 42 + .../api/v30/app107/HelloController.java | 85 + .../api/v30/app107/SpringDocApp107Test.java | 42 + .../api/v30/app108/ActionResult.java | 173 + .../api/v30/app108/HelloController.java | 49 + .../api/v30/app108/SpringDocApp108Test.java | 42 + .../api/v30/app109/HelloController.java | 64 + .../api/v30/app109/SpringDocApp109Test.java | 42 + .../api/v30/app11/HelloController.java | 71 + .../api/v30/app11/SpringDocApp11Test.java | 44 + .../api/v30/app110/ErrorMessage.java | 94 + .../v30/app110/GlobalControllerAdvice.java | 192 + .../org/springdoc/api/v30/app110/Person.java | 212 + .../api/v30/app110/PersonController.java | 96 + .../api/v30/app110/PersonController2.java | 95 + .../org/springdoc/api/v30/app110/Problem.java | 99 + .../api/v30/app110/SpringDocApp110Test.java | 72 + .../api/v30/app111/ErrorMessage.java | 94 + .../v30/app111/GlobalControllerAdvice.java | 192 + .../org/springdoc/api/v30/app111/Person.java | 212 + .../api/v30/app111/PersonController.java | 95 + .../api/v30/app111/PersonController2.java | 95 + .../org/springdoc/api/v30/app111/Problem.java | 99 + .../api/v30/app111/SpringDocApp111Test.java | 71 + .../api/v30/app112/ErrorMessage.java | 94 + .../v30/app112/GlobalControllerAdvice.java | 192 + .../org/springdoc/api/v30/app112/Person.java | 212 + .../api/v30/app112/PersonController.java | 95 + .../org/springdoc/api/v30/app112/Problem.java | 99 + .../api/v30/app112/SpringDocApp112Test.java | 71 + .../v30/app112/sample/PersonController2.java | 97 + .../api/v30/app113/HelloController.java | 68 + .../api/v30/app113/SpringDocApp113Test.java | 44 + .../api/v30/app114/HelloController.java | 66 + .../api/v30/app114/SpringDocApp114Test.java | 51 + .../api/v30/app115/HelloController.java | 53 + .../app115/JavaTimeOperationCustomizer.java | 68 + .../api/v30/app115/SpringDocApp115Test.java | 45 + .../api/v30/app116/FooErrorHandler.java | 50 + .../api/v30/app116/HelloController.java | 58 + .../api/v30/app116/SpringDocApp116Test.java | 45 + .../api/v30/app117/HelloApplication.java | 304 + .../api/v30/app117/SpringDocApp117Test.java | 44 + .../api/v30/app118/AbstractParent.java | 121 + .../api/v30/app118/ConcreteParent.java | 121 + .../springdoc/api/v30/app118/Controller.java | 114 + .../api/v30/app118/SpringDocApp118Test.java | 44 + .../api/v30/app119/HelloController.java | 67 + .../springdoc/api/v30/app119/JsonRequest.java | 56 + .../api/v30/app119/SpringDocApp119Test.java | 44 + .../api/v30/app12/HelloController.java | 55 + .../api/v30/app12/SpringDocApp12Test.java | 43 + .../springdoc/api/v30/app120/AccountId.java | 81 + .../app120/MetaAnnotationController.java | 34 +- .../api/v30/app120/SpringDocApp120Test.java | 43 + .../v30/app121/InheritedRequestParams.java | 59 + .../api/v30/app121/RequestParams.java | 281 + .../api/v30/app121/SpringDocApp121Test.java | 43 + .../api/v30/app121/TestController.java | 52 + .../api/v30/app122/BaseController.java | 55 + .../springdoc/api/v30/app122/BaseObject.java | 41 + .../springdoc/api/v30/app122/CustomerDto.java | 41 + .../api/v30/app122/FirstController.java | 40 + .../api/v30/app122/SpringDocApp122Test.java | 43 + .../org/springdoc/api/v30/app122/Wrapper.java | 45 + .../api/v30/app123/HelloController.java | 56 + .../api/v30/app123/MyExceptionHandler.java | 66 + .../api/v30/app123/SpringDocApp123Test.java | 43 + .../api/v30/app124/HelloController.java | 73 + .../api/v30/app124/MyExceptionHandler.java | 51 + .../api/v30/app124/SpringDocApp124Test.java | 43 + .../api/v30/app125/DeprecatedEntity.java | 86 + .../api/v30/app125/HelloController.java | 52 + .../api/v30/app125/SpringDocApp125Test.java | 58 + .../api/v30/app126/HelloController.java | 80 + .../org/springdoc/api/v30/app126/Problem.java | 105 + ...SecurityProblemResponsesConfiguration.java | 28 +- .../api/v30/app126/SpringDocApp126Test.java | 70 + .../api/v30/app127/AbstractObject.java | 83 + .../api/v30/app127/ConcreteObjectA.java | 58 + .../api/v30/app127/ConcreteType.java | 64 + .../springdoc/api/v30/app127/Controller.java | 62 + .../api/v30/app127/SpringDocApp127Test.java | 64 + .../springdoc/api/v30/app127/Umbrella.java | 59 + .../api/v30/app129/ActualReturnedEntity.java | 42 + .../api/v30/app129/HelloController.java | 58 + .../api/v30/app129/OperationResponse.java | 43 + .../api/v30/app129/SpringDocApp129Test.java | 44 + .../api/v30/app13/HelloController.java | 49 + .../springdoc/api/v30/app13/PersonDTO.java | 124 + .../api/v30/app13/SpringDocApp13Test.java | 43 + .../api/v30/app130/HelloController.java | 60 + .../api/v30/app130/SpringDocApp130Test.java | 44 + .../springdoc/api/v30/app130/TrackerData.java | 61 + .../api/v30/app131/HelloController.java | 99 + .../api/v30/app131/Organization.java | 104 + .../api/v30/app131/RestControllerError.java | 48 + .../api/v30/app131/SpringDocApp131Test.java | 44 + .../api/v30/app132/HelloController.java | 99 + .../api/v30/app132/Organization.java | 104 + .../api/v30/app132/RestControllerError.java | 48 + .../api/v30/app132/SpringDocApp132Test.java | 44 + .../api/v30/app133/HelloController.java | 83 + .../api/v30/app133/SpringDocApp133Test.java | 44 + .../api/v30/app134/HelloController.java | 228 + .../api/v30/app134/OpenApiConfig.java | 99 + .../api/v30/app134/SpringDocApp134Test.java | 116 + .../org/springdoc/api/v30/app135/Book.java | 115 + .../api/v30/app135/BookRepository.java | 60 + .../springdoc/api/v30/app135/BookRouter.java | 140 + .../api/v30/app135/SpringDocApp135Test.java | 44 + .../api/v30/app137/HelloController.java | 49 + .../api/v30/app137/OpenApiConfig.java | 46 + .../api/v30/app137/SpringDocApp137Test.java | 46 + .../api/v30/app138/HelloController.java | 55 + .../api/v30/app138/SpringDocApp138Test.java | 46 + .../api/v30/app139/HelloController.java | 62 + .../api/v30/app139/SpringDocApp139Test.java | 46 + .../api/v30/app14/HelloController.java | 61 + .../api/v30/app14/SpringDocApp14Test.java | 43 + .../api/v30/app140/HelloApplication.java | 314 + .../api/v30/app140/SpringDocApp140Test.java | 44 + .../org/springdoc/api/v30/app141/Book.java | 115 + .../api/v30/app141/BookRepository.java | 60 + .../springdoc/api/v30/app141/BookRouter.java | 135 + .../api/v30/app141/SpringDocApp141Test.java | 44 + .../api/v30/app142/HelloApplication.java | 296 + .../api/v30/app142/SpringDocApp142Test.java | 44 + .../api/v30/app149/HelloController.java | 91 + .../api/v30/app149/HelloMessage.java | 53 + .../api/v30/app149/SpringDocApp149Test.java | 45 + .../api/v30/app15/HelloController.java | 55 + .../api/v30/app15/SpringDocApp15Test.java | 75 + .../api/v30/app150/HelloController.java | 99 + .../api/v30/app150/SpringDocApp150Test.java | 45 + .../api/v30/app151/HelloController.java | 53 + .../api/v30/app151/SpringDocApp151Test.java | 45 + .../api/v30/app152/HelloController.java | 72 + .../api/v30/app152/SpringDocApp152Test.java | 45 + .../springdoc/api/v30/app153/OrderState.java | 68 + .../api/v30/app153/OrderStateMapper.java | 53 + .../api/v30/app153/SpringDocApp153Test.java | 45 + .../api/v30/app153/TestController.java | 62 + .../api/v30/app154/HelloController.java | 97 + .../api/v30/app154/OpenApiConfiguration.java | 56 + .../api/v30/app154/SpringDocApp154Test.java | 45 + .../app155/AbstractIntParameterObject.java | 81 + .../v30/app155/AbstractParameterObject.java | 85 + .../api/v30/app155/ConcreteEnum.java | 43 + .../app155/ConcreteIntParameterObject.java | 56 + .../v30/app155/ConcreteParameterObject.java | 56 + .../api/v30/app155/HelloController.java | 66 + .../api/v30/app155/SpringDocApp155Test.java | 45 + .../api/v30/app156/HelloController.java | 80 + .../springdoc/api/v30/app156/SomeEnum.java | 41 + .../api/v30/app156/SpringDocApp156Test.java | 45 + .../org/springdoc/api/v30/app156/User.java | 103 + .../org/springdoc/api/v30/app157/Bar.java | 46 + .../org/springdoc/api/v30/app157/Foo.java | 46 + .../api/v30/app157/HelloController.java | 61 + .../api/v30/app157/SpringDocApp157Test.java | 91 + .../api/v30/app157/StringyConverter.java | 64 + .../api/v30/app158/CommonFooErrorHandler.java | 49 + .../springdoc/api/v30/app158/ErrorDTO.java | 70 + .../api/v30/app158/HelloController.java | 54 + .../springdoc/api/v30/app158/SimpleDTO.java | 72 + .../v30/app158/SpecificFooErrorHandler.java | 36 + .../api/v30/app158/SpringDocApp158Test.java | 44 + .../api/v30/app159/CustomException.java | 41 + .../org/springdoc/api/v30/app159/FooBean.java | 93 + .../api/v30/app159/FooErrorHandler.java | 68 + .../api/v30/app159/HelloController.java | 57 + .../api/v30/app159/SpringDocApp159Test.java | 44 + .../org/springdoc/api/v30/app159/Views.java | 44 + .../api/v30/app16/HelloController.java | 48 + .../api/v30/app16/SpringDocApp16Test.java | 61 + .../api/v30/app160/HelloController.java | 111 + .../api/v30/app160/SpringDocApp160Test.java | 46 + .../api/v30/app161/HelloController.java | 86 + .../api/v30/app161/SpringDocApp161Test.java | 44 + .../api/v30/app162/SpringDocApp162Test.java | 64 + .../app162/exception/NoResultException.java | 30 + .../exception/NonUniqueResultException.java | 33 + .../rest/JavadocOnlyRestController.java | 34 +- .../app162/rest/dto/JavadocOnlyRestDto.java | 85 + .../rest/util/RestExceptionHandler.java | 71 + .../api/v30/app163/SpringDocApp163Test.java | 64 + .../app163/exception/NoResultException.java | 30 + .../exception/NonUniqueResultException.java | 33 + ...ationOverrideForJavadocRestController.java | 34 +- .../AnnotationOverrideForJavadocRestDto.java | 86 + .../AnnotationOverrideForJavadocRestDto2.java | 46 + .../AnnotationOverrideForJavadocRestDto3.java | 46 + .../rest/util/RestExceptionHandler.java | 71 + .../api/v30/app164/SpringDocApp164Test.java | 62 + .../app164/SpringDocJavadocProviderTest.java | 87 + .../app164/exception/NoResultException.java | 30 + .../exception/NonUniqueResultException.java | 33 + .../rest/NoGenericOverrideRestController.java | 75 + .../rest/util/RestExceptionHandler.java | 71 + .../app166/ConcreteSubclassFromGeneric.java | 39 + .../api/v30/app166/HelloController.java | 53 + .../org/springdoc/api/v30/app166/MyData.java | 48 + .../api/v30/app166/SimpleGeneric.java | 48 + .../api/v30/app166/SimpleInnerClass.java | 57 + .../api/v30/app166/SimpleInnerInnerClass.java | 47 + .../api/v30/app166/SimpleOuterClass.java | 48 + .../api/v30/app166/SpringDocApp166Test.java | 44 + .../api/v30/app167/HelloController.java | 42 + .../api/v30/app167/SpringDocApp167Test.java | 44 + ...ionFieldInRequestBodyIsNullController.java | 53 + .../org/springdoc/api/v30/app168/Person.java | 55 + .../api/v30/app168/SpringDocApp168Test.java | 44 + .../api/v30/app169/RecordController.java | 42 + .../api/v30/app169/SimpleInnerClass.java | 36 + .../api/v30/app169/SimpleOuterClass.java | 36 + .../api/v30/app169/SpringDocApp169Test.java | 44 + .../api/v30/app17/HelloController.java | 52 + .../api/v30/app17/SpringDocApp17Test.java | 43 + .../org/springdoc/api/v30/app170/Animal.java | 43 + .../api/v30/app170/BasicController.java | 45 + .../org/springdoc/api/v30/app170/Cat.java | 48 + .../org/springdoc/api/v30/app170/Dog.java | 59 + .../api/v30/app170/SpringDocApp170Test.java | 45 + .../api/v30/app171/HelloController.java | 48 + .../springdoc/api/v30/app171/PersonDTO.java | 81 + .../api/v30/app171/PersonProjection.java | 50 + .../api/v30/app171/SpringDocApp171Test.java | 45 + .../app172/JavadocPropertyCustomizerTest.java | 30 +- .../org/springdoc/api/v30/app173/Example.java | 47 + .../api/v30/app173/ExampleController.java | 65 + .../api/v30/app173/SpringDocApp173Test.java | 47 + .../api/v30/app174/ExampleController.java | 50 + .../springdoc/api/v30/app174/Question.java | 68 + .../api/v30/app174/SpringDocApp174Test.java | 45 + .../org/springdoc/api/v30/app174/Test.java | 70 + .../api/v30/app174/TestQuestion.java | 68 + .../api/v30/app174/TextQuestion.java | 54 + .../api/v30/app18/HelloController.java | 111 + .../api/v30/app18/SpringDocApp18Test.java | 45 + .../api/v30/app19/HelloController.java | 77 + .../api/v30/app19/SpringDocApp19Test.java | 43 + .../api/v30/app2/SpringDocApp2Test.java | 65 + .../springdoc/api/v30/app2/api/ApiUtil.java | 69 + .../api/v30/app2/api/ExceptionTranslator.java | 74 + .../api/v30/app2/api/HomeController.java | 58 + .../springdoc/api/v30/app2/api/PetApi.java | 229 + .../api/v30/app2/api/PetApiController.java | 68 + .../api/v30/app2/api/PetApiDelegate.java | 192 + .../api/v30/app2/api/PetApiDelegateImpl.java | 38 + .../springdoc/api/v30/app2/api/StoreApi.java | 143 + .../api/v30/app2/api/StoreApiController.java | 68 + .../api/v30/app2/api/StoreApiDelegate.java | 123 + .../v30/app2/api/StoreApiDelegateImpl.java | 38 + .../springdoc/api/v30/app2/api/UserApi.java | 197 + .../api/v30/app2/api/UserApiController.java | 70 + .../api/v30/app2/api/UserApiDelegate.java | 167 + .../api/v30/app2/api/UserApiDelegateImpl.java | 38 + .../api/v30/app2/model/Category.java | 134 + .../api/v30/app2/model/ModelApiResponse.java | 170 + .../springdoc/api/v30/app2/model/Order.java | 360 + .../org/springdoc/api/v30/app2/model/Pet.java | 392 + .../org/springdoc/api/v30/app2/model/Tag.java | 137 + .../springdoc/api/v30/app2/model/User.java | 358 + .../api/v30/app20/HelloController.java | 53 + .../api/v30/app20/SpringDocApp20Test.java | 43 + .../api/v30/app21/HelloController.java | 64 + .../api/v30/app21/SpringDocApp21Test.java | 45 + .../api/v30/app22/HelloController.java | 52 + .../springdoc/api/v30/app22/PersonDTO.java | 120 + .../api/v30/app22/SpringDocApp22Test.java | 43 + .../api/v30/app23/HelloController.java | 59 + .../api/v30/app23/SpringDocApp23Test.java | 43 + .../api/v30/app24/HelloController.java | 59 + .../api/v30/app24/SpringDocApp24Test.java | 37 + .../api/v30/app24/SpringDocTestApp.java | 77 + .../api/v30/app25/HelloController.java | 109 + .../api/v30/app25/SpringDocApp25Test.java | 43 + .../test/org/springdoc/api/v30/app26/Bar.java | 56 + .../test/org/springdoc/api/v30/app26/Foo.java | 57 + .../api/v30/app26/HelloController.java | 49 + .../org/springdoc/api/v30/app26/MyModel.java | 59 + .../api/v30/app26/SpringDocApp26Test.java | 43 + .../org/springdoc/api/v30/app27/Advice.java | 82 + .../test/org/springdoc/api/v30/app27/Bar.java | 37 + .../test/org/springdoc/api/v30/app27/Foo.java | 37 + .../api/v30/app27/HelloController.java | 65 + .../springdoc/api/v30/app27/MyException.java | 39 + .../api/v30/app27/SpringDocApp27Test.java | 63 + .../api/v30/app28/HelloController.java | 52 + .../api/v30/app28/SpringDocApp28Test.java | 43 + .../api/v30/app29/HelloController.java | 62 + .../api/v30/app29/SpringDocApp29Test.java | 43 + .../springdoc/api/v30/app29/TrackerData.java | 61 + .../api/v30/app3/HelloController.java | 52 + .../org/springdoc/api/v30/app3/PersonDTO.java | 121 + .../springdoc/api/v30/app3/PlayingCard.java | 151 + .../api/v30/app3/SpringDocApp3Test.java | 42 + .../api/v30/app30/HelloController.java | 51 + .../api/v30/app30/SpringDocApp30Test.java | 43 + .../api/v30/app31/HelloController.java | 99 + .../api/v30/app31/SpringDocApp31Test.java | 43 + .../api/v30/app32/HelloController.java | 75 + .../api/v30/app32/SpringDocApp32Test.java | 43 + .../api/v30/app33/HelloController.java | 56 + .../api/v30/app33/SpringDocApp33Test.java | 43 + .../api/v30/app34/HelloController.java | 56 + .../api/v30/app34/MyExceptionHandler.java | 66 + .../api/v30/app34/SpringDocApp34Test.java | 43 + .../api/v30/app35/HelloController.java | 73 + .../api/v30/app35/SpringDocApp35Test.java | 49 + .../test/org/springdoc/api/v30/app37/Bar.java | 37 + .../test/org/springdoc/api/v30/app37/Car.java | 38 + .../test/org/springdoc/api/v30/app37/Foo.java | 37 + .../api/v30/app37/HelloController.java | 99 + .../test/org/springdoc/api/v30/app37/Pet.java | 38 + .../api/v30/app37/SpringDocApp37Test.java | 43 + .../api/v30/app38/HelloController.java | 51 + .../api/v30/app38/SpringDocApp38Test.java | 43 + .../api/v30/app39/HelloController.java | 64 + .../api/v30/app39/SpringDocApp39Test.java | 37 + .../api/v30/app39/SpringDocTestApp.java | 76 + .../api/v30/app4/HelloController.java | 50 + .../api/v30/app4/SpringDocApp4Test.java | 55 + .../springdoc/api/v30/app4/TrackerData.java | 60 + .../api/v30/app40/HelloController.java | 50 + .../api/v30/app40/SpringDocApp40Test.java | 43 + .../api/v30/app41/HelloController.java | 68 + .../api/v30/app41/SpringDocApp411Test.java | 78 + .../api/v30/app41/SpringDocApp41Test.java | 80 + .../api/v30/app42/HelloController.java | 50 + .../api/v30/app42/SpringDocApp42Test.java | 58 + .../org/springdoc/api/v30/app42/TweetId.java | 55 + .../api/v30/app43/HelloController.java | 54 + .../api/v30/app43/SpringDocApp43Test.java | 43 + .../api/v30/app44/HelloController.java | 234 + .../api/v30/app44/SpringDocApp44Test.java | 68 + .../api/v30/app45/HelloController.java | 84 + .../api/v30/app45/HelloController2.java | 84 + .../api/v30/app45/OpenApiConfig.java | 41 + .../springdoc/api/v30/app45/PersonDTO.java | 120 + .../api/v30/app45/SpringDocApp45Test.java | 43 + .../api/v30/app46/HelloController.java | 61 + .../api/v30/app46/SpringDocApp46Test.java | 43 + .../api/v30/app47/HelloController.java | 55 + .../api/v30/app47/SpringDocApp47Test.java | 43 + .../v30/app48/AbstractHelloController.java | 58 + .../api/v30/app48/HelloController.java | 61 + .../api/v30/app48/SpringDocApp48Test.java | 43 + .../api/v30/app49/HelloController.java | 57 + .../api/v30/app49/SpringDocApp49Test.java | 37 + .../api/v30/app49/SpringDocTestApp.java | 70 + .../api/v30/app5/CustomOpenAPIConfig.java | 51 + ...gurationComponentsSecuritySchemesTest.java | 36 +- ...penApiResourceCustomConfigurationTest.java | 73 + .../OpenApiResourceNoConfigurationTest.java | 68 + .../api/v30/app50/HelloController.java | 56 + .../api/v30/app50/SpringDocApp50Test.java | 37 + .../api/v30/app50/SpringDocTestApp.java | 70 + .../api/v30/app51/HelloController.java | 115 + .../api/v30/app51/SpringDocApp51Test.java | 43 + .../api/v30/app52/HelloController.java | 104 + .../api/v30/app52/SpringDocApp52Test.java | 43 + .../api/v30/app53/HelloController.java | 155 + .../HelloControllerWithGlobalApiResponse.java | 72 + .../api/v30/app53/SpringDocApp53Test.java | 43 + .../api/v30/app54/HelloController.java | 84 + .../springdoc/api/v30/app54/MealParty.java | 49 + .../api/v30/app54/SpringDocApp54Test.java | 43 + .../org/springdoc/api/v30/app54/Views.java | 44 + .../api/v30/app55/HelloController.java | 60 + .../api/v30/app55/SpringDocApp55Test.java | 43 + .../api/v30/app56/GlobalExceptionHandler.java | 90 + .../api/v30/app56/HelloController.java | 48 + .../api/v30/app56/SpringDocApp56Test.java | 43 + .../api/v30/app57/HelloController.java | 53 + .../api/v30/app57/SpringDocApp57Test.java | 43 + .../api/v30/app58/HelloController.java | 183 + .../api/v30/app58/SpringDocApp58Test.java | 43 + .../api/v30/app59/HelloController.java | 44 + .../api/v30/app59/SpringDocApp59Test.java | 43 + .../api/v30/app6/HelloController.java | 61 + .../api/v30/app6/SpringDocApp6Test.java | 44 + .../api/v30/app60/HelloController.java | 76 + .../springdoc/api/v30/app60/QueryPaging.java | 47 + .../springdoc/api/v30/app60/QuerySort.java | 43 + .../api/v30/app60/SpringDocApp60Test.java | 43 + .../api/v30/app61/HelloController.java | 66 + .../api/v30/app61/SpringDocApp61Test.java | 43 + .../api/v30/app62/BaseController.java | 62 + .../api/v30/app62/SpringDocApp62Test.java | 43 + .../api/v30/app62/TestController.java | 54 + .../api/v30/app63/HelloController.java | 58 + .../api/v30/app63/SpringDocApp63Test.java | 48 + .../api/v30/app64/HelloController.java | 61 + .../api/v30/app64/SpringDocApp64Test.java | 45 + .../api/v30/app65/HelloController.java | 55 + .../api/v30/app65/SpringDocApp65Test.java | 43 + .../api/v30/app66/DefaultHealthCheckApi.java | 57 + .../api/v30/app66/HelloController.java | 56 + .../api/v30/app66/SpringDocApp66Test.java | 43 + .../api/v30/app66/UndocumentedClass.java | 37 + .../api/v30/app67/HelloController.java | 141 + .../api/v30/app67/SpringDocApp67Test.java | 43 + .../api/v30/app69/HelloController.java | 53 + .../springdoc/api/v30/app69/PersonDTO.java | 120 + .../api/v30/app69/SpringDocApp69Test.java | 43 + .../api/v30/app7/HelloController.java | 53 + .../api/v30/app7/SpringDocApp7Test.java | 44 + .../api/v30/app70/HelloController.java | 57 + .../api/v30/app70/SpringDocApp70Test.java | 43 + .../app70/customizer/CustomizedOperation.java | 43 + .../app70/customizer/CustomizedParameter.java | 43 + .../app70/customizer/CustomizedProperty.java | 43 + .../app70/customizer/OperationCustomizer.java | 54 + .../app70/customizer/ParameterCustomizer.java | 54 + .../app70/customizer/PropertyCustomizer.java | 78 + .../api/v30/app70/model/ApiType.java | 47 + .../test/org/springdoc/api/v30/app71/Dog.java | 50 + .../api/v30/app71/HelloController.java | 49 + .../api/v30/app71/SpringDocApp71Test.java | 43 + .../app72/BlockingAutoConfigurationTest.java | 130 + .../app72/CacheAutoConfigurationTest1.java | 114 + .../v30/app72/GroupAutoConfigurationTest.java | 81 + .../api/v30/app73/HelloController.java | 71 + .../api/v30/app73/SpringDocApp73Test.java | 43 + .../api/v30/app74/HelloController.java | 62 + .../api/v30/app74/SpringDocApp74Test.java | 43 + .../api/v30/app75/HelloController.java | 127 + .../springdoc/api/v30/app75/PersonDTO.java | 120 + .../RestResponseEntityExceptionHandler.java | 58 + .../api/v30/app75/SpringDocApp75Test.java | 44 + .../api/v30/app76/HelloController.java | 65 + .../api/v30/app76/SpringDocApp76Test.java | 68 + .../api/v30/app77/HelloController.java | 71 + .../api/v30/app77/SpringDocApp77Test.java | 43 + .../api/v30/app78/HelloController.java | 65 + .../springdoc/api/v30/app78/PersonDTO.java | 120 + .../api/v30/app78/SpringDocApp78Test.java | 43 + .../api/v30/app79/HelloController.java | 53 + .../api/v30/app79/SpringDocApp79Test.java | 44 + .../api/v30/app8/HelloController.java | 46 + .../api/v30/app8/SpringDocApp8Test.java | 60 + .../api/v30/app80/HelloController.java | 81 + .../api/v30/app80/SpringDocApp80Test.java | 45 + .../springdoc/api/v30/app80/TestObject.java | 80 + .../api/v30/app81/HelloController.java | 49 + .../api/v30/app81/SpringDocApp81Test.java | 84 + .../api/v30/app82/HelloController.java | 55 + .../springdoc/api/v30/app82/PersonDTO.java | 120 + .../api/v30/app82/SpringDocApp82Test.java | 44 + .../api/v30/app83/HelloController.java | 68 + .../springdoc/api/v30/app83/PersonDTO.java | 120 + .../api/v30/app83/SpringDocApp83Test.java | 44 + .../api/v30/app84/HelloController.java | 61 + .../api/v30/app84/SpringDocApp84Test.java | 44 + .../api/v30/app85/HelloController.java | 58 + .../api/v30/app85/SpringDocApp85Test.java | 44 + .../api/v30/app86/HelloController.java | 58 + .../api/v30/app86/SpringDocApp86Test.java | 47 + .../api/v30/app86/test/HelloController2.java | 58 + .../api/v30/app87/HelloController.java | 72 + .../api/v30/app87/SpringDocApp87Test.java | 44 + .../api/v30/app88/HelloController.java | 48 + .../api/v30/app88/SpringDocApp88Test.java | 45 + .../api/v30/app89/HelloController.java | 54 + .../api/v30/app89/SpringDocApp89Test.java | 54 + .../org/springdoc/api/v30/app9/MyApi.java | 54 + .../api/v30/app9/MyApiController.java | 62 + .../api/v30/app9/SpringDocApp9Test.java | 44 + .../api/v30/app90/HelloController.java | 81 + .../api/v30/app90/SpringDocApp90Test.java | 37 + .../api/v30/app90/SpringDocTestApp.java | 103 + .../org/springdoc/api/v30/app90/User.java | 448 + .../org/springdoc/api/v30/app91/Advice.java | 110 + .../org/springdoc/api/v30/app91/ApiError.java | 79 + .../org/springdoc/api/v30/app91/Greeting.java | 63 + .../api/v30/app91/GreetingController.java | 72 + .../api/v30/app91/SpringDocApp91Test.java | 47 + .../api/v30/app92/HelloController.java | 53 + .../api/v30/app92/ParameterCustomizer.java | 55 + .../api/v30/app92/SpringDocApp92Test.java | 45 + .../api/v30/app93/BaseClientModel.java | 40 + .../api/v30/app93/BaseController.java | 50 + .../api/v30/app93/SpecificClientModel.java | 40 + .../api/v30/app93/SpecificController.java | 35 + .../api/v30/app93/SpringDocApp93Test.java | 45 + .../org/springdoc/api/v30/app94/Greeting.java | 63 + .../{ => v30}/app94/SpringDocApp94Test.java | 38 +- .../api/v30/app95/HelloController.java | 55 + .../api/v30/app95/SpringDocApp95Test.java | 47 + .../api/v30/app96/HelloController.java | 76 + .../api/v30/app96/SpringDocApp96Test.java | 45 + .../api/v30/app97/HelloController.java | 69 + .../api/v30/app97/SpringDocApp97Test.java | 45 + .../springdoc/api/v30/app97/StudentV1.java | 50 + .../springdoc/api/v30/app97/StudentV2.java | 50 + .../springdoc/api/v30/app97/StudentV3.java | 50 + .../api/v30/app98/HelloController.java | 48 + .../v30/app98/IgnoredAnnotationParameter.java | 43 + .../api/v30/app98/SpringDocApp98Test.java | 49 + .../api/v30/app99/HelloController.java | 54 + .../api/v30/app99/SpringDocApp99Test.java | 47 + .../resources/results/{ => 3.0.1}/app1.json | 0 .../resources/results/{ => 3.0.1}/app10.json | 0 .../resources/results/{ => 3.0.1}/app100.json | 0 .../resources/results/{ => 3.0.1}/app101.json | 0 .../resources/results/{ => 3.0.1}/app102.json | 0 .../resources/results/{ => 3.0.1}/app103.json | 0 .../resources/results/{ => 3.0.1}/app104.json | 0 .../results/{ => 3.0.1}/app105-1.json | 0 .../results/{ => 3.0.1}/app105-2.json | 0 .../results/{ => 3.0.1}/app105-3.json | 0 .../results/{ => 3.0.1}/app105-4.json | 0 .../resources/results/{ => 3.0.1}/app106.json | 0 .../resources/results/{ => 3.0.1}/app107.json | 0 .../resources/results/{ => 3.0.1}/app108.json | 0 .../resources/results/{ => 3.0.1}/app109.json | 0 .../resources/results/{ => 3.0.1}/app11.json | 0 .../resources/results/{ => 3.0.1}/app110.json | 0 .../resources/results/{ => 3.0.1}/app111.json | 0 .../resources/results/{ => 3.0.1}/app112.json | 0 .../resources/results/{ => 3.0.1}/app113.json | 0 .../resources/results/{ => 3.0.1}/app114.json | 0 .../resources/results/{ => 3.0.1}/app115.json | 0 .../resources/results/{ => 3.0.1}/app116.json | 0 .../resources/results/{ => 3.0.1}/app117.json | 0 .../resources/results/{ => 3.0.1}/app118.json | 0 .../resources/results/{ => 3.0.1}/app119.json | 0 .../resources/results/{ => 3.0.1}/app12.json | 0 .../resources/results/{ => 3.0.1}/app120.json | 0 .../resources/results/{ => 3.0.1}/app121.json | 0 .../resources/results/{ => 3.0.1}/app122.json | 0 .../resources/results/{ => 3.0.1}/app123.json | 0 .../resources/results/{ => 3.0.1}/app124.json | 0 .../resources/results/{ => 3.0.1}/app125.json | 0 .../resources/results/{ => 3.0.1}/app126.json | 0 .../resources/results/{ => 3.0.1}/app129.json | 0 .../resources/results/{ => 3.0.1}/app13.json | 0 .../resources/results/{ => 3.0.1}/app130.json | 0 .../resources/results/{ => 3.0.1}/app131.json | 0 .../resources/results/{ => 3.0.1}/app132.json | 0 .../resources/results/{ => 3.0.1}/app133.json | 0 .../results/{ => 3.0.1}/app134-1.json | 0 .../results/{ => 3.0.1}/app134-2.json | 0 .../results/{ => 3.0.1}/app134-3.json | 0 .../results/{ => 3.0.1}/app134-4.json | 0 .../results/{ => 3.0.1}/app134-5.json | 0 .../resources/results/{ => 3.0.1}/app135.json | 0 .../resources/results/{ => 3.0.1}/app137.json | 0 .../resources/results/{ => 3.0.1}/app138.json | 0 .../resources/results/{ => 3.0.1}/app139.json | 0 .../resources/results/{ => 3.0.1}/app14.json | 0 .../resources/results/{ => 3.0.1}/app140.json | 0 .../resources/results/{ => 3.0.1}/app141.json | 0 .../resources/results/{ => 3.0.1}/app142.json | 0 .../resources/results/{ => 3.0.1}/app149.json | 0 .../resources/results/{ => 3.0.1}/app15.json | 0 .../resources/results/{ => 3.0.1}/app150.json | 0 .../resources/results/{ => 3.0.1}/app151.json | 0 .../resources/results/{ => 3.0.1}/app152.json | 0 .../resources/results/{ => 3.0.1}/app153.json | 0 .../resources/results/{ => 3.0.1}/app154.json | 0 .../resources/results/{ => 3.0.1}/app155.json | 0 .../resources/results/{ => 3.0.1}/app156.json | 0 .../resources/results/{ => 3.0.1}/app157.json | 0 .../resources/results/{ => 3.0.1}/app158.json | 0 .../resources/results/{ => 3.0.1}/app159.json | 0 .../resources/results/{ => 3.0.1}/app160.json | 0 .../resources/results/{ => 3.0.1}/app161.json | 0 .../test/resources/results/3.0.1/app162.json | 342 + .../test/resources/results/3.0.1/app163.json | 227 + .../resources/results/{ => 3.0.1}/app164.json | 0 .../resources/results/{ => 3.0.1}/app166.json | 0 .../resources/results/{ => 3.0.1}/app167.json | 0 .../resources/results/{ => 3.0.1}/app168.json | 0 .../resources/results/{ => 3.0.1}/app169.json | 0 .../resources/results/{ => 3.0.1}/app17.json | 0 .../resources/results/{ => 3.0.1}/app170.json | 0 .../resources/results/{ => 3.0.1}/app171.json | 0 .../resources/results/{ => 3.0.1}/app173.json | 0 .../resources/results/{ => 3.0.1}/app174.json | 0 .../resources/results/{ => 3.0.1}/app18.json | 0 .../resources/results/{ => 3.0.1}/app19.json | 0 .../resources/results/{ => 3.0.1}/app2.json | 0 .../resources/results/{ => 3.0.1}/app20.json | 0 .../resources/results/{ => 3.0.1}/app21.json | 0 .../resources/results/{ => 3.0.1}/app22.json | 0 .../resources/results/{ => 3.0.1}/app23.json | 0 .../resources/results/{ => 3.0.1}/app24.json | 0 .../resources/results/{ => 3.0.1}/app25.json | 0 .../resources/results/{ => 3.0.1}/app26.json | 0 .../resources/results/{ => 3.0.1}/app27.json | 0 .../resources/results/{ => 3.0.1}/app28.json | 0 .../resources/results/{ => 3.0.1}/app29.json | 0 .../resources/results/{ => 3.0.1}/app3.json | 0 .../resources/results/{ => 3.0.1}/app30.json | 0 .../resources/results/{ => 3.0.1}/app31.json | 0 .../resources/results/{ => 3.0.1}/app32.json | 0 .../resources/results/{ => 3.0.1}/app33.json | 0 .../resources/results/{ => 3.0.1}/app34.json | 0 .../resources/results/{ => 3.0.1}/app35.json | 0 .../resources/results/{ => 3.0.1}/app37.json | 0 .../resources/results/{ => 3.0.1}/app38.json | 0 .../resources/results/{ => 3.0.1}/app39.json | 0 .../test/resources/results/3.0.1/app4.json | 86 + .../resources/results/{ => 3.0.1}/app40.json | 0 .../resources/results/{ => 3.0.1}/app41.json | 0 .../resources/results/{ => 3.0.1}/app42.json | 0 .../resources/results/{ => 3.0.1}/app43.json | 0 .../resources/results/{ => 3.0.1}/app44.json | 0 .../resources/results/{ => 3.0.1}/app45.json | 0 .../resources/results/{ => 3.0.1}/app46.json | 0 .../resources/results/{ => 3.0.1}/app47.json | 0 .../resources/results/{ => 3.0.1}/app48.json | 0 .../resources/results/{ => 3.0.1}/app49.json | 0 .../resources/results/{ => 3.0.1}/app50.json | 0 .../resources/results/{ => 3.0.1}/app51.json | 0 .../resources/results/{ => 3.0.1}/app52.json | 0 .../resources/results/{ => 3.0.1}/app53.json | 0 .../resources/results/{ => 3.0.1}/app54.json | 0 .../resources/results/{ => 3.0.1}/app55.json | 0 .../resources/results/{ => 3.0.1}/app56.json | 0 .../resources/results/{ => 3.0.1}/app57.json | 0 .../resources/results/{ => 3.0.1}/app58.json | 0 .../resources/results/{ => 3.0.1}/app59.json | 0 .../resources/results/{ => 3.0.1}/app6.json | 0 .../resources/results/{ => 3.0.1}/app60.json | 0 .../resources/results/{ => 3.0.1}/app61.json | 0 .../resources/results/{ => 3.0.1}/app62.json | 0 .../resources/results/{ => 3.0.1}/app63.json | 0 .../resources/results/{ => 3.0.1}/app64.json | 0 .../resources/results/{ => 3.0.1}/app65.json | 0 .../resources/results/{ => 3.0.1}/app66.json | 0 .../resources/results/{ => 3.0.1}/app67.json | 0 .../resources/results/{ => 3.0.1}/app69.json | 0 .../resources/results/{ => 3.0.1}/app7.json | 0 .../resources/results/{ => 3.0.1}/app70.json | 0 .../resources/results/{ => 3.0.1}/app71.json | 0 .../resources/results/{ => 3.0.1}/app73.json | 0 .../resources/results/{ => 3.0.1}/app74.json | 0 .../resources/results/{ => 3.0.1}/app75.json | 0 .../resources/results/{ => 3.0.1}/app76.json | 0 .../resources/results/{ => 3.0.1}/app77.json | 0 .../resources/results/{ => 3.0.1}/app78.json | 0 .../resources/results/{ => 3.0.1}/app79.json | 0 .../resources/results/{ => 3.0.1}/app8.json | 0 .../resources/results/{ => 3.0.1}/app80.json | 0 .../resources/results/{ => 3.0.1}/app82.json | 0 .../resources/results/{ => 3.0.1}/app83.json | 0 .../resources/results/{ => 3.0.1}/app84.json | 0 .../resources/results/{ => 3.0.1}/app85.json | 0 .../resources/results/{ => 3.0.1}/app86.json | 0 .../resources/results/{ => 3.0.1}/app87.json | 0 .../resources/results/{ => 3.0.1}/app88.json | 0 .../resources/results/{ => 3.0.1}/app89.json | 0 .../resources/results/{ => 3.0.1}/app9.json | 0 .../resources/results/{ => 3.0.1}/app90.json | 0 .../resources/results/{ => 3.0.1}/app91.json | 0 .../resources/results/{ => 3.0.1}/app92.json | 0 .../resources/results/{ => 3.0.1}/app93.json | 0 .../resources/results/{ => 3.0.1}/app94.json | 0 .../resources/results/{ => 3.0.1}/app95.json | 0 .../resources/results/{ => 3.0.1}/app96.json | 0 .../resources/results/{ => 3.0.1}/app97.json | 0 .../resources/results/{ => 3.0.1}/app98.json | 0 .../resources/results/{ => 3.0.1}/app99.json | 0 .../test/resources/results/3.1.0/app1.json | 682 ++ .../test/resources/results/3.1.0/app10.json | 74 + .../test/resources/results/3.1.0/app100.json | 76 + .../test/resources/results/3.1.0/app101.json | 58 + .../test/resources/results/3.1.0/app102.json | 160 + .../test/resources/results/3.1.0/app103.json | 91 + .../test/resources/results/3.1.0/app104.json | 80 + .../resources/results/3.1.0/app105-1.json | 283 + .../resources/results/3.1.0/app105-2.json | 451 + .../resources/results/3.1.0/app105-3.json | 661 ++ .../resources/results/3.1.0/app105-4.json | 86 + .../test/resources/results/3.1.0/app106.json | 57 + .../test/resources/results/3.1.0/app107.json | 83 + .../test/resources/results/3.1.0/app108.json | 88 + .../test/resources/results/3.1.0/app109.json | 68 + .../test/resources/results/3.1.0/app11.json | 107 + .../test/resources/results/3.1.0/app110.json | 310 + .../test/resources/results/3.1.0/app111.json | 223 + .../test/resources/results/3.1.0/app112.json | 310 + .../test/resources/results/3.1.0/app113.json | 85 + .../test/resources/results/3.1.0/app114.json | 81 + .../test/resources/results/3.1.0/app115.json | 45 + .../test/resources/results/3.1.0/app116.json | 58 + .../test/resources/results/3.1.0/app117.json | 168 + .../test/resources/results/3.1.0/app118.json | 270 + .../test/resources/results/3.1.0/app119.json | 85 + .../test/resources/results/3.1.0/app12.json | 53 + .../test/resources/results/3.1.0/app120.json | 279 + .../test/resources/results/3.1.0/app121.json | 217 + .../test/resources/results/3.1.0/app122.json | 76 + .../test/resources/results/3.1.0/app123.json | 77 + .../test/resources/results/3.1.0/app124.json | 77 + .../test/resources/results/3.1.0/app125.json | 78 + .../test/resources/results/3.1.0/app126.json | 124 + .../test/resources/results/3.1.0/app129.json | 94 + .../test/resources/results/3.1.0/app13.json | 76 + .../test/resources/results/3.1.0/app130.json | 54 + .../test/resources/results/3.1.0/app131.json | 114 + .../test/resources/results/3.1.0/app132.json | 114 + .../test/resources/results/3.1.0/app133.json | 125 + .../resources/results/3.1.0/app134-1.json | 72 + .../resources/results/3.1.0/app134-2.json | 139 + .../resources/results/3.1.0/app134-3.json | 72 + .../resources/results/3.1.0/app134-4.json | 82 + .../resources/results/3.1.0/app134-5.json | 76 + .../test/resources/results/3.1.0/app135.json | 428 + .../test/resources/results/3.1.0/app137.json | 67 + .../test/resources/results/3.1.0/app138.json | 74 + .../test/resources/results/3.1.0/app139.json | 90 + .../test/resources/results/3.1.0/app14.json | 70 + .../test/resources/results/3.1.0/app140.json | 168 + .../test/resources/results/3.1.0/app141.json | 428 + .../test/resources/results/3.1.0/app142.json | 168 + .../test/resources/results/3.1.0/app149.json | 106 + .../test/resources/results/3.1.0/app15.json | 47 + .../test/resources/results/3.1.0/app150.json | 137 + .../test/resources/results/3.1.0/app151.json | 45 + .../test/resources/results/3.1.0/app152.json | 44 + .../test/resources/results/3.1.0/app153.json | 60 + .../test/resources/results/3.1.0/app154.json | 194 + .../test/resources/results/3.1.0/app155.json | 133 + .../test/resources/results/3.1.0/app156.json | 80 + .../test/resources/results/3.1.0/app157.json | 70 + .../test/resources/results/3.1.0/app158.json | 80 + .../test/resources/results/3.1.0/app159.json | 107 + .../test/resources/results/3.1.0/app160.json | 65 + .../test/resources/results/3.1.0/app161.json | 132 + .../test/resources/results/3.1.0/app162.json | 343 + .../test/resources/results/3.1.0/app163.json | 228 + .../test/resources/results/3.1.0/app164.json | 129 + .../test/resources/results/3.1.0/app166.json | 175 + .../test/resources/results/3.1.0/app167.json | 101 + .../test/resources/results/3.1.0/app168.json | 63 + .../test/resources/results/3.1.0/app169.json | 98 + .../test/resources/results/3.1.0/app17.json | 50 + .../test/resources/results/3.1.0/app170.json | 88 + .../test/resources/results/3.1.0/app171.json | 65 + .../test/resources/results/3.1.0/app173.json | 132 + .../test/resources/results/3.1.0/app174.json | 120 + .../test/resources/results/3.1.0/app18.json | 224 + .../test/resources/results/3.1.0/app19.json | 119 + .../test/resources/results/3.1.0/app2.json | 1305 +++ .../test/resources/results/3.1.0/app20.json | 15 + .../test/resources/results/3.1.0/app21.json | 65 + .../test/resources/results/3.1.0/app22.json | 71 + .../test/resources/results/3.1.0/app23.json | 62 + .../test/resources/results/3.1.0/app24.json | 89 + .../test/resources/results/3.1.0/app25.json | 193 + .../test/resources/results/3.1.0/app26.json | 102 + .../test/resources/results/3.1.0/app27.json | 69 + .../test/resources/results/3.1.0/app28.json | 69 + .../test/resources/results/3.1.0/app29.json | 87 + .../test/resources/results/3.1.0/app3.json | 113 + .../test/resources/results/3.1.0/app30.json | 56 + .../test/resources/results/3.1.0/app31.json | 111 + .../test/resources/results/3.1.0/app32.json | 75 + .../test/resources/results/3.1.0/app33.json | 64 + .../test/resources/results/3.1.0/app34.json | 64 + .../test/resources/results/3.1.0/app35.json | 78 + .../test/resources/results/3.1.0/app37.json | 169 + .../test/resources/results/3.1.0/app38.json | 45 + .../test/resources/results/3.1.0/app39.json | 94 + .../test/resources/results/3.1.0/app4.json | 86 + .../test/resources/results/3.1.0/app40.json | 44 + .../test/resources/results/3.1.0/app41.json | 69 + .../test/resources/results/3.1.0/app42.json | 54 + .../test/resources/results/3.1.0/app43.json | 66 + .../test/resources/results/3.1.0/app44.json | 107 + .../test/resources/results/3.1.0/app45.json | 166 + .../test/resources/results/3.1.0/app46.json | 58 + .../test/resources/results/3.1.0/app47.json | 55 + .../test/resources/results/3.1.0/app48.json | 114 + .../test/resources/results/3.1.0/app49.json | 49 + .../test/resources/results/3.1.0/app50.json | 59 + .../test/resources/results/3.1.0/app51.json | 212 + .../test/resources/results/3.1.0/app52.json | 206 + .../test/resources/results/3.1.0/app53.json | 246 + .../test/resources/results/3.1.0/app54.json | 151 + .../test/resources/results/3.1.0/app55.json | 38 + .../test/resources/results/3.1.0/app56.json | 67 + .../test/resources/results/3.1.0/app57.json | 55 + .../test/resources/results/3.1.0/app58.json | 136 + .../test/resources/results/3.1.0/app59.json | 38 + .../test/resources/results/3.1.0/app6.json | 69 + .../test/resources/results/3.1.0/app60.json | 121 + .../test/resources/results/3.1.0/app61.json | 94 + .../test/resources/results/3.1.0/app62.json | 54 + .../test/resources/results/3.1.0/app63.json | 15 + .../test/resources/results/3.1.0/app64.json | 55 + .../test/resources/results/3.1.0/app65.json | 88 + .../test/resources/results/3.1.0/app66.json | 88 + .../test/resources/results/3.1.0/app67.json | 188 + .../test/resources/results/3.1.0/app69.json | 76 + .../test/resources/results/3.1.0/app7.json | 48 + .../test/resources/results/3.1.0/app70.json | 69 + .../test/resources/results/3.1.0/app71.json | 69 + .../test/resources/results/3.1.0/app73.json | 172 + .../test/resources/results/3.1.0/app74.json | 55 + .../test/resources/results/3.1.0/app75.json | 178 + .../test/resources/results/3.1.0/app76.json | 83 + .../test/resources/results/3.1.0/app77.json | 90 + .../test/resources/results/3.1.0/app78.json | 109 + .../test/resources/results/3.1.0/app79.json | 55 + .../test/resources/results/3.1.0/app8.json | 73 + .../test/resources/results/3.1.0/app80.json | 95 + .../test/resources/results/3.1.0/app82.json | 94 + .../test/resources/results/3.1.0/app83.json | 80 + .../test/resources/results/3.1.0/app84.json | 77 + .../test/resources/results/3.1.0/app85.json | 54 + .../test/resources/results/3.1.0/app86.json | 48 + .../test/resources/results/3.1.0/app87.json | 82 + .../test/resources/results/3.1.0/app88.json | 35 + .../test/resources/results/3.1.0/app89.json | 55 + .../test/resources/results/3.1.0/app9.json | 64 + .../test/resources/results/3.1.0/app90.json | 161 + .../test/resources/results/3.1.0/app91.json | 101 + .../test/resources/results/3.1.0/app92.json | 55 + .../test/resources/results/3.1.0/app93.json | 73 + .../test/resources/results/3.1.0/app94.json | 79 + .../test/resources/results/3.1.0/app95.json | 48 + .../test/resources/results/3.1.0/app96.json | 123 + .../test/resources/results/3.1.0/app97.json | 154 + .../test/resources/results/3.1.0/app98.json | 37 + .../test/resources/results/3.1.0/app99.json | 37 + .../src/test/resources/results/app162.json | 342 - .../src/test/resources/results/app163.json | 227 - .../src/test/resources/results/app4.json | 86 - .../springdoc/api/AbstractSpringDocTest.java | 79 - .../ControllerWithContinuationParameter.java | 38 - .../springdoc/api/app1/SpringDocApp1Test.java | 25 - .../springdoc/api/app1/SpringDocTestApp.java | 43 - .../springdoc/api/app21/HelloController.java | 25 - .../api/app21/SpringDocApp21Test.java | 37 - .../api/v30/AbstractSpringDocTest.java | 87 + .../ControllerWithContinuationParameter.java | 38 + .../api/v30/app1/SpringDocApp1Test.java | 25 + .../api/v30/app1/SpringDocTestApp.java | 43 + .../api/v30/app21/HelloController.java | 25 + .../api/v30/app21/SpringDocApp21Test.java | 37 + .../api/v31/AbstractSpringDocTest.java | 85 + .../ControllerWithContinuationParameter.java | 38 + .../api/v31/app1/SpringDocApp1Test.java | 25 + .../api/v31/app1/SpringDocTestApp.java | 43 + .../api/v31/app21/HelloController.java | 25 + .../api/v31/app21/SpringDocApp21Test.java | 38 + .../api/AbstractKotlinSpringDocTest.kt | 84 - .../springdoc/api/app10/ExampleController.kt | 20 - .../springdoc/api/app10/SpringDocApp10Test.kt | 31 - .../springdoc/api/app11/SpringDocApp11Test.kt | 31 - .../api/app11/SystemStatusController.kt | 59 - .../springdoc/api/app2/SpringDocApp2Test.kt | 31 - .../api/app2/SystemStatusController.kt | 59 - .../springdoc/api/app3/SpringDocApp3Test.kt | 31 - .../api/app3/SystemStatusController.kt | 45 - .../org/springdoc/api/app4/HelloController.kt | 37 - .../springdoc/api/app4/SpringDocApp4Test.kt | 31 - .../org/springdoc/api/app5/HelloController.kt | 46 - .../springdoc/api/app5/SpringDocApp5Test.kt | 31 - .../springdoc/api/app6/ByteArrayController.kt | 38 - .../springdoc/api/app6/SpringDocApp6Test.kt | 31 - .../springdoc/api/app7/ExampleController.kt | 17 - .../springdoc/api/app7/SpringDocApp7Test.kt | 46 - .../springdoc/api/app8/ExampleController.kt | 17 - .../springdoc/api/app8/SpringDocApp8Test.kt | 49 - .../org/springdoc/api/app9/DemoController.kt | 72 - .../springdoc/api/app9/SpringDocApp9Test.kt | 31 - .../api/v30/AbstractKotlinSpringDocTest.kt | 92 + .../api/v30/app10/ExampleController.kt | 20 + .../api/v30/app10/SpringDocApp10Test.kt | 31 + .../api/v30/app11/SpringDocApp11Test.kt | 31 + .../api/v30/app11/SystemStatusController.kt | 59 + .../api/v30/app2/SpringDocApp2Test.kt | 31 + .../api/v30/app2/SystemStatusController.kt | 59 + .../api/v30/app3/SpringDocApp3Test.kt | 31 + .../api/v30/app3/SystemStatusController.kt | 45 + .../springdoc/api/v30/app4/HelloController.kt | 37 + .../api/v30/app4/SpringDocApp4Test.kt | 31 + .../springdoc/api/v30/app5/HelloController.kt | 46 + .../api/v30/app5/SpringDocApp5Test.kt | 31 + .../api/v30/app6/ByteArrayController.kt | 38 + .../api/v30/app6/SpringDocApp6Test.kt | 31 + .../api/v30/app7/ExampleController.kt | 17 + .../api/v30/app7/SpringDocApp7Test.kt | 46 + .../api/v30/app8/ExampleController.kt | 17 + .../api/v30/app8/SpringDocApp8Test.kt | 49 + .../springdoc/api/v30/app9/DemoController.kt | 72 + .../api/v30/app9/SpringDocApp9Test.kt | 31 + .../api/v31/AbstractKotlinSpringDocTest.kt | 91 + .../api/v31/app10/ExampleController.kt | 20 + .../api/v31/app10/SpringDocApp10Test.kt | 31 + .../api/v31/app11/SpringDocApp11Test.kt | 31 + .../api/v31/app11/SystemStatusController.kt | 59 + .../api/v31/app2/SpringDocApp2Test.kt | 31 + .../api/v31/app2/SystemStatusController.kt | 59 + .../api/v31/app3/SpringDocApp3Test.kt | 31 + .../api/v31/app3/SystemStatusController.kt | 45 + .../springdoc/api/v31/app4/HelloController.kt | 37 + .../api/v31/app4/SpringDocApp4Test.kt | 31 + .../springdoc/api/v31/app5/HelloController.kt | 46 + .../api/v31/app5/SpringDocApp5Test.kt | 31 + .../api/v31/app6/ByteArrayController.kt | 38 + .../api/v31/app6/SpringDocApp6Test.kt | 31 + .../api/v31/app7/ExampleController.kt | 17 + .../api/v31/app7/SpringDocApp7Test.kt | 46 + .../api/v31/app8/ExampleController.kt | 17 + .../api/v31/app8/SpringDocApp8Test.kt | 49 + .../springdoc/api/v31/app9/DemoController.kt | 72 + .../api/v31/app9/SpringDocApp9Test.kt | 31 + .../resources/results/{ => 3.0.1}/app1.json | 0 .../resources/results/{ => 3.0.1}/app10.json | 0 .../resources/results/{ => 3.0.1}/app11.json | 0 .../resources/results/{ => 3.0.1}/app2.json | 0 .../resources/results/{ => 3.0.1}/app21.json | 0 .../resources/results/{ => 3.0.1}/app3.json | 0 .../resources/results/{ => 3.0.1}/app4.json | 0 .../resources/results/{ => 3.0.1}/app5.json | 0 .../resources/results/{ => 3.0.1}/app6.json | 0 .../resources/results/{ => 3.0.1}/app7.json | 0 .../resources/results/{ => 3.0.1}/app8.json | 0 .../resources/results/{ => 3.0.1}/app9.json | 0 .../test/resources/results/3.1.0/app1.json | 51 + .../test/resources/results/3.1.0/app10.json | 121 + .../test/resources/results/3.1.0/app11.json | 117 + .../test/resources/results/3.1.0/app2.json | 107 + .../test/resources/results/3.1.0/app21.json | 62 + .../test/resources/results/3.1.0/app3.json | 74 + .../test/resources/results/3.1.0/app4.json | 63 + .../test/resources/results/3.1.0/app5.json | 40 + .../test/resources/results/3.1.0/app6.json | 52 + .../test/resources/results/3.1.0/app7.json | 90 + .../test/resources/results/3.1.0/app8.json | 90 + .../test/resources/results/3.1.0/app9.json | 133 + .../springdoc/api/app12/EnumController.java | 2 +- .../api/AbstractKotlinSpringDocMVCTest.kt | 83 - .../springdoc/api/app10/ExampleController.kt | 20 - .../springdoc/api/app10/SpringDocApp10Test.kt | 31 - .../springdoc/api/app11/ExampleController.kt | 96 - .../springdoc/api/app11/SpringDocApp11Test.kt | 31 - .../springdoc/api/app12/SpringDocApp12Test.kt | 35 - .../springdoc/api/app13/SpringDocApp13Test.kt | 33 - .../org/springdoc/api/app13/TestController.kt | 50 - .../springdoc/api/app14/SpringDocApp14Test.kt | 29 - .../org/springdoc/api/app14/TestController.kt | 47 - .../springdoc/api/app2/SpringDocApp2Test.kt | 29 - .../api/app2/SystemStatusController.kt | 43 - .../springdoc/api/app3/SpringDocApp3Test.kt | 31 - .../api/app3/SystemStatusController.kt | 43 - .../org/springdoc/api/app4/HelloController.kt | 37 - .../springdoc/api/app4/SpringDocApp4Test.kt | 31 - .../org/springdoc/api/app5/ListController.kt | 31 - .../springdoc/api/app5/SpringDocApp5Test.kt | 31 - .../springdoc/api/app6/ByteArrayController.kt | 34 - .../springdoc/api/app6/SpringDocApp6Test.kt | 31 - .../springdoc/api/app7/ExampleController.kt | 17 - .../springdoc/api/app7/SpringDocApp7Test.kt | 46 - .../springdoc/api/app8/ExampleController.kt | 17 - .../springdoc/api/app8/SpringDocApp8Test.kt | 49 - .../org/springdoc/api/app9/DemoController.kt | 71 - .../springdoc/api/app9/SpringDocApp9Test.kt | 9 - .../api/v30/AbstractKotlinSpringDocMVCTest.kt | 91 + .../api/v30/app10/ExampleController.kt | 20 + .../api/v30/app10/SpringDocApp10Test.kt | 31 + .../api/v30/app11/ExampleController.kt | 96 + .../api/v30/app11/SpringDocApp11Test.kt | 31 + .../api/v30/app12/EnumController.java | 18 + .../api/v30/app12/SpringDocApp12Test.kt | 35 + .../api/v30/app13/SpringDocApp13Test.kt | 33 + .../springdoc/api/v30/app13/TestController.kt | 50 + .../api/v30/app14/SpringDocApp14Test.kt | 29 + .../springdoc/api/v30/app14/TestController.kt | 47 + .../api/v30/app2/SpringDocApp2Test.kt | 29 + .../api/v30/app2/SystemStatusController.kt | 43 + .../api/v30/app3/SpringDocApp3Test.kt | 31 + .../api/v30/app3/SystemStatusController.kt | 43 + .../springdoc/api/v30/app4/HelloController.kt | 37 + .../api/v30/app4/SpringDocApp4Test.kt | 31 + .../springdoc/api/v30/app5/ListController.kt | 31 + .../api/v30/app5/SpringDocApp5Test.kt | 31 + .../api/v30/app6/ByteArrayController.kt | 34 + .../api/v30/app6/SpringDocApp6Test.kt | 31 + .../api/v30/app7/ExampleController.kt | 17 + .../api/v30/app7/SpringDocApp7Test.kt | 46 + .../api/v30/app8/ExampleController.kt | 17 + .../api/v30/app8/SpringDocApp8Test.kt | 49 + .../springdoc/api/v30/app9/DemoController.kt | 71 + .../api/v30/app9/SpringDocApp9Test.kt | 9 + .../api/v31/AbstractKotlinSpringDocMVCTest.kt | 91 + .../api/v31/app10/ExampleController.kt | 20 + .../api/v31/app10/SpringDocApp10Test.kt | 31 + .../api/v31/app11/ExampleController.kt | 96 + .../api/v31/app11/SpringDocApp11Test.kt | 31 + .../api/v31/app12/EnumController.java | 18 + .../api/v31/app12/SpringDocApp12Test.kt | 35 + .../api/v31/app13/SpringDocApp13Test.kt | 33 + .../springdoc/api/v31/app13/TestController.kt | 50 + .../api/v31/app14/SpringDocApp14Test.kt | 29 + .../springdoc/api/v31/app14/TestController.kt | 47 + .../api/v31/app2/SpringDocApp2Test.kt | 29 + .../api/v31/app2/SystemStatusController.kt | 43 + .../api/v31/app3/SpringDocApp3Test.kt | 31 + .../api/v31/app3/SystemStatusController.kt | 43 + .../springdoc/api/v31/app4/HelloController.kt | 37 + .../api/v31/app4/SpringDocApp4Test.kt | 31 + .../springdoc/api/v31/app5/ListController.kt | 31 + .../api/v31/app5/SpringDocApp5Test.kt | 31 + .../api/v31/app6/ByteArrayController.kt | 34 + .../api/v31/app6/SpringDocApp6Test.kt | 31 + .../api/v31/app7/ExampleController.kt | 17 + .../api/v31/app7/SpringDocApp7Test.kt | 46 + .../api/v31/app8/ExampleController.kt | 17 + .../api/v31/app8/SpringDocApp8Test.kt | 49 + .../springdoc/api/v31/app9/DemoController.kt | 71 + .../api/v31/app9/SpringDocApp9Test.kt | 9 + .../resources/results/{ => 3.0.1}/app1.json | 0 .../resources/results/{ => 3.0.1}/app10.json | 0 .../resources/results/{ => 3.0.1}/app11.json | 0 .../resources/results/{ => 3.0.1}/app12.json | 0 .../resources/results/{ => 3.0.1}/app13.json | 0 .../resources/results/{ => 3.0.1}/app14.json | 0 .../resources/results/{ => 3.0.1}/app2.json | 0 .../resources/results/{ => 3.0.1}/app3.json | 0 .../resources/results/{ => 3.0.1}/app4.json | 0 .../resources/results/{ => 3.0.1}/app5.json | 0 .../resources/results/{ => 3.0.1}/app6.json | 0 .../resources/results/{ => 3.0.1}/app7.json | 0 .../resources/results/{ => 3.0.1}/app8.json | 0 .../resources/results/{ => 3.0.1}/app9.json | 0 .../test/resources/results/3.1.0/app1.json | 51 + .../test/resources/results/3.1.0/app10.json | 121 + .../test/resources/results/3.1.0/app11.json | 136 + .../test/resources/results/3.1.0/app12.json | 50 + .../test/resources/results/3.1.0/app13.json | 68 + .../test/resources/results/3.1.0/app14.json | 81 + .../test/resources/results/3.1.0/app2.json | 73 + .../test/resources/results/3.1.0/app3.json | 74 + .../test/resources/results/3.1.0/app4.json | 63 + .../test/resources/results/3.1.0/app5.json | 40 + .../test/resources/results/3.1.0/app6.json | 51 + .../test/resources/results/3.1.0/app7.json | 90 + .../test/resources/results/3.1.0/app8.json | 90 + .../test/resources/results/3.1.0/app9.json | 133 + .../springdoc/api/AbstractSpringDocTest.java | 82 - .../springdoc/api/app1/HelloController.java | 50 - .../test/org/springdoc/api/app1/Person.java | 35 - .../springdoc/api/app1/SpringDocApp1Test.java | 40 - .../api/app10/AuthorizationServerConfig.java | 78 - .../springdoc/api/app10/HelloController.java | 20 - .../test/org/springdoc/api/app10/Jwks.java | 37 - .../api/app10/KeyGeneratorUtils.java | 33 - .../api/app10/SpringDocApp10Test.java | 56 - .../api/app11/AuthorizationServerConfig.java | 75 - .../springdoc/api/app11/HelloController.java | 17 - .../test/org/springdoc/api/app11/Jwks.java | 29 - .../api/app11/KeyGeneratorUtils.java | 26 - .../api/app11/SpringDocApp11Test.java | 56 - .../api/app12/AuthorizationServerConfig.java | 75 - .../springdoc/api/app12/HelloController.java | 17 - .../test/org/springdoc/api/app12/Jwks.java | 29 - .../api/app12/KeyGeneratorUtils.java | 26 - .../api/app12/SpringDocApp12Test.java | 56 - .../springdoc/api/app2/HelloController.java | 48 - .../springdoc/api/app2/SpringDocApp2Test.java | 41 - .../test/org/springdoc/api/app2/User.java | 43 - .../springdoc/api/app3/SpringOauth2Test.java | 46 - .../springdoc/api/app5/HelloController.java | 39 - .../test/org/springdoc/api/app5/Sample.java | 43 - .../springdoc/api/app5/SpringDocApp5Test.java | 30 - .../springdoc/api/app6/SpringDocApp6Test.java | 39 - .../springdoc/api/app6/SpringDocConfig.java | 31 - .../api/app6/controllers/MyController.java | 30 - .../security/JWTAuthenticationFilter.java | 113 - .../app6/security/JWTAuthorizationFilter.java | 83 - .../app6/security/MyUserDetailsService.java | 29 - .../api/app6/security/WebSecurity.java | 120 - .../org/springdoc/api/app7/AnotherPerson.java | 35 - .../org/springdoc/api/app7/CurrentUser.java | 16 - .../springdoc/api/app7/HelloController.java | 39 - .../test/org/springdoc/api/app7/Person.java | 35 - .../springdoc/api/app7/SpringDocApp7Test.java | 40 - .../springdoc/api/app7/TheOtherPerson.java | 36 - .../springdoc/api/app8/SpringDocApp8Test.java | 24 - .../api/app8/security/WebConfig.java | 22 - .../springdoc/api/app9/SpringDocApp9Test.java | 42 - .../org/springdoc/api/app9/WebConfig.java | 22 - .../configuration/SecurityConfiguration.java | 46 - .../api/v30/AbstractSpringDocTest.java | 90 + .../api/v30/app1/HelloController.java | 58 + .../org/springdoc/api/v30/app1/Person.java | 43 + .../api/v30/app1/SpringDocApp1Test.java | 48 + .../v30/app10/AuthorizationServerConfig.java | 104 + .../api/v30/app10/HelloController.java | 46 + .../org/springdoc/api/v30/app10/Jwks.java | 58 + .../api/v30/app10/KeyGeneratorUtils.java | 54 + .../api/v30/app10/SpringDocApp10Test.java | 64 + .../v30/app11/AuthorizationServerConfig.java | 101 + .../api/v30/app11/HelloController.java | 43 + .../org/springdoc/api/v30/app11/Jwks.java | 55 + .../api/v30/app11/KeyGeneratorUtils.java | 52 + .../api/v30/app11/SpringDocApp11Test.java | 64 + .../v30/app12/AuthorizationServerConfig.java | 101 + .../api/v30/app12/HelloController.java | 43 + .../org/springdoc/api/v30/app12/Jwks.java | 55 + .../api/v30/app12/KeyGeneratorUtils.java | 52 + .../api/v30/app12/SpringDocApp12Test.java | 64 + .../api/v30/app2/HelloController.java | 56 + .../api/v30/app2/SpringDocApp2Test.java | 49 + .../test/org/springdoc/api/v30/app2/User.java | 69 + .../api/v30/app3/SpringOauth2Test.java | 54 + .../api/v30/app5/HelloController.java | 47 + .../org/springdoc/api/v30/app5/Sample.java | 51 + .../api/v30/app5/SpringDocApp5Test.java | 38 + .../api/v30/app6/SpringDocApp6Test.java | 47 + .../api/v30/app6/SpringDocConfig.java | 57 + .../v30/app6/controllers/MyController.java | 56 + .../security/JWTAuthenticationFilter.java | 139 + .../app6/security/JWTAuthorizationFilter.java | 109 + .../app6/security/MyUserDetailsService.java | 55 + .../api/v30/app6/security/WebSecurity.java | 126 + .../springdoc/api/v30/app7/AnotherPerson.java | 43 + .../springdoc/api/v30/app7/CurrentUser.java | 42 + .../api/v30/app7/HelloController.java | 47 + .../org/springdoc/api/v30/app7/Person.java | 43 + .../api/v30/app7/SpringDocApp7Test.java | 48 + .../api/v30/app7/TheOtherPerson.java | 44 + .../api/v30/app8/SpringDocApp8Test.java | 50 + .../api/v30/app8/security/WebConfig.java | 48 + .../api/v30/app9/SpringDocApp9Test.java | 50 + .../org/springdoc/api/v30/app9/WebConfig.java | 48 + .../configuration/SecurityConfiguration.java | 54 + .../api/v31/AbstractSpringDocTest.java | 88 + .../api/v31/app1/HelloController.java | 58 + .../org/springdoc/api/v31/app1/Person.java | 43 + .../api/v31/app1/SpringDocApp1Test.java | 48 + .../v31/app10/AuthorizationServerConfig.java | 104 + .../api/v31/app10/HelloController.java | 46 + .../org/springdoc/api/v31/app10/Jwks.java | 58 + .../api/v31/app10/KeyGeneratorUtils.java | 54 + .../api/v31/app10/SpringDocApp10Test.java | 64 + .../v31/app11/AuthorizationServerConfig.java | 101 + .../api/v31/app11/HelloController.java | 43 + .../org/springdoc/api/v31/app11/Jwks.java | 55 + .../api/v31/app11/KeyGeneratorUtils.java | 52 + .../api/v31/app11/SpringDocApp11Test.java | 64 + .../v31/app12/AuthorizationServerConfig.java | 101 + .../api/v31/app12/HelloController.java | 43 + .../org/springdoc/api/v31/app12/Jwks.java | 55 + .../api/v31/app12/KeyGeneratorUtils.java | 52 + .../api/v31/app12/SpringDocApp12Test.java | 64 + .../api/v31/app2/HelloController.java | 56 + .../api/v31/app2/SpringDocApp2Test.java | 49 + .../test/org/springdoc/api/v31/app2/User.java | 69 + .../api/v31/app3/SpringOauth2Test.java | 54 + .../api/v31/app5/HelloController.java | 47 + .../org/springdoc/api/v31/app5/Sample.java | 51 + .../api/v31/app5/SpringDocApp5Test.java | 38 + .../api/v31/app6/SpringDocApp6Test.java | 47 + .../api/v31/app6/SpringDocConfig.java | 57 + .../v31/app6/controllers/MyController.java | 56 + .../security/JWTAuthenticationFilter.java | 139 + .../app6/security/JWTAuthorizationFilter.java | 109 + .../app6/security/MyUserDetailsService.java | 55 + .../api/v31/app6/security/WebSecurity.java | 126 + .../springdoc/api/v31/app7/AnotherPerson.java | 43 + .../springdoc/api/v31/app7/CurrentUser.java | 42 + .../api/v31/app7/HelloController.java | 47 + .../org/springdoc/api/v31/app7/Person.java | 43 + .../api/v31/app7/SpringDocApp7Test.java | 48 + .../api/v31/app7/TheOtherPerson.java | 44 + .../api/v31/app8/SpringDocApp8Test.java | 50 + .../api/v31/app8/security/WebConfig.java | 48 + .../api/v31/app9/SpringDocApp9Test.java | 50 + .../org/springdoc/api/v31/app9/WebConfig.java | 48 + .../configuration/SecurityConfiguration.java | 54 + .../resources/results/{ => 3.0.1}/app1.json | 0 .../resources/results/{ => 3.0.1}/app10.json | 0 .../resources/results/{ => 3.0.1}/app11.json | 0 .../resources/results/{ => 3.0.1}/app12.json | 0 .../resources/results/{ => 3.0.1}/app2.json | 0 .../resources/results/{ => 3.0.1}/app5.json | 0 .../resources/results/{ => 3.0.1}/app6.json | 0 .../resources/results/{ => 3.0.1}/app7.json | 0 .../resources/results/{ => 3.0.1}/app8.json | 0 .../resources/results/{ => 3.0.1}/app9.json | 0 .../test/resources/results/3.1.0/app1.json | 121 + .../test/resources/results/3.1.0/app10.json | 523 ++ .../test/resources/results/3.1.0/app11.json | 674 ++ .../test/resources/results/3.1.0/app12.json | 860 ++ .../test/resources/results/3.1.0/app2.json | 120 + .../test/resources/results/3.1.0/app5.json | 58 + .../test/resources/results/3.1.0/app6.json | 103 + .../test/resources/results/3.1.0/app7.json | 41 + .../test/resources/results/3.1.0/app8.json | 52 + .../test/resources/results/3.1.0/app9.json | 19 + 3938 files changed, 185393 insertions(+), 65247 deletions(-) create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/OAS31ModelConverter.java delete mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractCommonTest.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/RequestParams.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/TestController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HelloMessage.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HiddenHelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/HelloRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app151/HelloRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app152/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/DefaultRequestMappingHandlerMapping.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/DefaultWebFluxRegistrations.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/TestController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/SpringDocApp184Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/DuplicatedPathController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/SpringDocApp187Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/OrderDemo.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/SpringDocApp189Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/SpringDocTestApp.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190bisTest.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/BaseHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/GetNameHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Router/GetNameRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/SpringDocApp191Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/SpringDocTestApp.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/controller/ExceptionTranslator.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/controller/TweetController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/dto/TweetDTO.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/exception/TweetConflictException.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/exception/TweetNotFoundException.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/payload/ErrorResponse.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/SpringDocTestApp.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/SpringDocTestApp.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/Tweet.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/toto/HelloController2.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app64/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocTestApp.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/controller/ExceptionTranslator.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/controller/TweetController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/dto/TweetDTO.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/exception/TweetConflictException.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/exception/TweetNotFoundException.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/payload/ErrorResponse.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/controller/ExceptionTranslator.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/controller/TweetController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/dto/TweetDTO.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/exception/TweetConflictException.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/exception/TweetNotFoundException.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/payload/ErrorResponse.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/RoutingConfiguration.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/User.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserRepositoryImpl.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/Coffee.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeOrder.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeService.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/RouteConfig.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/Employee.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/EmployeeFunctionalConfig.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/EmployeeRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/SpringDocApp72Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/controller/PersonRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/controller/PositionRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Person.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Position.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Sex.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/exception/PositionNotFoundException.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/handler/PersonHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/handler/PositionHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/payload/ErrorResponse.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/service/PersonService.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/Quote.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteGenerator.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/Book.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/BookRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/BookRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/Post.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app78/HelloController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/BaseClientModel.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/BaseController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpecificClientModel.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpecificController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/Book.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/BookRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/BookRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app81/OperationIdController.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/RoutingConfiguration.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/User.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserRepositoryImpl.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/Coffee.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeOrder.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeService.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/RouteConfig.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/Employee.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/EmployeeFunctionalConfig.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/EmployeeRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/controller/PersonRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/controller/PositionRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Person.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Position.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Sex.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/exception/PositionNotFoundException.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/handler/PersonHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/handler/PositionHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/payload/ErrorResponse.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/service/PersonService.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/Quote.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteGenerator.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/Book.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/BookRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/BookRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/Post.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostHandler.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/Book.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/BookRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/BookRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/HelloRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/book/BookRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/Employee.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/EmployeeRepository.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/EmployeeRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/position/PositionRouter.java delete mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/quotes/QuotesRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/TestController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HiddenHelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app150/HelloRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app151/HelloRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/DefaultRequestMappingHandlerMapping.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/DefaultWebFluxRegistrations.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/TestController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app184/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app184/SpringDocApp184Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app187/DuplicatedPathController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app188/OrderDemo.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app188/SpringDocApp188Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocApp189Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190bisTest.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Handler/BaseHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Handler/GetNameHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Router/GetNameRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/SpringDocApp191Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/controller/ExceptionTranslator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/controller/TweetController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/dto/TweetDTO.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/exception/TweetConflictException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/exception/TweetNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/Tweet.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/toto/HelloController2.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/controller/ExceptionTranslator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/controller/TweetController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/dto/TweetDTO.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/exception/TweetConflictException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/exception/TweetNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/SpringDocApp68Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/controller/ExceptionTranslator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/controller/TweetController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/dto/TweetDTO.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/exception/TweetConflictException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/exception/TweetNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/RoutingConfiguration.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/User.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserRepositoryImpl.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/Coffee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeOrder.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeService.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/RouteConfig.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/Employee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/EmployeeFunctionalConfig.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/EmployeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/SpringDocApp72Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/controller/PersonRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/controller/PositionRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Person.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Position.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Sex.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/exception/PositionNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/handler/PersonHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/handler/PositionHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/service/PersonService.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/Quote.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteGenerator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/Book.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/BookRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/Post.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/BaseClientModel.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/BaseController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpecificClientModel.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpecificController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/Book.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/BookRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app81/OperationIdController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/RoutingConfiguration.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/User.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserRepositoryImpl.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/Coffee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeOrder.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeService.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/RouteConfig.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/Employee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/EmployeeFunctionalConfig.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/EmployeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/controller/PersonRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/controller/PositionRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Person.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Position.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Sex.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/exception/PositionNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/handler/PersonHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/handler/PositionHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/service/PersonService.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/Quote.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteGenerator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/Book.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/BookRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/Post.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/Book.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/BookRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/HelloRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/book/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/Employee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/EmployeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/EmployeeRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/position/PositionRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/quotes/QuotesRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/TestController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HiddenHelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app150/HelloRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app151/HelloRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/DefaultRequestMappingHandlerMapping.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/DefaultWebFluxRegistrations.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/TestController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app184/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app187/DuplicatedPathController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app188/OrderDemo.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190bisTest.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Handler/BaseHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Handler/GetNameHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Router/GetNameRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/SpringDocApp191Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/controller/ExceptionTranslator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/controller/TweetController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/dto/TweetDTO.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/exception/TweetConflictException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/exception/TweetNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/Tweet.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/toto/HelloController2.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocTestApp.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/controller/ExceptionTranslator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/controller/TweetController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/dto/TweetDTO.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/exception/TweetConflictException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/exception/TweetNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/SpringDocApp68Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/controller/ExceptionTranslator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/controller/TweetController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/dto/TweetDTO.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/exception/TweetConflictException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/exception/TweetNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/RoutingConfiguration.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/User.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserRepositoryImpl.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/Coffee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeOrder.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeService.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/RouteConfig.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/Employee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/EmployeeFunctionalConfig.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/EmployeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/SpringDocApp72Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/controller/PersonRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/controller/PositionRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Person.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Position.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Sex.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/exception/PositionNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/handler/PersonHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/handler/PositionHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/service/PersonService.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/Quote.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteGenerator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/Book.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/BookRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/Post.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/BaseClientModel.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/BaseController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpecificClientModel.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpecificController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/Book.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/BookRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app81/OperationIdController.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/RoutingConfiguration.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/User.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserRepositoryImpl.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/Coffee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeOrder.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeService.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/RouteConfig.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/Employee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/EmployeeFunctionalConfig.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/EmployeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/controller/PersonRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/controller/PositionRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Person.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Position.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Sex.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/exception/PositionNotFoundException.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/handler/PersonHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/handler/PositionHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/payload/ErrorResponse.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/service/PersonService.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/Quote.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteGenerator.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/Book.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/BookRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/Post.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostHandler.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/Book.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/BookRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/HelloRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/book/BookRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/Employee.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/EmployeeRepository.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/EmployeeRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/position/PositionRouter.java create mode 100644 springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/quotes/QuotesRouter.java rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app102.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app149.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app150.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app151.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app152.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app153.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app154.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app184-1.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app184-2.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app184-3.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app184.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app187.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app188.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app189.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app191.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app3.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app39.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app4.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app5.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app63.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app64.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app65.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app66.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app67.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app68.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app69.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app70.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app71.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app72.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app73.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app74.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app75.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app78.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app79.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app80.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app81.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app82.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app83.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app84.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app85.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app86.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app87.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app88.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app89.json (100%) rename springdoc-openapi-starter-webflux-api/src/test/resources/results/{ => 3.0.1}/app90.json (100%) create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app102.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app149.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app150.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app151.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app152.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app153.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app154.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-1.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-2.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-3.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app187.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app188.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app189.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app191.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app3.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app39.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app4.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app5.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app63.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app64.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app65.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app66.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app67.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app68.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app69.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app70.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app71.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app72.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app73.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app74.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app75.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app78.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app79.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app80.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app81.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app82.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app83.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app84.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app85.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app86.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app87.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app88.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app89.json create mode 100644 springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app90.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1451Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1452Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocActuatorTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app144/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app144/SpringDocApp144Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp1451Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp1452Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp145Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app146/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app146/SpringDocApp146Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app147/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app147/SpringDocApp147Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app148/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app148/SpringDocApp148Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app186/SpringDocApp186Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocActuatorTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app144/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app144/SpringDocApp144Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp1451Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp1452Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp145Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app146/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app146/SpringDocApp146Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app147/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app147/SpringDocApp147Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app148/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app148/SpringDocApp148Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app186/SpringDocApp186Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocTestApp.java rename springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/{ => 3.0.1}/app144.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/{ => 3.0.1}/app145-1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/{ => 3.0.1}/app145-2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/{ => 3.0.1}/app145.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/{ => 3.0.1}/app146-1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/{ => 3.0.1}/app146-2.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app147-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app147-2.json rename springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/{ => 3.0.1}/app148-1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/{ => 3.0.1}/app148-2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/{ => 3.0.1}/app186.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app144.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app146-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app146-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app147-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app147-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app148-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app148-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app186.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/SpringDocApp128Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/CustomizedOperation.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocConfiguration.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/ApiUtil.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/ExceptionTranslator.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/HomeController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiDelegate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiDelegateImpl.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiDelegate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiDelegateImpl.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiDelegate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiDelegateImpl.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserClient.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Body.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Body1.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Category.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/ModelApiResponse.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Order.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Pet.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Tag.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/User.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocActuatorTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app128/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app128/SpringDocApp128Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app144/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app144/SpringDocApp144Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app145/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp145Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app147/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app147/SpringDocApp147Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app148/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app148/SpringDocApp148Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app186/SpringDocApp186Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app36/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app36/SpringDocApp36Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/CustomizedOperation.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/SpringDocApp68Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/SpringDocConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/ApiUtil.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/ExceptionTranslator.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/HomeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserClient.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Body.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Body1.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Category.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/ModelApiResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Order.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Tag.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocActuatorTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app128/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app128/SpringDocApp128Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app144/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app144/SpringDocApp144Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app145/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp145Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app147/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app147/SpringDocApp147Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app148/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app148/SpringDocApp148Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app186/SpringDocApp186Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app36/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app36/SpringDocApp36Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/CustomizedOperation.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/SpringDocApp68Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/SpringDocConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/ApiUtil.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/ExceptionTranslator.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/HomeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserClient.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Body.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Body1.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Category.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/ModelApiResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Order.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Tag.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app128.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app144.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app145.json rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app146-1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app146-2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app147-1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app147-2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app148-1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app148-2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app186.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app68-1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app68-2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app68-3.json (100%) rename springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app68-4.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app128.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app144.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app145.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app146-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app146-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app147-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app147-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app148-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app148-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app186.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-3.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-4.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app145.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/Account.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/AccountRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/Customer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/CustomerRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/PersonRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/Account.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/AccountRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/Customer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/CustomerRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/OpenApiConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/ChildProperty.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/ChildPropertyRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/Property.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/PropertyRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/HelloWorldModel.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/Application.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/ApplicationPredicate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/GreetingController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/QApplication.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/Bank.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/BankRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/CodeLookupRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/DemoApplication.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/EntityDefinition.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/PersonRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/PersonApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/PersonRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/Clinic.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/ClinicRepo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/Doctor.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/DoctorRepo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/QUser.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/TesteResource.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/User.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/UserPredicate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Address.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/BaseEntity.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Cat.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Clinic.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Doctor.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Dog.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Owner.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Pet.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Specialty.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/ClinicRepo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/DoctorRepo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/OwnerRepo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/PetRepo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/PersonRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/SpringRestConfiguration.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/ExamplePageable.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/ExamplePageableReplacement.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/PersonApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/PersonRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/QUser.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/User.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/UserPredicate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/PersonApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/PersonRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/SpringDocApp301Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/ExampleSort.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/ExampleSortReplacement.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/Account.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/AccountRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/Customer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/CustomerRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/OpenApiConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/SpringRestConfiguration.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/ChildProperty.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/ChildPropertyRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/Property.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/PropertyRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolder.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolderRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/BaseEntity.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/ProductEntity.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/ProductRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app38/DefaultFlatParamObjectController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/DatabaseLoader.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/Employee.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/EmployeeController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/EmployeeRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/SpringDocTestApp.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/Country.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/CountryPredicate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/GreetingController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/QCountry.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/DatabaseLoader.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/Employee.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/SpringDocTestApp.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/Album.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/AlbumController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/AlbumModelAssembler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/ComponentsController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/hateoas/ComponentDtoModelAssembler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/dto/DemoComponentDto.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/dto/converter/DemoComponentConverter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/model/DemoComponent.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/service/ComponentsService.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/OpenAPIConfiguration.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/SpringRestConfiguration.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/WebMvcConfiguration.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/exception/BadArgumentException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/exception/BusinessException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/model/ExceptionDto.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/utils/Converter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/Account.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/AccountRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/Customer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/CustomerRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/Account.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/AccountRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/Customer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/CustomerRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/ChildProperty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/ChildPropertyRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/Property.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/PropertyRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloWorldModel.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/Application.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/ApplicationPredicate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/GreetingController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/QApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/Bank.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/BankRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/CodeLookupRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/DemoApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/EntityDefinition.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/Clinic.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/ClinicRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/Doctor.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/DoctorRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/QUser.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/TesteResource.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/UserPredicate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Address.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/BaseEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Cat.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Clinic.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Doctor.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Dog.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Owner.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Specialty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/ClinicRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/DoctorRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/OwnerRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/PetRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringRestConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/ExamplePageable.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/ExamplePageableReplacement.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/PersonApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app3/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/QUser.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/UserPredicate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/PersonApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/SpringDocApp301Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/ExampleSort.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/ExampleSortReplacement.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/Account.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/AccountRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/Customer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/CustomerRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringRestConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/ChildProperty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/ChildPropertyRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/Property.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/PropertyRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/EnumFieldHolder.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/EnumFieldHolderRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/SpringDocApp36Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/BaseEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/ProductEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/ProductRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app38/DefaultFlatParamObjectController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/Country.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/CountryPredicate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/GreetingController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/QCountry.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/Album.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/AlbumController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/AlbumModelAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/ComponentsController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/hateoas/ComponentDtoModelAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/dto/DemoComponentDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/dto/converter/DemoComponentConverter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/model/DemoComponent.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/service/ComponentsService.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/OpenAPIConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/SpringRestConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/WebMvcConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/exception/BadArgumentException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/exception/BusinessException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/model/ExceptionDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/utils/Converter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/Account.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/AccountRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/Customer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/CustomerRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/Account.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/AccountRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/Customer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/CustomerRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/ChildProperty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/ChildPropertyRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/Property.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/PropertyRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloWorldModel.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/Application.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/ApplicationPredicate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/GreetingController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/QApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/Bank.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/BankRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/CodeLookupRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/DemoApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/EntityDefinition.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/Clinic.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/ClinicRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/Doctor.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/DoctorRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/QUser.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/TesteResource.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/UserPredicate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Address.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/BaseEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Cat.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Clinic.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Doctor.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Dog.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Owner.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Specialty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/ClinicRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/DoctorRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/OwnerRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/PetRepo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringRestConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/ExamplePageable.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/ExamplePageableReplacement.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/PersonApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app3/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/QUser.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/UserPredicate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/PersonApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/PersonRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/SpringDocApp301Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/ExampleSort.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/ExampleSortReplacement.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/Account.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/AccountRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/Customer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/CustomerRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringRestConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/ChildProperty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/ChildPropertyRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/Property.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/PropertyRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/EnumFieldHolder.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/EnumFieldHolderRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/SpringDocApp36Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/BaseEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/ProductEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/ProductRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app38/DefaultFlatParamObjectController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/Country.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/CountryPredicate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/GreetingController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/QCountry.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/Album.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/AlbumController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/AlbumModelAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/ComponentsController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/hateoas/ComponentDtoModelAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/dto/DemoComponentDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/dto/converter/DemoComponentConverter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/model/DemoComponent.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/service/ComponentsService.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/OpenAPIConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/SpringRestConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/WebMvcConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/exception/BadArgumentException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/exception/BusinessException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/model/ExceptionDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/utils/Converter.java rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app10.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app11.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app12.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app13.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app14.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app15.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app16.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app17.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app18.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app19.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app20.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app21.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app22.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app23.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app24.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app25.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app26.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app27.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app28.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app29.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app3.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app30.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app301.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app31.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app32.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app33.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app34.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app35.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app36.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app37.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app38.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app4.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app5.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app6.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app7.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app8.json (100%) rename springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/{ => 3.0.1}/app9.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app10.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app11.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app12.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app13.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app14.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app15.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app16.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app17.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app18.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app19.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app20.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app21.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app22.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app23.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app24.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app25.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app26.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app27.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app28.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app29.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app3.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app30.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app301.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app31.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app32.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app33.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app34.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app35.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app36.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app37.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app38.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app4.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app5.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app6.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app7.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app8.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app9.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/app154/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocFunctionTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/app154/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocFunctionTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/app154/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java rename springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/results/{ => 3.0.1}/app154.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/results/3.1.0/app154.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app175/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app175/SpringDocApp175Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/SpringDocApp174Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app175/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app175/SpringDocApp175Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/SpringDocApp174Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app175/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app175/SpringDocApp175Test.java rename springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app174.json (100%) rename springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app175.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.1.0/app174.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.1.0/app175.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/Car.groovy delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/CarController.groovy delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/CarService.groovy delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/OpenApiConfiguration.groovy delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/SpringDocApp1Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/SpringDocApp10Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/SpringDocApp11Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/TestController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/TestRequest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/GlobalExceptionHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/MyException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/SpringDocApp191Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/Car.groovy delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/CarController.groovy delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/CarService.groovy delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/OpenApiConfiguration.groovy delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/SpringDocApp2Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/DeprecatedEntity.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/Car.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/CarController.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/CarService.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/OpenApiConfiguration.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/TestRequest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/GlobalExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/MyException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/SpringDocApp191Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/Car.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/CarController.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/CarService.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/OpenApiConfiguration.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/DeprecatedEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/Car.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/CarController.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/CarService.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/OpenApiConfiguration.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/TestRequest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/GlobalExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/MyException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/SpringDocApp191Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/Car.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/CarController.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/CarService.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/OpenApiConfiguration.groovy create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/DeprecatedEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java rename springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/{ => 3.0.1}/app1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/{ => 3.0.1}/app10.json (100%) rename springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/{ => 3.0.1}/app11.json (100%) rename springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/{ => 3.0.1}/app191.json (100%) rename springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/{ => 3.0.1}/app2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/{ => 3.0.1}/app9.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app10.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app11.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app191.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app9.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/DatabaseLoader.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/Employee.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/EmployeeController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/EmployeeRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/Dummy.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/config/DatabaseConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/controller/PostController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/entities/Post.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/hateoas/PostResourceAssembler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/repositories/PostRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/service/PostService.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/DatabaseLoader.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/Employee.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/SpringDocTestApp.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/Album.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/AlbumController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/AlbumModelAssembler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/controller/CompanyController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/entities/Company.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/entities/CompanyDto.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/hateoas/CompanyModelAssembler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/controller/ItemController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/model/Item.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/FooConfiguration.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/Foo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooResourceAssembler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooService.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/DatabaseLoader.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/Employee.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/EmployeeController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/EmployeeRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/FooConfiguration.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/FooController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/FeedResponse.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/ResponseData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/Dummy.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10DirectTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10NotSpecifiedTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10ViaDtoTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/config/DatabaseConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/controller/PostController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/entities/Post.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/hateoas/PostResourceAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/repositories/PostRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/service/PostService.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/Album.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/AlbumController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/AlbumModelAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/controller/CompanyController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/entities/Company.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/entities/CompanyDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/hateoas/CompanyModelAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/controller/ItemController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/model/Item.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/FooConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooResourceAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooService.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/FooConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/FooController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/dto/FeedResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/dto/ResponseData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/Dummy.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10DirectTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10NotSpecifiedTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10ViaDtoTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/config/DatabaseConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/controller/PostController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/entities/Post.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/hateoas/PostResourceAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/repositories/PostRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/service/PostService.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/Album.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/AlbumController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/AlbumModelAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/controller/CompanyController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/entities/Company.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/entities/CompanyDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/hateoas/CompanyModelAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/controller/ItemController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/model/Item.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/FooConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooResourceAssembler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooService.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/DatabaseLoader.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/Employee.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/EmployeeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/EmployeeRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/FooConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/FooController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/dto/FeedResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/dto/ResponseData.java rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app10-direct.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app10-via_dto.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app3.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app4.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app5.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app6.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app7.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app8.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app9.json (100%) rename springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/{ => 3.0.1}/app9wrong.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app10-direct.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app10-via_dto.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app3.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app4.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app5.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app6.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app7.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app8.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app9.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app9wrong.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiOriginFilter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiResponseMessage.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ErrorMessage.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ExceptionTranslator.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HomeController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemLightDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/SpringDocApp100Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/SpringDocApp101Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/RequestParams.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/TestController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/ExampleBody.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/SpringDocApp103Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/CrudController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/Design.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/DesignController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/HavingPK.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/SpringDocApp104Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/SpringDocApp105Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ApiUtil.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ExceptionTranslator.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/HomeController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegateImpl.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegateImpl.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegateImpl.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Category.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/ModelApiResponse.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Order.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Pet.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Tag.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/User.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/SpringDocApp106Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/SpringDocApp107Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/ActionResult.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/SpringDocApp108Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/SpringDocApp109Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/ErrorMessage.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/GlobalControllerAdvice.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController2.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Problem.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/SpringDocApp110Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/ErrorMessage.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/GlobalControllerAdvice.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController2.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Problem.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/SpringDocApp111Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/ErrorMessage.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/GlobalControllerAdvice.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/PersonController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Problem.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/SpringDocApp112Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/sample/PersonController2.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/SpringDocApp113Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/SpringDocApp114Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/JavaTimeOperationCustomizer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/SpringDocApp115Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/FooErrorHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/SpringDocApp116Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/HelloApplication.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/SpringDocApp117Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/AbstractParent.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/ConcreteParent.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/Controller.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/SpringDocApp118Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/JsonRequest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/SpringDocApp119Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/AccountId.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/SpringDocApp120Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/InheritedRequestParams.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/RequestParams.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/SpringDocApp121Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/TestController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseObject.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/CustomerDto.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/FirstController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/SpringDocApp122Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/Wrapper.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/MyExceptionHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/SpringDocApp123Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/MyExceptionHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/SpringDocApp124Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/DeprecatedEntity.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/SpringDocApp125Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/Problem.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SpringDocApp126Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/AbstractObject.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteObjectA.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteType.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Controller.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/SpringDocApp127Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Umbrella.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/ActualReturnedEntity.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/OperationResponse.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/SpringDocApp129Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/SpringDocApp130Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/TrackerData.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/Organization.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/RestControllerError.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/SpringDocApp131Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/Organization.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/RestControllerError.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/SpringDocApp132Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/SpringDocApp133Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/OpenApiConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/SpringDocApp134Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/Book.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRouter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/SpringDocApp135Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/OpenApiConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/SpringDocApp137Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/SpringDocApp138Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/SpringDocApp139Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/HelloApplication.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/SpringDocApp140Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/Book.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRepository.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRouter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/SpringDocApp141Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/HelloApplication.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/SpringDocApp142Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloMessage.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderState.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderStateMapper.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/TestController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/OpenApiConfiguration.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractIntParameterObject.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractParameterObject.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteEnum.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteIntParameterObject.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteParameterObject.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/SpringDocApp155Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SomeEnum.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SpringDocApp156Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/User.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Bar.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Foo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/SpringDocApp157Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/StringyConverter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/CommonFooErrorHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/ErrorDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SimpleDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpecificFooErrorHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpringDocApp158Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/CustomException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooBean.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooErrorHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/SpringDocApp159Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/Views.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/SpringDocApp160Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/SpringDocApp161Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/exception/NoResultException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/exception/NonUniqueResultException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/dto/JavadocOnlyRestDto.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/exception/NoResultException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/exception/NonUniqueResultException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocJavadocProviderTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/exception/NoResultException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/exception/NonUniqueResultException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/ConcreteSubclassFromGeneric.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/MyData.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleGeneric.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerClass.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerInnerClass.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleOuterClass.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SpringDocApp166Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/SpringDocApp167Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/DescriptionFieldInRequestBodyIsNullController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/SpringDocApp168Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/RecordController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SimpleInnerClass.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SimpleOuterClass.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SpringDocApp169Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Animal.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/BasicController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Cat.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Dog.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/SpringDocApp170Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonProjection.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/SpringDocApp171Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/Example.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/ExampleController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/SpringDocApp173Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Question.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ApiUtil.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ExceptionTranslator.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/HomeController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegateImpl.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegateImpl.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegate.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegateImpl.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Category.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/ModelApiResponse.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Order.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Pet.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Tag.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/User.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocTestApp.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Bar.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Foo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/MyModel.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Advice.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Bar.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Foo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/MyException.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/TrackerData.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PlayingCard.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/MyExceptionHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Bar.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Car.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Foo.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Pet.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/TrackerData.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/SpringDocApp40Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp411Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp41Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/SpringDocApp42Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/TweetId.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/SpringDocApp43Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/SpringDocApp44Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController2.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/OpenApiConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/SpringDocApp45Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/SpringDocApp46Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/SpringDocApp47Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/AbstractHelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/SpringDocApp48Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocApp49Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocTestApp.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/CustomOpenAPIConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceCustomConfigurationTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceNoConfigurationTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocApp50Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocTestApp.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/SpringDocApp51Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/SpringDocApp52Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloControllerWithGlobalApiResponse.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/SpringDocApp53Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/MealParty.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/SpringDocApp54Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/Views.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/SpringDocApp55Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/GlobalExceptionHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/SpringDocApp56Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/SpringDocApp57Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/SpringDocApp58Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/SpringDocApp59Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/QueryPaging.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/QuerySort.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/SpringDocApp60Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/SpringDocApp61Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/BaseController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/SpringDocApp62Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/TestController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/DefaultHealthCheckApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/UndocumentedClass.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedOperation.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedParameter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedProperty.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/OperationCustomizer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/ParameterCustomizer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/PropertyCustomizer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/model/ApiType.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/Dog.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/RestResponseEntityExceptionHandler.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/SpringDocApp77Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/TestObject.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/PersonDTO.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/test/HelloController2.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApi.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApiController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocTestApp.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/User.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Advice.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/ApiError.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Greeting.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/GreetingController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/SpringDocApp91Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/ParameterCustomizer.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/SpringDocApp92Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/BaseClientModel.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/BaseController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificClientModel.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpringDocApp93Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/Greeting.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/SpringDocApp95Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/SpringDocApp96Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/SpringDocApp97Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV1.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV2.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV3.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/IgnoredAnnotationParameter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/SpringDocApp98Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/SpringDocApp99Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiOriginFilter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiResponseMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ErrorMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ExceptionTranslator.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/HomeController.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app1/InventoryApi.java (77%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app1/InventoryApiController.java (75%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app1/InventoryItem.java (82%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemLightDTO.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app1/Manufacturer.java (78%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app1/PeopleRestService.java (83%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/SpringDocApp100Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/HelloDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/SpringDocApp101Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/ExampleBody.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/SpringDocApp103Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/CrudController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/Design.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/DesignController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/HavingPK.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/SpringDocApp104Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/SpringDocApp105Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/ApiUtil.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/ExceptionTranslator.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/HomeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Category.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/ModelApiResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Order.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Tag.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app106/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app106/SpringDocApp106Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app107/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app107/SpringDocApp107Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/ActionResult.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/SpringDocApp108Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app109/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app109/SpringDocApp109Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/ErrorMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/GlobalControllerAdvice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/PersonController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/PersonController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/Problem.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/SpringDocApp110Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/ErrorMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/GlobalControllerAdvice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/PersonController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/PersonController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/Problem.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/SpringDocApp111Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/ErrorMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/GlobalControllerAdvice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/PersonController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/Problem.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/SpringDocApp112Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/sample/PersonController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app113/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app113/SpringDocApp113Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app114/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app114/SpringDocApp114Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/FooErrorHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/SpringDocApp116Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app117/HelloApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app117/SpringDocApp117Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/AbstractParent.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/ConcreteParent.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/Controller.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/SpringDocApp118Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/JsonRequest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/SpringDocApp119Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/AccountId.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app120/MetaAnnotationController.java (88%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/SpringDocApp120Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/InheritedRequestParams.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/RequestParams.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/SpringDocApp121Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/BaseController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/BaseObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/CustomerDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/FirstController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/SpringDocApp122Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/Wrapper.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/MyExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/SpringDocApp123Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/MyExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/SpringDocApp124Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/DeprecatedEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/SpringDocApp125Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/Problem.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app126/SecurityProblemResponsesConfiguration.java (75%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/SpringDocApp126Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/AbstractObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/ConcreteObjectA.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/ConcreteType.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/Controller.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/SpringDocApp127Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/Umbrella.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/ActualReturnedEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/OperationResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/SpringDocApp129Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/SpringDocApp130Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/TrackerData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/Organization.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/RestControllerError.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/SpringDocApp131Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/Organization.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/RestControllerError.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/SpringDocApp132Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app133/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app133/SpringDocApp133Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/SpringDocApp134Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/Book.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/BookRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/BookRouter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/SpringDocApp135Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/SpringDocApp137Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app138/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app138/SpringDocApp138Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app139/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app139/SpringDocApp139Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app140/HelloApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app140/SpringDocApp140Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/Book.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/BookRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/BookRouter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/SpringDocApp141Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app142/HelloApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app142/SpringDocApp142Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app150/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app151/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/OrderState.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/OrderStateMapper.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/OpenApiConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/AbstractIntParameterObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/AbstractParameterObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteEnum.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteIntParameterObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteParameterObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/SpringDocApp155Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/SomeEnum.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/SpringDocApp156Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/Bar.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/SpringDocApp157Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/StringyConverter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/CommonFooErrorHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/ErrorDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SimpleDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SpecificFooErrorHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SpringDocApp158Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/CustomException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/FooBean.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/FooErrorHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/SpringDocApp159Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/Views.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app16/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app160/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app160/SpringDocApp160Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app161/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app161/SpringDocApp161Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/SpringDocApp162Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/exception/NoResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/exception/NonUniqueResultException.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app162/rest/JavadocOnlyRestController.java (76%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/dto/JavadocOnlyRestDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/util/RestExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/SpringDocApp163Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/exception/NoResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/exception/NonUniqueResultException.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app163/rest/AnnotationOverrideForJavadocRestController.java (78%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/util/RestExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/SpringDocApp164Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/SpringDocJavadocProviderTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/exception/NoResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/exception/NonUniqueResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/rest/NoGenericOverrideRestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/rest/util/RestExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/ConcreteSubclassFromGeneric.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/MyData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleGeneric.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleInnerClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleInnerInnerClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleOuterClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SpringDocApp166Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app167/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app167/SpringDocApp167Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/DescriptionFieldInRequestBodyIsNullController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/SpringDocApp168Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/RecordController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SimpleInnerClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SimpleOuterClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SpringDocApp169Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app17/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Animal.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/BasicController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Cat.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Dog.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/SpringDocApp170Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/PersonProjection.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/SpringDocApp171Test.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app172/JavadocPropertyCustomizerTest.java (82%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/Example.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/ExampleController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/SpringDocApp173Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/ExampleController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/Question.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/SpringDocApp174Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/TestQuestion.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/TextQuestion.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app19/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/ApiUtil.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/ExceptionTranslator.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/HomeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Category.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/ModelApiResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Order.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Tag.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app20/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app23/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app25/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/Bar.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/MyModel.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Advice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Bar.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/MyException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/TrackerData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/PlayingCard.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/MyExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app35/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Bar.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Car.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app38/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/TrackerData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app40/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app40/SpringDocApp40Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp411Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp41Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/SpringDocApp42Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/TweetId.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app43/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app43/SpringDocApp43Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app44/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app44/SpringDocApp44Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/HelloController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/SpringDocApp45Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app46/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app46/SpringDocApp46Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app47/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app47/SpringDocApp47Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/AbstractHelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/SpringDocApp48Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/SpringDocApp49Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/CustomOpenAPIConfig.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java (84%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceCustomConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceNoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/SpringDocApp50Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app51/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app51/SpringDocApp51Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app52/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app52/SpringDocApp52Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/HelloControllerWithGlobalApiResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/SpringDocApp53Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/MealParty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/SpringDocApp54Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/Views.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app55/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app55/SpringDocApp55Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/GlobalExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/SpringDocApp56Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app57/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app57/SpringDocApp57Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app58/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app58/SpringDocApp58Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app59/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app59/SpringDocApp59Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app6/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/QueryPaging.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/QuerySort.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/SpringDocApp60Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app61/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app61/SpringDocApp61Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/BaseController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/SpringDocApp62Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/DefaultHealthCheckApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/UndocumentedClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedOperation.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedParameter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedProperty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/OperationCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/ParameterCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/PropertyCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/model/ApiType.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/Dog.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app73/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app74/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/RestResponseEntityExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app77/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app77/SpringDocApp77Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app79/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app8/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/TestObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app81/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app84/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app85/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/test/HelloController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app87/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app88/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app89/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/MyApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/MyApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/Advice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/ApiError.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/Greeting.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/GreetingController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/SpringDocApp91Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/ParameterCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/SpringDocApp92Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/BaseClientModel.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/BaseController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpecificClientModel.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpecificController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpringDocApp93Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app94/Greeting.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/{ => v30}/app94/SpringDocApp94Test.java (86%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app95/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app95/SpringDocApp95Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app96/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app96/SpringDocApp96Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/SpringDocApp97Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV1.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV3.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/IgnoredAnnotationParameter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/SpringDocApp98Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app99/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app99/SpringDocApp99Test.java rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app10.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app100.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app101.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app102.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app103.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app104.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app105-1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app105-2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app105-3.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app105-4.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app106.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app107.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app108.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app109.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app11.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app110.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app111.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app112.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app113.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app114.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app115.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app116.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app117.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app118.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app119.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app12.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app120.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app121.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app122.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app123.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app124.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app125.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app126.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app129.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app13.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app130.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app131.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app132.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app133.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app134-1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app134-2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app134-3.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app134-4.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app134-5.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app135.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app137.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app138.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app139.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app14.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app140.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app141.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app142.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app149.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app15.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app150.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app151.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app152.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app153.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app154.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app155.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app156.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app157.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app158.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app159.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app160.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app161.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app162.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app163.json rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app164.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app166.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app167.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app168.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app169.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app17.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app170.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app171.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app173.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app174.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app18.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app19.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app20.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app21.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app22.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app23.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app24.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app25.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app26.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app27.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app28.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app29.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app3.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app30.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app31.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app32.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app33.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app34.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app35.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app37.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app38.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app39.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app4.json rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app40.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app41.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app42.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app43.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app44.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app45.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app46.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app47.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app48.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app49.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app50.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app51.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app52.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app53.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app54.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app55.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app56.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app57.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app58.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app59.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app6.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app60.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app61.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app62.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app63.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app64.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app65.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app66.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app67.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app69.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app7.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app70.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app71.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app73.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app74.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app75.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app76.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app77.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app78.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app79.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app8.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app80.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app82.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app83.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app84.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app85.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app86.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app87.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app88.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app89.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app9.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app90.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app91.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app92.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app93.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app94.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app95.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app96.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app97.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app98.json (100%) rename springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/{ => 3.0.1}/app99.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app10.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app100.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app101.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app102.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app103.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app104.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-3.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-4.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app106.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app107.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app108.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app109.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app11.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app110.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app111.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app112.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app113.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app114.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app115.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app116.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app117.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app118.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app119.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app12.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app120.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app121.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app122.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app123.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app124.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app125.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app126.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app129.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app13.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app130.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app131.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app132.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app133.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-3.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-4.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-5.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app135.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app137.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app138.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app139.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app14.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app140.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app141.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app142.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app149.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app15.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app150.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app151.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app152.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app153.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app154.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app155.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app156.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app157.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app158.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app159.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app160.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app161.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app162.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app163.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app164.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app166.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app167.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app168.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app169.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app17.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app170.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app171.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app173.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app174.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app18.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app19.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app20.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app21.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app22.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app23.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app24.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app25.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app26.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app27.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app28.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app29.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app3.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app30.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app31.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app32.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app33.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app34.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app35.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app37.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app38.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app39.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app4.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app40.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app41.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app42.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app43.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app44.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app45.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app46.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app47.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app48.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app49.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app50.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app51.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app52.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app53.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app54.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app55.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app56.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app57.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app58.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app59.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app6.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app60.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app61.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app62.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app63.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app64.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app65.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app66.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app67.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app69.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app7.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app70.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app71.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app73.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app74.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app75.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app76.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app77.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app78.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app79.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app8.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app80.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app82.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app83.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app84.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app85.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app86.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app87.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app88.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app89.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app9.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app90.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app91.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app92.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app93.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app94.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app95.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app96.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app97.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app98.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app99.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app162.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app163.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app4.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/ControllerWithContinuationParameter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/SpringDocTestApp.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/ControllerWithContinuationParameter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/ControllerWithContinuationParameter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app10/ExampleController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app10/SpringDocApp10Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SpringDocApp2Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app3/SpringDocApp3Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app3/SystemStatusController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app4/HelloController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app4/SpringDocApp4Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app5/HelloController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app5/SpringDocApp5Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/SpringDocApp6Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app7/ExampleController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app7/SpringDocApp7Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app8/ExampleController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app8/SpringDocApp8Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app9/DemoController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app9/SpringDocApp9Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/AbstractKotlinSpringDocTest.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/SpringDocApp10Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SpringDocApp11Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SpringDocApp2Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SpringDocApp3Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/HelloController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/SpringDocApp4Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/HelloController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/SpringDocApp5Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/ByteArrayController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/SpringDocApp6Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/SpringDocApp7Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/SpringDocApp8Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/DemoController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/SpringDocApp9Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocTest.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/HelloController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/HelloController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/ByteArrayController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/DemoController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app10.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app11.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app21.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app3.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app4.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app5.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app6.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app7.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app8.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/{ => 3.0.1}/app9.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app10.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app11.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app21.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app3.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app4.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app5.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app6.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app7.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app8.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app9.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocMVCTest.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app10/ExampleController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app10/SpringDocApp10Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/ExampleController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/TestController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app2/SpringDocApp2Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app3/SpringDocApp3Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app3/SystemStatusController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app4/HelloController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app4/SpringDocApp4Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app5/ListController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app5/SpringDocApp5Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/SpringDocApp6Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app7/ExampleController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app7/SpringDocApp7Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app8/ExampleController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app8/SpringDocApp8Test.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app9/DemoController.kt delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app9/SpringDocApp9Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/AbstractKotlinSpringDocMVCTest.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/SpringDocApp10Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SpringDocApp11Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app13/SpringDocApp13Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app13/TestController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app14/SpringDocApp14Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app14/TestController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SpringDocApp2Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SpringDocApp3Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/HelloController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/SpringDocApp4Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/ListController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/SpringDocApp5Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/ByteArrayController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/SpringDocApp6Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/SpringDocApp7Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/SpringDocApp8Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/DemoController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/SpringDocApp9Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/SpringDocApp13Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/TestController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/SpringDocApp14Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/TestController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SystemStatusController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/HelloController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/ListController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/ByteArrayController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/ExampleController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/DemoController.kt create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app10.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app11.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app12.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app13.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app14.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app3.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app4.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app5.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app6.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app7.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app8.json (100%) rename springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/{ => 3.0.1}/app9.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app10.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app11.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app12.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app13.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app14.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app3.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app4.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app5.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app6.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app7.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app8.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app9.json delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/AuthorizationServerConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/Jwks.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/KeyGeneratorUtils.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/AuthorizationServerConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/Jwks.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/KeyGeneratorUtils.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/AuthorizationServerConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/Jwks.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/KeyGeneratorUtils.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/User.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app3/SpringOauth2Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/Sample.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/SpringDocConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/controllers/MyController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/JWTAuthenticationFilter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/JWTAuthorizationFilter.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/MyUserDetailsService.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/WebSecurity.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/AnotherPerson.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/CurrentUser.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/Person.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/TheOtherPerson.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app8/security/WebConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/WebConfig.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/configuration/SecurityConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/AuthorizationServerConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/Jwks.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/KeyGeneratorUtils.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/AuthorizationServerConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/Jwks.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/KeyGeneratorUtils.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/AuthorizationServerConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/Jwks.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/KeyGeneratorUtils.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringOauth2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/Sample.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/controllers/MyController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/JWTAuthenticationFilter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/JWTAuthorizationFilter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/MyUserDetailsService.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/WebSecurity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/AnotherPerson.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/CurrentUser.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/TheOtherPerson.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app8/security/WebConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app9/WebConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/configuration/SecurityConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/AuthorizationServerConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/Jwks.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/KeyGeneratorUtils.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/AuthorizationServerConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/Jwks.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/KeyGeneratorUtils.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/AuthorizationServerConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/Jwks.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/KeyGeneratorUtils.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringOauth2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/Sample.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/controllers/MyController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/JWTAuthenticationFilter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/JWTAuthorizationFilter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/MyUserDetailsService.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/WebSecurity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/AnotherPerson.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/CurrentUser.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/TheOtherPerson.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app8/security/WebConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app9/WebConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/configuration/SecurityConfiguration.java rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app1.json (100%) rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app10.json (100%) rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app11.json (100%) rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app12.json (100%) rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app2.json (100%) rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app5.json (100%) rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app6.json (100%) rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app7.json (100%) rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app8.json (100%) rename springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/{ => 3.0.1}/app9.json (100%) create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app1.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app10.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app11.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app12.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app2.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app5.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app6.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app7.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app8.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app9.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index d69abcb72..4c39763c9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ @@ -52,6 +52,7 @@ import org.springdoc.core.converters.AdditionalModelsConverter; import org.springdoc.core.converters.FileSupportConverter; import org.springdoc.core.converters.ModelConverterRegistrar; +import org.springdoc.core.converters.OAS31ModelConverter; import org.springdoc.core.converters.PolymorphicModelConverter; import org.springdoc.core.converters.PropertyCustomizingConverter; import org.springdoc.core.converters.ResponseSupportConverter; @@ -597,14 +598,14 @@ public SpringDocCustomizers springDocCustomizers(Optional Optional> operationCustomizers, Optional> routerOperationCustomizers, Optional> dataRestRouterOperationCustomizers, - Optional> methodFilters, Optional> globalOpenApiCustomizers, + Optional> methodFilters, Optional> globalOpenApiCustomizers, Optional> globalOperationCustomizers, - Optional> globalOpenApiMethodFilters){ + Optional> globalOpenApiMethodFilters) { return new SpringDocCustomizers(openApiCustomizers, operationCustomizers, - routerOperationCustomizers, - dataRestRouterOperationCustomizers, - methodFilters, globalOpenApiCustomizers, globalOperationCustomizers, globalOpenApiMethodFilters); + routerOperationCustomizers, + dataRestRouterOperationCustomizers, + methodFilters, globalOpenApiCustomizers, globalOperationCustomizers, globalOpenApiMethodFilters); } /** @@ -658,4 +659,17 @@ ParameterObjectNamingStrategyCustomizer parameterObjectNamingStrategyCustomizer( GlobalOpenApiCustomizer globalOpenApiCustomizer() { return new OperationIdCustomizer(); } + + /** + * Oas 31 model converter oas 31 model converter. + * + * @param springDocConfigProperties the spring doc config properties + * @return the oas 31 model converter + */ + @Bean + @ConditionalOnMissingBean + @Lazy(false) + OAS31ModelConverter oas31ModelConverter(SpringDocConfigProperties springDocConfigProperties) { + return springDocConfigProperties.isOpenapi31() ? new OAS31ModelConverter() : null; + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java index f84cdbffd..5c35852ba 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java @@ -31,7 +31,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import org.springdoc.core.converters.CollectionModelContentConverter; -import org.springdoc.core.converters.RepresentationModelLinksOASMixin; +import org.springdoc.core.converters.HateoasLinksConverter; import org.springdoc.core.customizers.GlobalOpenApiCustomizer; import org.springdoc.core.customizers.OpenApiHateoasLinksCustomizer; import org.springdoc.core.properties.SpringDocConfigProperties; @@ -49,7 +49,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; import org.springframework.hateoas.Links; -import org.springframework.hateoas.RepresentationModel; import org.springframework.hateoas.server.LinkRelationProvider; /** @@ -99,20 +98,32 @@ CollectionModelContentConverter collectionModelContentConverter(HateoasHalProvid * * @param halProvider the hal provider * @param springDocConfigProperties the spring doc config properties - * @param objectMapperProvider the object mapper provider * @return the open api customizer - * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) + * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) */ @Bean(Constants.LINKS_SCHEMA_CUSTOMISER) @ConditionalOnMissingBean(name = Constants.LINKS_SCHEMA_CUSTOMISER) @Lazy(false) - GlobalOpenApiCustomizer linksSchemaCustomizer(HateoasHalProvider halProvider, SpringDocConfigProperties springDocConfigProperties, - ObjectMapperProvider objectMapperProvider) { + GlobalOpenApiCustomizer linksSchemaCustomizer(HateoasHalProvider halProvider, SpringDocConfigProperties springDocConfigProperties) { if (!halProvider.isHalEnabled()) { return openApi -> { }; } - objectMapperProvider.jsonMapper().addMixIn(RepresentationModel.class, RepresentationModelLinksOASMixin.class); return new OpenApiHateoasLinksCustomizer(springDocConfigProperties); } + + /** + * Hateoas links converter hateoas links converter. + * + * @param springDocObjectMapper the spring doc object mapper + * @return the hateoas links converter + */ + @Bean + @ConditionalOnMissingBean + @Lazy(false) + HateoasLinksConverter hateoasLinksConverter(ObjectMapperProvider springDocObjectMapper) { + return new HateoasLinksConverter(springDocObjectMapper) ; + } + + } \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java index a3fd6ab3b..7c7a34f6d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java @@ -41,6 +41,8 @@ import org.slf4j.LoggerFactory; import org.springdoc.core.providers.ObjectMapperProvider; +import static org.springdoc.core.utils.SpringDocUtils.handleSchemaTypes; + /** * The type Additional models converter. * @@ -146,8 +148,11 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato Class cls = javaType.getRawClass(); if (modelToSchemaMap.containsKey(cls)) try { + Schema schema = modelToSchemaMap.get(cls); + if(springDocObjectMapper.isOpenapi31()) + handleSchemaTypes(schema); return springDocObjectMapper.jsonMapper() - .readValue(springDocObjectMapper.jsonMapper().writeValueAsString(modelToSchemaMap.get(cls)), new TypeReference() {}); + .readValue(springDocObjectMapper.jsonMapper().writeValueAsString(schema), new TypeReference() {}); } catch (JsonProcessingException e) { LOGGER.warn("Json Processing Exception occurred: {}", e.getMessage()); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java new file mode 100644 index 000000000..929115c4e --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java @@ -0,0 +1,92 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package org.springdoc.core.converters; + + +import java.util.Iterator; + +import com.fasterxml.jackson.databind.JavaType; +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverterContext; +import io.swagger.v3.core.util.AnnotationsUtils; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.JsonSchema; +import io.swagger.v3.oas.models.media.Schema; +import org.springdoc.core.providers.ObjectMapperProvider; + +import org.springframework.hateoas.RepresentationModel; + +/** + * The type Hateoas links converter. + * + * @author bnasslahsen + */ +public class HateoasLinksConverter implements ModelConverter { + + /** + * The Spring doc object mapper. + */ + private final ObjectMapperProvider springDocObjectMapper; + + /** + * Instantiates a new Hateoas links converter. + * + * @param springDocObjectMapper the spring doc object mapper + */ + public HateoasLinksConverter(ObjectMapperProvider springDocObjectMapper) { + this.springDocObjectMapper = springDocObjectMapper; + } + + @Override + public Schema resolve( + io.swagger.v3.core.converter.AnnotatedType type, + ModelConverterContext context, + Iterator chain + ) { + JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); + if (javaType != null) { + if (RepresentationModel.class.isAssignableFrom(javaType.getRawClass())) { + Schema schema = chain.next().resolve(type, context, chain); + String schemaName = schema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); + Schema original = context.getDefinedModels().get(schemaName); + Object links = original.getProperties().get("_links"); + if(links instanceof JsonSchema jsonSchema) { + jsonSchema.set$ref(AnnotationsUtils.COMPONENTS_REF + "Links"); + jsonSchema.setType(null); + jsonSchema.setItems(null); + jsonSchema.setTypes(null); + } else if (links instanceof ArraySchema arraySchema){ + arraySchema.set$ref(AnnotationsUtils.COMPONENTS_REF + "Links"); + } + return schema; + } + } + return chain.hasNext() ? chain.next().resolve(type, context, chain) : null; + } + +} diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/OAS31ModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/OAS31ModelConverter.java new file mode 100644 index 000000000..17fbdbbb4 --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/OAS31ModelConverter.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package org.springdoc.core.converters; + +import java.util.Iterator; + +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverterContext; +import io.swagger.v3.oas.models.media.Schema; + +import static org.springdoc.core.utils.SpringDocUtils.handleSchemaTypes; +import static org.springdoc.core.utils.SpringDocUtils.isComposedSchema; + +/** + * The type OAS31 Model converter. + * + * @author bnasslahsen + */ +public class OAS31ModelConverter implements ModelConverter { + + @Override + public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator chain) { + if (chain.hasNext()) { + Schema resolvedSchema = chain.next().resolve(type, context, chain); + if (resolvedSchema != null && !isComposedSchema(resolvedSchema)) { + handleSchemaTypes(resolvedSchema); + } + return resolvedSchema; + } + return null; + } + +} diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java index 281c6efb3..34e7e7f3a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java @@ -35,12 +35,13 @@ import io.swagger.v3.core.converter.ModelConverter; import io.swagger.v3.core.converter.ModelConverterContext; import io.swagger.v3.oas.models.media.Schema; -import org.apache.commons.lang3.StringUtils; import org.springdoc.core.providers.ObjectMapperProvider; import org.springframework.core.ResolvableType; import org.springframework.data.web.PagedModel; +import static org.springdoc.core.utils.SpringDocUtils.getParentTypeName; + /** * The Spring Data Page type model converter. * @@ -95,7 +96,7 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if (!type.isSchemaProperty()) type = resolvePagedModelType(type); else - type.name(cls.getSimpleName() + StringUtils.capitalize(type.getParent().getType())); + type.name(getParentTypeName(type, cls)); } } return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java index 0e2864c88..0bae9272a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageableOpenAPIConverter.java @@ -33,10 +33,11 @@ import io.swagger.v3.core.converter.ModelConverter; import io.swagger.v3.core.converter.ModelConverterContext; import io.swagger.v3.oas.models.media.Schema; -import org.apache.commons.lang3.StringUtils; import org.springdoc.core.converters.models.Pageable; import org.springdoc.core.providers.ObjectMapperProvider; +import static org.springdoc.core.utils.SpringDocUtils.getParentTypeName; + /** * The Pageable Type models converter. * @@ -90,7 +91,7 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if (!type.isSchemaProperty()) type = PAGEABLE; else - type.name(cls.getSimpleName() + StringUtils.capitalize(type.getParent().getType())); + type.name(getParentTypeName(type, cls)); } } return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 338db8cde..2a8b57b41 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.converters; @@ -64,6 +64,11 @@ public class PolymorphicModelConverter implements ModelConverter { */ private static final List PARENT_TYPES_TO_IGNORE = Collections.synchronizedList(new ArrayList<>()); + /** + * The constant PARENT_TYPES_TO_IGNORE. + */ + private static final List TYPES_TO_SKIP = Collections.synchronizedList(new ArrayList<>()); + static { PARENT_TYPES_TO_IGNORE.add("JsonSchema"); PARENT_TYPES_TO_IGNORE.add("Pageable"); @@ -115,6 +120,9 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if (field.isAnnotationPresent(JsonUnwrapped.class)) { PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); } + else if (field.isAnnotationPresent(io.swagger.v3.oas.annotations.media.Schema.class)) { + TYPES_TO_SKIP.add(field.getType().getSimpleName()); + } } if (chain.hasNext()) { if (!type.isResolveAsRef() && type.getParent() != null @@ -149,12 +157,13 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato private Schema composePolymorphicSchema(AnnotatedType type, Schema schema, Collection schemas) { String ref = schema.get$ref(); List composedSchemas = findComposedSchemas(ref, schemas); - if (composedSchemas.isEmpty()) return schema; - ComposedSchema result = new ComposedSchema(); if (isConcreteClass(type)) result.addOneOfItem(schema); - composedSchemas.forEach(result::addOneOfItem); + JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); + Class clazz = javaType.getRawClass(); + if(TYPES_TO_SKIP.stream().noneMatch(typeToSkip -> typeToSkip.equals(clazz.getSimpleName()))) + composedSchemas.forEach(result::addOneOfItem); return result; } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java deleted file mode 100644 index 0d0fe462c..000000000 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/RepresentationModelLinksOASMixin.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * - * * * * * * Copyright 2019-2025 the original author or authors. - * * * * * * - * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * * you may not use this file except in compliance with the License. - * * * * * * You may obtain a copy of the License at - * * * * * * - * * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * * - * * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * * See the License for the specific language governing permissions and - * * * * * * limitations under the License. - * * * * * - * * * * - * * * - * * - * - */ - -package org.springdoc.core.converters; - -import io.swagger.v3.core.util.AnnotationsUtils; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.hateoas.Links; -import org.springframework.hateoas.mediatype.hal.RepresentationModelMixin; - -/** - * The type Representation model links oas mixin. - * - * @author bnasslahsen - */ -public abstract class RepresentationModelLinksOASMixin extends RepresentationModelMixin { - @Override - @Schema(ref = AnnotationsUtils.COMPONENTS_REF + "Links") - public abstract Links getLinks(); -} diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java index 875bba99c..3b2b77929 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/SortOpenAPIConverter.java @@ -33,10 +33,11 @@ import io.swagger.v3.core.converter.ModelConverter; import io.swagger.v3.core.converter.ModelConverterContext; import io.swagger.v3.oas.models.media.Schema; -import org.apache.commons.lang3.StringUtils; import org.springdoc.core.converters.models.Sort; import org.springdoc.core.providers.ObjectMapperProvider; +import static org.springdoc.core.utils.SpringDocUtils.getParentTypeName; + /** * The Spring Data Sort type model converter. * @@ -85,7 +86,7 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if (!type.isSchemaProperty()) type = SORT; else - type.name(cls.getSimpleName() + StringUtils.capitalize(type.getParent().getType())); + type.name(getParentTypeName(type, cls)); } } return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java index 73eed5e8b..df37c2b43 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java @@ -54,6 +54,7 @@ import org.springframework.web.method.HandlerMethod; import static org.springdoc.core.providers.ActuatorProvider.getTag; +import static org.springdoc.core.utils.SpringDocUtils.handleSchemaTypes; /** * The type Actuator operation customizer. @@ -240,7 +241,9 @@ private Parameter getParameterFromField(OperationParameter operationParameter) { * @return the schema */ private Schema resolveSchema(Parameter parameter) { - return AnnotationsUtils.resolveSchemaFromType(parameter.getType(), null, null, springDocConfigProperties.isOpenapi31()); + Schema schema = AnnotationsUtils.resolveSchemaFromType(parameter.getType(), null, null, springDocConfigProperties.isOpenapi31()); + if(springDocConfigProperties.isOpenapi31()) handleSchemaTypes(schema); + return schema; } /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java index 028725dcd..c3cae9d1e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/OpenApiHateoasLinksCustomizer.java @@ -33,7 +33,7 @@ import io.swagger.v3.core.util.AnnotationsUtils; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.MapSchema; -import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import org.springdoc.core.properties.SpringDocConfigProperties; @@ -68,7 +68,7 @@ public void customise(OpenAPI openApi) { .schema("Link", resolvedLinkSchema.schema) .schema("Links", new MapSchema() .additionalProperties(new StringSchema()) - .additionalProperties(new ObjectSchema().$ref(AnnotationsUtils.COMPONENTS_REF + "Link"))); + .additionalProperties(new Schema<>().$ref(AnnotationsUtils.COMPONENTS_REF + "Link"))); if (springDocConfigProperties.isRemoveBrokenReferenceDefinitions()) this.removeBrokenReferenceDefinitions(openApi); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java index bdc8dd369..8c7b53311 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedOpenAPIMixin31.java @@ -42,7 +42,7 @@ * * @author bnasslashen */ -@JsonPropertyOrder(value = { "openapi", "info", "externalDocs", "servers", "security", "tags", "paths", "components", "webhooks" }, alphabetic = true) +@JsonPropertyOrder(value = {"openapi", "info", "externalDocs", "servers", "security", "tags", "paths", "components", "webhooks"}, alphabetic = true) public interface SortedOpenAPIMixin31 { /** @@ -71,5 +71,4 @@ public interface SortedOpenAPIMixin31 { */ @JsonSerialize(using = PathsSerializer.class) Paths getPaths(); - } \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java index 55595e81c..a7f820a71 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/mixins/SortedSchemaMixin31.java @@ -36,13 +36,15 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.v3.core.jackson.mixin.Schema31Mixin; /** * The interface Sorted schema mixin 31. * * @author bnasslashen */ -@JsonPropertyOrder(value = { "type", "format" }, alphabetic = true) +@JsonPropertyOrder(value = {"type", "format", "if", "then", "else"}, alphabetic = true) public interface SortedSchemaMixin31 { /** @@ -116,6 +118,7 @@ public interface SortedSchemaMixin31 { * @return the types */ @JsonProperty("type") + @JsonSerialize(using = Schema31Mixin.TypeSerializer.class) Set getTypes(); /** @@ -140,7 +143,7 @@ public interface SortedSchemaMixin31 { * * @return the example */ - @JsonInclude(JsonInclude.Include.CUSTOM) + @JsonInclude(value = JsonInclude.Include.NON_NULL) Object getExample(); /** @@ -151,4 +154,12 @@ public interface SortedSchemaMixin31 { @JsonIgnore Object getJsonSchemaImpl(); + /** + * Gets boolean schema value. + * + * @return the boolean schema value + */ + @JsonIgnore + Boolean getBooleanSchemaValue(); + } \ No newline at end of file diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java index f5823daf3..1b5f8eeb9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java @@ -58,12 +58,18 @@ public class ObjectMapperProvider extends ObjectMapperFactory { */ private final ObjectMapper yamlMapper; + /** + * The Spring doc config properties. + */ + private final SpringDocConfigProperties springDocConfigProperties; + /** * Instantiates a new Spring doc object mapper. * * @param springDocConfigProperties the spring doc config properties */ public ObjectMapperProvider(SpringDocConfigProperties springDocConfigProperties) { + this.springDocConfigProperties = springDocConfigProperties; OpenApiVersion openApiVersion = springDocConfigProperties.getApiDocs().getVersion(); if (openApiVersion == OpenApiVersion.OPENAPI_3_1) { jsonMapper = Json31.mapper(); @@ -132,4 +138,12 @@ public ObjectMapper yamlMapper() { return yamlMapper; } + /** + * Is openapi 31 boolean. + * + * @return the boolean + */ + public boolean isOpenapi31() { + return springDocConfigProperties.isOpenapi31(); + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 442344d87..c0a19ed07 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -302,7 +302,7 @@ public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, for (MethodParameter methodParameter : parameters) { // check if query param - Parameter parameter = null; + Parameter parameter; io.swagger.v3.oas.annotations.Parameter parameterDoc = AnnotatedElementUtils.findMergedAnnotation( AnnotatedElementUtils.forAnnotations(methodParameter.getParameterAnnotations()), io.swagger.v3.oas.annotations.Parameter.class); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index f605afa41..f29c91198 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -53,7 +53,6 @@ import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.examples.Example; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Content; import io.swagger.v3.oas.models.media.FileSchema; import io.swagger.v3.oas.models.media.ObjectSchema; @@ -74,6 +73,7 @@ import org.springdoc.core.utils.Constants; import org.springdoc.core.utils.PropertyResolverUtils; import org.springdoc.core.utils.SpringDocAnnotationsUtils; +import org.springdoc.core.utils.SpringDocUtils; import org.springframework.beans.factory.config.BeanExpressionContext; import org.springframework.beans.factory.config.BeanExpressionResolver; @@ -89,6 +89,7 @@ import static org.springdoc.core.utils.Constants.DOT; import static org.springdoc.core.utils.SpringDocUtils.getParameterAnnotations; +import static org.springdoc.core.utils.SpringDocUtils.handleSchemaTypes; /** * The type Generic parameter builder. @@ -299,6 +300,8 @@ public Parameter buildParameterFromDoc(io.swagger.v3.oas.annotations.Parameter p if (parameterDoc.content().length > 0) { Optional optionalContent = AnnotationsUtils.getContent(parameterDoc.content(), null, null, null, components, jsonView, propertyResolverUtils.isOpenapi31()); + if (propertyResolverUtils.isOpenapi31()) + optionalContent.ifPresent(SpringDocUtils::handleSchemaTypes); optionalContent.ifPresent(parameter::setContent); } else @@ -350,6 +353,8 @@ private void setSchema(io.swagger.v3.oas.annotations.Parameter parameterDoc, Com schema.setDefault(defaultValue); } } + if (isOpenapi31()) + handleSchemaTypes(schema); parameter.setSchema(schema); } } @@ -427,7 +432,7 @@ private Schema calculateRequestBodySchema(Components components, ParameterInfo p requestBodyInfo.getMergedSchema().addProperty(paramName, schemaN); schemaN = requestBodyInfo.getMergedSchema(); } - else if (parameterInfo.isRequestPart() || schemaN instanceof FileSchema || schemaN instanceof ArraySchema && ((ArraySchema) schemaN).getItems() instanceof FileSchema) { + else if (parameterInfo.isRequestPart() || schemaN instanceof FileSchema || (schemaN!=null && schemaN.getItems() instanceof FileSchema)) { schemaN = new ObjectSchema().addProperty(paramName, schemaN); requestBodyInfo.setMergedSchema(schemaN); } @@ -470,7 +475,7 @@ private void setExamples(io.swagger.v3.oas.annotations.Parameter parameterDoc, P * @param parameter the parameter * @param locale the locale */ - private void setExtensions(io.swagger.v3.oas.annotations.Parameter parameterDoc, Parameter parameter, Locale locale) { + private void setExtensions(io.swagger.v3.oas.annotations.Parameter parameterDoc, Parameter parameter, Locale locale) { if (parameterDoc.extensions().length > 0) { Map extensionMap = AnnotationsUtils.getExtensions(propertyResolverUtils.isOpenapi31(), parameterDoc.extensions()); if (propertyResolverUtils.isResolveExtensionsProperties()) { @@ -537,7 +542,7 @@ private boolean isExplodable(io.swagger.v3.oas.annotations.Parameter p) { * @return the boolean */ public boolean isFile(MethodParameter methodParameter) { - if (methodParameter.getGenericParameterType() instanceof ParameterizedType ) { + if (methodParameter.getGenericParameterType() instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) methodParameter.getGenericParameterType(); return isFile(parameterizedType); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java index 858238d6c..596e61395 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java @@ -61,7 +61,6 @@ import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.servers.Server; @@ -477,15 +476,14 @@ public Schema resolveProperties(Schema schema, Locale locale) { if (!CollectionUtils.isEmpty(properties)) { LinkedHashMap resolvedSchemas = properties.entrySet().stream().map(es -> { es.setValue(resolveProperties(es.getValue(), locale)); - if (es.getValue() instanceof ArraySchema arraySchema) { - resolveProperties(arraySchema.getItems(), locale); + if (es.getValue().getItems() !=null ) { + resolveProperties(es.getValue().getItems(), locale); } return es; }).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new)); schema.setProperties(resolvedSchemas); } - return schema; } @@ -606,12 +604,14 @@ public Webhooks[] getWebhooks() { * @param locale the locale */ private void buildOpenAPIWithOpenAPIDefinition(OpenAPI openAPI, OpenAPIDefinition apiDef, Locale locale) { + boolean isOpenapi3 = propertyResolverUtils.isOpenapi31(); + Map extensions = AnnotationsUtils.getExtensions(isOpenapi3, apiDef.info().extensions()); // info - AnnotationsUtils.getInfo(apiDef.info(), propertyResolverUtils.isOpenapi31()).map(info -> resolveProperties(info, locale)).ifPresent(openAPI::setInfo); + AnnotationsUtils.getInfo(apiDef.info(),true).map(info -> resolveProperties(info, extensions, locale)).ifPresent(openAPI::setInfo); // OpenApiDefinition security requirements securityParser.getSecurityRequirements(apiDef.security()).ifPresent(openAPI::setSecurity); // OpenApiDefinition external docs - AnnotationsUtils.getExternalDocumentation(apiDef.externalDocs(), propertyResolverUtils.isOpenapi31()).ifPresent(openAPI::setExternalDocs); + AnnotationsUtils.getExternalDocumentation(apiDef.externalDocs(), isOpenapi3).ifPresent(openAPI::setExternalDocs); // OpenApiDefinition tags AnnotationsUtils.getTags(apiDef.tags(), false).ifPresent(tags -> openAPI.setTags(new ArrayList<>(tags))); // OpenApiDefinition servers @@ -623,7 +623,7 @@ private void buildOpenAPIWithOpenAPIDefinition(OpenAPI openAPI, OpenAPIDefinitio ); // OpenApiDefinition extensions if (apiDef.extensions().length > 0) { - openAPI.setExtensions(AnnotationsUtils.getExtensions(propertyResolverUtils.isOpenapi31(), apiDef.extensions())); + openAPI.setExtensions(AnnotationsUtils.getExtensions(isOpenapi3, apiDef.extensions())); } } @@ -647,11 +647,12 @@ private List resolveProperties(List servers, Locale locale) { /** * Resolve properties info. * - * @param info the info - * @param locale the locale + * @param info the info + * @param extensions + * @param locale the locale * @return the info */ - private Info resolveProperties(Info info, Locale locale) { + private Info resolveProperties(Info info, Map extensions, Locale locale) { resolveProperty(info::getTitle, info::title, propertyResolverUtils, locale); resolveProperty(info::getDescription, info::description, propertyResolverUtils, locale); resolveProperty(info::getVersion, info::version, propertyResolverUtils, locale); @@ -670,9 +671,12 @@ private Info resolveProperties(Info info, Locale locale) { resolveProperty(contact::getUrl, contact::url, propertyResolverUtils, locale); } - if (propertyResolverUtils.isResolveExtensionsProperties()) { - Map extensionsResolved = propertyResolverUtils.resolveExtensions(locale, info.getExtensions()); - info.setExtensions(extensionsResolved); + if (propertyResolverUtils.isResolveExtensionsProperties() && extensions != null) { + Map extensionsResolved = propertyResolverUtils.resolveExtensions(locale, extensions); + if(propertyResolverUtils.isOpenapi31()) + extensionsResolved.forEach(info::addExtension31); + else + info.setExtensions(extensionsResolved); } return info; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java index faed6bba9..d9b151cb5 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java @@ -57,6 +57,7 @@ import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Content; import io.swagger.v3.oas.models.media.MediaType; +import io.swagger.v3.oas.models.media.ObjectSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import org.apache.commons.lang3.ArrayUtils; @@ -69,6 +70,8 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.RequestAttribute; +import static org.springdoc.core.utils.SpringDocUtils.handleSchemaTypes; + /** * The type Spring doc annotations utils. * @@ -131,7 +134,8 @@ public static Schema extractSchema(Components components, Type returnType, JsonV try { resolvedSchema = ModelConverters.getInstance(openapi31) .resolveAsResolvedSchema( - new AnnotatedType(returnType).resolveAsRef(true).jsonViewAnnotation(jsonView).ctxAnnotations(annotations)); + new AnnotatedType(returnType) + .resolveAsRef(true).jsonViewAnnotation(jsonView).ctxAnnotations(annotations)); } catch (Exception e) { LOGGER.warn(Constants.GRACEFUL_EXCEPTION_OCCURRED, e); @@ -168,13 +172,16 @@ else if (componentSchemas.containsKey(entry.getKey()) && schemaMap.containsKey(e components.setSchemas(componentSchemas); } if (resolvedSchema.schema != null) { - schemaN = new Schema(); + schemaN = new Schema(specVersion); if (StringUtils.isNotBlank(resolvedSchema.schema.getName())) schemaN.set$ref(COMPONENTS_REF + resolvedSchema.schema.getName()); else schemaN = resolvedSchema.schema; } } + if(openapi31) + handleSchemaTypes(schemaN); + return schemaN; } @@ -215,9 +222,10 @@ public static Optional getContent(io.swagger.v3.oas.annotations.media.C } } - if (content.size() == 0 && annotationContents.length != 1) { + if (content.isEmpty() && annotationContents.length != 1) { return Optional.empty(); } + handleSchemaTypes(content); return Optional.of(content); } @@ -386,7 +394,7 @@ private static MediaType getMediaType(Schema schema, Components components, Json getSchema(annotationContent, components, jsonViewAnnotation, openapi31).ifPresent(mediaType::setSchema); if (annotationContent.schemaProperties().length > 0) { if (mediaType.getSchema() == null) { - mediaType.schema(new Schema().type("object")); + mediaType.schema(new ObjectSchema()); } Schema oSchema = mediaType.getSchema(); for (SchemaProperty sp : annotationContent.schemaProperties()) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java index 9306a6c3f..636ccc229 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.utils; @@ -43,8 +43,8 @@ import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.SpecVersion; import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.JsonSchema; import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; @@ -65,6 +65,8 @@ import org.springframework.hateoas.server.LinkRelationProvider; import org.springframework.util.CollectionUtils; +import static org.springdoc.core.utils.SpringDocUtils.isComposedSchema; + /** * The class Spring doc data rest utils. * @@ -191,8 +193,8 @@ private void updateRequestBody(OpenAPI openAPI, RequestBody requestBody, boolean if (entityInoMap.containsKey(key)) updateRequestBodySchema(key, schema, openAPI.getComponents(), openapi31); } - else if (schema instanceof ComposedSchema) { - updateComposedSchema((ComposedSchema) schema, REQUEST_BODY, openAPI.getComponents(), openapi31); + else if (isComposedSchema(schema)) { + updateComposedSchema(schema.getAllOf(), schema.getOneOf(), REQUEST_BODY, openAPI.getComponents(), openapi31); } }); } @@ -223,8 +225,8 @@ private void updateRequestBodySchema(String className, Schema schema, Components referencedSchema.setName(key + REQUEST_BODY); Map properties = referencedSchema.getProperties(); updateRequestBodySchemaProperties(key, referencedSchema, properties); - if (referencedSchema instanceof ComposedSchema) - updateComposedSchema((ComposedSchema) referencedSchema, REQUEST_BODY, components, openapi31); + if (isComposedSchema(referencedSchema)) + updateComposedSchema(referencedSchema.getAllOf(), referencedSchema.getOneOf(), REQUEST_BODY, components, openapi31); }); } } @@ -244,10 +246,11 @@ private void updateRequestBodySchemaProperties(String key, Schema referencedSche Entry entry = it.next(); String propId = entry.getKey(); if (entityInoMap.containsKey(key) && entityInoMap.get(key).getAssociationsFields().contains(propId)) { - if (entry.getValue() instanceof ArraySchema) + if (entry.getValue().getItems()!=null) referencedSchema.addProperty(propId, new ArraySchema().items(new StringSchema())); else - referencedSchema.addProperty(propId, new StringSchema()); + referencedSchema.addProperty(propId, new StringSchema()); { + } } } } @@ -290,9 +293,18 @@ else if (EMBEDDED.equals(propId)) { */ private void updateResponseSchemaEmbedded(Components components, EntityInfo entityInfo, Entry entry, boolean openapi31) { String entityClassName = linkRelationProvider.getCollectionResourceRelFor(entityInfo.getDomainType()).value(); - ArraySchema arraySchema = (ArraySchema) entry.getValue().getProperties().get(entityClassName); - if (arraySchema != null) { - Schema itemsSchema = arraySchema.getItems(); + Schema itemsSchema = null; + if (openapi31) { + JsonSchema jsonSchema = (JsonSchema) entry.getValue().getProperties().get(entityClassName); + if (jsonSchema != null) + itemsSchema = jsonSchema.getItems(); + } + else { + ArraySchema arraySchema = (ArraySchema) entry.getValue().getProperties().get(entityClassName); + if (arraySchema != null) + itemsSchema = arraySchema.getItems(); + } + if (itemsSchema != null) { Set entitiesNames = entityInoMap.keySet(); if (itemsSchema.get$ref() != null && !itemsSchema.get$ref().endsWith(RESPONSE)) { String key = itemsSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); @@ -303,8 +315,8 @@ private void updateResponseSchemaEmbedded(Components components, EntityInfo enti updateResponseSchema(key, components.getSchemas().get(key + RESPONSE), components, openapi31); } } - else if (itemsSchema instanceof ComposedSchema) { - updateComposedSchema((ComposedSchema) itemsSchema, RESPONSE, components, openapi31); + else if (isComposedSchema(itemsSchema)) { + updateComposedSchema(itemsSchema.getAllOf(), itemsSchema.getOneOf(), RESPONSE, components, openapi31); } } } @@ -354,8 +366,8 @@ private void addSchemas(Components components, String key, Schema referencedSche } } } - if (referencedSchema instanceof ComposedSchema) { - updateComposedSchema((ComposedSchema) referencedSchema, RESPONSE, null, openapi31); + if (isComposedSchema(referencedSchema)) { + updateComposedSchema(referencedSchema.getAllOf(), referencedSchema.getOneOf(), RESPONSE, null, openapi31); } components.addSchemas(key + RESPONSE, referencedSchema); } @@ -363,18 +375,18 @@ private void addSchemas(Components components, String key, Schema referencedSche /** * Update composed schema. * - * @param referencedSchema the referenced schema - * @param suffix the suffix - * @param components the components - * @param openapi31 the openapi 31 + * @param allOf the all of + * @param oneOf the one of + * @param suffix the suffix + * @param components the components + * @param openapi31 the openapi 31 */ - private void updateComposedSchema(ComposedSchema referencedSchema, String suffix, Components components, boolean openapi31) { + private void updateComposedSchema(List allOf, List oneOf, String suffix, Components components, boolean openapi31) { //Update the allOf - ComposedSchema composedSchema = referencedSchema; - List allOfSchemas = composedSchema.getAllOf(); + List allOfSchemas = allOf; updateKey(allOfSchemas, suffix, components, openapi31); //Update the oneOf - List oneOfSchemas = composedSchema.getOneOf(); + List oneOfSchemas = oneOf; updateKey(oneOfSchemas, suffix, components, openapi31); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java index a41acc816..7b6a8f718 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java @@ -31,6 +31,8 @@ import java.util.List; import java.util.function.Predicate; +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.oas.models.media.Content; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; @@ -46,6 +48,7 @@ import org.springdoc.core.service.GenericResponseService; import org.springframework.core.MethodParameter; +import org.springframework.util.CollectionUtils; /** * The type Spring doc utils. @@ -442,5 +445,62 @@ public static Annotation[] getParameterAnnotations(MethodParameter methodParamet // Convert the list to an array and return return resultAnnotations.toArray(new Annotation[0]); } + + /** + * Gets parent type name. + * + * @param type the type + * @param cls the cls + * @return the parent type name + */ + @NotNull + public static String getParentTypeName(AnnotatedType type, Class cls) { + return cls.getSimpleName() + StringUtils.capitalize(type.getParent().getType() != null ? type.getParent().getType() : "object"); + } + + /** + * Is composed schema boolean. + * + * @param referencedSchema the referenced schema + * @return the boolean + */ + public static boolean isComposedSchema(Schema referencedSchema) { + return referencedSchema.getOneOf() != null || referencedSchema.getAllOf() != null || referencedSchema.getAnyOf() != null; + } + + /** + * Handle schema types. + * + * @param schema the schema + */ + public static void handleSchemaTypes(Schema schema) { + if (schema != null) { + if (schema.getType() != null && CollectionUtils.isEmpty(schema.getTypes())) { + schema.addType(schema.getType()); + } + else if (schema.getItems() != null && schema.getItems().getType() != null + && CollectionUtils.isEmpty(schema.getItems().getTypes())) { + schema.getItems().addType(schema.getItems().getType()); + } + if(schema.getProperties() != null){ + schema.getProperties().forEach((key, value) -> handleSchemaTypes(value)); + } + } + } + + /** + * Handle schema types. + * + * @param content the content + */ + public static void handleSchemaTypes(Content content) { + if(content !=null){ + content.values().forEach(mediaType -> { + if (mediaType.getSchema() != null) { + handleSchemaTypes(mediaType.getSchema()); + } + }); + } + } } diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractCommonTest.java deleted file mode 100644 index 3f94f121c..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.reactive.server.WebTestClient; - -@AutoConfigureWebTestClient(timeout = "3600000") -@ActiveProfiles("test") -@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) -public abstract class AbstractCommonTest { - - protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); - - @Autowired - protected WebTestClient webTestClient; - - protected String getContent(String fileName) { - try { - Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index 5bbdda803..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; - -import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; -import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; -import org.springframework.test.web.reactive.server.EntityExchangeResult; -import org.springframework.web.reactive.function.server.HandlerFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - - -@WebFluxTest -@AutoConfigureWebTestClient(timeout = "3600000") -public abstract class AbstractSpringDocTest extends AbstractCommonTest { - - public static final HandlerFunction HANDLER_FUNCTION = request -> ServerResponse.ok().build(); - - protected String groupName = ""; - - - @Test - void testApp() throws Exception { - String result = null; - try { - EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() - .expectStatus().isOk().expectBody().returnResult(); - - result = new String(getResult.getResponseBody()); - String className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } - catch (java.lang.AssertionError e) { - LOGGER.error(result); - throw e; - } - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java deleted file mode 100644 index 97878ab29..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app102; - -import io.swagger.v3.oas.annotations.Parameter; -import jakarta.validation.constraints.NotBlank; - -public class InheritedRequestParams extends RequestParams { - @Parameter(description = "parameter from child of RequestParams") - @NotBlank - private String childParam; - - public String getChildParam() { - return childParam; - } - - public void setChildParam(String childParam) { - this.childParam = childParam; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/RequestParams.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/RequestParams.java deleted file mode 100644 index 9c40ff49f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/RequestParams.java +++ /dev/null @@ -1,122 +0,0 @@ -package test.org.springdoc.api.app102; - -import java.math.BigInteger; -import java.util.List; -import java.util.Optional; - -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.lang.Nullable; - -public class RequestParams { - - @Parameter(description = "string parameter") - private String stringParam; - - @Deprecated - private String stringParam1; - - @Parameter(description = "string parameter2", required = true) - private String stringParam2; - - @Parameter(description = "int parameter") - private int intParam; - - private Optional intParam2; - - @Nullable - private String intParam3; - - private Nested nested; - - private List nestedList; - - public String getStringParam() { - return stringParam; - } - - public void setStringParam(String stringParam) { - this.stringParam = stringParam; - } - - public int getIntParam() { - return intParam; - } - - public void setIntParam(int intParam) { - this.intParam = intParam; - } - - public Optional getIntParam2() { - return intParam2; - } - - public void setIntParam2(Optional intParam2) { - this.intParam2 = intParam2; - } - - @Nullable - public String getIntParam3() { - return intParam3; - } - - public void setIntParam3(@Nullable String intParam3) { - this.intParam3 = intParam3; - } - - public String getStringParam1() { - return stringParam1; - } - - public void setStringParam1(String stringParam1) { - this.stringParam1 = stringParam1; - } - - public String getStringParam2() { - return stringParam2; - } - - public void setStringParam2(String stringParam2) { - this.stringParam2 = stringParam2; - } - - public Nested getNested() { - return nested; - } - - public void setNested(Nested nested) { - this.nested = nested; - } - - public List getNestedList() { - return nestedList; - } - - public void setNestedList(List nestedList) { - this.nestedList = nestedList; - } - - public static class Nested { - private String param1; - - private BigInteger param2; - - @Parameter(description = "nested string parameter") - public String getParam1() { - return param1; - } - - public void setParam1(String param1) { - this.param1 = param1; - } - - @Parameter(description = "nested BigInteger parameter") - public BigInteger getParam2() { - return param2; - } - - public void setParam2(BigInteger param2) { - this.param2 = param2; - } - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java deleted file mode 100644 index ce596b782..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java +++ /dev/null @@ -1,14 +0,0 @@ -package test.org.springdoc.api.app102; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp102Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app102" }) - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/TestController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/TestController.java deleted file mode 100644 index 20ab82688..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app102/TestController.java +++ /dev/null @@ -1,15 +0,0 @@ -package test.org.springdoc.api.app102; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.lang.Nullable; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class TestController { - @GetMapping("test") - public void getTest(@RequestParam @Nullable String param, @ParameterObject InheritedRequestParams requestParams) { - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HelloController.java deleted file mode 100644 index 942e91c67..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HelloController.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app149; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * To test the case a user does not use @RestController but puts @Operation on handler methods - * and wants these methods to be exposed. - * - * @author Azige - */ -@Controller -public class HelloController { - - @GetMapping("/hello") - @Operation(responses = @ApiResponse( - responseCode = "200", - description = "OK", - content = @Content(schema = @Schema(implementation = HelloMessage.class)) - )) - public String hello() { - return "forward:/message"; - } - - @GetMapping("/message") - @Operation - @ResponseBody - public HelloMessage message() { - return new HelloMessage("Lucky numbers!", 777); - } - - @GetMapping("/helloModelAndView") - @Operation(responses = @ApiResponse( - responseCode = "200", - description = "OK", - content = @Content(schema = @Schema(implementation = HelloMessage.class)) - )) - public HelloMessage helloModelAndView() { - return null; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HelloMessage.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HelloMessage.java deleted file mode 100644 index df05150c9..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HelloMessage.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app149; - -public class HelloMessage { - public String text; - - public int number; - - public HelloMessage(String text, int number) { - this.text = text; - this.number = number; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HiddenHelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HiddenHelloController.java deleted file mode 100644 index addf06c49..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/HiddenHelloController.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app149; - -import io.swagger.v3.oas.annotations.Operation; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author bnasslahsen - */ -@RestController -@RequestMapping("/api") -public class HiddenHelloController { - - @Operation(description = "I want here some custom config") - @GetMapping("/{entity}/{id}") - public ResponseEntity getEntity() { - throw new UnsupportedOperationException("the body is not relevant now"); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java deleted file mode 100644 index 0e4086819..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app149; - -import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp149Test extends AbstractSpringDocTest { - - static { - SpringDocUtils.getConfig().addHiddenRestControllers(HiddenHelloController.class); - } - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app149" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/HelloRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/HelloRouter.java deleted file mode 100644 index 0e2352158..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/HelloRouter.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app150; - -import java.util.function.Consumer; -import java.util.function.Supplier; - -import org.springdoc.core.fn.builders.operation.Builder; -import org.springdoc.webflux.core.fn.SpringdocRouteBuilder; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.function.server.RequestPredicates; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.RouterFunctions; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.RequestPredicates.path; -import static org.springframework.web.reactive.function.server.RouterFunctions.nest; -import static test.org.springdoc.api.AbstractSpringDocTest.HANDLER_FUNCTION; - -@Configuration -public class HelloRouter { - - @Bean - RouterFunction routeSample() { - Supplier> routerFunctionSupplier = - () -> SpringdocRouteBuilder.route() - .GET("toto", HANDLER_FUNCTION, builder -> builder.operationId("get-user-groups")) - - .POST("/titi", HANDLER_FUNCTION, builder -> builder.operationId("create-user-group-special")).build(); - - Consumer operationsConsumer = builder -> { - }; - - return RouterFunctions.nest(RequestPredicates.path("/users"), nest(path("/test"), nest(path("/greeter"), - SpringdocRouteBuilder.route() - .GET(HANDLER_FUNCTION, builder -> builder.operationId("get-users")) - .POST("/special", HANDLER_FUNCTION, builder -> builder.operationId("create-user-special")) - .nest(path("/groups"), routerFunctionSupplier, operationsConsumer) - .nest(path("/groups2"), routerFunctionSupplier, operationsConsumer) - .nest(path("/greeter3").or(path("/greeter4")), routerFunctionSupplier, operationsConsumer) - .build()))); - - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java deleted file mode 100644 index 8ed30cedf..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app150; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp150Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app150" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app151/HelloRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app151/HelloRouter.java deleted file mode 100644 index 8c47adf95..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app151/HelloRouter.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app151; - -import java.util.function.Consumer; -import java.util.function.Supplier; - -import org.springdoc.core.fn.builders.operation.Builder; -import org.springdoc.webflux.core.fn.SpringdocRouteBuilder; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.function.server.RequestPredicates; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.RouterFunctions; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.RequestPredicates.path; -import static org.springframework.web.reactive.function.server.RouterFunctions.nest; -import static test.org.springdoc.api.AbstractSpringDocTest.HANDLER_FUNCTION; - -@Configuration -public class HelloRouter { - - @Bean - RouterFunction routeSample() { - Supplier> routerFunctionSupplier = - () -> SpringdocRouteBuilder.route() - .GET("toto", HANDLER_FUNCTION, builder -> builder.operationId("get-user-groups")) - - .POST("/titi", HANDLER_FUNCTION, builder -> builder.operationId("create-user-group-special")).build(); - - Consumer operationsConsumer = builder -> { - }; - - return RouterFunctions.nest(RequestPredicates.path("/users"), nest(path("/test"), nest(path("/greeter"), - SpringdocRouteBuilder.route() - .GET("", HANDLER_FUNCTION, builder -> builder.operationId("get-users")) - .POST("/special", HANDLER_FUNCTION, builder -> builder.operationId("create-user-special")) - .nest(path("/groups"), routerFunctionSupplier, operationsConsumer) - .nest(path("/groups2"), routerFunctionSupplier, operationsConsumer) - .nest(path("/greeter3").or(path("/greeter4")), routerFunctionSupplier, operationsConsumer) - .build()))); - - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java deleted file mode 100644 index 0a089de8b..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app151; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp151Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app151" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app152/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app152/HelloController.java deleted file mode 100644 index 3a16a637e..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app152/HelloController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2021 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app152; - -import org.reactivestreams.Publisher; -import org.springdoc.core.models.GroupedOpenApi; -import reactor.core.publisher.Mono; - -import org.springframework.context.annotation.Bean; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public Publisher persons() { - return Mono.just("OK"); - } - - @Bean - public GroupedOpenApi userOpenApi() { - return GroupedOpenApi.builder() - .group("users") - .packagesToScan("test.org.springdoc.api.app152") - .build(); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java deleted file mode 100644 index 3e7267632..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2021 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app152; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp152Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app152" }) - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/DefaultRequestMappingHandlerMapping.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/DefaultRequestMappingHandlerMapping.java deleted file mode 100644 index a665a4e53..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/DefaultRequestMappingHandlerMapping.java +++ /dev/null @@ -1,42 +0,0 @@ -package test.org.springdoc.api.app153; - -import org.springframework.expression.ParserContext; -import org.springframework.expression.spel.standard.SpelExpressionParser; -import org.springframework.expression.spel.support.StandardEvaluationContext; -import org.springframework.util.StringValueResolver; -import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; - -public class DefaultRequestMappingHandlerMapping extends RequestMappingHandlerMapping { - - private static final SpelExpressionParser PARSER = new SpelExpressionParser(); - - private static ThreadLocal handlerHolder = new ThreadLocal<>(); - - @Override - public void setEmbeddedValueResolver(StringValueResolver resolver) { - super.setEmbeddedValueResolver(new StringValueResolver() { - @Override - public String resolveStringValue(String strVal) { - Object handler = handlerHolder.get(); - if (handler != null) { - strVal = String.valueOf(PARSER.parseExpression(strVal, ParserContext.TEMPLATE_EXPRESSION) - .getValue(new StandardEvaluationContext(handler))); - } - if (resolver != null) { - strVal = resolver.resolveStringValue(strVal); - } - return strVal; - } - }); - } - - @Override - protected void detectHandlerMethods(Object handler) { - Object handlerObject = (handler instanceof String ? obtainApplicationContext().getBean((String) handler) - : handler); - handlerHolder.set(handlerObject); - super.detectHandlerMethods(handler); - handlerHolder.remove(); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/DefaultWebFluxRegistrations.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/DefaultWebFluxRegistrations.java deleted file mode 100644 index 32de6f885..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/DefaultWebFluxRegistrations.java +++ /dev/null @@ -1,15 +0,0 @@ -package test.org.springdoc.api.app153; - -import org.springframework.boot.autoconfigure.web.reactive.WebFluxRegistrations; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; - -@Component -public class DefaultWebFluxRegistrations implements WebFluxRegistrations { - - @Override - public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { - return new DefaultRequestMappingHandlerMapping(); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java deleted file mode 100644 index d6a2a9f42..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2021 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app153; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp153Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app153" }) - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/TestController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/TestController.java deleted file mode 100644 index e7ce82d1f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app153/TestController.java +++ /dev/null @@ -1,13 +0,0 @@ -package test.org.springdoc.api.app153; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class TestController { - - @PostMapping("/echo") - public String echo(String content) { - return content; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/HelloController.java deleted file mode 100644 index 30c0effa2..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app184; - - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/globalBeanFiltered") - public String globalBeanFiltered() { - return "globalBeanFiltered"; - } - - @GetMapping("/beanFiltered") - public String beanFiltered() { - return "beanFiltered"; - } - - @GetMapping("/group1Filtered") - public String group1Filtered() { - return "group1Filtered"; - } - - @GetMapping("/group2Filtered") - public String group2Filtered() { - return "group2Filtered"; - } - - @GetMapping("/group3Filtered") - public String group3Filtered() { - return "group3Filtered"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/SpringDocApp184Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/SpringDocApp184Test.java deleted file mode 100644 index a666d7e51..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app184/SpringDocApp184Test.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app184; - -import java.util.Objects; - -import io.swagger.v3.oas.models.parameters.HeaderParameter; -import io.swagger.v3.oas.models.servers.Server; -import org.junit.jupiter.api.Test; -import org.springdoc.core.customizers.GlobalOpenApiCustomizer; -import org.springdoc.core.customizers.GlobalOperationCustomizer; -import org.springdoc.core.customizers.OpenApiCustomizer; -import org.springdoc.core.customizers.OperationCustomizer; -import org.springdoc.core.filters.GlobalOpenApiMethodFilter; -import org.springdoc.core.filters.OpenApiMethodFilter; -import org.springdoc.core.models.GroupedOpenApi; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = { - "springdoc.group-configs[0].group=group1", - "springdoc.group-configs[0].paths-to-exclude=/group1Filtered", -}) -public class SpringDocApp184Test extends AbstractSpringDocTest { - - @Test - void testGroup1() throws Exception { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group1").exchange() - .expectStatus().isOk() - .expectBody().json(getContent("results/app184-1.json"), true); - } - - @Test - void testGroup2() throws Exception { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group2").exchange() - .expectStatus().isOk() - .expectBody().json(getContent("results/app184-2.json"), true); - } - - @Test - void testGroup3() throws Exception { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group3").exchange() - .expectStatus().isOk() - .expectBody().json(getContent("results/app184-3.json"), true); - } - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app184" }) - static class SpringDocTestApp { - - @Bean - public GlobalOpenApiCustomizer addUrlGlobalBean() { - return openApi -> openApi.getServers().add(new Server().url("urlGlobalBean")); - } - - @Bean - public OpenApiCustomizer addUrlBean() { - return openApi -> openApi.getServers().add(new Server().url("urlBean")); - } - - @Bean - public GlobalOperationCustomizer addHeaderGlobaBeanl() { - return (operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGlobalBean")); - } - - @Bean - public OperationCustomizer addHeaderBean() { - return (operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerBean")); - } - - @Bean - public GlobalOpenApiMethodFilter globalFilterBean() { - return method -> !Objects.equals(method.getName(), "globalBeanFiltered"); - } - - @Bean - public OpenApiMethodFilter filterBean() { - return method -> !Objects.equals(method.getName(), "beanFiltered"); - } - - @Bean - public GroupedOpenApi group2() { - return GroupedOpenApi.builder() - .group("group2") - .addOpenApiCustomizer(openApi -> openApi.getServers().add(new Server().url("urlGroup2"))) - .addOperationCustomizer((operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGroup2"))) - .addOpenApiMethodFilter(method -> !Objects.equals(method.getName(), "group2Filtered")) - .build(); - } - - @Bean - public GroupedOpenApi group3() { - return GroupedOpenApi.builder() - .group("group3") - .addOpenApiCustomizer(openApi -> openApi.getServers().add(new Server().url("urlGroup3"))) - .addOperationCustomizer((operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGroup3"))) - .addOpenApiMethodFilter(method -> !Objects.equals(method.getName(), "group3Filtered")) - .build(); - } - - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/DuplicatedPathController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/DuplicatedPathController.java deleted file mode 100644 index a9df9a8dd..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/DuplicatedPathController.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app187; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class DuplicatedPathController { - - @GetMapping("/duplicated") - public String duplicated1() { - return "globalBeanFiltered"; - } - - @GetMapping(value = "/duplicated", params = "filter=params") - public String duplicated2() { - return "beanFiltered"; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/SpringDocApp187Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/SpringDocApp187Test.java deleted file mode 100644 index c077434bb..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app187/SpringDocApp187Test.java +++ /dev/null @@ -1,36 +0,0 @@ -package test.org.springdoc.api.app187; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.customizers.RouterOperationCustomizer; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; - -class SpringDocApp187Test extends AbstractSpringDocTest { - - @Test - void testAddRouterOperationCustomizerBean() { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() - .expectStatus().isOk() - .expectBody().json(getContent("results/app187.json"), true); - } - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app187" }) - static class SpringDocTestApp { - - @Bean - public RouterOperationCustomizer addRouterOperationCustomizer() { - return (routerOperation, handlerMethod) -> { - if (routerOperation.getParams().length > 0) { - routerOperation.setPath(routerOperation.getPath() + "?" + String.join("&", routerOperation.getParams())); - } - return routerOperation; - }; - } - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/OrderDemo.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/OrderDemo.java deleted file mode 100644 index 638f9c0e9..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/OrderDemo.java +++ /dev/null @@ -1,41 +0,0 @@ -package test.org.springdoc.api.app188; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.tags.Tag; -import org.springdoc.core.customizers.GlobalOpenApiCustomizer; -import org.springdoc.core.customizers.OpenApiCustomizer; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - - -public class OrderDemo { - - public static class Customizer2 implements OpenApiCustomizer, GlobalOpenApiCustomizer { - public void customise(OpenAPI openApi) { - openApi.addTagsItem(new Tag().name("2")); - } - } - - public static class Customizer3 implements OpenApiCustomizer, GlobalOpenApiCustomizer { - public void customise(OpenAPI openApi) { - openApi.addTagsItem(new Tag().name("3")); - } - } - - public static class Customizer1 implements OpenApiCustomizer, GlobalOpenApiCustomizer { - public void customise(OpenAPI openApi) { - openApi.addTagsItem(new Tag().name("1")); - } - } - - @RestController - public static class MyController { - - @GetMapping("/test") - public String testingMethod() { - return "foo"; - } - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java deleted file mode 100644 index 295640c02..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app188/SpringDocApp188Test.java +++ /dev/null @@ -1,31 +0,0 @@ -package test.org.springdoc.api.app188; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = { "springdoc.group-configs[0].group=mygroup", "springdoc.group-configs[0].paths-to-match=/test" }) -class SpringDocApp188Test extends AbstractSpringDocTest { - - @Test - void testApp1() { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL +"/mygroup").exchange() - .expectStatus().isOk() - .expectBody().json(getContent("results/app188.json"), true); - } - - @SpringBootApplication - @Import({ - OrderDemo.Customizer1.class, - OrderDemo.Customizer2.class, - OrderDemo.Customizer3.class, - }) - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app188" }) - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/HelloController.java deleted file mode 100644 index a147a697f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app189; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import reactor.core.publisher.Mono; - -import org.springframework.http.MediaType; -import org.springframework.http.codec.multipart.FilePart; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -public class HelloController { - - - @Operation(summary = "Parse Resume") - @PostMapping(value = "/parse-resume", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { - MediaType.MULTIPART_FORM_DATA_VALUE }) - @ApiResponses({ @ApiResponse(responseCode = "400", description = "Invalid input") }) - public Mono parse( - @RequestPart(name = "resumeFile") @Parameter(description = "Resume file to be parsed", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) FilePart resumeFile) { - return null; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/SpringDocApp189Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/SpringDocApp189Test.java deleted file mode 100644 index 542d56c64..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/SpringDocApp189Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app189; - -import java.time.Duration; - -import org.json.JSONException; -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractCommonTest; - -import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; -import org.springframework.test.web.reactive.server.EntityExchangeResult; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - -@WebFluxTest -public class SpringDocApp189Test extends AbstractCommonTest { - - @Test - public void testWithDifferentLocales() throws Exception { - runTestWithLocale("en-GB"); - runTestWithLocale("de-DE"); - } - private void runTestWithLocale(String locale) throws JSONException { - EntityExchangeResult getResult = webTestClient.mutate().responseTimeout(Duration.ofMinutes(1000)).build() - .get().uri(Constants.DEFAULT_API_DOCS_URL) - .header("Accept-Language", locale) - .exchange() - .expectStatus().isOk().expectBody().returnResult(); - - String result = new String(getResult.getResponseBody()); - String className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/SpringDocTestApp.java deleted file mode 100644 index fae77fa39..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app189/SpringDocTestApp.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app189; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.springdoc.core.customizers.OpenApiCustomizer; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app189" }) -public class SpringDocTestApp { - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Tweet API").version("v0") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - - @Bean - OpenApiCustomizer serverUrlCustomizer() { - return openApi -> - openApi.getServers().forEach(server -> { - server.setDescription("customized description"); - server.setUrl("https://customized.url"); - }); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190Test.java deleted file mode 100644 index c98dbb03e..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190Test.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app190; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractCommonTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; -import org.springframework.context.annotation.ComponentScan; - -import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_DEFAULT_API_DOCS; - -@WebFluxTest(properties = SPRINGDOC_ENABLE_DEFAULT_API_DOCS+"=false") -public class SpringDocApp190Test extends AbstractCommonTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app190" }) - static class SpringDocTestApp {} - - @Test - void test_disable_default_api_docs() throws Exception { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() - .expectStatus().isNotFound(); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190bisTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190bisTest.java deleted file mode 100644 index 21a048c82..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app190/SpringDocApp190bisTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app190; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractCommonTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; -import org.springframework.context.annotation.ComponentScan; - -import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_DEFAULT_API_DOCS; - -@WebFluxTest(properties = SPRINGDOC_ENABLE_DEFAULT_API_DOCS+"=true") -public class SpringDocApp190bisTest extends AbstractCommonTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app190" }) - static class SpringDocTestApp {} - - @Test - void test_enable_default_api_docs() throws Exception { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() - .expectStatus().isOk(); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/BaseHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/BaseHandler.java deleted file mode 100644 index 0bcc587f1..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/BaseHandler.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app191.Handler; - -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -@Component -public abstract class BaseHandler { - protected abstract Mono apply (ServerRequest serverRequest); - - public Mono handle(ServerRequest serverRequest) { - return this.apply(serverRequest); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/GetNameHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/GetNameHandler.java deleted file mode 100644 index 00854782a..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Handler/GetNameHandler.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app191.Handler; - -import reactor.core.publisher.Mono; - -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -@Component -public class GetNameHandler extends BaseHandler{ - @Override - protected Mono apply(ServerRequest serverRequest) { - return ServerResponse.ok() - .contentType(MediaType.APPLICATION_JSON) - .bodyValue("Name API is called"); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Router/GetNameRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Router/GetNameRouter.java deleted file mode 100644 index 92e1b5d40..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/Router/GetNameRouter.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api.app191.Router; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; -import test.org.springdoc.api.app191.Handler.GetNameHandler; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.reactive.function.server.RequestPredicates; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.RouterFunctions; -import org.springframework.web.reactive.function.server.ServerResponse; - - -@Configuration -public class GetNameRouter { - - @Bean - @RouterOperations( - value = { - @RouterOperation(path = "/v1/name", produces = {MediaType.APPLICATION_JSON_VALUE}, method = RequestMethod.GET, - beanClass = GetNameHandler.class, beanMethod = "handle", operation = @Operation(operationId = "getName", - description = "get name", responses = {@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = String.class)))}) - ) - }) - - public RouterFunction routerFunction(GetNameHandler getNameHandler) { - return RouterFunctions.route(RequestPredicates.GET("/v1/name"), getNameHandler::handle); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/SpringDocApp191Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/SpringDocApp191Test.java deleted file mode 100644 index 7f7cbcc24..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app191/SpringDocApp191Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app191; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp191Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app191" }) - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java deleted file mode 100644 index 1b4bbc081..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3; - -import test.org.springdoc.api.AbstractSpringDocTest; - -public class SpringDocApp3Test extends AbstractSpringDocTest { - - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/SpringDocTestApp.java deleted file mode 100644 index 6262f30d7..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/SpringDocTestApp.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app3" }) -public class SpringDocTestApp { - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Tweet API").version("v0") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/controller/ExceptionTranslator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/controller/ExceptionTranslator.java deleted file mode 100644 index be9ffede6..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/controller/ExceptionTranslator.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3.controller; - -import test.org.springdoc.api.app3.exception.TweetConflictException; -import test.org.springdoc.api.app3.exception.TweetNotFoundException; -import test.org.springdoc.api.app3.payload.ErrorResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -@RestControllerAdvice -public class ExceptionTranslator { - - - @SuppressWarnings("rawtypes") - @ExceptionHandler(TweetConflictException.class) - @ResponseStatus(HttpStatus.CONFLICT) - public ResponseEntity handleDuplicateKeyException(TweetConflictException ex) { - return ResponseEntity.status(HttpStatus.CONFLICT) - .body(new ErrorResponse("A Tweet with the same text already exists")); - } - - @SuppressWarnings("rawtypes") - @ExceptionHandler(TweetNotFoundException.class) - @ResponseStatus(HttpStatus.NOT_FOUND) - public ResponseEntity handleTweetNotFoundException(TweetNotFoundException ex) { - return ResponseEntity.notFound().build(); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/controller/TweetController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/controller/TweetController.java deleted file mode 100644 index a694e4daf..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/controller/TweetController.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3.controller; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import jakarta.validation.Valid; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import test.org.springdoc.api.app3.dto.TweetDTO; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * Created by rajeevkumarsingh on 08/09/17. - */ -@RestController -public class TweetController { - - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") }) - @GetMapping("/tweets") - public Flux getAllTweets() { - return null; - } - - @PostMapping("/tweets") - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "create Tweets") }) - public Mono createTweets(@Valid @RequestBody TweetDTO tweetDTO) { - return null; - } - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get Tweet By Id"), - @ApiResponse(responseCode = "404", description = "tweet not found") }) - @GetMapping("/tweets/{id}") - public Mono> getTweetById(@PathVariable(value = "id") String tweetId) { - return null; - } - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "update Tweet"), - @ApiResponse(responseCode = "404", description = "tweet not found") }) - @PutMapping("/tweets/{id}") - public Mono> updateTweet(@PathVariable(value = "id") String tweetId, - @Valid @RequestBody TweetDTO tweetDTO) { - return null; - } - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "delete Tweet"), - @ApiResponse(responseCode = "404", description = "tweet not found") }) - @DeleteMapping("/tweets/{id}") - public Mono> deleteTweet(@PathVariable(value = "id") String tweetId) { - return null; - } - - @Operation(description = "Tweets are Sent to the client as Server Sent Events", responses = { - @ApiResponse(responseCode = "200", description = "stream All Tweets") }) - @GetMapping(value = "/stream/tweets", produces = MediaType.TEXT_EVENT_STREAM_VALUE) - public Flux streamAllTweets() { - return null; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/dto/TweetDTO.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/dto/TweetDTO.java deleted file mode 100644 index 54c7c32d2..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/dto/TweetDTO.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3.dto; - -import java.util.Date; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - - -/** - * Created by rajeevkumarsingh on 08/09/17. - */ -public class TweetDTO { - private String id; - - @NotBlank - @Size(max = 140) - private String text; - - @NotNull - private Date createdAt = new Date(); - - public TweetDTO() { - - } - - public TweetDTO(String text) { - this.text = text; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/exception/TweetConflictException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/exception/TweetConflictException.java deleted file mode 100644 index 3f21e25d5..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/exception/TweetConflictException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3.exception; - -/** - * Created by rajeevkumarsingh on 22/10/17. - */ -public class TweetConflictException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public TweetConflictException(String tweetId) { - super("Tweet conflict with id " + tweetId); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/exception/TweetNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/exception/TweetNotFoundException.java deleted file mode 100644 index 3dc9df446..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/exception/TweetNotFoundException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3.exception; - -/** - * Created by rajeevkumarsingh on 22/10/17. - */ -public class TweetNotFoundException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public TweetNotFoundException(String tweetId) { - super("Tweet not found with id " + tweetId); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/payload/ErrorResponse.java deleted file mode 100644 index a1cdd1a98..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app3/payload/ErrorResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3.payload; - -/** - * Created by rajeevkumarsingh on 22/10/17. - */ -public class ErrorResponse { - private String message; - - public ErrorResponse(String message) { - this.message = message; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/HelloController.java deleted file mode 100644 index eb119b6c4..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/HelloController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app39; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import reactor.core.publisher.Mono; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @Operation(summary = "test Request") - @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) - @PostMapping("/test") - public Mono searchEmployee(String test) { - return Mono.empty(); - } - - @GetMapping("/hello") - public Mono hello() { - return Mono.just("hello"); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java deleted file mode 100644 index 4c346c559..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app39; - -import test.org.springdoc.api.AbstractSpringDocTest; - -public class SpringDocApp39Test extends AbstractSpringDocTest { - - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java deleted file mode 100644 index 2bc6f4704..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app39; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.StringSchema; -import io.swagger.v3.oas.models.parameters.HeaderParameter; -import org.springdoc.core.customizers.OpenApiCustomizer; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app39" }) -public class SpringDocTestApp { - - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - @Bean - public OpenAPI customOpenAPI() { - StringSchema schema = new StringSchema(); - return new OpenAPI() - .components(new Components().addParameters("myGlobalHeader", new HeaderParameter().required(true).name("My-Global-Header").description("My Global Header").schema(schema))); - } - - @Bean - public OpenApiCustomizer customerGlobalHeaderOpenApiCustomizer() { - return openApi -> openApi.getPaths().values().stream().flatMap(pathItem -> pathItem.readOperations().stream()) - .forEach(operation -> operation.addParametersItem(new HeaderParameter().$ref("#/components/parameters/myGlobalHeader"))); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/HelloController.java deleted file mode 100644 index 7f1727c96..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import reactor.core.publisher.Mono; - -import org.springframework.http.MediaType; -import org.springframework.http.codec.multipart.FilePart; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -public class HelloController { - - - @Operation(summary = "Parse Resume") - @PostMapping(value = "/parse-resume", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { - MediaType.MULTIPART_FORM_DATA_VALUE }) - @ApiResponses({ @ApiResponse(responseCode = "400", description = "Invalid input") }) - public Mono parse( - @RequestPart(name = "resumeFile") @Parameter(description = "Resume file to be parsed", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) FilePart resumeFile) { - return null; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java deleted file mode 100644 index cf11f1e8f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4; - -import test.org.springdoc.api.AbstractSpringDocTest; - -public class SpringDocApp4Test extends AbstractSpringDocTest { - - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/SpringDocTestApp.java deleted file mode 100644 index 22ae0f622..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app4/SpringDocTestApp.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app4" }) -public class SpringDocTestApp { - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Tweet API").version("v0") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/HelloController.java deleted file mode 100644 index a20a51156..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/HelloController.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5; - -import reactor.core.publisher.Mono; - -import org.springframework.http.HttpEntity; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @PostMapping(value = "/tweets/does-not-work", consumes = MediaType.APPLICATION_JSON_VALUE) - public Mono postNotWorks(@RequestBody Mono tweet) { - return tweet; - } - - @GetMapping("/test") - public Mono> demo2() { - return null; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java deleted file mode 100644 index b96e55723..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5; - -import test.org.springdoc.api.AbstractSpringDocTest; - -public class SpringDocApp5Test extends AbstractSpringDocTest { - - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/SpringDocTestApp.java deleted file mode 100644 index df9ec8b30..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/SpringDocTestApp.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app5" }) -public class SpringDocTestApp { - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Tweet API").version("v0") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/Tweet.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/Tweet.java deleted file mode 100644 index 03487c9bb..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app5/Tweet.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5; - -import java.util.Date; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - -public class Tweet { - private String id; - - @NotBlank - @Size(max = 140) - private String text; - - @NotNull - private Date createdAt = new Date(); - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/HelloController.java deleted file mode 100644 index 7ce2032ae..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/HelloController.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app63; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/test") - public void test(String hello) { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java deleted file mode 100644 index f6bc9e2e7..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app63; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.packagesToScan=hell,hello1, hello.me") -public class SpringDocApp63Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app63" }) - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/toto/HelloController2.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/toto/HelloController2.java deleted file mode 100644 index 826222b66..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app63/toto/HelloController2.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app63.toto; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController2 { - - @GetMapping("/test1") - public void test1(String hello) { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app64/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app64/HelloController.java deleted file mode 100644 index 0245f3a24..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app64/HelloController.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app64; - -import io.swagger.v3.oas.annotations.Operation; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/v1/test") - public void test1(String hello) { - } - - @GetMapping(value = "/api/balance/abcd") - @Operation(summary = "This is the test endpoint") - public String test2(String from) { - return "This is a fake test"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java deleted file mode 100644 index ecfe5a691..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app64; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.paths-to-match=/v1, /api/**") -public class SpringDocApp64Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app64" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/HelloController.java deleted file mode 100644 index 3896d2de0..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/HelloController.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app65; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@Tag(name = "Health", description = "Health check / ping API") -@RestController -public class HelloController { - - @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") - @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) - public ResponseEntity ping() { - return ResponseEntity.ok("Healthy"); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java deleted file mode 100644 index 67e2721fc..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app65; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp65Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app65" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java deleted file mode 100644 index 16119b069..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -public class SpringDocApp66Test extends AbstractSpringDocTest { - - public SpringDocApp66Test() { - this.groupName = "/stream"; - } - - @Test - void testApp2() throws Exception { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "streams").exchange() - .expectStatus().isNotFound(); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocTestApp.java deleted file mode 100644 index 18be50db4..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/SpringDocTestApp.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app66" }) -public class SpringDocTestApp { - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Tweet API").version("v0") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - - @Bean - public GroupedOpenApi streamOpenApi() { - String[] paths = { "/stream/**" }; - String[] packagedToMatch = { "test.org.springdoc.api.app66" }; - return GroupedOpenApi.builder().group("stream").pathsToMatch(paths) - .build(); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/controller/ExceptionTranslator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/controller/ExceptionTranslator.java deleted file mode 100644 index dc81d1bfd..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/controller/ExceptionTranslator.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66.controller; - -import test.org.springdoc.api.app66.exception.TweetConflictException; -import test.org.springdoc.api.app66.exception.TweetNotFoundException; -import test.org.springdoc.api.app66.payload.ErrorResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -@RestControllerAdvice -public class ExceptionTranslator { - - - @SuppressWarnings("rawtypes") - @ExceptionHandler(TweetConflictException.class) - @ResponseStatus(HttpStatus.CONFLICT) - public ResponseEntity handleDuplicateKeyException(TweetConflictException ex) { - return ResponseEntity.status(HttpStatus.CONFLICT) - .body(new ErrorResponse("A Tweet with the same text already exists")); - } - - @SuppressWarnings("rawtypes") - @ExceptionHandler(TweetNotFoundException.class) - @ResponseStatus(HttpStatus.NOT_FOUND) - public ResponseEntity handleTweetNotFoundException(TweetNotFoundException ex) { - return ResponseEntity.notFound().build(); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/controller/TweetController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/controller/TweetController.java deleted file mode 100644 index d62eeaf86..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/controller/TweetController.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66.controller; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import jakarta.validation.Valid; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import test.org.springdoc.api.app66.dto.TweetDTO; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * Created by rajeevkumarsingh on 08/09/17. - */ -@RestController -public class TweetController { - - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") }) - @GetMapping("/tweets") - public Flux getAllTweets() { - return null; - } - - @PostMapping("/tweets") - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "create Tweets") }) - public Mono createTweets(@Valid @RequestBody TweetDTO tweetDTO) { - return null; - } - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get Tweet By Id"), - @ApiResponse(responseCode = "404", description = "tweet not found") }) - @GetMapping("/tweets/{id}") - public Mono> getTweetById(@PathVariable(value = "id") String tweetId) { - return null; - } - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "update Tweet"), - @ApiResponse(responseCode = "404", description = "tweet not found") }) - @PutMapping("/tweets/{id}") - public Mono> updateTweet(@PathVariable(value = "id") String tweetId, - @Valid @RequestBody TweetDTO tweetDTO) { - return null; - } - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "delete Tweet"), - @ApiResponse(responseCode = "404", description = "tweet not found") }) - @DeleteMapping("/tweets/{id}") - public Mono> deleteTweet(@PathVariable(value = "id") String tweetId) { - return null; - } - - @Operation(description = "Tweets are Sent to the client as Server Sent Events", responses = { - @ApiResponse(responseCode = "200", description = "stream All Tweets") }) - @GetMapping(value = "/stream/tweets", produces = MediaType.TEXT_EVENT_STREAM_VALUE) - public Flux streamAllTweets() { - return null; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/dto/TweetDTO.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/dto/TweetDTO.java deleted file mode 100644 index 51cdc3528..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/dto/TweetDTO.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66.dto; - -import java.util.Date; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - - -/** - * Created by rajeevkumarsingh on 08/09/17. - */ -public class TweetDTO { - private String id; - - @NotBlank - @Size(max = 140) - private String text; - - @NotNull - private Date createdAt = new Date(); - - public TweetDTO() { - - } - - public TweetDTO(String text) { - this.text = text; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/exception/TweetConflictException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/exception/TweetConflictException.java deleted file mode 100644 index 131049958..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/exception/TweetConflictException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66.exception; - -/** - * Created by rajeevkumarsingh on 22/10/17. - */ -public class TweetConflictException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public TweetConflictException(String tweetId) { - super("Tweet conflict with id " + tweetId); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/exception/TweetNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/exception/TweetNotFoundException.java deleted file mode 100644 index 1dcd1f9bc..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/exception/TweetNotFoundException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66.exception; - -/** - * Created by rajeevkumarsingh on 22/10/17. - */ -public class TweetNotFoundException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public TweetNotFoundException(String tweetId) { - super("Tweet not found with id " + tweetId); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/payload/ErrorResponse.java deleted file mode 100644 index fb7fcdc09..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app66/payload/ErrorResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66.payload; - -/** - * Created by rajeevkumarsingh on 22/10/17. - */ -public class ErrorResponse { - private String message; - - public ErrorResponse(String message) { - this.message = message; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/HelloController.java deleted file mode 100644 index c34093e7a..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/HelloController.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app67; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/api") -public class HelloController { - - @RequestMapping - public String test() { - return "ok"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java deleted file mode 100644 index 279d52509..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app67; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp67Test extends AbstractSpringDocTest { - - @Test - void testApp() { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange().expectStatus().isOk().expectBody() - .jsonPath("$.openapi").isEqualTo("3.0.1") - .jsonPath("$.paths./api.get.tags[0]").isEqualTo("hello-controller") - .jsonPath("$.paths./api.get.responses.200.content.['*/*'].schema.type").isEqualTo("string") - .jsonPath("$.paths./api.post.tags[0]").isEqualTo("hello-controller") - .jsonPath("$.paths./api.post.responses.200.content.['*/*'].schema.type").isEqualTo("string") - .jsonPath("$.paths./api.put.tags[0]").isEqualTo("hello-controller") - .jsonPath("$.paths./api.put.responses.200.content.['*/*'].schema.type").isEqualTo("string") - .jsonPath("$.paths./api.patch.tags[0]").isEqualTo("hello-controller") - .jsonPath("$.paths./api.patch.responses.200.content.['*/*'].schema.type").isEqualTo("string") - .jsonPath("$.paths./api.delete.tags[0]").isEqualTo("hello-controller") - .jsonPath("$.paths./api.delete.responses.200.content.['*/*'].schema.type").isEqualTo("string") - .jsonPath("$.paths./api.options.tags[0]").isEqualTo("hello-controller") - .jsonPath("$.paths./api.options.responses.200.content.['*/*'].schema.type").isEqualTo("string") - .jsonPath("$.paths./api.head.tags[0]").isEqualTo("hello-controller") - .jsonPath("$.paths./api.head.responses.200.content.['*/*'].schema.type").isEqualTo("string"); - } - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app67" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java deleted file mode 100644 index 91e941bab..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = { - "springdoc.group-configs[0].group=stream", - "springdoc.group-configs[0].pathsToMatch=/stream/**" -}) -public class SpringDocApp68Test extends AbstractSpringDocTest { - - public SpringDocApp68Test() { - this.groupName = "/stream"; - } - - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app68" }) - static class SpringDocTestApp { - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Tweet API").version("v0") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/controller/ExceptionTranslator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/controller/ExceptionTranslator.java deleted file mode 100644 index aca1d2d9f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/controller/ExceptionTranslator.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.controller; - -import test.org.springdoc.api.app68.exception.TweetConflictException; -import test.org.springdoc.api.app68.exception.TweetNotFoundException; -import test.org.springdoc.api.app68.payload.ErrorResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -@RestControllerAdvice -public class ExceptionTranslator { - - - @SuppressWarnings("rawtypes") - @ExceptionHandler(TweetConflictException.class) - @ResponseStatus(HttpStatus.CONFLICT) - public ResponseEntity handleDuplicateKeyException(TweetConflictException ex) { - return ResponseEntity.status(HttpStatus.CONFLICT) - .body(new ErrorResponse("A Tweet with the same text already exists")); - } - - @SuppressWarnings("rawtypes") - @ExceptionHandler(TweetNotFoundException.class) - @ResponseStatus(HttpStatus.NOT_FOUND) - public ResponseEntity handleTweetNotFoundException(TweetNotFoundException ex) { - return ResponseEntity.notFound().build(); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/controller/TweetController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/controller/TweetController.java deleted file mode 100644 index 255677a2c..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/controller/TweetController.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.controller; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import jakarta.validation.Valid; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import test.org.springdoc.api.app68.dto.TweetDTO; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * Created by rajeevkumarsingh on 08/09/17. - */ -@RestController -public class TweetController { - - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") }) - @GetMapping("/tweets") - public Flux getAllTweets() { - return null; - } - - @PostMapping("/tweets") - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "create Tweets") }) - public Mono createTweets(@Valid @RequestBody TweetDTO tweetDTO) { - return null; - } - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get Tweet By Id"), - @ApiResponse(responseCode = "404", description = "tweet not found") }) - @GetMapping("/tweets/{id}") - public Mono> getTweetById(@PathVariable(value = "id") String tweetId) { - return null; - } - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "update Tweet"), - @ApiResponse(responseCode = "404", description = "tweet not found") }) - @PutMapping("/tweets/{id}") - public Mono> updateTweet(@PathVariable(value = "id") String tweetId, - @Valid @RequestBody TweetDTO tweetDTO) { - return null; - } - - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "delete Tweet"), - @ApiResponse(responseCode = "404", description = "tweet not found") }) - @DeleteMapping("/tweets/{id}") - public Mono> deleteTweet(@PathVariable(value = "id") String tweetId) { - return null; - } - - @Operation(description = "Tweets are Sent to the client as Server Sent Events", responses = { - @ApiResponse(responseCode = "200", description = "stream All Tweets") }) - @GetMapping(value = "/stream/tweets", produces = MediaType.TEXT_EVENT_STREAM_VALUE) - public Flux streamAllTweets() { - return null; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/dto/TweetDTO.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/dto/TweetDTO.java deleted file mode 100644 index d2accbb1e..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/dto/TweetDTO.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.dto; - -import java.util.Date; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - - -/** - * Created by rajeevkumarsingh on 08/09/17. - */ -public class TweetDTO { - private String id; - - @NotBlank - @Size(max = 140) - private String text; - - @NotNull - private Date createdAt = new Date(); - - public TweetDTO() { - - } - - public TweetDTO(String text) { - this.text = text; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/exception/TweetConflictException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/exception/TweetConflictException.java deleted file mode 100644 index 8e4af3d64..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/exception/TweetConflictException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.exception; - -/** - * Created by rajeevkumarsingh on 22/10/17. - */ -public class TweetConflictException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public TweetConflictException(String tweetId) { - super("Tweet conflict with id " + tweetId); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/exception/TweetNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/exception/TweetNotFoundException.java deleted file mode 100644 index 799c9171c..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/exception/TweetNotFoundException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.exception; - -/** - * Created by rajeevkumarsingh on 22/10/17. - */ -public class TweetNotFoundException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public TweetNotFoundException(String tweetId) { - super("Tweet not found with id " + tweetId); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/payload/ErrorResponse.java deleted file mode 100644 index 81c38d169..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app68/payload/ErrorResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.payload; - -/** - * Created by rajeevkumarsingh on 22/10/17. - */ -public class ErrorResponse { - private String message; - - public ErrorResponse(String message) { - this.message = message; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/RoutingConfiguration.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/RoutingConfiguration.java deleted file mode 100644 index 74237d287..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/RoutingConfiguration.java +++ /dev/null @@ -1,36 +0,0 @@ -package test.org.springdoc.api.app69; - -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -@Configuration -public class RoutingConfiguration { - - @Bean - @RouterOperations({ @RouterOperation(path = "/api/user/index", beanClass = UserRepository.class, beanMethod = "getAllUsers"), - @RouterOperation(path = "/api/user/{id}", beanClass = UserRepository.class, beanMethod = "getUserById"), - @RouterOperation(path = "/api/user/post", beanClass = UserRepository.class, beanMethod = "saveUser"), - @RouterOperation(path = "/api/user/put/{id}", beanClass = UserRepository.class, beanMethod = "putUser"), - @RouterOperation(path = "/api/user/delete/{id}", beanClass = UserRepository.class, beanMethod = "deleteUser") }) - public RouterFunction monoRouterFunction(UserHandler userHandler) { - return route(GET("/api/user/index").and(accept(MediaType.APPLICATION_JSON)), userHandler::getAll) - .andRoute(GET("/api/user/{id}").and(accept(MediaType.APPLICATION_JSON)), userHandler::getUser) - .andRoute(POST("/api/user/post").and(accept(MediaType.APPLICATION_JSON)), userHandler::postUser) - .andRoute(PUT("/api/user/put/{id}").and(accept(MediaType.APPLICATION_JSON)), userHandler::putUser) - .andRoute(DELETE("/api/user/delete/{id}").and(accept(MediaType.APPLICATION_JSON)), userHandler::deleteUser); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java deleted file mode 100644 index 147d06810..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app69; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp69Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app69" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/User.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/User.java deleted file mode 100644 index 92b8015b5..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/User.java +++ /dev/null @@ -1,59 +0,0 @@ -package test.org.springdoc.api.app69; - -public class User { - private long id; - - private String firstname; - - private String lastname; - - private int age; - - public User() { - } - - public User(long id, String firstname, String lastname, int age) { - this.id = id; - this.firstname = firstname; - this.lastname = lastname; - this.age = age; - } - - public long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getFirstname() { - return firstname; - } - - public void setFirstname(String firstname) { - this.firstname = firstname; - } - - public String getLastname() { - return lastname; - } - - public void setLastname(String lastname) { - this.lastname = lastname; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - @Override - public String toString() { - String info = String.format("id = %d, firstname = %s, lastname = %s, age = %d", id, firstname, lastname, age); - return info; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserHandler.java deleted file mode 100644 index 9d1c404b3..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserHandler.java +++ /dev/null @@ -1,93 +0,0 @@ -package test.org.springdoc.api.app69; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.BodyInserters.fromObject; - -@Component -public class UserHandler { - - private final UserRepository customerRepository; - - public UserHandler(UserRepository repository) { - this.customerRepository = repository; - } - - /** - * GET ALL Users - */ - public Mono getAll(ServerRequest request) { - // fetch all customers from repository - Flux customers = customerRepository.getAllUsers(); - - // build response - return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(customers, User.class); - } - - /** - * GET a User by ID - */ - public Mono getUser(ServerRequest request) { - // parse path-variable - long customerId = Long.valueOf(request.queryParam("id").get()); - - // build notFound response - Mono notFound = ServerResponse.notFound().build(); - - // get customer from repository - Mono customerMono = customerRepository.getUserById(customerId); - - // build response - return customerMono - .flatMap(customer -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(customer))) - .switchIfEmpty(notFound); - } - - /** - * POST a User - */ - public Mono postUser(ServerRequest request) { - Mono customer = request.bodyToMono(User.class); - return ServerResponse.ok().build(customerRepository.saveUser(customer)); - } - - /** - * PUT a User - */ - public Mono putUser(ServerRequest request) { - // parse id from path-variable - long customerId = Long.valueOf(request.pathVariable("id")); - - // get customer data from request object - Mono customer = request.bodyToMono(User.class); - - // get customer from repository - Mono responseMono = customerRepository.putUser(customerId, customer); - - // build response - return responseMono - .flatMap(cust -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(cust))); - } - - /** - * DELETE a User - */ - public Mono deleteUser(ServerRequest request) { - // parse id from path-variable - long customerId = Long.valueOf(request.pathVariable("id")); - - // get customer from repository - Mono responseMono = customerRepository.deleteUser(customerId); - - // build response - return responseMono - .flatMap(strMono -> ServerResponse.ok().contentType(MediaType.TEXT_PLAIN).body(fromObject(strMono))); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserRepository.java deleted file mode 100644 index 85ecc348c..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserRepository.java +++ /dev/null @@ -1,25 +0,0 @@ -package test.org.springdoc.api.app69; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public interface UserRepository { - - public Mono getUserById(@Parameter(in = ParameterIn.PATH, description = "The user Id") Long id); - - @Operation(description = "get all the users") - public Flux getAllUsers(); - - @Operation(description = "get all the users by firstname") - public Flux getAllUsers(String firstname); - - public Mono saveUser(Mono user); - - public Mono putUser(@Parameter(in = ParameterIn.PATH) Long id, @RequestBody Mono user); - - public Mono deleteUser(@Parameter(in = ParameterIn.PATH) Long id); -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserRepositoryImpl.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserRepositoryImpl.java deleted file mode 100644 index 55cf5764c..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app69/UserRepositoryImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -package test.org.springdoc.api.app69; - -import java.util.HashMap; -import java.util.Map; - -import jakarta.annotation.PostConstruct; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Repository; - -@Repository -public class UserRepositoryImpl implements UserRepository { - private Map users = new HashMap(); - - @PostConstruct - public void init() throws Exception { - users.put(Long.valueOf(1), new User(1, "Jack", "Smith", 20)); - users.put(Long.valueOf(2), new User(2, "Peter", "Johnson", 25)); - } - - @Override - public Mono getUserById(Long id) { - return Mono.just(users.get(id)); - } - - @Override - public Flux getAllUsers() { - return Flux.fromIterable(this.users.values()); - } - - @Override - public Flux getAllUsers(String firstname) { - return Flux.fromIterable(this.users.values().stream().filter(user -> user.getFirstname().equals(firstname)).toList()); - } - - @Override - public Mono saveUser(Mono monoUser) { - Mono userMono = monoUser.doOnNext(user -> { - // do post - users.put(user.getId(), user); - - // log on console - System.out.println("########### POST:" + user); - }); - - return userMono.then(); - } - - @Override - public Mono putUser(Long id, Mono monoUser) { - Mono userMono = monoUser.doOnNext(user -> { - // reset user.Id - user.setId(id); - - // do put - users.put(id, user); - - // log on console - System.out.println("########### PUT:" + user); - }); - - return userMono; - } - - @Override - public Mono deleteUser(Long id) { - // delete processing - users.remove(id); - return Mono.just("Delete Succesfully!"); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/Coffee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/Coffee.java deleted file mode 100644 index 0151623b1..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/Coffee.java +++ /dev/null @@ -1,60 +0,0 @@ -package test.org.springdoc.api.app70; - -import java.util.Objects; - -public class Coffee { - - private String id; - - private String name; - - public Coffee() { - } - - public Coffee(String name) { - this.name = name; - } - - public Coffee(String id, String name) { - this.id = id; - this.name = name; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Coffee coffee = (Coffee) o; - return Objects.equals(id, coffee.id) && - Objects.equals(name, coffee.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - return "Coffee{" + - "id='" + id + '\'' + - ", name='" + name + '\'' + - '}'; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeOrder.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeOrder.java deleted file mode 100644 index 1cb918689..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeOrder.java +++ /dev/null @@ -1,48 +0,0 @@ -package test.org.springdoc.api.app70; - -import java.time.Instant; -import java.util.Objects; - -public class CoffeeOrder { - private String coffeeId; - - private Instant whenOrdered; - - public CoffeeOrder() { - } - - public CoffeeOrder(String coffeeId, Instant whenOrdered) { - this.coffeeId = coffeeId; - this.whenOrdered = whenOrdered; - } - - public String getCoffeeId() { - return coffeeId; - } - - public Instant getWhenOrdered() { - return whenOrdered; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CoffeeOrder that = (CoffeeOrder) o; - return Objects.equals(coffeeId, that.coffeeId) && - Objects.equals(whenOrdered, that.whenOrdered); - } - - @Override - public int hashCode() { - return Objects.hash(coffeeId, whenOrdered); - } - - @Override - public String toString() { - return "CoffeeOrder{" + - "coffeeId='" + coffeeId + '\'' + - ", whenOrdered=" + whenOrdered + - '}'; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeRepository.java deleted file mode 100644 index 2243765ec..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeRepository.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app70; - -import org.reactivestreams.Publisher; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Repository; - -@Repository -public class CoffeeRepository { - Flux deleteAll() { - return null; - } - - Mono findById(String id) { - return null; - } - - Publisher save(Coffee coffee) { - return null; - } - - Flux findAll() { - return null; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeService.java deleted file mode 100644 index 053cd196d..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/CoffeeService.java +++ /dev/null @@ -1,34 +0,0 @@ -package test.org.springdoc.api.app70; - -import java.time.Duration; -import java.time.Instant; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Service; - -@Service -public class CoffeeService { - private final CoffeeRepository repo; - - public CoffeeService(CoffeeRepository repo) { - this.repo = repo; - } - - Flux getAllCoffees() { - return repo.findAll(); - } - - Mono getCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { - return repo.findById(id); - } - - Flux getOrdersForCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { - return Flux.interval(Duration.ofSeconds(1)) - .onBackpressureDrop() - .map(i -> new CoffeeOrder(id, Instant.now())); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/RouteConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/RouteConfig.java deleted file mode 100644 index 2048118e4..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/RouteConfig.java +++ /dev/null @@ -1,50 +0,0 @@ -package test.org.springdoc.api.app70; - -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; -import reactor.core.publisher.Mono; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -@Configuration -public class RouteConfig { - private final CoffeeService service; - - public RouteConfig(CoffeeService service) { - this.service = service; - } - - @Bean - @RouterOperations({ @RouterOperation(path = "/coffees", beanClass = CoffeeService.class, beanMethod = "getAllCoffees"), - @RouterOperation(path = "/coffees/{id}", beanClass = CoffeeService.class, beanMethod = "getCoffeeById"), - @RouterOperation(path = "/coffees/{id}/orders", beanClass = CoffeeService.class, beanMethod = "getOrdersForCoffeeById") }) - RouterFunction routerFunction() { - return route(GET("/coffees"), this::all) - .andRoute(GET("/coffees/{id}"), this::byId) - .andRoute(GET("/coffees/{id}/orders"), this::orders); - } - - private Mono all(ServerRequest req) { - return ServerResponse.ok() - .body(service.getAllCoffees(), Coffee.class); - } - - private Mono byId(ServerRequest req) { - return ServerResponse.ok() - .body(service.getCoffeeById(req.pathVariable("id")), Coffee.class); - } - - private Mono orders(ServerRequest req) { - return ServerResponse.ok() - .contentType(MediaType.TEXT_EVENT_STREAM) - .body(service.getOrdersForCoffeeById(req.pathVariable("id")), CoffeeOrder.class); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java deleted file mode 100644 index e6cd2f115..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app70; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp70Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app70" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/Employee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/Employee.java deleted file mode 100644 index d4183422a..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/Employee.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app71; - -public class Employee { - - private String id; - - private String name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/EmployeeFunctionalConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/EmployeeFunctionalConfig.java deleted file mode 100644 index a662f5ba1..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/EmployeeFunctionalConfig.java +++ /dev/null @@ -1,82 +0,0 @@ -package test.org.springdoc.api.app71; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.BodyExtractors; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; -import static org.springframework.web.reactive.function.server.ServerResponse.ok; - -@Configuration -public class EmployeeFunctionalConfig { - - - @Bean - EmployeeRepository employeeRepository() { - return new EmployeeRepository(); - } - - @Bean - @RouterOperation(beanClass = EmployeeRepository.class, beanMethod = "findAllEmployees") - RouterFunction getAllEmployeesRoute() { - return route(GET("/employees").and(accept(MediaType.APPLICATION_JSON)), - req -> ok().body( - employeeRepository().findAllEmployees(), Employee.class)); - } - - @Bean - @RouterOperation(operation = @Operation(operationId = "findEmployeeById", summary = "Find purchase order by ID", tags = { "MyEmployee" }, - parameters = { @Parameter(in = ParameterIn.PATH, name = "id", description = "Employee Id") }, - responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Employee.class))), - @ApiResponse(responseCode = "400", description = "Invalid Employee ID supplied"), - @ApiResponse(responseCode = "404", description = "Employee not found") })) - RouterFunction getEmployeeByIdRoute() { - return route(GET("/employees/{id}"), - req -> ok().body( - employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class)); - } - - - @Bean - @RouterOperation(beanClass = EmployeeRepository.class, beanMethod = "updateEmployee") - RouterFunction updateEmployeeRoute() { - return route(POST("/employees/update").and(accept(MediaType.APPLICATION_XML)), - req -> req.body(BodyExtractors.toMono(Employee.class)) - .doOnNext(employeeRepository()::updateEmployee) - .then(ok().build())); - } - - @Bean - @RouterOperations({ @RouterOperation(path = "/employees-composed/update", beanClass = EmployeeRepository.class, beanMethod = "updateEmployee"), - @RouterOperation(path = "/employees-composed/{id}", beanClass = EmployeeRepository.class, beanMethod = "findEmployeeById"), - @RouterOperation(path = "/employees-composed", beanClass = EmployeeRepository.class, beanMethod = "findAllEmployees") }) - RouterFunction composedRoutes() { - return - route(GET("/employees-composed"), - req -> ok().body( - employeeRepository().findAllEmployees(), Employee.class)) - .and(route(GET("/employees-composed/{id}"), - req -> ok().body( - employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class))) - .and(route(POST("/employees-composed/update"), - req -> req.body(BodyExtractors.toMono(Employee.class)) - .doOnNext(employeeRepository()::updateEmployee) - .then(ok().build()))); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/EmployeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/EmployeeRepository.java deleted file mode 100644 index 80e6e380d..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/EmployeeRepository.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app71; - -import java.util.Map; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public class EmployeeRepository { - - static Map employeeData; - - static Map employeeAccessData; - - - public Mono findEmployeeById(@Parameter(in = ParameterIn.PATH) String id) { - return Mono.just(employeeData.get(id)); - } - - public Flux findAllEmployees() { - return Flux.fromIterable(employeeData.values()); - } - - public Mono updateEmployee(Employee employee) { - Employee existingEmployee = employeeData.get(employee.getId()); - if (existingEmployee != null) { - existingEmployee.setName(employee.getName()); - } - return Mono.just(existingEmployee); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java deleted file mode 100644 index 41f252f62..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app71; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp71Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app71" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/SpringDocApp72Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/SpringDocApp72Test.java deleted file mode 100644 index 153324014..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/SpringDocApp72Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app72; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp72Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app72" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/controller/PersonRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/controller/PersonRouter.java deleted file mode 100644 index 850796b3c..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/controller/PersonRouter.java +++ /dev/null @@ -1,36 +0,0 @@ -package test.org.springdoc.api.app72.controller; - -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; -import test.org.springdoc.api.app72.handler.PersonHandler; -import test.org.springdoc.api.app72.service.PersonService; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.RouterFunctions; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; - -@Configuration -public class PersonRouter { - - @RouterOperations({ @RouterOperation(path = "/getAllPersons", beanClass = PersonService.class, beanMethod = "getAll"), - @RouterOperation(path = "/getPerson/{id}", beanClass = PersonService.class, beanMethod = "getById"), - @RouterOperation(path = "/createPerson", beanClass = PersonService.class, beanMethod = "save"), - @RouterOperation(path = "/deletePerson/{id}", beanClass = PersonService.class, beanMethod = "delete") }) - @Bean - public RouterFunction personRoute(PersonHandler handler) { - return RouterFunctions - .route(GET("/getAllPersons").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) - .andRoute(GET("/getPerson/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) - .andRoute(POST("/createPerson").and(accept(MediaType.APPLICATION_JSON)), handler::save) - .andRoute(DELETE("/deletePerson/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/controller/PositionRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/controller/PositionRouter.java deleted file mode 100644 index cfbc715f0..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/controller/PositionRouter.java +++ /dev/null @@ -1,48 +0,0 @@ -package test.org.springdoc.api.app72.controller; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; -import test.org.springdoc.api.app72.entity.Position; -import test.org.springdoc.api.app72.handler.PositionHandler; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.RouterFunctions; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; - -@Configuration -public class PositionRouter { - - @Bean - @RouterOperations({ @RouterOperation(path = "/getAllPositions", operation = @Operation(description = "Get all positions", operationId = "findAll", tags = "positions", - responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Position.class)))))), - @RouterOperation(path = "/getPosition/{id}", operation = @Operation(description = "Find all", operationId = "findById", tags = "positions", parameters = @Parameter(name = "id", in = ParameterIn.PATH), - responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Position.class))))), - @RouterOperation(path = "/createPosition", operation = @Operation(description = "Save position", operationId = "save", tags = "positions", requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = Position.class))), - responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Position.class))))), - @RouterOperation(path = "/deletePosition/{id}", operation = @Operation(description = "Delete By Id", operationId = "deleteBy", tags = "positions", parameters = @Parameter(name = "id", in = ParameterIn.PATH), - responses = @ApiResponse(responseCode = "200", content = @Content))) }) - public RouterFunction positionRoute(PositionHandler handler) { - return RouterFunctions - .route(GET("/getAllPositions").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) - .andRoute(GET("/getPosition/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) - .andRoute(POST("/createPosition").and(accept(MediaType.APPLICATION_JSON)), handler::save) - .andRoute(DELETE("/deletePosition/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Person.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Person.java deleted file mode 100644 index 1edfbe049..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Person.java +++ /dev/null @@ -1,74 +0,0 @@ -package test.org.springdoc.api.app72.entity; - -public class Person { - - private String id; - - private Sex sex; - - private String firstName; - - private String lastName; - - private String age; - - private String interests; - - private String email; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Sex getSex() { - return sex; - } - - public void setSex(Sex sex) { - this.sex = sex; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getAge() { - return age; - } - - public void setAge(String age) { - this.age = age; - } - - public String getInterests() { - return interests; - } - - public void setInterests(String interests) { - this.interests = interests; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Position.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Position.java deleted file mode 100644 index ce147fc3a..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Position.java +++ /dev/null @@ -1,54 +0,0 @@ -package test.org.springdoc.api.app72.entity; - -import java.util.Date; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - - -public class Position { - - private String id; - - @NotBlank - @Size(max = 140) - private String positionName; - - private String description; - - @NotNull - private Date createdAt = new Date(); - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPositionName() { - return positionName; - } - - public void setPositionName(String positionName) { - this.positionName = positionName; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Sex.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Sex.java deleted file mode 100644 index 49e457b67..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/entity/Sex.java +++ /dev/null @@ -1,5 +0,0 @@ -package test.org.springdoc.api.app72.entity; - -public enum Sex { - MAN, WOMEN -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/exception/PositionNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/exception/PositionNotFoundException.java deleted file mode 100644 index 4e2e5d872..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/exception/PositionNotFoundException.java +++ /dev/null @@ -1,8 +0,0 @@ -package test.org.springdoc.api.app72.exception; - -public class PositionNotFoundException extends RuntimeException { - - public PositionNotFoundException(String positionId) { - super("Position not found with id " + positionId); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/handler/PersonHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/handler/PersonHandler.java deleted file mode 100644 index 8bc6b8c85..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/handler/PersonHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -package test.org.springdoc.api.app72.handler; - -import reactor.core.publisher.Mono; -import test.org.springdoc.api.app72.entity.Person; -import test.org.springdoc.api.app72.service.PersonService; - -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.BodyInserters; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.ServerResponse.ok; - -@Component -@SuppressWarnings({ "deprecared", "unchecked" }) -public class PersonHandler { - - private final PersonService personService; - - public PersonHandler(PersonService personService) { - this.personService = personService; - } - - public Mono findById(ServerRequest request) { - String id = request.pathVariable("id"); - return ok() - .contentType(MediaType.APPLICATION_JSON) - .body(personService.getById(id), Person.class); - } - - public Mono findAll(ServerRequest request) { - return ok() - .contentType(MediaType.APPLICATION_JSON) - .body(personService.getAll(), Person.class); - } - - public Mono save(ServerRequest request) { - final Mono person = request.bodyToMono(Person.class); - return ok() - .contentType(MediaType.APPLICATION_JSON) - .body(BodyInserters.fromPublisher(person.flatMap(personService::save), Person.class)); - } - - public Mono delete(ServerRequest request) { - String id = request.pathVariable("id"); - return ok() - .contentType(MediaType.APPLICATION_JSON) - .body(personService.delete(id), Void.class); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/handler/PositionHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/handler/PositionHandler.java deleted file mode 100644 index feaa44aa0..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/handler/PositionHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app72.handler; - -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -@Component -public class PositionHandler { - - - public Mono findById(ServerRequest request) { - String id = request.pathVariable("id"); - return null; - } - - public Mono findAll(ServerRequest request) { - return null; - } - - public Mono save(ServerRequest request) { - return null; - } - - public Mono delete(ServerRequest request) { - return null; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/payload/ErrorResponse.java deleted file mode 100644 index f05cc7797..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/payload/ErrorResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app72.payload; - -public class ErrorResponse { - - private String message; - - public ErrorResponse(String message) { - this.message = message; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/service/PersonService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/service/PersonService.java deleted file mode 100644 index c1ac684bc..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app72/service/PersonService.java +++ /dev/null @@ -1,39 +0,0 @@ -package test.org.springdoc.api.app72.service; - -import java.util.Objects; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import test.org.springdoc.api.app72.entity.Person; - -import org.springframework.stereotype.Service; - -@Service -public class PersonService { - - public Flux getAll() { - return null; - } - - public Mono getById(@Parameter(in = ParameterIn.PATH) final String id) { - return null; - } - - public Mono update(@Parameter(in = ParameterIn.PATH) final String id, final Person person) { - return null; - } - - public Mono save(final Person person) { - return null; - } - - public Mono delete(@Parameter(in = ParameterIn.PATH) final String id) { - final Mono dbPerson = getById(id); - if (Objects.isNull(dbPerson)) { - return Mono.empty(); - } - return null; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/Quote.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/Quote.java deleted file mode 100644 index 34eb837d6..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/Quote.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app73; - - -import java.math.BigDecimal; -import java.math.MathContext; -import java.time.Instant; - -public class Quote { - - private static final MathContext MATH_CONTEXT = new MathContext(2); - - private String ticker; - - private BigDecimal price; - - private Instant instant; - - public Quote() { - } - - public Quote(String ticker, BigDecimal price) { - this.ticker = ticker; - this.price = price; - } - - public Quote(String ticker, Double price) { - this(ticker, new BigDecimal(price, MATH_CONTEXT)); - } - - public String getTicker() { - return ticker; - } - - public void setTicker(String ticker) { - this.ticker = ticker; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public Instant getInstant() { - return instant; - } - - public void setInstant(Instant instant) { - this.instant = instant; - } - - @Override - public String toString() { - return "Quote{" + - "ticker='" + ticker + '\'' + - ", price=" + price + - ", instant=" + instant + - '}'; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteGenerator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteGenerator.java deleted file mode 100644 index 305934d2c..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteGenerator.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app73; - - -import java.math.BigDecimal; -import java.math.MathContext; -import java.time.Duration; -import java.time.Instant; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import reactor.core.publisher.Flux; - -import org.springframework.stereotype.Component; - -@Component -public class QuoteGenerator { - - private final MathContext mathContext = new MathContext(2); - - private final Random random = new Random(); - - private final List prices = new ArrayList<>(); - - /** - * Bootstraps the generator with tickers and initial prices - */ - public QuoteGenerator() { - this.prices.add(new Quote("CTXS", 82.26)); - this.prices.add(new Quote("DELL", 63.74)); - this.prices.add(new Quote("GOOG", 847.24)); - this.prices.add(new Quote("MSFT", 65.11)); - this.prices.add(new Quote("ORCL", 45.71)); - this.prices.add(new Quote("RHT", 84.29)); - this.prices.add(new Quote("VMW", 92.21)); - } - - - public Flux fetchQuoteStream(Duration period) { - - // We want to emit quotes with a specific period; - // to do so, we create a Flux.interval - return Flux.interval(period) - // In case of back-pressure, drop events - .onBackpressureDrop() - // For each tick, generate a list of quotes - .map(this::generateQuotes) - // "flatten" that List into a Flux - .flatMapIterable(quotes -> quotes) - .log("io.spring.workshop.stockquotes"); - } - - /* - * Create quotes for all tickers at a single instant. - */ - private List generateQuotes(long interval) { - final Instant instant = Instant.now(); - return prices.stream() - .map(baseQuote -> { - BigDecimal priceChange = baseQuote.getPrice() - .multiply(new BigDecimal(0.05 * this.random.nextDouble()), this.mathContext); - Quote result = new Quote(baseQuote.getTicker(), baseQuote.getPrice().add(priceChange)); - result.setInstant(instant); - return result; - }) - .toList(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteHandler.java deleted file mode 100644 index d99c917fd..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteHandler.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app73; - - -import java.time.Duration; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.BodyInserters; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -@Component -public class QuoteHandler { - - private final Flux quoteStream; - - public QuoteHandler(QuoteGenerator quoteGenerator) { - this.quoteStream = quoteGenerator.fetchQuoteStream(Duration.ofMillis(1000)).share(); - } - - public Mono hello(ServerRequest request) { - return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) - .body(BodyInserters.fromObject("Hello Spring!")); - } - - public Mono echo(ServerRequest request) { - return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) - .body(request.bodyToMono(String.class), String.class); - } - - public Mono streamQuotes(ServerRequest request) { - return ServerResponse.ok() - .contentType(MediaType.APPLICATION_STREAM_JSON) - .body(this.quoteStream, Quote.class); - } - - public Mono fetchQuotes(ServerRequest request) { - int size = Integer.parseInt(request.queryParam("size").orElse("10")); - return ServerResponse.ok() - .contentType(MediaType.APPLICATION_JSON) - .body(this.quoteStream.take(size), Quote.class); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteRouter.java deleted file mode 100644 index babcf8957..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/QuoteRouter.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app73; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.RouterFunctions; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.http.MediaType.APPLICATION_JSON; -import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; -import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; -import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON_VALUE; -import static org.springframework.http.MediaType.TEXT_PLAIN; -import static org.springframework.http.MediaType.TEXT_PLAIN_VALUE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RequestPredicates.contentType; - -@Configuration -public class QuoteRouter { - - @RouterOperations({ - @RouterOperation(path = "/hello", operation = @Operation(operationId = "hello", responses = @ApiResponse(responseCode = "200"))), - @RouterOperation(path = "/echo", produces = TEXT_PLAIN_VALUE, operation = @Operation(operationId = "echo", requestBody = @RequestBody(content = @Content(schema = @Schema(type = "string"))), - responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(type = "string"))))), - @RouterOperation(path = "/echo", produces = APPLICATION_JSON_VALUE, operation = @Operation(operationId = "echo", requestBody = @RequestBody(content = @Content(schema = @Schema(type = "string"))), - responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(type = "string"))))), - @RouterOperation(path = "/quotes", produces = APPLICATION_JSON_VALUE, operation = @Operation(operationId = "fetchQuotes", parameters = @Parameter(name = "size", in = ParameterIn.QUERY, schema = @Schema(type = "string")), - responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Quote.class)))))), - @RouterOperation(path = "/quotes", produces = APPLICATION_STREAM_JSON_VALUE, operation = @Operation(operationId = "fetchQuotes", - responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Quote.class))))) }) - @Bean - public RouterFunction route(QuoteHandler quoteHandler) { - return RouterFunctions - .route(GET("/hello").and(accept(TEXT_PLAIN)), quoteHandler::hello) - .andRoute(POST("/echo").and(accept(TEXT_PLAIN).and(contentType(TEXT_PLAIN))), quoteHandler::echo) - .andRoute(POST("/echo").and(accept(APPLICATION_JSON).and(contentType(APPLICATION_JSON))), quoteHandler::echo) - .andRoute(GET("/quotes").and(accept(APPLICATION_JSON)), quoteHandler::fetchQuotes) - .andRoute(GET("/quotes").and(accept(APPLICATION_STREAM_JSON)), quoteHandler::streamQuotes); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java deleted file mode 100644 index e65782664..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app73; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp73Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app73" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/Book.java deleted file mode 100644 index 3cce755e9..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/Book.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app74; - -public class Book { - - private String id; - - private String title; - - private String author; - - public Book(String id, String title, String author) { - this.id = id; - this.title = title; - this.author = author; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/BookRepository.java deleted file mode 100644 index 298dba914..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/BookRepository.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app74; - -import reactor.core.publisher.Flux; - -import org.springframework.stereotype.Component; - -@Component -public class BookRepository { - - - Flux findByAuthor(String author) { - return Flux.just(new Book("1", "title1", "author1")); - } - - Flux findAll() { - return Flux.just(new Book("2", "title2", "author2")); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/BookRouter.java deleted file mode 100644 index 81577bddb..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/BookRouter.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app74; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; - -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; -import static org.springframework.web.reactive.function.server.ServerResponse.ok; - -@Configuration -class BookRouter { - - @Bean - @RouterOperations({ - @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) - RouterFunction routes(BookRepository br) { - return - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) - .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java deleted file mode 100644 index 82ee9c754..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app74; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp74Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app74" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/Post.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/Post.java deleted file mode 100644 index f2013dd87..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/Post.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app75; - -import java.time.LocalDateTime; - -public class Post { - - private String id; - - private String title; - - private String content; - - private LocalDateTime createdDate; - - public Post(String id, String title, String content) { - this.id = id; - this.title = title; - this.content = content; - this.createdDate = LocalDateTime.now(); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public LocalDateTime getCreatedDate() { - return createdDate; - } - - public void setCreatedDate(LocalDateTime createdDate) { - this.createdDate = createdDate; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostHandler.java deleted file mode 100644 index 90f4d94a3..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostHandler.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app75; - - -import java.net.URI; - -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -@Component -class PostHandler { - - private final PostRepository posts; - - public PostHandler(PostRepository posts) { - this.posts = posts; - } - - public Mono all(ServerRequest req) { - return ServerResponse.ok().body(this.posts.findAll(), Post.class); - } - - public Mono create(ServerRequest req) { - return req.bodyToMono(Post.class) - .flatMap(post -> this.posts.save(post)) - .flatMap(p -> ServerResponse.created(URI.create("/posts/" + p.getId())).build()); - } - - public Mono get(ServerRequest req) { - return this.posts.findById(req.pathVariable("id")) - .flatMap(post -> ServerResponse.ok().body(Mono.just(post), Post.class)) - .switchIfEmpty(ServerResponse.notFound().build()); - } - - public Mono update(ServerRequest req) { - - return Mono - .zip( - (data) -> { - Post p = (Post) data[0]; - Post p2 = (Post) data[1]; - p.setTitle(p2.getTitle()); - p.setContent(p2.getContent()); - return p; - }, - this.posts.findById(req.pathVariable("id")), - req.bodyToMono(Post.class) - ) - .cast(Post.class) - .flatMap(post -> this.posts.save(post)) - .flatMap(post -> ServerResponse.noContent().build()); - - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostRepository.java deleted file mode 100644 index 5277e026d..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostRepository.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app75; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Component; - -@Component -public class PostRepository { - - public Flux findByAuthor(String author) { - return Flux.just(new Post("1", "title1", "author1")); - } - - public Flux findAll() { - return Flux.just(new Post("2", "title2", "author2")); - } - - public Mono findById(String id) { - return Mono.just(new Post("3", "title2", "author2")); - } - - public Mono save(Post post) { - return Mono.just(new Post("4", "title2", "author2")); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostRouter.java deleted file mode 100644 index c35101c1f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/PostRouter.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app75; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; -import static org.springframework.web.reactive.function.server.RequestPredicates.queryParam; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -@Configuration -class PostRouter { - - @RouterOperations({ @RouterOperation(path = "/posts", method = RequestMethod.GET, headers = { "x-header1=test1", "x-header2=test2" }, operation = @Operation(operationId = "all", - parameters = { @Parameter(name = "key", description = "sample description"), @Parameter(name = "test", description = "sample desc") }, - responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Post.class)))))), - @RouterOperation(path = "/posts", method = RequestMethod.POST, operation = @Operation(operationId = "create", - requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = Post.class))), responses = @ApiResponse(responseCode = "201"))), - @RouterOperation(path = "/posts/{id}", method = RequestMethod.GET, operation = @Operation(operationId = "get", - parameters = @Parameter(name = "id", in = ParameterIn.PATH), - responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Post.class))))), - @RouterOperation(path = "/posts/{id}", method = RequestMethod.PUT, operation = @Operation(operationId = "update", - parameters = @Parameter(name = "id", in = ParameterIn.PATH), - responses = @ApiResponse(responseCode = "202", content = @Content(schema = @Schema(implementation = Post.class))))) }) - @Bean - public RouterFunction routes(PostHandler postController) { - return route(GET("/posts").and(queryParam("key", "value")), postController::all) - .andRoute(POST("/posts"), postController::create) - .andRoute(GET("/posts/{id}"), postController::get) - .andRoute(PUT("/posts/{id}"), postController::update); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java deleted file mode 100644 index 826dab7ef..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app75; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp75Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app75" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app78/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app78/HelloController.java deleted file mode 100644 index 256c7891b..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app78/HelloController.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app78; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import reactor.core.publisher.Flux; - -import org.springframework.http.MediaType; -import org.springframework.http.codec.multipart.FilePart; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - - @PostMapping(value = "/files", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) - @Operation(summary = "files") - public Flux handleFileUpload( - @RequestPart("files") @Parameter(description = "files", - content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) - Flux filePartFux) throws IOException { - File tmp = File.createTempFile("tmp", ""); - return filePartFux.flatMap(filePart -> { - Path path = Paths.get(tmp.toString() + filePart.filename()); - System.out.println(path); - return filePart.transferTo(path); - }); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java deleted file mode 100644 index 7f6ad9955..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app78; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp78Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app78" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/BaseClientModel.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/BaseClientModel.java deleted file mode 100644 index 0b5878ba6..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/BaseClientModel.java +++ /dev/null @@ -1,8 +0,0 @@ -package test.org.springdoc.api.app79; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public abstract class BaseClientModel { - @JsonProperty("id") - int id; -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/BaseController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/BaseController.java deleted file mode 100644 index 641dcc85d..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/BaseController.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app79; - -import java.util.List; - -import reactor.core.publisher.Mono; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; - -public abstract class BaseController { - @GetMapping("/test1") - Mono> get1() { - return null; - } - - @GetMapping("/test2") - Mono>> get2() { - return null; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpecificClientModel.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpecificClientModel.java deleted file mode 100644 index c14081e21..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpecificClientModel.java +++ /dev/null @@ -1,10 +0,0 @@ -package test.org.springdoc.api.app79; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -public class SpecificClientModel extends BaseClientModel { - @JsonProperty("name") - @Schema(title = "my title", pattern = "this is it", example = "this is example") - String name; -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpecificController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpecificController.java deleted file mode 100644 index ec6984aaa..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpecificController.java +++ /dev/null @@ -1,6 +0,0 @@ -package test.org.springdoc.api.app79; - -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class SpecificController extends BaseController {} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java deleted file mode 100644 index dc76a3d1f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app79; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp79Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app79" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/Book.java deleted file mode 100644 index 5785cd907..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/Book.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app80; - -public class Book { - - private String id; - - private String title; - - private String author; - - public Book(String id, String title, String author) { - this.id = id; - this.title = title; - this.author = author; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/BookRepository.java deleted file mode 100644 index 27dc79eec..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/BookRepository.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app80; - -import reactor.core.publisher.Flux; - -import org.springframework.stereotype.Component; - -@Component -public class BookRepository { - - - Flux findByAuthor(String author) { - return Flux.just(new Book("1", "title1", "author1")); - } - - Flux findAll() { - return Flux.just(new Book("2", "title2", "author2")); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/BookRouter.java deleted file mode 100644 index a5a82f785..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/BookRouter.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app80; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; - -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RequestPredicates.path; -import static org.springframework.web.reactive.function.server.RouterFunctions.nest; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; -import static org.springframework.web.reactive.function.server.ServerResponse.ok; - -@Configuration -class BookRouter { - - @Bean - @RouterOperations({ - @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) - RouterFunction routes(BookRepository br) { - return - nest(path("/greeter").and(path("/greeter2")), - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) - .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class))); - } - - @Bean - @RouterOperations({ - @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) - RouterFunction routes1(BookRepository br) { - return - nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), - route(GET("/books"), req -> ok().body(br.findAll(), Book.class)) - .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class))); - } - - @Bean - @RouterOperations({ - @RouterOperation(path = "/greeter/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })), - @RouterOperation(path = "/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) - RouterFunction routes3(BookRepository br) { - return - nest(path("/greeter").or(path("/greeter2")), - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) - .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class))); - } - - @Bean - @RouterOperations({ - @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/test/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) - RouterFunction routes4(BookRepository br) { - return - nest(path("/test"), - nest(path("/greeter").and(path("/greeter2")), - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) - .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)))); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java deleted file mode 100644 index 799706e45..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app80; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp80Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app80" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app81/OperationIdController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app81/OperationIdController.java deleted file mode 100644 index cf380f511..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app81/OperationIdController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app81; - -import reactor.core.publisher.Mono; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class OperationIdController { - - @GetMapping(path = "/test_0") // gets operationId opIdTest_3 - public Mono opIdTest() { - return null; - } - - @GetMapping(path = "/test_1") // gets operationId opIdTest_2 - public Mono opIdTest(@RequestParam String param) { - return null; - } - - @GetMapping(path = "/test_2") // gets operationId opIdTest_1 - public Mono opIdTest(@RequestParam Integer param) { - return null; - } - - @GetMapping(path = "/test_3") // gets operationId opIdTest - public Mono opIdTest(@RequestParam Boolean param) { - return null; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java deleted file mode 100644 index 716e65061..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app81; - -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.ThreadLocalRandom; - -import org.junit.jupiter.api.RepeatedTest; -import org.springdoc.webflux.api.OpenApiWebfluxResource; -import test.org.springdoc.api.AbstractCommonTest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.http.server.reactive.ServerHttpRequest; -import org.springframework.web.method.HandlerMethod; -import org.springframework.web.reactive.result.method.RequestMappingInfo; -import org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springdoc.core.utils.Constants.SPRINGDOC_CACHE_DISABLED; - - -/** - * Tests deterministic creation of operationIds - */ -@WebFluxTest(properties = SPRINGDOC_CACHE_DISABLED + "=true") -public class SpringDocApp81Test extends AbstractCommonTest { - - @Autowired - OpenApiWebfluxResource resource; - - @Autowired - RequestMappingInfoHandlerMapping mappingInfoHandlerMapping; - - @RepeatedTest(10) - public void shouldGenerateOperationIdsDeterministically() throws Exception { - shuffleSpringHandlerMethods(); - - ServerHttpRequest request = mock(ServerHttpRequest.class); - when(request.getURI()).thenReturn(URI.create("http://localhost")); - - String expected = getContent("results/app81.json"); - byte[] openApiBytes =resource.openapiJson(request, "", Locale.US).block(); - String openApi = new String(openApiBytes, StandardCharsets.UTF_8); // for UTF-8 encoding String openApi = resource.openapiJson(request, "", Locale.US).block(); - assertEquals(expected, openApi, true); - } - - private void shuffleSpringHandlerMethods() { - Map handlerMethods = mappingInfoHandlerMapping.getHandlerMethods(); - List> collect = new ArrayList<>(handlerMethods.entrySet()); - collect.sort(Comparator.comparing(a -> ThreadLocalRandom.current().nextBoolean() ? -1 : 1)); - - collect.forEach(e -> mappingInfoHandlerMapping.unregisterMapping(e.getKey())); - collect.forEach(e -> mappingInfoHandlerMapping.registerMapping(e.getKey(), e.getValue().getBean(), e.getValue().getMethod())); - } - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app81" }) - static class SpringDocTestApp { - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/RoutingConfiguration.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/RoutingConfiguration.java deleted file mode 100644 index 097484b5a..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/RoutingConfiguration.java +++ /dev/null @@ -1,39 +0,0 @@ -package test.org.springdoc.api.app82; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.http.MediaType.APPLICATION_JSON; -import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -@Configuration -public class RoutingConfiguration { - - @Bean - public RouterFunction monoRouterFunction(UserHandler userHandler) { - return route(GET("/api/user/index").and(accept(APPLICATION_JSON)), userHandler::getAll) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("getAllUsers")) - - .and(route(GET("/api/user/{id}").and(accept(APPLICATION_JSON)), userHandler::getUser) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("getUserById"))) - - .and(route(POST("/api/user/post").and(accept(APPLICATION_JSON)), userHandler::postUser) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("saveUser"))) - - .and(route(PUT("/api/user/put").and(accept(APPLICATION_JSON)), userHandler::putUser) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("putUser"))) - - .and(route(DELETE("/api/user/delete/{id}").and(accept(APPLICATION_JSON)), userHandler::deleteUser) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("deleteUser"))); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java deleted file mode 100644 index 5515a48e2..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app82; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp82Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app82" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/User.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/User.java deleted file mode 100644 index 9c3fede16..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/User.java +++ /dev/null @@ -1,59 +0,0 @@ -package test.org.springdoc.api.app82; - -public class User { - private long id; - - private String firstname; - - private String lastname; - - private int age; - - public User() { - } - - public User(long id, String firstname, String lastname, int age) { - this.id = id; - this.firstname = firstname; - this.lastname = lastname; - this.age = age; - } - - public long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getFirstname() { - return firstname; - } - - public void setFirstname(String firstname) { - this.firstname = firstname; - } - - public String getLastname() { - return lastname; - } - - public void setLastname(String lastname) { - this.lastname = lastname; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - @Override - public String toString() { - String info = String.format("id = %d, firstname = %s, lastname = %s, age = %d", id, firstname, lastname, age); - return info; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserHandler.java deleted file mode 100644 index d44aa3c1f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserHandler.java +++ /dev/null @@ -1,93 +0,0 @@ -package test.org.springdoc.api.app82; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.BodyInserters.fromObject; - -@Component -public class UserHandler { - - private final UserRepository customerRepository; - - public UserHandler(UserRepository repository) { - this.customerRepository = repository; - } - - /** - * GET ALL Users - */ - public Mono getAll(ServerRequest request) { - // fetch all customers from repository - Flux customers = customerRepository.getAllUsers(); - - // build response - return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(customers, User.class); - } - - /** - * GET a User by ID - */ - public Mono getUser(ServerRequest request) { - // parse path-variable - long customerId = Long.valueOf(request.queryParam("id").get()); - - // build notFound response - Mono notFound = ServerResponse.notFound().build(); - - // get customer from repository - Mono customerMono = customerRepository.getUserById(customerId); - - // build response - return customerMono - .flatMap(customer -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(customer))) - .switchIfEmpty(notFound); - } - - /** - * POST a User - */ - public Mono postUser(ServerRequest request) { - Mono customer = request.bodyToMono(User.class); - return ServerResponse.ok().build(customerRepository.saveUser(customer)); - } - - /** - * PUT a User - */ - public Mono putUser(ServerRequest request) { - // parse id from path-variable - long customerId = Long.valueOf(request.pathVariable("id")); - - // get customer data from request object - Mono customer = request.bodyToMono(User.class); - - // get customer from repository - Mono responseMono = customerRepository.putUser(customerId, customer); - - // build response - return responseMono - .flatMap(cust -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(cust))); - } - - /** - * DELETE a User - */ - public Mono deleteUser(ServerRequest request) { - // parse id from path-variable - long customerId = Long.valueOf(request.pathVariable("id")); - - // get customer from repository - Mono responseMono = customerRepository.deleteUser(customerId); - - // build response - return responseMono - .flatMap(strMono -> ServerResponse.ok().contentType(MediaType.TEXT_PLAIN).body(fromObject(strMono))); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserRepository.java deleted file mode 100644 index a0e7d888b..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserRepository.java +++ /dev/null @@ -1,25 +0,0 @@ -package test.org.springdoc.api.app82; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public interface UserRepository { - - public Mono getUserById(@Parameter(in = ParameterIn.PATH, description = "The user Id") Long id); - - @Operation(description = "get all the users") - public Flux getAllUsers(); - - @Operation(description = "get all the users by firstname") - public Flux getAllUsers(String firstname); - - public Mono saveUser(Mono user); - - public Mono putUser(@Parameter(in = ParameterIn.QUERY) Long id, @RequestBody Mono user); - - public Mono deleteUser(@Parameter(in = ParameterIn.PATH) Long id); -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserRepositoryImpl.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserRepositoryImpl.java deleted file mode 100644 index 236410585..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app82/UserRepositoryImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -package test.org.springdoc.api.app82; - -import java.util.HashMap; -import java.util.Map; - -import jakarta.annotation.PostConstruct; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Repository; - -@Repository -public class UserRepositoryImpl implements UserRepository { - private Map users = new HashMap(); - - @PostConstruct - public void init() throws Exception { - users.put(Long.valueOf(1), new User(1, "Jack", "Smith", 20)); - users.put(Long.valueOf(2), new User(2, "Peter", "Johnson", 25)); - } - - @Override - public Mono getUserById(Long id) { - return Mono.just(users.get(id)); - } - - @Override - public Flux getAllUsers() { - return Flux.fromIterable(this.users.values()); - } - - @Override - public Flux getAllUsers(String firstname) { - return Flux.fromIterable(this.users.values().stream().filter(user -> user.getFirstname().equals(firstname)).toList()); - } - - @Override - public Mono saveUser(Mono monoUser) { - Mono userMono = monoUser.doOnNext(user -> { - // do post - users.put(user.getId(), user); - - // log on console - System.out.println("########### POST:" + user); - }); - - return userMono.then(); - } - - @Override - public Mono putUser(Long id, Mono monoUser) { - Mono userMono = monoUser.doOnNext(user -> { - // reset user.Id - user.setId(id); - - // do put - users.put(id, user); - - // log on console - System.out.println("########### PUT:" + user); - }); - - return userMono; - } - - @Override - public Mono deleteUser(Long id) { - // delete processing - users.remove(id); - return Mono.just("Delete Succesfully!"); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/Coffee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/Coffee.java deleted file mode 100644 index fbddaefda..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/Coffee.java +++ /dev/null @@ -1,60 +0,0 @@ -package test.org.springdoc.api.app83; - -import java.util.Objects; - -public class Coffee { - - private String id; - - private String name; - - public Coffee() { - } - - public Coffee(String name) { - this.name = name; - } - - public Coffee(String id, String name) { - this.id = id; - this.name = name; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Coffee coffee = (Coffee) o; - return Objects.equals(id, coffee.id) && - Objects.equals(name, coffee.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - return "Coffee{" + - "id='" + id + '\'' + - ", name='" + name + '\'' + - '}'; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeOrder.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeOrder.java deleted file mode 100644 index f7e17f17e..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeOrder.java +++ /dev/null @@ -1,48 +0,0 @@ -package test.org.springdoc.api.app83; - -import java.time.Instant; -import java.util.Objects; - -public class CoffeeOrder { - private String coffeeId; - - private Instant whenOrdered; - - public CoffeeOrder() { - } - - public CoffeeOrder(String coffeeId, Instant whenOrdered) { - this.coffeeId = coffeeId; - this.whenOrdered = whenOrdered; - } - - public String getCoffeeId() { - return coffeeId; - } - - public Instant getWhenOrdered() { - return whenOrdered; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - CoffeeOrder that = (CoffeeOrder) o; - return Objects.equals(coffeeId, that.coffeeId) && - Objects.equals(whenOrdered, that.whenOrdered); - } - - @Override - public int hashCode() { - return Objects.hash(coffeeId, whenOrdered); - } - - @Override - public String toString() { - return "CoffeeOrder{" + - "coffeeId='" + coffeeId + '\'' + - ", whenOrdered=" + whenOrdered + - '}'; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeRepository.java deleted file mode 100644 index 366e447c8..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeRepository.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app83; - -import org.reactivestreams.Publisher; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Repository; - -@Repository -public class CoffeeRepository { - Flux deleteAll() { - return null; - } - - Mono findById(String id) { - return null; - } - - Publisher save(Coffee coffee) { - return null; - } - - Flux findAll() { - return null; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeService.java deleted file mode 100644 index 6543bccbc..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/CoffeeService.java +++ /dev/null @@ -1,34 +0,0 @@ -package test.org.springdoc.api.app83; - -import java.time.Duration; -import java.time.Instant; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Service; - -@Service -public class CoffeeService { - private final CoffeeRepository repo; - - public CoffeeService(CoffeeRepository repo) { - this.repo = repo; - } - - Flux getAllCoffees() { - return repo.findAll(); - } - - Mono getCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { - return repo.findById(id); - } - - Flux getOrdersForCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { - return Flux.interval(Duration.ofSeconds(1)) - .onBackpressureDrop() - .map(i -> new CoffeeOrder(id, Instant.now())); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/RouteConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/RouteConfig.java deleted file mode 100644 index 7f1e9860c..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/RouteConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -package test.org.springdoc.api.app83; - -import reactor.core.publisher.Mono; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -@Configuration -public class RouteConfig { - private final CoffeeService service; - - public RouteConfig(CoffeeService service) { - this.service = service; - } - - @Bean - RouterFunction routerFunction() { - return route(GET("/coffees"), this::all) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(CoffeeService.class).beanMethod("getAllCoffees")) - - .and(route(GET("/coffees/{id}"), this::byId) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(CoffeeService.class).beanMethod("getCoffeeById"))) - - .and(route(GET("/coffees/{id}/orders"), this::orders) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(CoffeeService.class).beanMethod("getOrdersForCoffeeById"))); - } - - private Mono all(ServerRequest req) { - return ServerResponse.ok() - .body(service.getAllCoffees(), Coffee.class); - } - - private Mono byId(ServerRequest req) { - return ServerResponse.ok() - .body(service.getCoffeeById(req.pathVariable("id")), Coffee.class); - } - - private Mono orders(ServerRequest req) { - return ServerResponse.ok() - .contentType(MediaType.TEXT_EVENT_STREAM) - .body(service.getOrdersForCoffeeById(req.pathVariable("id")), CoffeeOrder.class); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java deleted file mode 100644 index 405fa4e25..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app83; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp83Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app83" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/Employee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/Employee.java deleted file mode 100644 index 747e2caef..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/Employee.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app84; - -public class Employee { - - private String id; - - private String name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/EmployeeFunctionalConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/EmployeeFunctionalConfig.java deleted file mode 100644 index c5d630f1d..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/EmployeeFunctionalConfig.java +++ /dev/null @@ -1,81 +0,0 @@ -package test.org.springdoc.api.app84; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.BodyExtractors; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; -import static org.springframework.web.reactive.function.server.ServerResponse.ok; - -@Configuration -public class EmployeeFunctionalConfig { - - - @Bean - EmployeeRepository employeeRepository() { - return new EmployeeRepository(); - } - - @Bean - RouterFunction getAllEmployeesRoute() { - return route(GET("/employees").and(accept(MediaType.APPLICATION_JSON)), - req -> ok().body( - employeeRepository().findAllEmployees(), Employee.class)) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("findAllEmployees")); - } - - @Bean - RouterFunction getEmployeeByIdRoute() { - return route(GET("/employees/{id}"), - req -> ok().body( - employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class)) - .withAttribute(OPERATION_ATTRIBUTE, - operationBuilder().operationId("findEmployeeById").summary("Find purchase order by ID").tags(new String[] { "MyEmployee" }) - .parameter(parameterBuilder().in(ParameterIn.PATH).name("id").description("Employee Id")) - .response(responseBuilder().responseCode("200").description("successful operation").implementation(Employee.class)) - .response(responseBuilder().responseCode("400").description("Invalid Employee ID supplied")) - .response(responseBuilder().responseCode("404").description("Employee not found"))); - } - - - @Bean - RouterFunction updateEmployeeRoute() { - return route(POST("/employees/update").and(accept(MediaType.APPLICATION_XML)), - req -> req.body(BodyExtractors.toMono(Employee.class)) - .doOnNext(employeeRepository()::updateEmployee) - .then(ok().build())) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("updateEmployee")); - } - - @Bean - RouterFunction composedRoutes() { - return - route(GET("/employees-composed"), - req -> ok().body( - employeeRepository().findAllEmployees(), Employee.class)) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("findAllEmployees")) - - .and(route(GET("/employees-composed/{id}"), req -> ok().body( - employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class)) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("findEmployeeById"))) - - .and(route(POST("/employees-composed/update"), - req -> req.body(BodyExtractors.toMono(Employee.class)) - .doOnNext(employeeRepository()::updateEmployee) - .then(ok().build())) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("updateEmployee"))); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/EmployeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/EmployeeRepository.java deleted file mode 100644 index 003e6fd35..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/EmployeeRepository.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app84; - -import java.util.Map; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public class EmployeeRepository { - - static Map employeeData; - - static Map employeeAccessData; - - - public Mono findEmployeeById(@Parameter(in = ParameterIn.PATH) String id) { - return Mono.just(employeeData.get(id)); - } - - public Flux findAllEmployees() { - return Flux.fromIterable(employeeData.values()); - } - - public Mono updateEmployee(Employee employee) { - Employee existingEmployee = employeeData.get(employee.getId()); - if (existingEmployee != null) { - existingEmployee.setName(employee.getName()); - } - return Mono.just(existingEmployee); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java deleted file mode 100644 index 3e554b55f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app84; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp84Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app84" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java deleted file mode 100644 index cffdeeec4..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app85; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp85Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app85" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/controller/PersonRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/controller/PersonRouter.java deleted file mode 100644 index 15e0235f3..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/controller/PersonRouter.java +++ /dev/null @@ -1,39 +0,0 @@ -package test.org.springdoc.api.app85.controller; - -import test.org.springdoc.api.app85.handler.PersonHandler; -import test.org.springdoc.api.app85.service.PersonService; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - - -@Configuration -public class PersonRouter { - - @Bean - public RouterFunction personRoute(PersonHandler handler) { - return route(GET("/getAllPersons").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("getAll")) - - .and(route(GET("/getPerson/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("getById"))) - - .and(route(POST("/createPerson").and(accept(MediaType.APPLICATION_JSON)), handler::save) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("save"))) - - .and(route(DELETE("/deletePerson/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("delete"))); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/controller/PositionRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/controller/PositionRouter.java deleted file mode 100644 index ee3f0a7c0..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/controller/PositionRouter.java +++ /dev/null @@ -1,53 +0,0 @@ -package test.org.springdoc.api.app85.controller; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import test.org.springdoc.api.app85.entity.Position; -import test.org.springdoc.api.app85.handler.PositionHandler; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; -import static org.springdoc.core.fn.builders.content.Builder.contentBuilder; -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -@Configuration -public class PositionRouter { - - @Bean - public RouterFunction positionRoute(PositionHandler handler) { - return route(GET("/getAllPositions").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("findAll").description("Get all positions").tags(new String[] { "positions" }) - .response(responseBuilder().responseCode("200").implementationArray(Position.class))) - - .and(route(GET("/getPosition/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) - .withAttribute(OPERATION_ATTRIBUTE, - operationBuilder().operationId("findById").description("Find all").tags(new String[] { "positions" }) - .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) - .response(responseBuilder().responseCode("200").implementation(Position.class)))) - - .and(route(POST("/createPosition").and(accept(MediaType.APPLICATION_JSON)), handler::save) - .withAttribute(OPERATION_ATTRIBUTE, - operationBuilder().operationId("save").description("Save position").tags(new String[] { "positions" }) - .requestBody(requestBodyBuilder().implementation(Position.class)) - .response(responseBuilder().responseCode("200").implementation(Position.class)))) - - .and(route(DELETE("/deletePosition/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete) - .withAttribute(OPERATION_ATTRIBUTE, - operationBuilder().operationId("deleteBy").description("Delete By Id").tags(new String[] { "positions" }) - .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) - .response(responseBuilder().responseCode("200").content(contentBuilder())))); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Person.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Person.java deleted file mode 100644 index cc7a3b99e..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Person.java +++ /dev/null @@ -1,74 +0,0 @@ -package test.org.springdoc.api.app85.entity; - -public class Person { - - private String id; - - private Sex sex; - - private String firstName; - - private String lastName; - - private String age; - - private String interests; - - private String email; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Sex getSex() { - return sex; - } - - public void setSex(Sex sex) { - this.sex = sex; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getAge() { - return age; - } - - public void setAge(String age) { - this.age = age; - } - - public String getInterests() { - return interests; - } - - public void setInterests(String interests) { - this.interests = interests; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Position.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Position.java deleted file mode 100644 index 4b17816ba..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Position.java +++ /dev/null @@ -1,54 +0,0 @@ -package test.org.springdoc.api.app85.entity; - -import java.util.Date; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - - -public class Position { - - private String id; - - @NotBlank - @Size(max = 140) - private String positionName; - - private String description; - - @NotNull - private Date createdAt = new Date(); - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPositionName() { - return positionName; - } - - public void setPositionName(String positionName) { - this.positionName = positionName; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Sex.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Sex.java deleted file mode 100644 index 6f830eb5e..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/entity/Sex.java +++ /dev/null @@ -1,5 +0,0 @@ -package test.org.springdoc.api.app85.entity; - -public enum Sex { - MAN, WOMEN -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/exception/PositionNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/exception/PositionNotFoundException.java deleted file mode 100644 index ff959dd95..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/exception/PositionNotFoundException.java +++ /dev/null @@ -1,8 +0,0 @@ -package test.org.springdoc.api.app85.exception; - -public class PositionNotFoundException extends RuntimeException { - - public PositionNotFoundException(String positionId) { - super("Position not found with id " + positionId); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/handler/PersonHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/handler/PersonHandler.java deleted file mode 100644 index 0f1f6b13d..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/handler/PersonHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -package test.org.springdoc.api.app85.handler; - -import reactor.core.publisher.Mono; -import test.org.springdoc.api.app85.entity.Person; -import test.org.springdoc.api.app85.service.PersonService; - -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.BodyInserters; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springframework.web.reactive.function.server.ServerResponse.ok; - -@Component -@SuppressWarnings({ "deprecared", "unchecked" }) -public class PersonHandler { - - private final PersonService personService; - - public PersonHandler(PersonService personService) { - this.personService = personService; - } - - public Mono findById(ServerRequest request) { - String id = request.pathVariable("id"); - return ok() - .contentType(MediaType.APPLICATION_JSON) - .body(personService.getById(id), Person.class); - } - - public Mono findAll(ServerRequest request) { - return ok() - .contentType(MediaType.APPLICATION_JSON) - .body(personService.getAll(), Person.class); - } - - public Mono save(ServerRequest request) { - final Mono person = request.bodyToMono(Person.class); - return ok() - .contentType(MediaType.APPLICATION_JSON) - .body(BodyInserters.fromPublisher(person.flatMap(personService::save), Person.class)); - } - - public Mono delete(ServerRequest request) { - String id = request.pathVariable("id"); - return ok() - .contentType(MediaType.APPLICATION_JSON) - .body(personService.delete(id), Void.class); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/handler/PositionHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/handler/PositionHandler.java deleted file mode 100644 index bd116293c..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/handler/PositionHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app85.handler; - -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -@Component -public class PositionHandler { - - - public Mono findById(ServerRequest request) { - String id = request.pathVariable("id"); - return null; - } - - public Mono findAll(ServerRequest request) { - return null; - } - - public Mono save(ServerRequest request) { - return null; - } - - public Mono delete(ServerRequest request) { - return null; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/payload/ErrorResponse.java deleted file mode 100644 index c6a2659f4..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/payload/ErrorResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app85.payload; - -public class ErrorResponse { - - private String message; - - public ErrorResponse(String message) { - this.message = message; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/service/PersonService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/service/PersonService.java deleted file mode 100644 index f2dc542a4..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app85/service/PersonService.java +++ /dev/null @@ -1,39 +0,0 @@ -package test.org.springdoc.api.app85.service; - -import java.util.Objects; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import test.org.springdoc.api.app85.entity.Person; - -import org.springframework.stereotype.Service; - -@Service -public class PersonService { - - public Flux getAll() { - return null; - } - - public Mono getById(@Parameter(in = ParameterIn.PATH) final String id) { - return null; - } - - public Mono update(@Parameter(in = ParameterIn.PATH) final String id, final Person person) { - return null; - } - - public Mono save(final Person person) { - return null; - } - - public Mono delete(@Parameter(in = ParameterIn.PATH) final String id) { - final Mono dbPerson = getById(id); - if (Objects.isNull(dbPerson)) { - return Mono.empty(); - } - return null; - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/Quote.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/Quote.java deleted file mode 100644 index 77110537b..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/Quote.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app86; - - -import java.math.BigDecimal; -import java.math.MathContext; -import java.time.Instant; - -public class Quote { - - private static final MathContext MATH_CONTEXT = new MathContext(2); - - private String ticker; - - private BigDecimal price; - - private Instant instant; - - public Quote() { - } - - public Quote(String ticker, BigDecimal price) { - this.ticker = ticker; - this.price = price; - } - - public Quote(String ticker, Double price) { - this(ticker, new BigDecimal(price, MATH_CONTEXT)); - } - - public String getTicker() { - return ticker; - } - - public void setTicker(String ticker) { - this.ticker = ticker; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public Instant getInstant() { - return instant; - } - - public void setInstant(Instant instant) { - this.instant = instant; - } - - @Override - public String toString() { - return "Quote{" + - "ticker='" + ticker + '\'' + - ", price=" + price + - ", instant=" + instant + - '}'; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteGenerator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteGenerator.java deleted file mode 100644 index 8b1619d43..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteGenerator.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app86; - - -import java.math.BigDecimal; -import java.math.MathContext; -import java.time.Duration; -import java.time.Instant; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import reactor.core.publisher.Flux; - -import org.springframework.stereotype.Component; - -@Component -public class QuoteGenerator { - - private final MathContext mathContext = new MathContext(2); - - private final Random random = new Random(); - - private final List prices = new ArrayList<>(); - - /** - * Bootstraps the generator with tickers and initial prices - */ - public QuoteGenerator() { - this.prices.add(new Quote("CTXS", 82.26)); - this.prices.add(new Quote("DELL", 63.74)); - this.prices.add(new Quote("GOOG", 847.24)); - this.prices.add(new Quote("MSFT", 65.11)); - this.prices.add(new Quote("ORCL", 45.71)); - this.prices.add(new Quote("RHT", 84.29)); - this.prices.add(new Quote("VMW", 92.21)); - } - - - public Flux fetchQuoteStream(Duration period) { - - // We want to emit quotes with a specific period; - // to do so, we create a Flux.interval - return Flux.interval(period) - // In case of back-pressure, drop events - .onBackpressureDrop() - // For each tick, generate a list of quotes - .map(this::generateQuotes) - // "flatten" that List into a Flux - .flatMapIterable(quotes -> quotes) - .log("io.spring.workshop.stockquotes"); - } - - /* - * Create quotes for all tickers at a single instant. - */ - private List generateQuotes(long interval) { - final Instant instant = Instant.now(); - return prices.stream() - .map(baseQuote -> { - BigDecimal priceChange = baseQuote.getPrice() - .multiply(new BigDecimal(0.05 * this.random.nextDouble()), this.mathContext); - Quote result = new Quote(baseQuote.getTicker(), baseQuote.getPrice().add(priceChange)); - result.setInstant(instant); - return result; - }) - .toList(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteHandler.java deleted file mode 100644 index 37ac0b74b..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteHandler.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app86; - - -import java.time.Duration; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.BodyInserters; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -@Component -public class QuoteHandler { - - private final Flux quoteStream; - - public QuoteHandler(QuoteGenerator quoteGenerator) { - this.quoteStream = quoteGenerator.fetchQuoteStream(Duration.ofMillis(1000)).share(); - } - - public Mono hello(ServerRequest request) { - return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) - .body(BodyInserters.fromObject("Hello Spring!")); - } - - public Mono echo(ServerRequest request) { - return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) - .body(request.bodyToMono(String.class), String.class); - } - - public Mono streamQuotes(ServerRequest request) { - return ServerResponse.ok() - .contentType(MediaType.APPLICATION_STREAM_JSON) - .body(this.quoteStream, Quote.class); - } - - public Mono fetchQuotes(ServerRequest request) { - int size = Integer.parseInt(request.queryParam("size").orElse("10")); - return ServerResponse.ok() - .contentType(MediaType.APPLICATION_JSON) - .body(this.quoteStream.take(size), Quote.class); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteRouter.java deleted file mode 100644 index dc00d70a9..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/QuoteRouter.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app86; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.http.MediaType.APPLICATION_JSON; -import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; -import static org.springframework.http.MediaType.TEXT_PLAIN; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RequestPredicates.contentType; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -@Configuration -public class QuoteRouter { - - @Bean - public RouterFunction myroute(QuoteHandler quoteHandler) { - return route(GET("/hello").and(accept(TEXT_PLAIN)), quoteHandler::hello) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("hello").response(responseBuilder().responseCode("200"))) - - .and(route(POST("/echo").and(accept(TEXT_PLAIN).and(contentType(TEXT_PLAIN))), quoteHandler::echo) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("echo") - .requestBody(requestBodyBuilder().implementation(String.class)) - .response(responseBuilder().responseCode("200").implementation(String.class)))) - - .and(route(POST("/echo").and(accept(APPLICATION_JSON).and(contentType(APPLICATION_JSON))), quoteHandler::echo) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("echo") - .requestBody(requestBodyBuilder().implementation(String.class)) - .response(responseBuilder().responseCode("200").implementation(String.class))) - ) - - .and(route(GET("/quotes").and(accept(APPLICATION_JSON)), quoteHandler::fetchQuotes) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("fetchQuotes") - .parameter(parameterBuilder().in(ParameterIn.QUERY).name("size").implementation(String.class)) - .response(responseBuilder().responseCode("200").implementationArray(Quote.class)))) - - .and(route(GET("/quotes").and(accept(APPLICATION_STREAM_JSON)), quoteHandler::streamQuotes) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("fetchQuotes") - .response(responseBuilder().responseCode("200").implementation(Quote.class)))); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java deleted file mode 100644 index 0b2f53336..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app86; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp86Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app86" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/Book.java deleted file mode 100644 index c1d4df2c3..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/Book.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app87; - -public class Book { - - private String id; - - private String title; - - private String author; - - public Book(String id, String title, String author) { - this.id = id; - this.title = title; - this.author = author; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/BookRepository.java deleted file mode 100644 index eeae467f5..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/BookRepository.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app87; - -import reactor.core.publisher.Flux; - -import org.springframework.stereotype.Component; - -@Component -public class BookRepository { - - - Flux findByAuthor(String author) { - return Flux.just(new Book("1", "title1", "author1")); - } - - Flux findAll() { - return Flux.just(new Book("2", "title2", "author2")); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/BookRouter.java deleted file mode 100644 index 36b4beed2..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/BookRouter.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app87; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; - -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; -import static org.springframework.web.reactive.function.server.ServerResponse.ok; - -@Configuration -class BookRouter { - - @Bean - RouterFunction routes(BookRepository br) { - return route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) - - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) - - .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() - .beanClass(BookRepository.class).beanMethod("findByAuthor") - .operationId("findByAuthor").parameter(parameterBuilder().in(ParameterIn.PATH).name("author")))); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java deleted file mode 100644 index 43afc364a..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app87; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp87Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app87" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/Post.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/Post.java deleted file mode 100644 index d37df9bf4..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/Post.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app88; - -import java.time.LocalDateTime; - -public class Post { - - private String id; - - private String title; - - private String content; - - private LocalDateTime createdDate; - - public Post(String id, String title, String content) { - this.id = id; - this.title = title; - this.content = content; - this.createdDate = LocalDateTime.now(); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public LocalDateTime getCreatedDate() { - return createdDate; - } - - public void setCreatedDate(LocalDateTime createdDate) { - this.createdDate = createdDate; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostHandler.java deleted file mode 100644 index 867cf3839..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostHandler.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app88; - - -import java.net.URI; - -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; - -@Component -class PostHandler { - - private final PostRepository posts; - - public PostHandler(PostRepository posts) { - this.posts = posts; - } - - public Mono all(ServerRequest req) { - return ServerResponse.ok().body(this.posts.findAll(), Post.class); - } - - public Mono create(ServerRequest req) { - return req.bodyToMono(Post.class) - .flatMap(post -> this.posts.save(post)) - .flatMap(p -> ServerResponse.created(URI.create("/posts/" + p.getId())).build()); - } - - public Mono get(ServerRequest req) { - return this.posts.findById(req.pathVariable("id")) - .flatMap(post -> ServerResponse.ok().body(Mono.just(post), Post.class)) - .switchIfEmpty(ServerResponse.notFound().build()); - } - - public Mono update(ServerRequest req) { - - return Mono - .zip( - (data) -> { - Post p = (Post) data[0]; - Post p2 = (Post) data[1]; - p.setTitle(p2.getTitle()); - p.setContent(p2.getContent()); - return p; - }, - this.posts.findById(req.pathVariable("id")), - req.bodyToMono(Post.class) - ) - .cast(Post.class) - .flatMap(post -> this.posts.save(post)) - .flatMap(post -> ServerResponse.noContent().build()); - - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostRepository.java deleted file mode 100644 index c1265ca9d..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostRepository.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app88; - -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import org.springframework.stereotype.Component; - -@Component -public class PostRepository { - - public Flux findByAuthor(String author) { - return Flux.just(new Post("1", "title1", "author1")); - } - - public Flux findAll() { - return Flux.just(new Post("2", "title2", "author2")); - } - - public Mono findById(String id) { - return Mono.just(new Post("3", "title2", "author2")); - } - - public Mono save(Post post) { - return Mono.just(new Post("4", "title2", "author2")); - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostRouter.java deleted file mode 100644 index c0eeebc94..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/PostRouter.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app88; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.POST; -import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; -import static org.springframework.web.reactive.function.server.RequestPredicates.queryParam; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -@Configuration -class PostRouter { - - @Bean - public RouterFunction routes(PostHandler postController) { - return route(GET("/posts").and(queryParam("key", "value")), postController::all) - .withAttribute(OPERATION_ATTRIBUTE, - operationBuilder().operationId("all") - .parameter(parameterBuilder().name("key").description("sample description")) - .parameter(parameterBuilder().name("test").description("sample desc")) - .response(responseBuilder().responseCode("200").implementationArray(Post.class))) - - .and(route(POST("/posts"), postController::create) - .withAttribute(OPERATION_ATTRIBUTE, - operationBuilder().operationId("create") - .requestBody(requestBodyBuilder().implementation(Post.class)) - .response(responseBuilder().responseCode("201")))) - - .and(route(GET("/posts/{id}"), postController::get) - .withAttribute(OPERATION_ATTRIBUTE, - operationBuilder().operationId("get") - .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) - .response(responseBuilder().responseCode("200").implementation(Post.class)))) - - .and(route(PUT("/posts/{id}"), postController::update) - .withAttribute(OPERATION_ATTRIBUTE, - operationBuilder().operationId("update") - .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) - .response(responseBuilder().responseCode("202").implementation(Post.class)))); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java deleted file mode 100644 index 758f61a2d..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app88; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp88Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app88" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/Book.java deleted file mode 100644 index f9572f855..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/Book.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app89; - -public class Book { - - private String id; - - private String title; - - private String author; - - public Book(String id, String title, String author) { - this.id = id; - this.title = title; - this.author = author; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/BookRepository.java deleted file mode 100644 index b307f733e..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/BookRepository.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app89; - -import reactor.core.publisher.Flux; - -import org.springframework.stereotype.Component; - -@Component -public class BookRepository { - - - Flux findByAuthor(String author) { - return Flux.just(new Book("1", "title1", "author1")); - } - - Flux findAll() { - return Flux.just(new Book("2", "title2", "author2")); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/BookRouter.java deleted file mode 100644 index 3abd86779..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/BookRouter.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app89; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; - -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RequestPredicates.path; -import static org.springframework.web.reactive.function.server.RouterFunctions.nest; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; -import static org.springframework.web.reactive.function.server.ServerResponse.ok; - -@Configuration -class BookRouter { - - @Bean - RouterFunction routes(BookRepository br) { - return nest(path("/greeter").and(path("/greeter2")), - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) - - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getFindAll())) - - .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute())) - ); - } - - @Bean - RouterFunction routes1(BookRepository br) { - return nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), - route(GET("/books"), req -> ok().body(br.findAll(), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) - - .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute()))); - } - - @Bean - RouterFunction routes3(BookRepository br) { - return nest(path("/greeter").or(path("/greeter2")), - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) - - - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getFindAll())) - - .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute()))); - } - - @Bean - RouterFunction routes4(BookRepository br) { - return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) - - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getFindAll())) - - .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) - .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute())))); - } - - private org.springdoc.core.fn.builders.operation.Builder getFindAll() { - return operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"); - } - - private org.springdoc.core.fn.builders.operation.Builder getRouterAttribute() { - return operationBuilder() - .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) - .beanClass(BookRepository.class).beanMethod("findByAuthor"); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java deleted file mode 100644 index 679dc254f..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app89; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp89Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app89" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/HelloRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/HelloRouter.java deleted file mode 100644 index a92d1e9ff..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/HelloRouter.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app90; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.function.server.RouterFunction; - -import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; -import static test.org.springdoc.api.AbstractSpringDocTest.HANDLER_FUNCTION; - -@Configuration -class HelloRouter { - - @Bean - RouterFunction routes() { - return route().GET("/foo", HANDLER_FUNCTION, ops -> ops - .operationId("hello") - .parameter(parameterBuilder().name("key1").description("My key1 description")) - .parameter(parameterBuilder().name("key2").description("My key2 description")) - .response(responseBuilder().responseCode("200").description("This is normal response description")) - .response(responseBuilder().responseCode("404").description("This is another response description")) - ).build(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java deleted file mode 100644 index b73bbd41e..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app90; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -public class SpringDocApp90Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app90" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/book/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/book/BookRouter.java deleted file mode 100644 index 4ce631377..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/book/BookRouter.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app90.book; - -import java.util.function.Consumer; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import reactor.core.publisher.Flux; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.server.RouterFunction; - -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RequestPredicates.path; -import static org.springframework.web.reactive.function.server.RouterFunctions.nest; -import static test.org.springdoc.api.AbstractSpringDocTest.HANDLER_FUNCTION; - -@Configuration -class BookRouter { - - - @Bean - RouterFunction bookRoute(BookRepository br) { - return route().GET("/books", accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), HANDLER_FUNCTION, ops -> ops.operationId("findAll").tag("book") - .beanClass(BookRepository.class).beanMethod("findAll")).build() - - .and(route().GET("/books", accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN), HANDLER_FUNCTION, - ops -> ops.operationId("findAll").tag("book").beanClass(BookRepository.class).beanMethod("findAll")).build()) - - .and(route().GET("/books/{author}", HANDLER_FUNCTION, ops -> ops.tag("book") - .beanClass(BookRepository.class).beanMethod("findByAuthor") - .operationId("findByAuthor").tag("book").parameter(parameterBuilder().in(ParameterIn.PATH).name("author"))).build()); - } - - @Bean - RouterFunction routes2() { - return nest(path("/greeter").and(path("/greeter2")), - route().GET("/books", accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), HANDLER_FUNCTION, getOperation1()).build()) - - .and(route().GET("/books/nest", accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN), HANDLER_FUNCTION, getOperation1()).build()) - - .and(route().GET("/books/nest/{author}", HANDLER_FUNCTION, getOperation2()).build()); - } - - @Bean - RouterFunction routes4() { - return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), - route().GET("/books", accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), HANDLER_FUNCTION, getOperation1()).build() - - .and(route().GET("/books", accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN), HANDLER_FUNCTION, getOperation1()).build()) - - .and(route().GET("/books/{author}", HANDLER_FUNCTION, getOperation2()).build()))); - } - - - private Consumer getOperation1() { - return ops -> ops.operationId("findAll").tag("book").beanClass(BookRepository.class).beanMethod("findAll"); - } - - private Consumer getOperation2() { - return ops -> ops.operationId("findAll").tag("book") - .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) - .beanClass(BookRepository.class).beanMethod("findByAuthor"); - } - - - @Component - class BookRepository { - - Flux findByAuthor(String author) { - return Flux.just(new Book("1", "title1", "author1")); - } - - Flux findAll() { - return Flux.just(new Book("2", "title2", "author2")); - } - } - - class Book { - - private String id; - - private String title; - - private String author; - - public Book(String id, String title, String author) { - this.id = id; - this.title = title; - this.author = author; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - } - -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/Employee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/Employee.java deleted file mode 100644 index 4b9b98422..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/Employee.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app90.employee; - -public class Employee { - - private String id; - - private String name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/EmployeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/EmployeeRepository.java deleted file mode 100644 index d11166681..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/EmployeeRepository.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app90.employee; - -import java.util.Map; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public class EmployeeRepository { - - static Map employeeData; - - static Map employeeAccessData; - - - public Mono findEmployeeById(@Parameter(in = ParameterIn.PATH) String id) { - return Mono.just(employeeData.get(id)); - } - - public Flux findAllEmployees() { - return Flux.fromIterable(employeeData.values()); - } - - public Mono updateEmployee(Employee employee) { - Employee existingEmployee = employeeData.get(employee.getId()); - if (existingEmployee != null) { - existingEmployee.setName(employee.getName()); - } - return Mono.just(existingEmployee); - } -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/EmployeeRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/EmployeeRouter.java deleted file mode 100644 index e8ff3af4b..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/employee/EmployeeRouter.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app90.employee; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import test.org.springdoc.api.app84.Employee; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; -import static test.org.springdoc.api.AbstractSpringDocTest.HANDLER_FUNCTION; - -@Configuration -class EmployeeRouter { - - @Bean - RouterFunction getEmployeeByIdRoute() { - return route().GET("/employees/{id}", HANDLER_FUNCTION, ops -> ops.tag("employee") - .operationId("findEmployeeById").summary("Find purchase order by ID").tags(new String[] { "MyEmployee" }) - .parameter(parameterBuilder().in(ParameterIn.PATH).name("id").description("Employee Id")) - .response(responseBuilder().responseCode("200").description("successful operation").implementation(Employee.class)) - .response(responseBuilder().responseCode("400").description("Invalid Employee ID supplied")) - .response(responseBuilder().responseCode("404").description("Employee not found"))).build(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/position/PositionRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/position/PositionRouter.java deleted file mode 100644 index 6e38f6dbe..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/position/PositionRouter.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app90.position; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import test.org.springdoc.api.app85.entity.Position; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; -import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static test.org.springdoc.api.AbstractSpringDocTest.HANDLER_FUNCTION; - -@Configuration -class PositionRouter { - - @Bean - public RouterFunction positionRoute() { - return route().GET("/getAllPositions", accept(MediaType.APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops - .operationId("findAll").description("Get all positions").tags(new String[] { "positions" }) - .response(responseBuilder().responseCode("200").implementationArray(Position.class))).build() - - .and(route().GET("/getPosition/{id}", accept(MediaType.APPLICATION_STREAM_JSON), HANDLER_FUNCTION, ops -> ops - .operationId("findById").description("Find all").tags(new String[] { "positions" }) - .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) - .response(responseBuilder().responseCode("200").implementation(Position.class))).build()) - - .and(route().POST("/createPosition", accept(MediaType.APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops - .operationId("save").description("Save position").tags(new String[] { "positions" }) - .requestBody(requestBodyBuilder().implementation(Position.class)) - .response(responseBuilder().responseCode("200").implementation(Position.class))).build()) - - .and(route().DELETE("/deletePosition/{id}", accept(MediaType.APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops - .operationId("deleteBy").description("Delete By Id").tags(new String[] { "positions" }) - .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) - .response(responseBuilder().responseCode("200").content(org.springdoc.core.fn.builders.content.Builder.contentBuilder()))).build()); - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/quotes/QuotesRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/quotes/QuotesRouter.java deleted file mode 100644 index f8c586fac..000000000 --- a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/app90/quotes/QuotesRouter.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app90.quotes; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.time.Instant; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; - -import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; -import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; -import static org.springframework.http.MediaType.APPLICATION_JSON; -import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; -import static org.springframework.http.MediaType.TEXT_PLAIN; -import static org.springframework.web.reactive.function.server.RequestPredicates.accept; -import static org.springframework.web.reactive.function.server.RequestPredicates.contentType; -import static test.org.springdoc.api.AbstractSpringDocTest.HANDLER_FUNCTION; - -@Configuration -class QuotesRouter { - - @Bean - RouterFunction myroute() { - return route().GET("/hello", accept(TEXT_PLAIN), HANDLER_FUNCTION, ops -> ops.tag("quotes") - .operationId("hello").response(responseBuilder().responseCode("200"))).build() - - .and(route().POST("/echo", accept(TEXT_PLAIN).and(contentType(TEXT_PLAIN)), HANDLER_FUNCTION, ops -> ops.tag("quotes") - .operationId("echo") - .requestBody(requestBodyBuilder().implementation(String.class)) - .response(responseBuilder().responseCode("200").implementation(String.class))).build()) - - .and(route().POST("/echo", accept(APPLICATION_JSON).and(contentType(APPLICATION_JSON)), HANDLER_FUNCTION, ops -> ops.tag("quotes") - .operationId("echo") - .requestBody(requestBodyBuilder().implementation(String.class)) - .response(responseBuilder().responseCode("200").implementation(String.class))).build()) - - .and(route().GET("/quotes", accept(APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops.tag("quotes") - .operationId("fetchQuotes") - .parameter(parameterBuilder().in(ParameterIn.QUERY).name("size").implementation(String.class)) - .response(responseBuilder().responseCode("200").implementationArray(Quote.class))).build()) - - .and(route().GET("/quotes", accept(APPLICATION_STREAM_JSON), HANDLER_FUNCTION, ops -> ops.tag("quotes") - .operationId("fetchQuotes") - .response(responseBuilder().responseCode("200").implementation(Quote.class))).build()); - } - - - class Quote { - - private String ticker; - - private BigDecimal price; - - private Instant instant; - - public Quote() { - } - - public Quote(String ticker, BigDecimal price) { - this.ticker = ticker; - this.price = price; - } - - public Quote(String ticker, Double price) { - this(ticker, new BigDecimal(price, new MathContext(2))); - } - - public String getTicker() { - return ticker; - } - - public void setTicker(String ticker) { - this.ticker = ticker; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public Instant getInstant() { - return instant; - } - - public void setInstant(Instant instant) { - this.instant = instant; - } - - @Override - public String toString() { - return "Quote{" + - "ticker='" + ticker + '\'' + - ", price=" + price + - ", instant=" + instant + - '}'; - } - } -} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java new file mode 100644 index 000000000..a26b7e6f2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.reactive.server.WebTestClient; + +@AutoConfigureWebTestClient(timeout = "3600000") +@ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) +public abstract class AbstractCommonTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); + + @Autowired + protected WebTestClient webTestClient; + + protected String getContent(String fileName) { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..3d7c5fef0 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.test.web.reactive.server.EntityExchangeResult; +import org.springframework.web.reactive.function.server.HandlerFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + + +@WebFluxTest +@AutoConfigureWebTestClient(timeout = "3600000") +public abstract class AbstractSpringDocTest extends AbstractCommonTest { + + public static final HandlerFunction HANDLER_FUNCTION = request -> ServerResponse.ok().build(); + + protected String groupName = ""; + + + @Test + void testApp() throws Exception { + String result = null; + try { + EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() + .expectStatus().isOk().expectBody().returnResult(); + + result = new String(getResult.getResponseBody()); + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + catch (java.lang.AssertionError e) { + LOGGER.error(result); + throw e; + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java new file mode 100644 index 000000000..834dd9c39 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app102; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NotBlank; + +public class InheritedRequestParams extends RequestParams { + @Parameter(description = "parameter from child of RequestParams") + @NotBlank + private String childParam; + + public String getChildParam() { + return childParam; + } + + public void setChildParam(String childParam) { + this.childParam = childParam; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java new file mode 100644 index 000000000..cc62d7d89 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java @@ -0,0 +1,148 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app102; + +import java.math.BigInteger; +import java.util.List; +import java.util.Optional; + +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.lang.Nullable; + +public class RequestParams { + + @Parameter(description = "string parameter") + private String stringParam; + + @Deprecated + private String stringParam1; + + @Parameter(description = "string parameter2", required = true) + private String stringParam2; + + @Parameter(description = "int parameter") + private int intParam; + + private Optional intParam2; + + @Nullable + private String intParam3; + + private Nested nested; + + private List nestedList; + + public String getStringParam() { + return stringParam; + } + + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + public int getIntParam() { + return intParam; + } + + public void setIntParam(int intParam) { + this.intParam = intParam; + } + + public Optional getIntParam2() { + return intParam2; + } + + public void setIntParam2(Optional intParam2) { + this.intParam2 = intParam2; + } + + @Nullable + public String getIntParam3() { + return intParam3; + } + + public void setIntParam3(@Nullable String intParam3) { + this.intParam3 = intParam3; + } + + public String getStringParam1() { + return stringParam1; + } + + public void setStringParam1(String stringParam1) { + this.stringParam1 = stringParam1; + } + + public String getStringParam2() { + return stringParam2; + } + + public void setStringParam2(String stringParam2) { + this.stringParam2 = stringParam2; + } + + public Nested getNested() { + return nested; + } + + public void setNested(Nested nested) { + this.nested = nested; + } + + public List getNestedList() { + return nestedList; + } + + public void setNestedList(List nestedList) { + this.nestedList = nestedList; + } + + public static class Nested { + private String param1; + + private BigInteger param2; + + @Parameter(description = "nested string parameter") + public String getParam1() { + return param1; + } + + public void setParam1(String param1) { + this.param1 = param1; + } + + @Parameter(description = "nested BigInteger parameter") + public BigInteger getParam2() { + return param2; + } + + public void setParam2(BigInteger param2) { + this.param2 = param2; + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java new file mode 100644 index 000000000..98d216ef1 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app102; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp102Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app102" }) + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/TestController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/TestController.java new file mode 100644 index 000000000..4ce1f3a02 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app102/TestController.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app102; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.lang.Nullable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestController { + @GetMapping("test") + public void getTest(@RequestParam @Nullable String param, @ParameterObject InheritedRequestParams requestParams) { + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java new file mode 100644 index 000000000..a8f86a654 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app149; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * To test the case a user does not use @RestController but puts @Operation on handler methods + * and wants these methods to be exposed. + * + * @author Azige + */ +@Controller +public class HelloController { + + @GetMapping("/hello") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public String hello() { + return "forward:/message"; + } + + @GetMapping("/message") + @Operation + @ResponseBody + public HelloMessage message() { + return new HelloMessage("Lucky numbers!", 777); + } + + @GetMapping("/helloModelAndView") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public HelloMessage helloModelAndView() { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java new file mode 100644 index 000000000..d9f307ab2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app149; + +public class HelloMessage { + public String text; + + public int number; + + public HelloMessage(String text, int number) { + this.text = text; + this.number = number; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HiddenHelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HiddenHelloController.java new file mode 100644 index 000000000..344d88387 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/HiddenHelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app149; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/api") +public class HiddenHelloController { + + @Operation(description = "I want here some custom config") + @GetMapping("/{entity}/{id}") + public ResponseEntity getEntity() { + throw new UnsupportedOperationException("the body is not relevant now"); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java new file mode 100644 index 000000000..9df343416 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app149; + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp149Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().addHiddenRestControllers(HiddenHelloController.class); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app149" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app150/HelloRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app150/HelloRouter.java new file mode 100644 index 000000000..f6058f717 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app150/HelloRouter.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app150; + +import java.util.function.Consumer; +import java.util.function.Supplier; + +import org.springdoc.core.fn.builders.operation.Builder; +import org.springdoc.webflux.core.fn.SpringdocRouteBuilder; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RequestPredicates; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +public class HelloRouter { + + @Bean + RouterFunction routeSample() { + Supplier> routerFunctionSupplier = + () -> SpringdocRouteBuilder.route() + .GET("toto", HANDLER_FUNCTION, builder -> builder.operationId("get-user-groups")) + + .POST("/titi", HANDLER_FUNCTION, builder -> builder.operationId("create-user-group-special")).build(); + + Consumer operationsConsumer = builder -> { + }; + + return RouterFunctions.nest(RequestPredicates.path("/users"), nest(path("/test"), nest(path("/greeter"), + SpringdocRouteBuilder.route() + .GET(HANDLER_FUNCTION, builder -> builder.operationId("get-users")) + .POST("/special", HANDLER_FUNCTION, builder -> builder.operationId("create-user-special")) + .nest(path("/groups"), routerFunctionSupplier, operationsConsumer) + .nest(path("/groups2"), routerFunctionSupplier, operationsConsumer) + .nest(path("/greeter3").or(path("/greeter4")), routerFunctionSupplier, operationsConsumer) + .build()))); + + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java new file mode 100644 index 000000000..a7db7997d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app150; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp150Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app150" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app151/HelloRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app151/HelloRouter.java new file mode 100644 index 000000000..45360dd8b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app151/HelloRouter.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app151; + +import java.util.function.Consumer; +import java.util.function.Supplier; + +import org.springdoc.core.fn.builders.operation.Builder; +import org.springdoc.webflux.core.fn.SpringdocRouteBuilder; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RequestPredicates; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +public class HelloRouter { + + @Bean + RouterFunction routeSample() { + Supplier> routerFunctionSupplier = + () -> SpringdocRouteBuilder.route() + .GET("toto", HANDLER_FUNCTION, builder -> builder.operationId("get-user-groups")) + + .POST("/titi", HANDLER_FUNCTION, builder -> builder.operationId("create-user-group-special")).build(); + + Consumer operationsConsumer = builder -> { + }; + + return RouterFunctions.nest(RequestPredicates.path("/users"), nest(path("/test"), nest(path("/greeter"), + SpringdocRouteBuilder.route() + .GET("", HANDLER_FUNCTION, builder -> builder.operationId("get-users")) + .POST("/special", HANDLER_FUNCTION, builder -> builder.operationId("create-user-special")) + .nest(path("/groups"), routerFunctionSupplier, operationsConsumer) + .nest(path("/groups2"), routerFunctionSupplier, operationsConsumer) + .nest(path("/greeter3").or(path("/greeter4")), routerFunctionSupplier, operationsConsumer) + .build()))); + + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java new file mode 100644 index 000000000..4e9ddee45 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app151; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp151Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app151" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java new file mode 100644 index 000000000..8909d3b63 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app152; + +import org.reactivestreams.Publisher; +import org.springdoc.core.models.GroupedOpenApi; +import reactor.core.publisher.Mono; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public Publisher persons() { + return Mono.just("OK"); + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v30.app152") + .build(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java new file mode 100644 index 000000000..2eff5a905 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app152; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp152Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app152" }) + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/DefaultRequestMappingHandlerMapping.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/DefaultRequestMappingHandlerMapping.java new file mode 100644 index 000000000..83e6bc286 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/DefaultRequestMappingHandlerMapping.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app153; + +import org.springframework.expression.ParserContext; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.expression.spel.support.StandardEvaluationContext; +import org.springframework.util.StringValueResolver; +import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; + +public class DefaultRequestMappingHandlerMapping extends RequestMappingHandlerMapping { + + private static final SpelExpressionParser PARSER = new SpelExpressionParser(); + + private static ThreadLocal handlerHolder = new ThreadLocal<>(); + + @Override + public void setEmbeddedValueResolver(StringValueResolver resolver) { + super.setEmbeddedValueResolver(new StringValueResolver() { + @Override + public String resolveStringValue(String strVal) { + Object handler = handlerHolder.get(); + if (handler != null) { + strVal = String.valueOf(PARSER.parseExpression(strVal, ParserContext.TEMPLATE_EXPRESSION) + .getValue(new StandardEvaluationContext(handler))); + } + if (resolver != null) { + strVal = resolver.resolveStringValue(strVal); + } + return strVal; + } + }); + } + + @Override + protected void detectHandlerMethods(Object handler) { + Object handlerObject = (handler instanceof String ? obtainApplicationContext().getBean((String) handler) + : handler); + handlerHolder.set(handlerObject); + super.detectHandlerMethods(handler); + handlerHolder.remove(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/DefaultWebFluxRegistrations.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/DefaultWebFluxRegistrations.java new file mode 100644 index 000000000..982354999 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/DefaultWebFluxRegistrations.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app153; + +import org.springframework.boot.autoconfigure.web.reactive.WebFluxRegistrations; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; + +@Component +public class DefaultWebFluxRegistrations implements WebFluxRegistrations { + + @Override + public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { + return new DefaultRequestMappingHandlerMapping(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java new file mode 100644 index 000000000..24141c747 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app153; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp153Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app153" }) + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/TestController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/TestController.java new file mode 100644 index 000000000..fd822d8e5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app153/TestController.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app153; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestController { + + @PostMapping("/echo") + public String echo(String content) { + return content; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app184/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app184/HelloController.java new file mode 100644 index 000000000..7968f97b6 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app184/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app184; + + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/globalBeanFiltered") + public String globalBeanFiltered() { + return "globalBeanFiltered"; + } + + @GetMapping("/beanFiltered") + public String beanFiltered() { + return "beanFiltered"; + } + + @GetMapping("/group1Filtered") + public String group1Filtered() { + return "group1Filtered"; + } + + @GetMapping("/group2Filtered") + public String group2Filtered() { + return "group2Filtered"; + } + + @GetMapping("/group3Filtered") + public String group3Filtered() { + return "group3Filtered"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app184/SpringDocApp184Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app184/SpringDocApp184Test.java new file mode 100644 index 000000000..050096df8 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app184/SpringDocApp184Test.java @@ -0,0 +1,132 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app184; + +import java.util.Objects; + +import io.swagger.v3.oas.models.parameters.HeaderParameter; +import io.swagger.v3.oas.models.servers.Server; +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.GlobalOpenApiCustomizer; +import org.springdoc.core.customizers.GlobalOperationCustomizer; +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.filters.GlobalOpenApiMethodFilter; +import org.springdoc.core.filters.OpenApiMethodFilter; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "springdoc.group-configs[0].group=group1", + "springdoc.group-configs[0].paths-to-exclude=/group1Filtered", +}) +public class SpringDocApp184Test extends AbstractSpringDocTest { + + @Test + void testGroup1() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group1").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.0.1/app184-1.json"), true); + } + + @Test + void testGroup2() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group2").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.0.1/app184-2.json"), true); + } + + @Test + void testGroup3() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group3").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.0.1/app184-3.json"), true); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app184" }) + static class SpringDocTestApp { + + @Bean + public GlobalOpenApiCustomizer addUrlGlobalBean() { + return openApi -> openApi.getServers().add(new Server().url("urlGlobalBean")); + } + + @Bean + public OpenApiCustomizer addUrlBean() { + return openApi -> openApi.getServers().add(new Server().url("urlBean")); + } + + @Bean + public GlobalOperationCustomizer addHeaderGlobaBeanl() { + return (operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGlobalBean")); + } + + @Bean + public OperationCustomizer addHeaderBean() { + return (operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerBean")); + } + + @Bean + public GlobalOpenApiMethodFilter globalFilterBean() { + return method -> !Objects.equals(method.getName(), "globalBeanFiltered"); + } + + @Bean + public OpenApiMethodFilter filterBean() { + return method -> !Objects.equals(method.getName(), "beanFiltered"); + } + + @Bean + public GroupedOpenApi group2() { + return GroupedOpenApi.builder() + .group("group2") + .addOpenApiCustomizer(openApi -> openApi.getServers().add(new Server().url("urlGroup2"))) + .addOperationCustomizer((operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGroup2"))) + .addOpenApiMethodFilter(method -> !Objects.equals(method.getName(), "group2Filtered")) + .build(); + } + + @Bean + public GroupedOpenApi group3() { + return GroupedOpenApi.builder() + .group("group3") + .addOpenApiCustomizer(openApi -> openApi.getServers().add(new Server().url("urlGroup3"))) + .addOperationCustomizer((operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGroup3"))) + .addOpenApiMethodFilter(method -> !Objects.equals(method.getName(), "group3Filtered")) + .build(); + } + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app187/DuplicatedPathController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app187/DuplicatedPathController.java new file mode 100644 index 000000000..036ff6c30 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app187/DuplicatedPathController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app187; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class DuplicatedPathController { + + @GetMapping("/duplicated") + public String duplicated1() { + return "globalBeanFiltered"; + } + + @GetMapping(value = "/duplicated", params = "filter=params") + public String duplicated2() { + return "beanFiltered"; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java new file mode 100644 index 000000000..9953eac67 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app187; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.RouterOperationCustomizer; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +class SpringDocApp187Test extends AbstractSpringDocTest { + + @Test + void testAddRouterOperationCustomizerBean() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.0.1/app187.json"), true); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app187" }) + static class SpringDocTestApp { + + @Bean + public RouterOperationCustomizer addRouterOperationCustomizer() { + return (routerOperation, handlerMethod) -> { + if (routerOperation.getParams().length > 0) { + routerOperation.setPath(routerOperation.getPath() + "?" + String.join("&", routerOperation.getParams())); + } + return routerOperation; + }; + } + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app188/OrderDemo.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app188/OrderDemo.java new file mode 100644 index 000000000..c99a1b881 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app188/OrderDemo.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app188; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.tags.Tag; +import org.springdoc.core.customizers.GlobalOpenApiCustomizer; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +public class OrderDemo { + + public static class Customizer2 implements OpenApiCustomizer, GlobalOpenApiCustomizer { + public void customise(OpenAPI openApi) { + openApi.addTagsItem(new Tag().name("2")); + } + } + + public static class Customizer3 implements OpenApiCustomizer, GlobalOpenApiCustomizer { + public void customise(OpenAPI openApi) { + openApi.addTagsItem(new Tag().name("3")); + } + } + + public static class Customizer1 implements OpenApiCustomizer, GlobalOpenApiCustomizer { + public void customise(OpenAPI openApi) { + openApi.addTagsItem(new Tag().name("1")); + } + } + + @RestController + public static class MyController { + + @GetMapping("/test") + public String testingMethod() { + return "foo"; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app188/SpringDocApp188Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app188/SpringDocApp188Test.java new file mode 100644 index 000000000..6d15cd802 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app188/SpringDocApp188Test.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app188; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Import; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.group-configs[0].group=mygroup", "springdoc.group-configs[0].paths-to-match=/test" }) +class SpringDocApp188Test extends AbstractSpringDocTest { + + @Test + void testApp1() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL +"/mygroup").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.0.1/app188.json"), true); + } + + @SpringBootApplication + @Import({ + OrderDemo.Customizer1.class, + OrderDemo.Customizer2.class, + OrderDemo.Customizer3.class, + }) + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app188" }) + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/HelloController.java new file mode 100644 index 000000000..deb1368ae --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app189; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.http.codec.multipart.FilePart; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + + @Operation(summary = "Parse Resume") + @PostMapping(value = "/parse-resume", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { + MediaType.MULTIPART_FORM_DATA_VALUE }) + @ApiResponses({ @ApiResponse(responseCode = "400", description = "Invalid input") }) + public Mono parse( + @RequestPart(name = "resumeFile") @Parameter(description = "Resume file to be parsed", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) FilePart resumeFile) { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocApp189Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocApp189Test.java new file mode 100644 index 000000000..a1a103533 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocApp189Test.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app189; + +import java.time.Duration; + +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractCommonTest; + +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.test.web.reactive.server.EntityExchangeResult; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@WebFluxTest +public class SpringDocApp189Test extends AbstractCommonTest { + + @Test + public void testWithDifferentLocales() throws Exception { + runTestWithLocale("en-GB"); + runTestWithLocale("de-DE"); + } + private void runTestWithLocale(String locale) throws JSONException { + EntityExchangeResult getResult = webTestClient.mutate().responseTimeout(Duration.ofMinutes(1000)).build() + .get().uri(Constants.DEFAULT_API_DOCS_URL) + .header("Accept-Language", locale) + .exchange() + .expectStatus().isOk().expectBody().returnResult(); + + String result = new String(getResult.getResponseBody()); + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocTestApp.java new file mode 100644 index 000000000..5cd3219d1 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app189/SpringDocTestApp.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app189; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app189" }) +public class SpringDocTestApp { + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + + @Bean + OpenApiCustomizer serverUrlCustomizer() { + return openApi -> + openApi.getServers().forEach(server -> { + server.setDescription("customized description"); + server.setUrl("https://customized.url"); + }); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190Test.java new file mode 100644 index 000000000..31942d4d2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190Test.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app190; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractCommonTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.context.annotation.ComponentScan; + +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_DEFAULT_API_DOCS; + +@WebFluxTest(properties = SPRINGDOC_ENABLE_DEFAULT_API_DOCS+"=false") +public class SpringDocApp190Test extends AbstractCommonTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app190" }) + static class SpringDocTestApp {} + + @Test + void test_disable_default_api_docs() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isNotFound(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190bisTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190bisTest.java new file mode 100644 index 000000000..de57544e3 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app190/SpringDocApp190bisTest.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app190; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractCommonTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.context.annotation.ComponentScan; + +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_DEFAULT_API_DOCS; + +@WebFluxTest(properties = SPRINGDOC_ENABLE_DEFAULT_API_DOCS+"=true") +public class SpringDocApp190bisTest extends AbstractCommonTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app190" }) + static class SpringDocTestApp {} + + @Test + void test_enable_default_api_docs() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Handler/BaseHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Handler/BaseHandler.java new file mode 100644 index 000000000..1c9738ca5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Handler/BaseHandler.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app191.Handler; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public abstract class BaseHandler { + protected abstract Mono apply (ServerRequest serverRequest); + + public Mono handle(ServerRequest serverRequest) { + return this.apply(serverRequest); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Handler/GetNameHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Handler/GetNameHandler.java new file mode 100644 index 000000000..3a77ca5b9 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Handler/GetNameHandler.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app191.Handler; + +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class GetNameHandler extends BaseHandler{ + @Override + protected Mono apply(ServerRequest serverRequest) { + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .bodyValue("Name API is called"); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Router/GetNameRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Router/GetNameRouter.java new file mode 100644 index 000000000..d6769ed1d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/Router/GetNameRouter.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app191.Router; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v30.app191.Handler.GetNameHandler; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.reactive.function.server.RequestPredicates; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + + +@Configuration +public class GetNameRouter { + + @Bean + @RouterOperations( + value = { + @RouterOperation(path = "/v1/name", produces = {MediaType.APPLICATION_JSON_VALUE}, method = RequestMethod.GET, + beanClass = GetNameHandler.class, beanMethod = "handle", operation = @Operation(operationId = "getName", + description = "get name", responses = {@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = String.class)))}) + ) + }) + + public RouterFunction routerFunction(GetNameHandler getNameHandler) { + return RouterFunctions.route(RequestPredicates.GET("/v1/name"), getNameHandler::handle); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/SpringDocApp191Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/SpringDocApp191Test.java new file mode 100644 index 000000000..825274e17 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app191/SpringDocApp191Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app191; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp191Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app191" }) + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java new file mode 100644 index 000000000..43ef06a06 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +public class SpringDocApp3Test extends AbstractSpringDocTest { + + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/SpringDocTestApp.java new file mode 100644 index 000000000..1108f7841 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/SpringDocTestApp.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app3" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/controller/ExceptionTranslator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/controller/ExceptionTranslator.java new file mode 100644 index 000000000..bc3ae394e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/controller/ExceptionTranslator.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3.controller; + +import test.org.springdoc.api.v30.app3.exception.TweetConflictException; +import test.org.springdoc.api.v30.app3.exception.TweetNotFoundException; +import test.org.springdoc.api.v30.app3.payload.ErrorResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class ExceptionTranslator { + + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetConflictException.class) + @ResponseStatus(HttpStatus.CONFLICT) + public ResponseEntity handleDuplicateKeyException(TweetConflictException ex) { + return ResponseEntity.status(HttpStatus.CONFLICT) + .body(new ErrorResponse("A Tweet with the same text already exists")); + } + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetNotFoundException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public ResponseEntity handleTweetNotFoundException(TweetNotFoundException ex) { + return ResponseEntity.notFound().build(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/controller/TweetController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/controller/TweetController.java new file mode 100644 index 000000000..279315459 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/controller/TweetController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import jakarta.validation.Valid; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v30.app3.dto.TweetDTO; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +@RestController +public class TweetController { + + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") }) + @GetMapping("/tweets") + public Flux getAllTweets() { + return null; + } + + @PostMapping("/tweets") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "create Tweets") }) + public Mono createTweets(@Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get Tweet By Id"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @GetMapping("/tweets/{id}") + public Mono> getTweetById(@PathVariable(value = "id") String tweetId) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "update Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @PutMapping("/tweets/{id}") + public Mono> updateTweet(@PathVariable(value = "id") String tweetId, + @Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "delete Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @DeleteMapping("/tweets/{id}") + public Mono> deleteTweet(@PathVariable(value = "id") String tweetId) { + return null; + } + + @Operation(description = "Tweets are Sent to the client as Server Sent Events", responses = { + @ApiResponse(responseCode = "200", description = "stream All Tweets") }) + @GetMapping(value = "/stream/tweets", produces = MediaType.TEXT_EVENT_STREAM_VALUE) + public Flux streamAllTweets() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/dto/TweetDTO.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/dto/TweetDTO.java new file mode 100644 index 000000000..ccd5ec868 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/dto/TweetDTO.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3.dto; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +public class TweetDTO { + private String id; + + @NotBlank + @Size(max = 140) + private String text; + + @NotNull + private Date createdAt = new Date(); + + public TweetDTO() { + + } + + public TweetDTO(String text) { + this.text = text; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/exception/TweetConflictException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/exception/TweetConflictException.java new file mode 100644 index 000000000..e6f6ff350 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/exception/TweetConflictException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetConflictException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetConflictException(String tweetId) { + super("Tweet conflict with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/exception/TweetNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/exception/TweetNotFoundException.java new file mode 100644 index 000000000..185499956 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/exception/TweetNotFoundException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetNotFoundException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetNotFoundException(String tweetId) { + super("Tweet not found with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/payload/ErrorResponse.java new file mode 100644 index 000000000..c2a6b5c0a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app3/payload/ErrorResponse.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3.payload; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class ErrorResponse { + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java new file mode 100644 index 000000000..94b645bfd --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app39; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import reactor.core.publisher.Mono; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @Operation(summary = "test Request") + @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) + @PostMapping("/test") + public Mono searchEmployee(String test) { + return Mono.empty(); + } + + @GetMapping("/hello") + public Mono hello() { + return Mono.just("hello"); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java new file mode 100644 index 000000000..b7f0a9933 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app39; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +public class SpringDocApp39Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java new file mode 100644 index 000000000..8cbab5977 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app39; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.HeaderParameter; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app39" }) +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + StringSchema schema = new StringSchema(); + return new OpenAPI() + .components(new Components().addParameters("myGlobalHeader", new HeaderParameter().required(true).name("My-Global-Header").description("My Global Header").schema(schema))); + } + + @Bean + public OpenApiCustomizer customerGlobalHeaderOpenApiCustomizer() { + return openApi -> openApi.getPaths().values().stream().flatMap(pathItem -> pathItem.readOperations().stream()) + .forEach(operation -> operation.addParametersItem(new HeaderParameter().$ref("#/components/parameters/myGlobalHeader"))); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java new file mode 100644 index 000000000..9cd25deeb --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.http.codec.multipart.FilePart; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + + @Operation(summary = "Parse Resume") + @PostMapping(value = "/parse-resume", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { + MediaType.MULTIPART_FORM_DATA_VALUE }) + @ApiResponses({ @ApiResponse(responseCode = "400", description = "Invalid input") }) + public Mono parse( + @RequestPart(name = "resumeFile") @Parameter(description = "Resume file to be parsed", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) FilePart resumeFile) { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java new file mode 100644 index 000000000..d7d58c2b3 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +public class SpringDocApp4Test extends AbstractSpringDocTest { + + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocTestApp.java new file mode 100644 index 000000000..71565d4e6 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app4/SpringDocTestApp.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app4" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/HelloController.java new file mode 100644 index 000000000..70b15c62b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import reactor.core.publisher.Mono; + +import org.springframework.http.HttpEntity; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/tweets/does-not-work", consumes = MediaType.APPLICATION_JSON_VALUE) + public Mono postNotWorks(@RequestBody Mono tweet) { + return tweet; + } + + @GetMapping("/test") + public Mono> demo2() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java new file mode 100644 index 000000000..f81f72341 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +public class SpringDocApp5Test extends AbstractSpringDocTest { + + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/SpringDocTestApp.java new file mode 100644 index 000000000..22427a0c6 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/SpringDocTestApp.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app5" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/Tweet.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/Tweet.java new file mode 100644 index 000000000..f5450644a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app5/Tweet.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +public class Tweet { + private String id; + + @NotBlank + @Size(max = 140) + private String text; + + @NotNull + private Date createdAt = new Date(); + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java new file mode 100644 index 000000000..ae6e5ee59 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app63; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test") + public void test(String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java new file mode 100644 index 000000000..7140f693b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app63; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.packagesToScan=hell,hello1, hello.me") +public class SpringDocApp63Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app63" }) + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/toto/HelloController2.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/toto/HelloController2.java new file mode 100644 index 000000000..4c2554ef0 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app63/toto/HelloController2.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app63.toto; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController2 { + + @GetMapping("/test1") + public void test1(String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java new file mode 100644 index 000000000..2da2ac5ef --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app64; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/v1/test") + public void test1(String hello) { + } + + @GetMapping(value = "/api/balance/abcd") + @Operation(summary = "This is the test endpoint") + public String test2(String from) { + return "This is a fake test"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java new file mode 100644 index 000000000..4300db82b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app64; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.paths-to-match=/v1, /api/**") +public class SpringDocApp64Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app64" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java new file mode 100644 index 000000000..6091dc9fe --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app65; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "Health", description = "Health check / ping API") +@RestController +public class HelloController { + + @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") + @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) + public ResponseEntity ping() { + return ResponseEntity.ok("Healthy"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java new file mode 100644 index 000000000..c25015780 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app65; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp65Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app65" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java new file mode 100644 index 000000000..b77e542a7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +public class SpringDocApp66Test extends AbstractSpringDocTest { + + public SpringDocApp66Test() { + this.groupName = "/stream"; + } + + @Test + void testApp2() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "streams").exchange() + .expectStatus().isNotFound(); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocTestApp.java new file mode 100644 index 000000000..5277292f8 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/SpringDocTestApp.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app66" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + + @Bean + public GroupedOpenApi streamOpenApi() { + String[] paths = { "/stream/**" }; + String[] packagedToMatch = { "test.org.springdoc.api.v30.app66" }; + return GroupedOpenApi.builder().group("stream").pathsToMatch(paths) + .build(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/controller/ExceptionTranslator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/controller/ExceptionTranslator.java new file mode 100644 index 000000000..c76f7da36 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/controller/ExceptionTranslator.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66.controller; + +import test.org.springdoc.api.v30.app66.exception.TweetConflictException; +import test.org.springdoc.api.v30.app66.exception.TweetNotFoundException; +import test.org.springdoc.api.v30.app66.payload.ErrorResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class ExceptionTranslator { + + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetConflictException.class) + @ResponseStatus(HttpStatus.CONFLICT) + public ResponseEntity handleDuplicateKeyException(TweetConflictException ex) { + return ResponseEntity.status(HttpStatus.CONFLICT) + .body(new ErrorResponse("A Tweet with the same text already exists")); + } + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetNotFoundException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public ResponseEntity handleTweetNotFoundException(TweetNotFoundException ex) { + return ResponseEntity.notFound().build(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/controller/TweetController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/controller/TweetController.java new file mode 100644 index 000000000..b1c2e4dcb --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/controller/TweetController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import jakarta.validation.Valid; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v30.app66.dto.TweetDTO; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +@RestController +public class TweetController { + + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") }) + @GetMapping("/tweets") + public Flux getAllTweets() { + return null; + } + + @PostMapping("/tweets") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "create Tweets") }) + public Mono createTweets(@Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get Tweet By Id"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @GetMapping("/tweets/{id}") + public Mono> getTweetById(@PathVariable(value = "id") String tweetId) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "update Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @PutMapping("/tweets/{id}") + public Mono> updateTweet(@PathVariable(value = "id") String tweetId, + @Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "delete Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @DeleteMapping("/tweets/{id}") + public Mono> deleteTweet(@PathVariable(value = "id") String tweetId) { + return null; + } + + @Operation(description = "Tweets are Sent to the client as Server Sent Events", responses = { + @ApiResponse(responseCode = "200", description = "stream All Tweets") }) + @GetMapping(value = "/stream/tweets", produces = MediaType.TEXT_EVENT_STREAM_VALUE) + public Flux streamAllTweets() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/dto/TweetDTO.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/dto/TweetDTO.java new file mode 100644 index 000000000..111f7a6b4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/dto/TweetDTO.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66.dto; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +public class TweetDTO { + private String id; + + @NotBlank + @Size(max = 140) + private String text; + + @NotNull + private Date createdAt = new Date(); + + public TweetDTO() { + + } + + public TweetDTO(String text) { + this.text = text; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/exception/TweetConflictException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/exception/TweetConflictException.java new file mode 100644 index 000000000..cea82f9bc --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/exception/TweetConflictException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetConflictException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetConflictException(String tweetId) { + super("Tweet conflict with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/exception/TweetNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/exception/TweetNotFoundException.java new file mode 100644 index 000000000..279a0caa1 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/exception/TweetNotFoundException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetNotFoundException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetNotFoundException(String tweetId) { + super("Tweet not found with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/payload/ErrorResponse.java new file mode 100644 index 000000000..4cd3408e5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app66/payload/ErrorResponse.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66.payload; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class ErrorResponse { + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java new file mode 100644 index 000000000..61016b603 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app67; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class HelloController { + + @RequestMapping + public String test() { + return "ok"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java new file mode 100644 index 000000000..5b24e7d1e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app67; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp67Test extends AbstractSpringDocTest { + + @Test + void testApp() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange().expectStatus().isOk().expectBody() + .jsonPath("$.openapi").isEqualTo("3.0.1") + .jsonPath("$.paths./api.get.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.get.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.post.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.post.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.put.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.put.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.patch.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.patch.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.delete.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.delete.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.options.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.options.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.head.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.head.responses.200.content.['*/*'].schema.type").isEqualTo("string"); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app67" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/SpringDocApp68Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/SpringDocApp68Test.java new file mode 100644 index 000000000..5cbfc84f9 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/SpringDocApp68Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "springdoc.group-configs[0].group=stream", + "springdoc.group-configs[0].pathsToMatch=/stream/**" +}) +public class SpringDocApp68Test extends AbstractSpringDocTest { + + public SpringDocApp68Test() { + this.groupName = "/stream"; + } + + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app68" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/controller/ExceptionTranslator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/controller/ExceptionTranslator.java new file mode 100644 index 000000000..96b395e06 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/controller/ExceptionTranslator.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.controller; + +import test.org.springdoc.api.v30.app68.exception.TweetConflictException; +import test.org.springdoc.api.v30.app68.exception.TweetNotFoundException; +import test.org.springdoc.api.v30.app68.payload.ErrorResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class ExceptionTranslator { + + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetConflictException.class) + @ResponseStatus(HttpStatus.CONFLICT) + public ResponseEntity handleDuplicateKeyException(TweetConflictException ex) { + return ResponseEntity.status(HttpStatus.CONFLICT) + .body(new ErrorResponse("A Tweet with the same text already exists")); + } + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetNotFoundException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public ResponseEntity handleTweetNotFoundException(TweetNotFoundException ex) { + return ResponseEntity.notFound().build(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/controller/TweetController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/controller/TweetController.java new file mode 100644 index 000000000..37ea7b5e4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/controller/TweetController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import jakarta.validation.Valid; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v30.app68.dto.TweetDTO; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +@RestController +public class TweetController { + + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") }) + @GetMapping("/tweets") + public Flux getAllTweets() { + return null; + } + + @PostMapping("/tweets") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "create Tweets") }) + public Mono createTweets(@Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get Tweet By Id"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @GetMapping("/tweets/{id}") + public Mono> getTweetById(@PathVariable(value = "id") String tweetId) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "update Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @PutMapping("/tweets/{id}") + public Mono> updateTweet(@PathVariable(value = "id") String tweetId, + @Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "delete Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @DeleteMapping("/tweets/{id}") + public Mono> deleteTweet(@PathVariable(value = "id") String tweetId) { + return null; + } + + @Operation(description = "Tweets are Sent to the client as Server Sent Events", responses = { + @ApiResponse(responseCode = "200", description = "stream All Tweets") }) + @GetMapping(value = "/stream/tweets", produces = MediaType.TEXT_EVENT_STREAM_VALUE) + public Flux streamAllTweets() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/dto/TweetDTO.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/dto/TweetDTO.java new file mode 100644 index 000000000..24b7f4aa5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/dto/TweetDTO.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.dto; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +public class TweetDTO { + private String id; + + @NotBlank + @Size(max = 140) + private String text; + + @NotNull + private Date createdAt = new Date(); + + public TweetDTO() { + + } + + public TweetDTO(String text) { + this.text = text; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/exception/TweetConflictException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/exception/TweetConflictException.java new file mode 100644 index 000000000..740d92163 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/exception/TweetConflictException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetConflictException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetConflictException(String tweetId) { + super("Tweet conflict with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/exception/TweetNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/exception/TweetNotFoundException.java new file mode 100644 index 000000000..1cc0d8fae --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/exception/TweetNotFoundException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetNotFoundException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetNotFoundException(String tweetId) { + super("Tweet not found with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/payload/ErrorResponse.java new file mode 100644 index 000000000..d52834bab --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app68/payload/ErrorResponse.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.payload; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class ErrorResponse { + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/RoutingConfiguration.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/RoutingConfiguration.java new file mode 100644 index 000000000..b3f18e1a2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/RoutingConfiguration.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app69; + +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class RoutingConfiguration { + + @Bean + @RouterOperations({ @RouterOperation(path = "/api/user/index", beanClass = UserRepository.class, beanMethod = "getAllUsers"), + @RouterOperation(path = "/api/user/{id}", beanClass = UserRepository.class, beanMethod = "getUserById"), + @RouterOperation(path = "/api/user/post", beanClass = UserRepository.class, beanMethod = "saveUser"), + @RouterOperation(path = "/api/user/put/{id}", beanClass = UserRepository.class, beanMethod = "putUser"), + @RouterOperation(path = "/api/user/delete/{id}", beanClass = UserRepository.class, beanMethod = "deleteUser") }) + public RouterFunction monoRouterFunction(UserHandler userHandler) { + return route(GET("/api/user/index").and(accept(MediaType.APPLICATION_JSON)), userHandler::getAll) + .andRoute(GET("/api/user/{id}").and(accept(MediaType.APPLICATION_JSON)), userHandler::getUser) + .andRoute(POST("/api/user/post").and(accept(MediaType.APPLICATION_JSON)), userHandler::postUser) + .andRoute(PUT("/api/user/put/{id}").and(accept(MediaType.APPLICATION_JSON)), userHandler::putUser) + .andRoute(DELETE("/api/user/delete/{id}").and(accept(MediaType.APPLICATION_JSON)), userHandler::deleteUser); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java new file mode 100644 index 000000000..9025c3564 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app69; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp69Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app69" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/User.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/User.java new file mode 100644 index 000000000..79ed3d4be --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/User.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app69; + +public class User { + private long id; + + private String firstname; + + private String lastname; + + private int age; + + public User() { + } + + public User(long id, String firstname, String lastname, int age) { + this.id = id; + this.firstname = firstname; + this.lastname = lastname; + this.age = age; + } + + public long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFirstname() { + return firstname; + } + + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + public String getLastname() { + return lastname; + } + + public void setLastname(String lastname) { + this.lastname = lastname; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + String info = String.format("id = %d, firstname = %s, lastname = %s, age = %d", id, firstname, lastname, age); + return info; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserHandler.java new file mode 100644 index 000000000..f77f6e480 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserHandler.java @@ -0,0 +1,119 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app69; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.BodyInserters.fromObject; + +@Component +public class UserHandler { + + private final UserRepository customerRepository; + + public UserHandler(UserRepository repository) { + this.customerRepository = repository; + } + + /** + * GET ALL Users + */ + public Mono getAll(ServerRequest request) { + // fetch all customers from repository + Flux customers = customerRepository.getAllUsers(); + + // build response + return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(customers, User.class); + } + + /** + * GET a User by ID + */ + public Mono getUser(ServerRequest request) { + // parse path-variable + long customerId = Long.valueOf(request.queryParam("id").get()); + + // build notFound response + Mono notFound = ServerResponse.notFound().build(); + + // get customer from repository + Mono customerMono = customerRepository.getUserById(customerId); + + // build response + return customerMono + .flatMap(customer -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(customer))) + .switchIfEmpty(notFound); + } + + /** + * POST a User + */ + public Mono postUser(ServerRequest request) { + Mono customer = request.bodyToMono(User.class); + return ServerResponse.ok().build(customerRepository.saveUser(customer)); + } + + /** + * PUT a User + */ + public Mono putUser(ServerRequest request) { + // parse id from path-variable + long customerId = Long.valueOf(request.pathVariable("id")); + + // get customer data from request object + Mono customer = request.bodyToMono(User.class); + + // get customer from repository + Mono responseMono = customerRepository.putUser(customerId, customer); + + // build response + return responseMono + .flatMap(cust -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(cust))); + } + + /** + * DELETE a User + */ + public Mono deleteUser(ServerRequest request) { + // parse id from path-variable + long customerId = Long.valueOf(request.pathVariable("id")); + + // get customer from repository + Mono responseMono = customerRepository.deleteUser(customerId); + + // build response + return responseMono + .flatMap(strMono -> ServerResponse.ok().contentType(MediaType.TEXT_PLAIN).body(fromObject(strMono))); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserRepository.java new file mode 100644 index 000000000..caf6e26a2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserRepository.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app69; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public interface UserRepository { + + public Mono getUserById(@Parameter(in = ParameterIn.PATH, description = "The user Id") Long id); + + @Operation(description = "get all the users") + public Flux getAllUsers(); + + @Operation(description = "get all the users by firstname") + public Flux getAllUsers(String firstname); + + public Mono saveUser(Mono user); + + public Mono putUser(@Parameter(in = ParameterIn.PATH) Long id, @RequestBody Mono user); + + public Mono deleteUser(@Parameter(in = ParameterIn.PATH) Long id); +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserRepositoryImpl.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserRepositoryImpl.java new file mode 100644 index 000000000..b94fc6cf5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app69/UserRepositoryImpl.java @@ -0,0 +1,98 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app69; + +import java.util.HashMap; +import java.util.Map; + +import jakarta.annotation.PostConstruct; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Repository; + +@Repository +public class UserRepositoryImpl implements UserRepository { + private Map users = new HashMap(); + + @PostConstruct + public void init() throws Exception { + users.put(Long.valueOf(1), new User(1, "Jack", "Smith", 20)); + users.put(Long.valueOf(2), new User(2, "Peter", "Johnson", 25)); + } + + @Override + public Mono getUserById(Long id) { + return Mono.just(users.get(id)); + } + + @Override + public Flux getAllUsers() { + return Flux.fromIterable(this.users.values()); + } + + @Override + public Flux getAllUsers(String firstname) { + return Flux.fromIterable(this.users.values().stream().filter(user -> user.getFirstname().equals(firstname)).toList()); + } + + @Override + public Mono saveUser(Mono monoUser) { + Mono userMono = monoUser.doOnNext(user -> { + // do post + users.put(user.getId(), user); + + // log on console + System.out.println("########### POST:" + user); + }); + + return userMono.then(); + } + + @Override + public Mono putUser(Long id, Mono monoUser) { + Mono userMono = monoUser.doOnNext(user -> { + // reset user.Id + user.setId(id); + + // do put + users.put(id, user); + + // log on console + System.out.println("########### PUT:" + user); + }); + + return userMono; + } + + @Override + public Mono deleteUser(Long id) { + // delete processing + users.remove(id); + return Mono.just("Delete Succesfully!"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/Coffee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/Coffee.java new file mode 100644 index 000000000..b41fd1c8b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/Coffee.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70; + +import java.util.Objects; + +public class Coffee { + + private String id; + + private String name; + + public Coffee() { + } + + public Coffee(String name) { + this.name = name; + } + + public Coffee(String id, String name) { + this.id = id; + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Coffee coffee = (Coffee) o; + return Objects.equals(id, coffee.id) && + Objects.equals(name, coffee.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + return "Coffee{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeOrder.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeOrder.java new file mode 100644 index 000000000..bb886f679 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeOrder.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70; + +import java.time.Instant; +import java.util.Objects; + +public class CoffeeOrder { + private String coffeeId; + + private Instant whenOrdered; + + public CoffeeOrder() { + } + + public CoffeeOrder(String coffeeId, Instant whenOrdered) { + this.coffeeId = coffeeId; + this.whenOrdered = whenOrdered; + } + + public String getCoffeeId() { + return coffeeId; + } + + public Instant getWhenOrdered() { + return whenOrdered; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CoffeeOrder that = (CoffeeOrder) o; + return Objects.equals(coffeeId, that.coffeeId) && + Objects.equals(whenOrdered, that.whenOrdered); + } + + @Override + public int hashCode() { + return Objects.hash(coffeeId, whenOrdered); + } + + @Override + public String toString() { + return "CoffeeOrder{" + + "coffeeId='" + coffeeId + '\'' + + ", whenOrdered=" + whenOrdered + + '}'; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeRepository.java new file mode 100644 index 000000000..246507904 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeRepository.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70; + +import org.reactivestreams.Publisher; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Repository; + +@Repository +public class CoffeeRepository { + Flux deleteAll() { + return null; + } + + Mono findById(String id) { + return null; + } + + Publisher save(Coffee coffee) { + return null; + } + + Flux findAll() { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeService.java new file mode 100644 index 000000000..2a8d90faa --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/CoffeeService.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70; + +import java.time.Duration; +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Service; + +@Service +public class CoffeeService { + private final CoffeeRepository repo; + + public CoffeeService(CoffeeRepository repo) { + this.repo = repo; + } + + Flux getAllCoffees() { + return repo.findAll(); + } + + Mono getCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { + return repo.findById(id); + } + + Flux getOrdersForCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Flux.interval(Duration.ofSeconds(1)) + .onBackpressureDrop() + .map(i -> new CoffeeOrder(id, Instant.now())); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/RouteConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/RouteConfig.java new file mode 100644 index 000000000..967752aab --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/RouteConfig.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70; + +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import reactor.core.publisher.Mono; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class RouteConfig { + private final CoffeeService service; + + public RouteConfig(CoffeeService service) { + this.service = service; + } + + @Bean + @RouterOperations({ @RouterOperation(path = "/coffees", beanClass = CoffeeService.class, beanMethod = "getAllCoffees"), + @RouterOperation(path = "/coffees/{id}", beanClass = CoffeeService.class, beanMethod = "getCoffeeById"), + @RouterOperation(path = "/coffees/{id}/orders", beanClass = CoffeeService.class, beanMethod = "getOrdersForCoffeeById") }) + RouterFunction routerFunction() { + return route(GET("/coffees"), this::all) + .andRoute(GET("/coffees/{id}"), this::byId) + .andRoute(GET("/coffees/{id}/orders"), this::orders); + } + + private Mono all(ServerRequest req) { + return ServerResponse.ok() + .body(service.getAllCoffees(), Coffee.class); + } + + private Mono byId(ServerRequest req) { + return ServerResponse.ok() + .body(service.getCoffeeById(req.pathVariable("id")), Coffee.class); + } + + private Mono orders(ServerRequest req) { + return ServerResponse.ok() + .contentType(MediaType.TEXT_EVENT_STREAM) + .body(service.getOrdersForCoffeeById(req.pathVariable("id")), CoffeeOrder.class); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java new file mode 100644 index 000000000..86f9863ba --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp70Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app70" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/Employee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/Employee.java new file mode 100644 index 000000000..94f6fdf4c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/Employee.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app71; + +public class Employee { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/EmployeeFunctionalConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/EmployeeFunctionalConfig.java new file mode 100644 index 000000000..012c9ee0a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/EmployeeFunctionalConfig.java @@ -0,0 +1,108 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app71; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.BodyExtractors; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +public class EmployeeFunctionalConfig { + + + @Bean + EmployeeRepository employeeRepository() { + return new EmployeeRepository(); + } + + @Bean + @RouterOperation(beanClass = EmployeeRepository.class, beanMethod = "findAllEmployees") + RouterFunction getAllEmployeesRoute() { + return route(GET("/employees").and(accept(MediaType.APPLICATION_JSON)), + req -> ok().body( + employeeRepository().findAllEmployees(), Employee.class)); + } + + @Bean + @RouterOperation(operation = @Operation(operationId = "findEmployeeById", summary = "Find purchase order by ID", tags = { "MyEmployee" }, + parameters = { @Parameter(in = ParameterIn.PATH, name = "id", description = "Employee Id") }, + responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Employee.class))), + @ApiResponse(responseCode = "400", description = "Invalid Employee ID supplied"), + @ApiResponse(responseCode = "404", description = "Employee not found") })) + RouterFunction getEmployeeByIdRoute() { + return route(GET("/employees/{id}"), + req -> ok().body( + employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class)); + } + + + @Bean + @RouterOperation(beanClass = EmployeeRepository.class, beanMethod = "updateEmployee") + RouterFunction updateEmployeeRoute() { + return route(POST("/employees/update").and(accept(MediaType.APPLICATION_XML)), + req -> req.body(BodyExtractors.toMono(Employee.class)) + .doOnNext(employeeRepository()::updateEmployee) + .then(ok().build())); + } + + @Bean + @RouterOperations({ @RouterOperation(path = "/employees-composed/update", beanClass = EmployeeRepository.class, beanMethod = "updateEmployee"), + @RouterOperation(path = "/employees-composed/{id}", beanClass = EmployeeRepository.class, beanMethod = "findEmployeeById"), + @RouterOperation(path = "/employees-composed", beanClass = EmployeeRepository.class, beanMethod = "findAllEmployees") }) + RouterFunction composedRoutes() { + return + route(GET("/employees-composed"), + req -> ok().body( + employeeRepository().findAllEmployees(), Employee.class)) + .and(route(GET("/employees-composed/{id}"), + req -> ok().body( + employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class))) + .and(route(POST("/employees-composed/update"), + req -> req.body(BodyExtractors.toMono(Employee.class)) + .doOnNext(employeeRepository()::updateEmployee) + .then(ok().build()))); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/EmployeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/EmployeeRepository.java new file mode 100644 index 000000000..37794c834 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/EmployeeRepository.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app71; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public class EmployeeRepository { + + static Map employeeData; + + static Map employeeAccessData; + + + public Mono findEmployeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Mono.just(employeeData.get(id)); + } + + public Flux findAllEmployees() { + return Flux.fromIterable(employeeData.values()); + } + + public Mono updateEmployee(Employee employee) { + Employee existingEmployee = employeeData.get(employee.getId()); + if (existingEmployee != null) { + existingEmployee.setName(employee.getName()); + } + return Mono.just(existingEmployee); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java new file mode 100644 index 000000000..8472bf4e6 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app71; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp71Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app71" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/SpringDocApp72Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/SpringDocApp72Test.java new file mode 100644 index 000000000..fbb07bf80 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/SpringDocApp72Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp72Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app72" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/controller/PersonRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/controller/PersonRouter.java new file mode 100644 index 000000000..07141a60d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/controller/PersonRouter.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.controller; + +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v30.app72.handler.PersonHandler; +import test.org.springdoc.api.v30.app72.service.PersonService; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; + +@Configuration +public class PersonRouter { + + @RouterOperations({ @RouterOperation(path = "/getAllPersons", beanClass = PersonService.class, beanMethod = "getAll"), + @RouterOperation(path = "/getPerson/{id}", beanClass = PersonService.class, beanMethod = "getById"), + @RouterOperation(path = "/createPerson", beanClass = PersonService.class, beanMethod = "save"), + @RouterOperation(path = "/deletePerson/{id}", beanClass = PersonService.class, beanMethod = "delete") }) + @Bean + public RouterFunction personRoute(PersonHandler handler) { + return RouterFunctions + .route(GET("/getAllPersons").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) + .andRoute(GET("/getPerson/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) + .andRoute(POST("/createPerson").and(accept(MediaType.APPLICATION_JSON)), handler::save) + .andRoute(DELETE("/deletePerson/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/controller/PositionRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/controller/PositionRouter.java new file mode 100644 index 000000000..3fc4a10ca --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/controller/PositionRouter.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v30.app72.entity.Position; +import test.org.springdoc.api.v30.app72.handler.PositionHandler; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; + +@Configuration +public class PositionRouter { + + @Bean + @RouterOperations({ @RouterOperation(path = "/getAllPositions", operation = @Operation(description = "Get all positions", operationId = "findAll", tags = "positions", + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Position.class)))))), + @RouterOperation(path = "/getPosition/{id}", operation = @Operation(description = "Find all", operationId = "findById", tags = "positions", parameters = @Parameter(name = "id", in = ParameterIn.PATH), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Position.class))))), + @RouterOperation(path = "/createPosition", operation = @Operation(description = "Save position", operationId = "save", tags = "positions", requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = Position.class))), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Position.class))))), + @RouterOperation(path = "/deletePosition/{id}", operation = @Operation(description = "Delete By Id", operationId = "deleteBy", tags = "positions", parameters = @Parameter(name = "id", in = ParameterIn.PATH), + responses = @ApiResponse(responseCode = "200", content = @Content))) }) + public RouterFunction positionRoute(PositionHandler handler) { + return RouterFunctions + .route(GET("/getAllPositions").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) + .andRoute(GET("/getPosition/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) + .andRoute(POST("/createPosition").and(accept(MediaType.APPLICATION_JSON)), handler::save) + .andRoute(DELETE("/deletePosition/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Person.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Person.java new file mode 100644 index 000000000..9432f84a7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Person.java @@ -0,0 +1,100 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.entity; + +public class Person { + + private String id; + + private Sex sex; + + private String firstName; + + private String lastName; + + private String age; + + private String interests; + + private String email; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Sex getSex() { + return sex; + } + + public void setSex(Sex sex) { + this.sex = sex; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getAge() { + return age; + } + + public void setAge(String age) { + this.age = age; + } + + public String getInterests() { + return interests; + } + + public void setInterests(String interests) { + this.interests = interests; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Position.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Position.java new file mode 100644 index 000000000..06cea5c94 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Position.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.entity; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +public class Position { + + private String id; + + @NotBlank + @Size(max = 140) + private String positionName; + + private String description; + + @NotNull + private Date createdAt = new Date(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPositionName() { + return positionName; + } + + public void setPositionName(String positionName) { + this.positionName = positionName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Sex.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Sex.java new file mode 100644 index 000000000..d2361ae1d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/entity/Sex.java @@ -0,0 +1,31 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.entity; + +public enum Sex { + MAN, WOMEN +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/exception/PositionNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/exception/PositionNotFoundException.java new file mode 100644 index 000000000..9a63bb3d3 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/exception/PositionNotFoundException.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.exception; + +public class PositionNotFoundException extends RuntimeException { + + public PositionNotFoundException(String positionId) { + super("Position not found with id " + positionId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/handler/PersonHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/handler/PersonHandler.java new file mode 100644 index 000000000..da05a3575 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/handler/PersonHandler.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.handler; + +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v30.app72.entity.Person; +import test.org.springdoc.api.v30.app72.service.PersonService; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Component +@SuppressWarnings({ "deprecared", "unchecked" }) +public class PersonHandler { + + private final PersonService personService; + + public PersonHandler(PersonService personService) { + this.personService = personService; + } + + public Mono findById(ServerRequest request) { + String id = request.pathVariable("id"); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.getById(id), Person.class); + } + + public Mono findAll(ServerRequest request) { + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.getAll(), Person.class); + } + + public Mono save(ServerRequest request) { + final Mono person = request.bodyToMono(Person.class); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(BodyInserters.fromPublisher(person.flatMap(personService::save), Person.class)); + } + + public Mono delete(ServerRequest request) { + String id = request.pathVariable("id"); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.delete(id), Void.class); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/handler/PositionHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/handler/PositionHandler.java new file mode 100644 index 000000000..96f389b2f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/handler/PositionHandler.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.handler; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class PositionHandler { + + + public Mono findById(ServerRequest request) { + String id = request.pathVariable("id"); + return null; + } + + public Mono findAll(ServerRequest request) { + return null; + } + + public Mono save(ServerRequest request) { + return null; + } + + public Mono delete(ServerRequest request) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/payload/ErrorResponse.java new file mode 100644 index 000000000..c6c467852 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/payload/ErrorResponse.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.payload; + +public class ErrorResponse { + + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/service/PersonService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/service/PersonService.java new file mode 100644 index 000000000..b0b0595cf --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app72/service/PersonService.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72.service; + +import java.util.Objects; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v30.app72.entity.Person; + +import org.springframework.stereotype.Service; + +@Service +public class PersonService { + + public Flux getAll() { + return null; + } + + public Mono getById(@Parameter(in = ParameterIn.PATH) final String id) { + return null; + } + + public Mono update(@Parameter(in = ParameterIn.PATH) final String id, final Person person) { + return null; + } + + public Mono save(final Person person) { + return null; + } + + public Mono delete(@Parameter(in = ParameterIn.PATH) final String id) { + final Mono dbPerson = getById(id); + if (Objects.isNull(dbPerson)) { + return Mono.empty(); + } + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/Quote.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/Quote.java new file mode 100644 index 000000000..b7c761c0b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/Quote.java @@ -0,0 +1,88 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app73; + + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Instant; + +public class Quote { + + private static final MathContext MATH_CONTEXT = new MathContext(2); + + private String ticker; + + private BigDecimal price; + + private Instant instant; + + public Quote() { + } + + public Quote(String ticker, BigDecimal price) { + this.ticker = ticker; + this.price = price; + } + + public Quote(String ticker, Double price) { + this(ticker, new BigDecimal(price, MATH_CONTEXT)); + } + + public String getTicker() { + return ticker; + } + + public void setTicker(String ticker) { + this.ticker = ticker; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Instant getInstant() { + return instant; + } + + public void setInstant(Instant instant) { + this.instant = instant; + } + + @Override + public String toString() { + return "Quote{" + + "ticker='" + ticker + '\'' + + ", price=" + price + + ", instant=" + instant + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteGenerator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteGenerator.java new file mode 100644 index 000000000..e42386616 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteGenerator.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app73; + + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class QuoteGenerator { + + private final MathContext mathContext = new MathContext(2); + + private final Random random = new Random(); + + private final List prices = new ArrayList<>(); + + /** + * Bootstraps the generator with tickers and initial prices + */ + public QuoteGenerator() { + this.prices.add(new Quote("CTXS", 82.26)); + this.prices.add(new Quote("DELL", 63.74)); + this.prices.add(new Quote("GOOG", 847.24)); + this.prices.add(new Quote("MSFT", 65.11)); + this.prices.add(new Quote("ORCL", 45.71)); + this.prices.add(new Quote("RHT", 84.29)); + this.prices.add(new Quote("VMW", 92.21)); + } + + + public Flux fetchQuoteStream(Duration period) { + + // We want to emit quotes with a specific period; + // to do so, we create a Flux.interval + return Flux.interval(period) + // In case of back-pressure, drop events + .onBackpressureDrop() + // For each tick, generate a list of quotes + .map(this::generateQuotes) + // "flatten" that List into a Flux + .flatMapIterable(quotes -> quotes) + .log("io.spring.workshop.stockquotes"); + } + + /* + * Create quotes for all tickers at a single instant. + */ + private List generateQuotes(long interval) { + final Instant instant = Instant.now(); + return prices.stream() + .map(baseQuote -> { + BigDecimal priceChange = baseQuote.getPrice() + .multiply(new BigDecimal(0.05 * this.random.nextDouble()), this.mathContext); + Quote result = new Quote(baseQuote.getTicker(), baseQuote.getPrice().add(priceChange)); + result.setInstant(instant); + return result; + }) + .toList(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteHandler.java new file mode 100644 index 000000000..a4b9cd91b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteHandler.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app73; + + +import java.time.Duration; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class QuoteHandler { + + private final Flux quoteStream; + + public QuoteHandler(QuoteGenerator quoteGenerator) { + this.quoteStream = quoteGenerator.fetchQuoteStream(Duration.ofMillis(1000)).share(); + } + + public Mono hello(ServerRequest request) { + return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) + .body(BodyInserters.fromObject("Hello Spring!")); + } + + public Mono echo(ServerRequest request) { + return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) + .body(request.bodyToMono(String.class), String.class); + } + + public Mono streamQuotes(ServerRequest request) { + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_STREAM_JSON) + .body(this.quoteStream, Quote.class); + } + + public Mono fetchQuotes(ServerRequest request) { + int size = Integer.parseInt(request.queryParam("size").orElse("10")); + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .body(this.quoteStream.take(size), Quote.class); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteRouter.java new file mode 100644 index 000000000..c7a08b747 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/QuoteRouter.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app73; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.http.MediaType.APPLICATION_JSON; +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; +import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; +import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON_VALUE; +import static org.springframework.http.MediaType.TEXT_PLAIN; +import static org.springframework.http.MediaType.TEXT_PLAIN_VALUE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.contentType; + +@Configuration +public class QuoteRouter { + + @RouterOperations({ + @RouterOperation(path = "/hello", operation = @Operation(operationId = "hello", responses = @ApiResponse(responseCode = "200"))), + @RouterOperation(path = "/echo", produces = TEXT_PLAIN_VALUE, operation = @Operation(operationId = "echo", requestBody = @RequestBody(content = @Content(schema = @Schema(type = "string"))), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(type = "string"))))), + @RouterOperation(path = "/echo", produces = APPLICATION_JSON_VALUE, operation = @Operation(operationId = "echo", requestBody = @RequestBody(content = @Content(schema = @Schema(type = "string"))), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(type = "string"))))), + @RouterOperation(path = "/quotes", produces = APPLICATION_JSON_VALUE, operation = @Operation(operationId = "fetchQuotes", parameters = @Parameter(name = "size", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Quote.class)))))), + @RouterOperation(path = "/quotes", produces = APPLICATION_STREAM_JSON_VALUE, operation = @Operation(operationId = "fetchQuotes", + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Quote.class))))) }) + @Bean + public RouterFunction route(QuoteHandler quoteHandler) { + return RouterFunctions + .route(GET("/hello").and(accept(TEXT_PLAIN)), quoteHandler::hello) + .andRoute(POST("/echo").and(accept(TEXT_PLAIN).and(contentType(TEXT_PLAIN))), quoteHandler::echo) + .andRoute(POST("/echo").and(accept(APPLICATION_JSON).and(contentType(APPLICATION_JSON))), quoteHandler::echo) + .andRoute(GET("/quotes").and(accept(APPLICATION_JSON)), quoteHandler::fetchQuotes) + .andRoute(GET("/quotes").and(accept(APPLICATION_STREAM_JSON)), quoteHandler::streamQuotes); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java new file mode 100644 index 000000000..9a3af3463 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app73; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp73Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app73" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/Book.java new file mode 100644 index 000000000..b70349944 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/Book.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app74; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/BookRepository.java new file mode 100644 index 000000000..1e832101b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app74; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/BookRouter.java new file mode 100644 index 000000000..40776a7a5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/BookRouter.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app74; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +class BookRouter { + + @Bean + @RouterOperations({ + @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes(BookRepository br) { + return + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java new file mode 100644 index 000000000..685b2a9af --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app74; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp74Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app74" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/Post.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/Post.java new file mode 100644 index 000000000..b94b392df --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/Post.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app75; + +import java.time.LocalDateTime; + +public class Post { + + private String id; + + private String title; + + private String content; + + private LocalDateTime createdDate; + + public Post(String id, String title, String content) { + this.id = id; + this.title = title; + this.content = content; + this.createdDate = LocalDateTime.now(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public LocalDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(LocalDateTime createdDate) { + this.createdDate = createdDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostHandler.java new file mode 100644 index 000000000..57d03263a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostHandler.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app75; + + +import java.net.URI; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +class PostHandler { + + private final PostRepository posts; + + public PostHandler(PostRepository posts) { + this.posts = posts; + } + + public Mono all(ServerRequest req) { + return ServerResponse.ok().body(this.posts.findAll(), Post.class); + } + + public Mono create(ServerRequest req) { + return req.bodyToMono(Post.class) + .flatMap(post -> this.posts.save(post)) + .flatMap(p -> ServerResponse.created(URI.create("/posts/" + p.getId())).build()); + } + + public Mono get(ServerRequest req) { + return this.posts.findById(req.pathVariable("id")) + .flatMap(post -> ServerResponse.ok().body(Mono.just(post), Post.class)) + .switchIfEmpty(ServerResponse.notFound().build()); + } + + public Mono update(ServerRequest req) { + + return Mono + .zip( + (data) -> { + Post p = (Post) data[0]; + Post p2 = (Post) data[1]; + p.setTitle(p2.getTitle()); + p.setContent(p2.getContent()); + return p; + }, + this.posts.findById(req.pathVariable("id")), + req.bodyToMono(Post.class) + ) + .cast(Post.class) + .flatMap(post -> this.posts.save(post)) + .flatMap(post -> ServerResponse.noContent().build()); + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostRepository.java new file mode 100644 index 000000000..80d6bf261 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostRepository.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app75; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; + +@Component +public class PostRepository { + + public Flux findByAuthor(String author) { + return Flux.just(new Post("1", "title1", "author1")); + } + + public Flux findAll() { + return Flux.just(new Post("2", "title2", "author2")); + } + + public Mono findById(String id) { + return Mono.just(new Post("3", "title2", "author2")); + } + + public Mono save(Post post) { + return Mono.just(new Post("4", "title2", "author2")); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostRouter.java new file mode 100644 index 000000000..a748b4419 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/PostRouter.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app75; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; +import static org.springframework.web.reactive.function.server.RequestPredicates.queryParam; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +class PostRouter { + + @RouterOperations({ @RouterOperation(path = "/posts", method = RequestMethod.GET, headers = { "x-header1=test1", "x-header2=test2" }, operation = @Operation(operationId = "all", + parameters = { @Parameter(name = "key", description = "sample description"), @Parameter(name = "test", description = "sample desc") }, + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Post.class)))))), + @RouterOperation(path = "/posts", method = RequestMethod.POST, operation = @Operation(operationId = "create", + requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = Post.class))), responses = @ApiResponse(responseCode = "201"))), + @RouterOperation(path = "/posts/{id}", method = RequestMethod.GET, operation = @Operation(operationId = "get", + parameters = @Parameter(name = "id", in = ParameterIn.PATH), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Post.class))))), + @RouterOperation(path = "/posts/{id}", method = RequestMethod.PUT, operation = @Operation(operationId = "update", + parameters = @Parameter(name = "id", in = ParameterIn.PATH), + responses = @ApiResponse(responseCode = "202", content = @Content(schema = @Schema(implementation = Post.class))))) }) + @Bean + public RouterFunction routes(PostHandler postController) { + return route(GET("/posts").and(queryParam("key", "value")), postController::all) + .andRoute(POST("/posts"), postController::create) + .andRoute(GET("/posts/{id}"), postController::get) + .andRoute(PUT("/posts/{id}"), postController::update); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java new file mode 100644 index 000000000..949d572af --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app75; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp75Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app75" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java new file mode 100644 index 000000000..5d8939aad --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app78; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import reactor.core.publisher.Flux; + +import org.springframework.http.MediaType; +import org.springframework.http.codec.multipart.FilePart; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @PostMapping(value = "/files", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + @Operation(summary = "files") + public Flux handleFileUpload( + @RequestPart("files") @Parameter(description = "files", + content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) + Flux filePartFux) throws IOException { + File tmp = File.createTempFile("tmp", ""); + return filePartFux.flatMap(filePart -> { + Path path = Paths.get(tmp.toString() + filePart.filename()); + System.out.println(path); + return filePart.transferTo(path); + }); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java new file mode 100644 index 000000000..979cd2a83 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app78; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp78Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app78" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/BaseClientModel.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/BaseClientModel.java new file mode 100644 index 000000000..ed6ecddd5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/BaseClientModel.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app79; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public abstract class BaseClientModel { + @JsonProperty("id") + int id; +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/BaseController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/BaseController.java new file mode 100644 index 000000000..8c365769a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/BaseController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app79; + +import java.util.List; + +import reactor.core.publisher.Mono; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; + +public abstract class BaseController { + @GetMapping("/test1") + Mono> get1() { + return null; + } + + @GetMapping("/test2") + Mono>> get2() { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpecificClientModel.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpecificClientModel.java new file mode 100644 index 000000000..915cd7fb1 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpecificClientModel.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app79; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class SpecificClientModel extends BaseClientModel { + @JsonProperty("name") + @Schema(title = "my title", pattern = "this is it", example = "this is example") + String name; +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpecificController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpecificController.java new file mode 100644 index 000000000..e4ebcc15c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpecificController.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app79; + +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class SpecificController extends BaseController {} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java new file mode 100644 index 000000000..2121c333f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app79; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp79Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app79" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/Book.java new file mode 100644 index 000000000..a88884953 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/Book.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app80; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/BookRepository.java new file mode 100644 index 000000000..b9ff1e510 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app80; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/BookRouter.java new file mode 100644 index 000000000..1bc5cece7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/BookRouter.java @@ -0,0 +1,113 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app80; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +class BookRouter { + + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes(BookRepository br) { + return + nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class))); + } + + @Bean + @RouterOperations({ + @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes1(BookRepository br) { + return + nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + route(GET("/books"), req -> ok().body(br.findAll(), Book.class)) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class))); + } + + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes3(BookRepository br) { + return + nest(path("/greeter").or(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class))); + } + + @Bean + @RouterOperations({ + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes4(BookRepository br) { + return + nest(path("/test"), + nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java new file mode 100644 index 000000000..438a706ad --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app80; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp80Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app80" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app81/OperationIdController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app81/OperationIdController.java new file mode 100644 index 000000000..d3cb04bdf --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app81/OperationIdController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app81; + +import reactor.core.publisher.Mono; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class OperationIdController { + + @GetMapping(path = "/test_0") // gets operationId opIdTest_3 + public Mono opIdTest() { + return null; + } + + @GetMapping(path = "/test_1") // gets operationId opIdTest_2 + public Mono opIdTest(@RequestParam String param) { + return null; + } + + @GetMapping(path = "/test_2") // gets operationId opIdTest_1 + public Mono opIdTest(@RequestParam Integer param) { + return null; + } + + @GetMapping(path = "/test_3") // gets operationId opIdTest + public Mono opIdTest(@RequestParam Boolean param) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java new file mode 100644 index 000000000..bf7969153 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app81; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.ThreadLocalRandom; + +import org.junit.jupiter.api.RepeatedTest; +import org.springdoc.webflux.api.OpenApiWebfluxResource; +import test.org.springdoc.api.v30.AbstractCommonTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.reactive.result.method.RequestMappingInfo; +import org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springdoc.core.utils.Constants.SPRINGDOC_CACHE_DISABLED; + + +/** + * Tests deterministic creation of operationIds + */ +@WebFluxTest(properties = SPRINGDOC_CACHE_DISABLED + "=true") +public class SpringDocApp81Test extends AbstractCommonTest { + + @Autowired + OpenApiWebfluxResource resource; + + @Autowired + RequestMappingInfoHandlerMapping mappingInfoHandlerMapping; + + @RepeatedTest(10) + public void shouldGenerateOperationIdsDeterministically() throws Exception { + shuffleSpringHandlerMethods(); + + ServerHttpRequest request = mock(ServerHttpRequest.class); + when(request.getURI()).thenReturn(URI.create("http://localhost")); + + String expected = getContent("results/3.0.1/app81.json"); + byte[] openApiBytes =resource.openapiJson(request, "", Locale.US).block(); + String openApi = new String(openApiBytes, StandardCharsets.UTF_8); // for UTF-8 encoding String openApi = resource.openapiJson(request, "", Locale.US).block(); + assertEquals(expected, openApi, true); + } + + private void shuffleSpringHandlerMethods() { + Map handlerMethods = mappingInfoHandlerMapping.getHandlerMethods(); + List> collect = new ArrayList<>(handlerMethods.entrySet()); + collect.sort(Comparator.comparing(a -> ThreadLocalRandom.current().nextBoolean() ? -1 : 1)); + + collect.forEach(e -> mappingInfoHandlerMapping.unregisterMapping(e.getKey())); + collect.forEach(e -> mappingInfoHandlerMapping.registerMapping(e.getKey(), e.getValue().getBean(), e.getValue().getMethod())); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app81" }) + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/RoutingConfiguration.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/RoutingConfiguration.java new file mode 100644 index 000000000..0fc04f75f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/RoutingConfiguration.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app82; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.http.MediaType.APPLICATION_JSON; +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class RoutingConfiguration { + + @Bean + public RouterFunction monoRouterFunction(UserHandler userHandler) { + return route(GET("/api/user/index").and(accept(APPLICATION_JSON)), userHandler::getAll) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("getAllUsers")) + + .and(route(GET("/api/user/{id}").and(accept(APPLICATION_JSON)), userHandler::getUser) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("getUserById"))) + + .and(route(POST("/api/user/post").and(accept(APPLICATION_JSON)), userHandler::postUser) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("saveUser"))) + + .and(route(PUT("/api/user/put").and(accept(APPLICATION_JSON)), userHandler::putUser) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("putUser"))) + + .and(route(DELETE("/api/user/delete/{id}").and(accept(APPLICATION_JSON)), userHandler::deleteUser) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("deleteUser"))); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java new file mode 100644 index 000000000..9886a28b9 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app82; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp82Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app82" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/User.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/User.java new file mode 100644 index 000000000..aaf36bb74 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/User.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app82; + +public class User { + private long id; + + private String firstname; + + private String lastname; + + private int age; + + public User() { + } + + public User(long id, String firstname, String lastname, int age) { + this.id = id; + this.firstname = firstname; + this.lastname = lastname; + this.age = age; + } + + public long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFirstname() { + return firstname; + } + + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + public String getLastname() { + return lastname; + } + + public void setLastname(String lastname) { + this.lastname = lastname; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + String info = String.format("id = %d, firstname = %s, lastname = %s, age = %d", id, firstname, lastname, age); + return info; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserHandler.java new file mode 100644 index 000000000..f12c82944 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserHandler.java @@ -0,0 +1,119 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app82; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.BodyInserters.fromObject; + +@Component +public class UserHandler { + + private final UserRepository customerRepository; + + public UserHandler(UserRepository repository) { + this.customerRepository = repository; + } + + /** + * GET ALL Users + */ + public Mono getAll(ServerRequest request) { + // fetch all customers from repository + Flux customers = customerRepository.getAllUsers(); + + // build response + return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(customers, User.class); + } + + /** + * GET a User by ID + */ + public Mono getUser(ServerRequest request) { + // parse path-variable + long customerId = Long.valueOf(request.queryParam("id").get()); + + // build notFound response + Mono notFound = ServerResponse.notFound().build(); + + // get customer from repository + Mono customerMono = customerRepository.getUserById(customerId); + + // build response + return customerMono + .flatMap(customer -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(customer))) + .switchIfEmpty(notFound); + } + + /** + * POST a User + */ + public Mono postUser(ServerRequest request) { + Mono customer = request.bodyToMono(User.class); + return ServerResponse.ok().build(customerRepository.saveUser(customer)); + } + + /** + * PUT a User + */ + public Mono putUser(ServerRequest request) { + // parse id from path-variable + long customerId = Long.valueOf(request.pathVariable("id")); + + // get customer data from request object + Mono customer = request.bodyToMono(User.class); + + // get customer from repository + Mono responseMono = customerRepository.putUser(customerId, customer); + + // build response + return responseMono + .flatMap(cust -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(cust))); + } + + /** + * DELETE a User + */ + public Mono deleteUser(ServerRequest request) { + // parse id from path-variable + long customerId = Long.valueOf(request.pathVariable("id")); + + // get customer from repository + Mono responseMono = customerRepository.deleteUser(customerId); + + // build response + return responseMono + .flatMap(strMono -> ServerResponse.ok().contentType(MediaType.TEXT_PLAIN).body(fromObject(strMono))); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserRepository.java new file mode 100644 index 000000000..497d298e9 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserRepository.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app82; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public interface UserRepository { + + public Mono getUserById(@Parameter(in = ParameterIn.PATH, description = "The user Id") Long id); + + @Operation(description = "get all the users") + public Flux getAllUsers(); + + @Operation(description = "get all the users by firstname") + public Flux getAllUsers(String firstname); + + public Mono saveUser(Mono user); + + public Mono putUser(@Parameter(in = ParameterIn.QUERY) Long id, @RequestBody Mono user); + + public Mono deleteUser(@Parameter(in = ParameterIn.PATH) Long id); +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserRepositoryImpl.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserRepositoryImpl.java new file mode 100644 index 000000000..356831926 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app82/UserRepositoryImpl.java @@ -0,0 +1,98 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app82; + +import java.util.HashMap; +import java.util.Map; + +import jakarta.annotation.PostConstruct; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Repository; + +@Repository +public class UserRepositoryImpl implements UserRepository { + private Map users = new HashMap(); + + @PostConstruct + public void init() throws Exception { + users.put(Long.valueOf(1), new User(1, "Jack", "Smith", 20)); + users.put(Long.valueOf(2), new User(2, "Peter", "Johnson", 25)); + } + + @Override + public Mono getUserById(Long id) { + return Mono.just(users.get(id)); + } + + @Override + public Flux getAllUsers() { + return Flux.fromIterable(this.users.values()); + } + + @Override + public Flux getAllUsers(String firstname) { + return Flux.fromIterable(this.users.values().stream().filter(user -> user.getFirstname().equals(firstname)).toList()); + } + + @Override + public Mono saveUser(Mono monoUser) { + Mono userMono = monoUser.doOnNext(user -> { + // do post + users.put(user.getId(), user); + + // log on console + System.out.println("########### POST:" + user); + }); + + return userMono.then(); + } + + @Override + public Mono putUser(Long id, Mono monoUser) { + Mono userMono = monoUser.doOnNext(user -> { + // reset user.Id + user.setId(id); + + // do put + users.put(id, user); + + // log on console + System.out.println("########### PUT:" + user); + }); + + return userMono; + } + + @Override + public Mono deleteUser(Long id) { + // delete processing + users.remove(id); + return Mono.just("Delete Succesfully!"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/Coffee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/Coffee.java new file mode 100644 index 000000000..e9b7bc829 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/Coffee.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app83; + +import java.util.Objects; + +public class Coffee { + + private String id; + + private String name; + + public Coffee() { + } + + public Coffee(String name) { + this.name = name; + } + + public Coffee(String id, String name) { + this.id = id; + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Coffee coffee = (Coffee) o; + return Objects.equals(id, coffee.id) && + Objects.equals(name, coffee.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + return "Coffee{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeOrder.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeOrder.java new file mode 100644 index 000000000..764b98a22 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeOrder.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app83; + +import java.time.Instant; +import java.util.Objects; + +public class CoffeeOrder { + private String coffeeId; + + private Instant whenOrdered; + + public CoffeeOrder() { + } + + public CoffeeOrder(String coffeeId, Instant whenOrdered) { + this.coffeeId = coffeeId; + this.whenOrdered = whenOrdered; + } + + public String getCoffeeId() { + return coffeeId; + } + + public Instant getWhenOrdered() { + return whenOrdered; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CoffeeOrder that = (CoffeeOrder) o; + return Objects.equals(coffeeId, that.coffeeId) && + Objects.equals(whenOrdered, that.whenOrdered); + } + + @Override + public int hashCode() { + return Objects.hash(coffeeId, whenOrdered); + } + + @Override + public String toString() { + return "CoffeeOrder{" + + "coffeeId='" + coffeeId + '\'' + + ", whenOrdered=" + whenOrdered + + '}'; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeRepository.java new file mode 100644 index 000000000..c3ed2e077 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeRepository.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app83; + +import org.reactivestreams.Publisher; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Repository; + +@Repository +public class CoffeeRepository { + Flux deleteAll() { + return null; + } + + Mono findById(String id) { + return null; + } + + Publisher save(Coffee coffee) { + return null; + } + + Flux findAll() { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeService.java new file mode 100644 index 000000000..a355a1e82 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/CoffeeService.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app83; + +import java.time.Duration; +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Service; + +@Service +public class CoffeeService { + private final CoffeeRepository repo; + + public CoffeeService(CoffeeRepository repo) { + this.repo = repo; + } + + Flux getAllCoffees() { + return repo.findAll(); + } + + Mono getCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { + return repo.findById(id); + } + + Flux getOrdersForCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Flux.interval(Duration.ofSeconds(1)) + .onBackpressureDrop() + .map(i -> new CoffeeOrder(id, Instant.now())); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/RouteConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/RouteConfig.java new file mode 100644 index 000000000..442697e9e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/RouteConfig.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app83; + +import reactor.core.publisher.Mono; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class RouteConfig { + private final CoffeeService service; + + public RouteConfig(CoffeeService service) { + this.service = service; + } + + @Bean + RouterFunction routerFunction() { + return route(GET("/coffees"), this::all) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(CoffeeService.class).beanMethod("getAllCoffees")) + + .and(route(GET("/coffees/{id}"), this::byId) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(CoffeeService.class).beanMethod("getCoffeeById"))) + + .and(route(GET("/coffees/{id}/orders"), this::orders) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(CoffeeService.class).beanMethod("getOrdersForCoffeeById"))); + } + + private Mono all(ServerRequest req) { + return ServerResponse.ok() + .body(service.getAllCoffees(), Coffee.class); + } + + private Mono byId(ServerRequest req) { + return ServerResponse.ok() + .body(service.getCoffeeById(req.pathVariable("id")), Coffee.class); + } + + private Mono orders(ServerRequest req) { + return ServerResponse.ok() + .contentType(MediaType.TEXT_EVENT_STREAM) + .body(service.getOrdersForCoffeeById(req.pathVariable("id")), CoffeeOrder.class); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java new file mode 100644 index 000000000..37d91fa96 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app83; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp83Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app83" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/Employee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/Employee.java new file mode 100644 index 000000000..1f44e346d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/Employee.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app84; + +public class Employee { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/EmployeeFunctionalConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/EmployeeFunctionalConfig.java new file mode 100644 index 000000000..536e16769 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/EmployeeFunctionalConfig.java @@ -0,0 +1,107 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app84; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.BodyExtractors; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +public class EmployeeFunctionalConfig { + + + @Bean + EmployeeRepository employeeRepository() { + return new EmployeeRepository(); + } + + @Bean + RouterFunction getAllEmployeesRoute() { + return route(GET("/employees").and(accept(MediaType.APPLICATION_JSON)), + req -> ok().body( + employeeRepository().findAllEmployees(), Employee.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("findAllEmployees")); + } + + @Bean + RouterFunction getEmployeeByIdRoute() { + return route(GET("/employees/{id}"), + req -> ok().body( + employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class)) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("findEmployeeById").summary("Find purchase order by ID").tags(new String[] { "MyEmployee" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id").description("Employee Id")) + .response(responseBuilder().responseCode("200").description("successful operation").implementation(Employee.class)) + .response(responseBuilder().responseCode("400").description("Invalid Employee ID supplied")) + .response(responseBuilder().responseCode("404").description("Employee not found"))); + } + + + @Bean + RouterFunction updateEmployeeRoute() { + return route(POST("/employees/update").and(accept(MediaType.APPLICATION_XML)), + req -> req.body(BodyExtractors.toMono(Employee.class)) + .doOnNext(employeeRepository()::updateEmployee) + .then(ok().build())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("updateEmployee")); + } + + @Bean + RouterFunction composedRoutes() { + return + route(GET("/employees-composed"), + req -> ok().body( + employeeRepository().findAllEmployees(), Employee.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("findAllEmployees")) + + .and(route(GET("/employees-composed/{id}"), req -> ok().body( + employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("findEmployeeById"))) + + .and(route(POST("/employees-composed/update"), + req -> req.body(BodyExtractors.toMono(Employee.class)) + .doOnNext(employeeRepository()::updateEmployee) + .then(ok().build())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("updateEmployee"))); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/EmployeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/EmployeeRepository.java new file mode 100644 index 000000000..dcd40506e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/EmployeeRepository.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app84; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public class EmployeeRepository { + + static Map employeeData; + + static Map employeeAccessData; + + + public Mono findEmployeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Mono.just(employeeData.get(id)); + } + + public Flux findAllEmployees() { + return Flux.fromIterable(employeeData.values()); + } + + public Mono updateEmployee(Employee employee) { + Employee existingEmployee = employeeData.get(employee.getId()); + if (existingEmployee != null) { + existingEmployee.setName(employee.getName()); + } + return Mono.just(existingEmployee); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java new file mode 100644 index 000000000..e77f4f055 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app84; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp84Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app84" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java new file mode 100644 index 000000000..980c78a60 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp85Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app85" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/controller/PersonRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/controller/PersonRouter.java new file mode 100644 index 000000000..885847b06 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/controller/PersonRouter.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.controller; + +import test.org.springdoc.api.v30.app85.handler.PersonHandler; +import test.org.springdoc.api.v30.app85.service.PersonService; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + + +@Configuration +public class PersonRouter { + + @Bean + public RouterFunction personRoute(PersonHandler handler) { + return route(GET("/getAllPersons").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("getAll")) + + .and(route(GET("/getPerson/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("getById"))) + + .and(route(POST("/createPerson").and(accept(MediaType.APPLICATION_JSON)), handler::save) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("save"))) + + .and(route(DELETE("/deletePerson/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("delete"))); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/controller/PositionRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/controller/PositionRouter.java new file mode 100644 index 000000000..c8109ed48 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/controller/PositionRouter.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.controller; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import test.org.springdoc.api.v30.app85.entity.Position; +import test.org.springdoc.api.v30.app85.handler.PositionHandler; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.content.Builder.contentBuilder; +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class PositionRouter { + + @Bean + public RouterFunction positionRoute(PositionHandler handler) { + return route(GET("/getAllPositions").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("findAll").description("Get all positions").tags(new String[] { "positions" }) + .response(responseBuilder().responseCode("200").implementationArray(Position.class))) + + .and(route(GET("/getPosition/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("findById").description("Find all").tags(new String[] { "positions" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").implementation(Position.class)))) + + .and(route(POST("/createPosition").and(accept(MediaType.APPLICATION_JSON)), handler::save) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("save").description("Save position").tags(new String[] { "positions" }) + .requestBody(requestBodyBuilder().implementation(Position.class)) + .response(responseBuilder().responseCode("200").implementation(Position.class)))) + + .and(route(DELETE("/deletePosition/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("deleteBy").description("Delete By Id").tags(new String[] { "positions" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").content(contentBuilder())))); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Person.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Person.java new file mode 100644 index 000000000..4e1b8d515 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Person.java @@ -0,0 +1,100 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.entity; + +public class Person { + + private String id; + + private Sex sex; + + private String firstName; + + private String lastName; + + private String age; + + private String interests; + + private String email; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Sex getSex() { + return sex; + } + + public void setSex(Sex sex) { + this.sex = sex; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getAge() { + return age; + } + + public void setAge(String age) { + this.age = age; + } + + public String getInterests() { + return interests; + } + + public void setInterests(String interests) { + this.interests = interests; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Position.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Position.java new file mode 100644 index 000000000..0276e08de --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Position.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.entity; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +public class Position { + + private String id; + + @NotBlank + @Size(max = 140) + private String positionName; + + private String description; + + @NotNull + private Date createdAt = new Date(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPositionName() { + return positionName; + } + + public void setPositionName(String positionName) { + this.positionName = positionName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Sex.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Sex.java new file mode 100644 index 000000000..557232491 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/entity/Sex.java @@ -0,0 +1,31 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.entity; + +public enum Sex { + MAN, WOMEN +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/exception/PositionNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/exception/PositionNotFoundException.java new file mode 100644 index 000000000..acc067a6a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/exception/PositionNotFoundException.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.exception; + +public class PositionNotFoundException extends RuntimeException { + + public PositionNotFoundException(String positionId) { + super("Position not found with id " + positionId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/handler/PersonHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/handler/PersonHandler.java new file mode 100644 index 000000000..d93bb28bf --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/handler/PersonHandler.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.handler; + +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v30.app85.entity.Person; +import test.org.springdoc.api.v30.app85.service.PersonService; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Component +@SuppressWarnings({ "deprecared", "unchecked" }) +public class PersonHandler { + + private final PersonService personService; + + public PersonHandler(PersonService personService) { + this.personService = personService; + } + + public Mono findById(ServerRequest request) { + String id = request.pathVariable("id"); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.getById(id), Person.class); + } + + public Mono findAll(ServerRequest request) { + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.getAll(), Person.class); + } + + public Mono save(ServerRequest request) { + final Mono person = request.bodyToMono(Person.class); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(BodyInserters.fromPublisher(person.flatMap(personService::save), Person.class)); + } + + public Mono delete(ServerRequest request) { + String id = request.pathVariable("id"); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.delete(id), Void.class); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/handler/PositionHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/handler/PositionHandler.java new file mode 100644 index 000000000..fe619ac24 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/handler/PositionHandler.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.handler; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class PositionHandler { + + + public Mono findById(ServerRequest request) { + String id = request.pathVariable("id"); + return null; + } + + public Mono findAll(ServerRequest request) { + return null; + } + + public Mono save(ServerRequest request) { + return null; + } + + public Mono delete(ServerRequest request) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/payload/ErrorResponse.java new file mode 100644 index 000000000..5627b175f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/payload/ErrorResponse.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.payload; + +public class ErrorResponse { + + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/service/PersonService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/service/PersonService.java new file mode 100644 index 000000000..43128c7a2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app85/service/PersonService.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85.service; + +import java.util.Objects; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v30.app85.entity.Person; + +import org.springframework.stereotype.Service; + +@Service +public class PersonService { + + public Flux getAll() { + return null; + } + + public Mono getById(@Parameter(in = ParameterIn.PATH) final String id) { + return null; + } + + public Mono update(@Parameter(in = ParameterIn.PATH) final String id, final Person person) { + return null; + } + + public Mono save(final Person person) { + return null; + } + + public Mono delete(@Parameter(in = ParameterIn.PATH) final String id) { + final Mono dbPerson = getById(id); + if (Objects.isNull(dbPerson)) { + return Mono.empty(); + } + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/Quote.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/Quote.java new file mode 100644 index 000000000..8094b5b6e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/Quote.java @@ -0,0 +1,88 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app86; + + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Instant; + +public class Quote { + + private static final MathContext MATH_CONTEXT = new MathContext(2); + + private String ticker; + + private BigDecimal price; + + private Instant instant; + + public Quote() { + } + + public Quote(String ticker, BigDecimal price) { + this.ticker = ticker; + this.price = price; + } + + public Quote(String ticker, Double price) { + this(ticker, new BigDecimal(price, MATH_CONTEXT)); + } + + public String getTicker() { + return ticker; + } + + public void setTicker(String ticker) { + this.ticker = ticker; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Instant getInstant() { + return instant; + } + + public void setInstant(Instant instant) { + this.instant = instant; + } + + @Override + public String toString() { + return "Quote{" + + "ticker='" + ticker + '\'' + + ", price=" + price + + ", instant=" + instant + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteGenerator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteGenerator.java new file mode 100644 index 000000000..5238ccaa7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteGenerator.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app86; + + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class QuoteGenerator { + + private final MathContext mathContext = new MathContext(2); + + private final Random random = new Random(); + + private final List prices = new ArrayList<>(); + + /** + * Bootstraps the generator with tickers and initial prices + */ + public QuoteGenerator() { + this.prices.add(new Quote("CTXS", 82.26)); + this.prices.add(new Quote("DELL", 63.74)); + this.prices.add(new Quote("GOOG", 847.24)); + this.prices.add(new Quote("MSFT", 65.11)); + this.prices.add(new Quote("ORCL", 45.71)); + this.prices.add(new Quote("RHT", 84.29)); + this.prices.add(new Quote("VMW", 92.21)); + } + + + public Flux fetchQuoteStream(Duration period) { + + // We want to emit quotes with a specific period; + // to do so, we create a Flux.interval + return Flux.interval(period) + // In case of back-pressure, drop events + .onBackpressureDrop() + // For each tick, generate a list of quotes + .map(this::generateQuotes) + // "flatten" that List into a Flux + .flatMapIterable(quotes -> quotes) + .log("io.spring.workshop.stockquotes"); + } + + /* + * Create quotes for all tickers at a single instant. + */ + private List generateQuotes(long interval) { + final Instant instant = Instant.now(); + return prices.stream() + .map(baseQuote -> { + BigDecimal priceChange = baseQuote.getPrice() + .multiply(new BigDecimal(0.05 * this.random.nextDouble()), this.mathContext); + Quote result = new Quote(baseQuote.getTicker(), baseQuote.getPrice().add(priceChange)); + result.setInstant(instant); + return result; + }) + .toList(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteHandler.java new file mode 100644 index 000000000..73478b09d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteHandler.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app86; + + +import java.time.Duration; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class QuoteHandler { + + private final Flux quoteStream; + + public QuoteHandler(QuoteGenerator quoteGenerator) { + this.quoteStream = quoteGenerator.fetchQuoteStream(Duration.ofMillis(1000)).share(); + } + + public Mono hello(ServerRequest request) { + return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) + .body(BodyInserters.fromObject("Hello Spring!")); + } + + public Mono echo(ServerRequest request) { + return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) + .body(request.bodyToMono(String.class), String.class); + } + + public Mono streamQuotes(ServerRequest request) { + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_STREAM_JSON) + .body(this.quoteStream, Quote.class); + } + + public Mono fetchQuotes(ServerRequest request) { + int size = Integer.parseInt(request.queryParam("size").orElse("10")); + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .body(this.quoteStream.take(size), Quote.class); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteRouter.java new file mode 100644 index 000000000..bcaaf61bf --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/QuoteRouter.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app86; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.http.MediaType.APPLICATION_JSON; +import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; +import static org.springframework.http.MediaType.TEXT_PLAIN; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.contentType; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class QuoteRouter { + + @Bean + public RouterFunction myroute(QuoteHandler quoteHandler) { + return route(GET("/hello").and(accept(TEXT_PLAIN)), quoteHandler::hello) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("hello").response(responseBuilder().responseCode("200"))) + + .and(route(POST("/echo").and(accept(TEXT_PLAIN).and(contentType(TEXT_PLAIN))), quoteHandler::echo) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("echo") + .requestBody(requestBodyBuilder().implementation(String.class)) + .response(responseBuilder().responseCode("200").implementation(String.class)))) + + .and(route(POST("/echo").and(accept(APPLICATION_JSON).and(contentType(APPLICATION_JSON))), quoteHandler::echo) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("echo") + .requestBody(requestBodyBuilder().implementation(String.class)) + .response(responseBuilder().responseCode("200").implementation(String.class))) + ) + + .and(route(GET("/quotes").and(accept(APPLICATION_JSON)), quoteHandler::fetchQuotes) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("fetchQuotes") + .parameter(parameterBuilder().in(ParameterIn.QUERY).name("size").implementation(String.class)) + .response(responseBuilder().responseCode("200").implementationArray(Quote.class)))) + + .and(route(GET("/quotes").and(accept(APPLICATION_STREAM_JSON)), quoteHandler::streamQuotes) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("fetchQuotes") + .response(responseBuilder().responseCode("200").implementation(Quote.class)))); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java new file mode 100644 index 000000000..07ef2e96d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app86; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp86Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app86" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/Book.java new file mode 100644 index 000000000..a092666db --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/Book.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app87; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/BookRepository.java new file mode 100644 index 000000000..4203eaf7d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app87; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/BookRouter.java new file mode 100644 index 000000000..9468ab6ce --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/BookRouter.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app87; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +class BookRouter { + + @Bean + RouterFunction routes(BookRepository br) { + return route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .beanClass(BookRepository.class).beanMethod("findByAuthor") + .operationId("findByAuthor").parameter(parameterBuilder().in(ParameterIn.PATH).name("author")))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java new file mode 100644 index 000000000..16e2190f5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app87; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp87Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app87" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/Post.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/Post.java new file mode 100644 index 000000000..f4a356ebb --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/Post.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app88; + +import java.time.LocalDateTime; + +public class Post { + + private String id; + + private String title; + + private String content; + + private LocalDateTime createdDate; + + public Post(String id, String title, String content) { + this.id = id; + this.title = title; + this.content = content; + this.createdDate = LocalDateTime.now(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public LocalDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(LocalDateTime createdDate) { + this.createdDate = createdDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostHandler.java new file mode 100644 index 000000000..a88c70129 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostHandler.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app88; + + +import java.net.URI; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +class PostHandler { + + private final PostRepository posts; + + public PostHandler(PostRepository posts) { + this.posts = posts; + } + + public Mono all(ServerRequest req) { + return ServerResponse.ok().body(this.posts.findAll(), Post.class); + } + + public Mono create(ServerRequest req) { + return req.bodyToMono(Post.class) + .flatMap(post -> this.posts.save(post)) + .flatMap(p -> ServerResponse.created(URI.create("/posts/" + p.getId())).build()); + } + + public Mono get(ServerRequest req) { + return this.posts.findById(req.pathVariable("id")) + .flatMap(post -> ServerResponse.ok().body(Mono.just(post), Post.class)) + .switchIfEmpty(ServerResponse.notFound().build()); + } + + public Mono update(ServerRequest req) { + + return Mono + .zip( + (data) -> { + Post p = (Post) data[0]; + Post p2 = (Post) data[1]; + p.setTitle(p2.getTitle()); + p.setContent(p2.getContent()); + return p; + }, + this.posts.findById(req.pathVariable("id")), + req.bodyToMono(Post.class) + ) + .cast(Post.class) + .flatMap(post -> this.posts.save(post)) + .flatMap(post -> ServerResponse.noContent().build()); + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostRepository.java new file mode 100644 index 000000000..91559d109 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostRepository.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app88; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; + +@Component +public class PostRepository { + + public Flux findByAuthor(String author) { + return Flux.just(new Post("1", "title1", "author1")); + } + + public Flux findAll() { + return Flux.just(new Post("2", "title2", "author2")); + } + + public Mono findById(String id) { + return Mono.just(new Post("3", "title2", "author2")); + } + + public Mono save(Post post) { + return Mono.just(new Post("4", "title2", "author2")); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostRouter.java new file mode 100644 index 000000000..1cbb475ab --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/PostRouter.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app88; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; +import static org.springframework.web.reactive.function.server.RequestPredicates.queryParam; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +class PostRouter { + + @Bean + public RouterFunction routes(PostHandler postController) { + return route(GET("/posts").and(queryParam("key", "value")), postController::all) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("all") + .parameter(parameterBuilder().name("key").description("sample description")) + .parameter(parameterBuilder().name("test").description("sample desc")) + .response(responseBuilder().responseCode("200").implementationArray(Post.class))) + + .and(route(POST("/posts"), postController::create) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("create") + .requestBody(requestBodyBuilder().implementation(Post.class)) + .response(responseBuilder().responseCode("201")))) + + .and(route(GET("/posts/{id}"), postController::get) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("get") + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").implementation(Post.class)))) + + .and(route(PUT("/posts/{id}"), postController::update) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("update") + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("202").implementation(Post.class)))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java new file mode 100644 index 000000000..6d4362639 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app88; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp88Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app88" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/Book.java new file mode 100644 index 000000000..b7ae26b03 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/Book.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app89; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/BookRepository.java new file mode 100644 index 000000000..f6a90043c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app89; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/BookRouter.java new file mode 100644 index 000000000..a61aa59fe --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/BookRouter.java @@ -0,0 +1,109 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app89; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +class BookRouter { + + @Bean + RouterFunction routes(BookRepository br) { + return nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll())) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute())) + ); + } + + @Bean + RouterFunction routes1(BookRepository br) { + return nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + route(GET("/books"), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute()))); + } + + @Bean + RouterFunction routes3(BookRepository br) { + return nest(path("/greeter").or(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) + + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll())) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute()))); + } + + @Bean + RouterFunction routes4(BookRepository br) { + return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll())) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute())))); + } + + private org.springdoc.core.fn.builders.operation.Builder getFindAll() { + return operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"); + } + + private org.springdoc.core.fn.builders.operation.Builder getRouterAttribute() { + return operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java new file mode 100644 index 000000000..817e4fbf2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app89; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp89Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app89" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/HelloRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/HelloRouter.java new file mode 100644 index 000000000..8c600dca7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/HelloRouter.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class HelloRouter { + + @Bean + RouterFunction routes() { + return route().GET("/foo", HANDLER_FUNCTION, ops -> ops + .operationId("hello") + .parameter(parameterBuilder().name("key1").description("My key1 description")) + .parameter(parameterBuilder().name("key2").description("My key2 description")) + .response(responseBuilder().responseCode("200").description("This is normal response description")) + .response(responseBuilder().responseCode("404").description("This is another response description")) + ).build(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java new file mode 100644 index 000000000..41b3ce03a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp90Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app90" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/book/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/book/BookRouter.java new file mode 100644 index 000000000..e5bda3d5a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/book/BookRouter.java @@ -0,0 +1,147 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90.book; + +import java.util.function.Consumer; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class BookRouter { + + + @Bean + RouterFunction bookRoute(BookRepository br) { + return route().GET("/books", accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), HANDLER_FUNCTION, ops -> ops.operationId("findAll").tag("book") + .beanClass(BookRepository.class).beanMethod("findAll")).build() + + .and(route().GET("/books", accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN), HANDLER_FUNCTION, + ops -> ops.operationId("findAll").tag("book").beanClass(BookRepository.class).beanMethod("findAll")).build()) + + .and(route().GET("/books/{author}", HANDLER_FUNCTION, ops -> ops.tag("book") + .beanClass(BookRepository.class).beanMethod("findByAuthor") + .operationId("findByAuthor").tag("book").parameter(parameterBuilder().in(ParameterIn.PATH).name("author"))).build()); + } + + @Bean + RouterFunction routes2() { + return nest(path("/greeter").and(path("/greeter2")), + route().GET("/books", accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), HANDLER_FUNCTION, getOperation1()).build()) + + .and(route().GET("/books/nest", accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN), HANDLER_FUNCTION, getOperation1()).build()) + + .and(route().GET("/books/nest/{author}", HANDLER_FUNCTION, getOperation2()).build()); + } + + @Bean + RouterFunction routes4() { + return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), + route().GET("/books", accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), HANDLER_FUNCTION, getOperation1()).build() + + .and(route().GET("/books", accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN), HANDLER_FUNCTION, getOperation1()).build()) + + .and(route().GET("/books/{author}", HANDLER_FUNCTION, getOperation2()).build()))); + } + + + private Consumer getOperation1() { + return ops -> ops.operationId("findAll").tag("book").beanClass(BookRepository.class).beanMethod("findAll"); + } + + private Consumer getOperation2() { + return ops -> ops.operationId("findAll").tag("book") + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"); + } + + + @Component + class BookRepository { + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } + } + + class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/Employee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/Employee.java new file mode 100644 index 000000000..9e1f09071 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/Employee.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90.employee; + +public class Employee { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/EmployeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/EmployeeRepository.java new file mode 100644 index 000000000..9fc792d0b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/EmployeeRepository.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90.employee; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public class EmployeeRepository { + + static Map employeeData; + + static Map employeeAccessData; + + + public Mono findEmployeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Mono.just(employeeData.get(id)); + } + + public Flux findAllEmployees() { + return Flux.fromIterable(employeeData.values()); + } + + public Mono updateEmployee(Employee employee) { + Employee existingEmployee = employeeData.get(employee.getId()); + if (existingEmployee != null) { + existingEmployee.setName(employee.getName()); + } + return Mono.just(existingEmployee); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/EmployeeRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/EmployeeRouter.java new file mode 100644 index 000000000..5b156b17c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/employee/EmployeeRouter.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90.employee; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import test.org.springdoc.api.v30.app84.Employee; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class EmployeeRouter { + + @Bean + RouterFunction getEmployeeByIdRoute() { + return route().GET("/employees/{id}", HANDLER_FUNCTION, ops -> ops.tag("employee") + .operationId("findEmployeeById").summary("Find purchase order by ID").tags(new String[] { "MyEmployee" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id").description("Employee Id")) + .response(responseBuilder().responseCode("200").description("successful operation").implementation(Employee.class)) + .response(responseBuilder().responseCode("400").description("Invalid Employee ID supplied")) + .response(responseBuilder().responseCode("404").description("Employee not found"))).build(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/position/PositionRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/position/PositionRouter.java new file mode 100644 index 000000000..624202706 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/position/PositionRouter.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90.position; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import test.org.springdoc.api.v30.app85.entity.Position; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class PositionRouter { + + @Bean + public RouterFunction positionRoute() { + return route().GET("/getAllPositions", accept(MediaType.APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops + .operationId("findAll").description("Get all positions").tags(new String[] { "positions" }) + .response(responseBuilder().responseCode("200").implementationArray(Position.class))).build() + + .and(route().GET("/getPosition/{id}", accept(MediaType.APPLICATION_STREAM_JSON), HANDLER_FUNCTION, ops -> ops + .operationId("findById").description("Find all").tags(new String[] { "positions" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").implementation(Position.class))).build()) + + .and(route().POST("/createPosition", accept(MediaType.APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops + .operationId("save").description("Save position").tags(new String[] { "positions" }) + .requestBody(requestBodyBuilder().implementation(Position.class)) + .response(responseBuilder().responseCode("200").implementation(Position.class))).build()) + + .and(route().DELETE("/deletePosition/{id}", accept(MediaType.APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops + .operationId("deleteBy").description("Delete By Id").tags(new String[] { "positions" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").content(org.springdoc.core.fn.builders.content.Builder.contentBuilder()))).build()); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/quotes/QuotesRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/quotes/QuotesRouter.java new file mode 100644 index 000000000..540573836 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v30/app90/quotes/QuotesRouter.java @@ -0,0 +1,133 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90.quotes; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Instant; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static org.springframework.http.MediaType.APPLICATION_JSON; +import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; +import static org.springframework.http.MediaType.TEXT_PLAIN; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.contentType; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class QuotesRouter { + + @Bean + RouterFunction myroute() { + return route().GET("/hello", accept(TEXT_PLAIN), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("hello").response(responseBuilder().responseCode("200"))).build() + + .and(route().POST("/echo", accept(TEXT_PLAIN).and(contentType(TEXT_PLAIN)), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("echo") + .requestBody(requestBodyBuilder().implementation(String.class)) + .response(responseBuilder().responseCode("200").implementation(String.class))).build()) + + .and(route().POST("/echo", accept(APPLICATION_JSON).and(contentType(APPLICATION_JSON)), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("echo") + .requestBody(requestBodyBuilder().implementation(String.class)) + .response(responseBuilder().responseCode("200").implementation(String.class))).build()) + + .and(route().GET("/quotes", accept(APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("fetchQuotes") + .parameter(parameterBuilder().in(ParameterIn.QUERY).name("size").implementation(String.class)) + .response(responseBuilder().responseCode("200").implementationArray(Quote.class))).build()) + + .and(route().GET("/quotes", accept(APPLICATION_STREAM_JSON), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("fetchQuotes") + .response(responseBuilder().responseCode("200").implementation(Quote.class))).build()); + } + + + class Quote { + + private String ticker; + + private BigDecimal price; + + private Instant instant; + + public Quote() { + } + + public Quote(String ticker, BigDecimal price) { + this.ticker = ticker; + this.price = price; + } + + public Quote(String ticker, Double price) { + this(ticker, new BigDecimal(price, new MathContext(2))); + } + + public String getTicker() { + return ticker; + } + + public void setTicker(String ticker) { + this.ticker = ticker; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Instant getInstant() { + return instant; + } + + public void setInstant(Instant instant) { + this.instant = instant; + } + + @Override + public String toString() { + return "Quote{" + + "ticker='" + ticker + '\'' + + ", price=" + price + + ", instant=" + instant + + '}'; + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java new file mode 100644 index 000000000..4dedd2868 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.reactive.server.WebTestClient; + +@AutoConfigureWebTestClient(timeout = "3600000") +@ActiveProfiles("test") +public abstract class AbstractCommonTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); + + @Autowired + protected WebTestClient webTestClient; + + protected String getContent(String fileName) { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..ccbc9f1aa --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.test.web.reactive.server.EntityExchangeResult; +import org.springframework.web.reactive.function.server.HandlerFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + + +@WebFluxTest +@AutoConfigureWebTestClient(timeout = "3600000") +public abstract class AbstractSpringDocTest extends AbstractCommonTest { + + public static final HandlerFunction HANDLER_FUNCTION = request -> ServerResponse.ok().build(); + + protected String groupName = ""; + + + @Test + void testApp() throws Exception { + String result = null; + try { + EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() + .expectStatus().isOk().expectBody().returnResult(); + + result = new String(getResult.getResponseBody()); + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java new file mode 100644 index 000000000..88b425548 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NotBlank; + +public class InheritedRequestParams extends RequestParams { + @Parameter(description = "parameter from child of RequestParams") + @NotBlank + private String childParam; + + public String getChildParam() { + return childParam; + } + + public void setChildParam(String childParam) { + this.childParam = childParam; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java new file mode 100644 index 000000000..b61503109 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java @@ -0,0 +1,148 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import java.math.BigInteger; +import java.util.List; +import java.util.Optional; + +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.lang.Nullable; + +public class RequestParams { + + @Parameter(description = "string parameter") + private String stringParam; + + @Deprecated + private String stringParam1; + + @Parameter(description = "string parameter2", required = true) + private String stringParam2; + + @Parameter(description = "int parameter") + private int intParam; + + private Optional intParam2; + + @Nullable + private String intParam3; + + private Nested nested; + + private List nestedList; + + public String getStringParam() { + return stringParam; + } + + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + public int getIntParam() { + return intParam; + } + + public void setIntParam(int intParam) { + this.intParam = intParam; + } + + public Optional getIntParam2() { + return intParam2; + } + + public void setIntParam2(Optional intParam2) { + this.intParam2 = intParam2; + } + + @Nullable + public String getIntParam3() { + return intParam3; + } + + public void setIntParam3(@Nullable String intParam3) { + this.intParam3 = intParam3; + } + + public String getStringParam1() { + return stringParam1; + } + + public void setStringParam1(String stringParam1) { + this.stringParam1 = stringParam1; + } + + public String getStringParam2() { + return stringParam2; + } + + public void setStringParam2(String stringParam2) { + this.stringParam2 = stringParam2; + } + + public Nested getNested() { + return nested; + } + + public void setNested(Nested nested) { + this.nested = nested; + } + + public List getNestedList() { + return nestedList; + } + + public void setNestedList(List nestedList) { + this.nestedList = nestedList; + } + + public static class Nested { + private String param1; + + private BigInteger param2; + + @Parameter(description = "nested string parameter") + public String getParam1() { + return param1; + } + + public void setParam1(String param1) { + this.param1 = param1; + } + + @Parameter(description = "nested BigInteger parameter") + public BigInteger getParam2() { + return param2; + } + + public void setParam2(BigInteger param2) { + this.param2 = param2; + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java new file mode 100644 index 000000000..76f9d6881 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp102Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app102" }) + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/TestController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/TestController.java new file mode 100644 index 000000000..c17cdc175 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app102/TestController.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.lang.Nullable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestController { + @GetMapping("test") + public void getTest(@RequestParam @Nullable String param, @ParameterObject InheritedRequestParams requestParams) { + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java new file mode 100644 index 000000000..70ac492cd --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * To test the case a user does not use @RestController but puts @Operation on handler methods + * and wants these methods to be exposed. + * + * @author Azige + */ +@Controller +public class HelloController { + + @GetMapping("/hello") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public String hello() { + return "forward:/message"; + } + + @GetMapping("/message") + @Operation + @ResponseBody + public HelloMessage message() { + return new HelloMessage("Lucky numbers!", 777); + } + + @GetMapping("/helloModelAndView") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public HelloMessage helloModelAndView() { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java new file mode 100644 index 000000000..53af43a16 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +public class HelloMessage { + public String text; + + public int number; + + public HelloMessage(String text, int number) { + this.text = text; + this.number = number; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HiddenHelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HiddenHelloController.java new file mode 100644 index 000000000..fd57a0465 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/HiddenHelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/api") +public class HiddenHelloController { + + @Operation(description = "I want here some custom config") + @GetMapping("/{entity}/{id}") + public ResponseEntity getEntity() { + throw new UnsupportedOperationException("the body is not relevant now"); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java new file mode 100644 index 000000000..f560c4379 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp149Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().addHiddenRestControllers(HiddenHelloController.class); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app149" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app150/HelloRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app150/HelloRouter.java new file mode 100644 index 000000000..089a2beaa --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app150/HelloRouter.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app150; + +import java.util.function.Consumer; +import java.util.function.Supplier; + +import org.springdoc.core.fn.builders.operation.Builder; +import org.springdoc.webflux.core.fn.SpringdocRouteBuilder; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RequestPredicates; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +public class HelloRouter { + + @Bean + RouterFunction routeSample() { + Supplier> routerFunctionSupplier = + () -> SpringdocRouteBuilder.route() + .GET("toto", HANDLER_FUNCTION, builder -> builder.operationId("get-user-groups")) + + .POST("/titi", HANDLER_FUNCTION, builder -> builder.operationId("create-user-group-special")).build(); + + Consumer operationsConsumer = builder -> { + }; + + return RouterFunctions.nest(RequestPredicates.path("/users"), nest(path("/test"), nest(path("/greeter"), + SpringdocRouteBuilder.route() + .GET(HANDLER_FUNCTION, builder -> builder.operationId("get-users")) + .POST("/special", HANDLER_FUNCTION, builder -> builder.operationId("create-user-special")) + .nest(path("/groups"), routerFunctionSupplier, operationsConsumer) + .nest(path("/groups2"), routerFunctionSupplier, operationsConsumer) + .nest(path("/greeter3").or(path("/greeter4")), routerFunctionSupplier, operationsConsumer) + .build()))); + + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java new file mode 100644 index 000000000..ad6d6429d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app150; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp150Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app150" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app151/HelloRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app151/HelloRouter.java new file mode 100644 index 000000000..e5205f610 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app151/HelloRouter.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app151; + +import java.util.function.Consumer; +import java.util.function.Supplier; + +import org.springdoc.core.fn.builders.operation.Builder; +import org.springdoc.webflux.core.fn.SpringdocRouteBuilder; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RequestPredicates; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +public class HelloRouter { + + @Bean + RouterFunction routeSample() { + Supplier> routerFunctionSupplier = + () -> SpringdocRouteBuilder.route() + .GET("toto", HANDLER_FUNCTION, builder -> builder.operationId("get-user-groups")) + + .POST("/titi", HANDLER_FUNCTION, builder -> builder.operationId("create-user-group-special")).build(); + + Consumer operationsConsumer = builder -> { + }; + + return RouterFunctions.nest(RequestPredicates.path("/users"), nest(path("/test"), nest(path("/greeter"), + SpringdocRouteBuilder.route() + .GET("", HANDLER_FUNCTION, builder -> builder.operationId("get-users")) + .POST("/special", HANDLER_FUNCTION, builder -> builder.operationId("create-user-special")) + .nest(path("/groups"), routerFunctionSupplier, operationsConsumer) + .nest(path("/groups2"), routerFunctionSupplier, operationsConsumer) + .nest(path("/greeter3").or(path("/greeter4")), routerFunctionSupplier, operationsConsumer) + .build()))); + + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java new file mode 100644 index 000000000..9ce852f90 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app151; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp151Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app151" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java new file mode 100644 index 000000000..2d1165465 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app152; + +import org.reactivestreams.Publisher; +import org.springdoc.core.models.GroupedOpenApi; +import reactor.core.publisher.Mono; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public Publisher persons() { + return Mono.just("OK"); + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v31.app152") + .build(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java new file mode 100644 index 000000000..f028a5e63 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app152; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp152Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app152" }) + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/DefaultRequestMappingHandlerMapping.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/DefaultRequestMappingHandlerMapping.java new file mode 100644 index 000000000..263c27b00 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/DefaultRequestMappingHandlerMapping.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import org.springframework.expression.ParserContext; +import org.springframework.expression.spel.standard.SpelExpressionParser; +import org.springframework.expression.spel.support.StandardEvaluationContext; +import org.springframework.util.StringValueResolver; +import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; + +public class DefaultRequestMappingHandlerMapping extends RequestMappingHandlerMapping { + + private static final SpelExpressionParser PARSER = new SpelExpressionParser(); + + private static ThreadLocal handlerHolder = new ThreadLocal<>(); + + @Override + public void setEmbeddedValueResolver(StringValueResolver resolver) { + super.setEmbeddedValueResolver(new StringValueResolver() { + @Override + public String resolveStringValue(String strVal) { + Object handler = handlerHolder.get(); + if (handler != null) { + strVal = String.valueOf(PARSER.parseExpression(strVal, ParserContext.TEMPLATE_EXPRESSION) + .getValue(new StandardEvaluationContext(handler))); + } + if (resolver != null) { + strVal = resolver.resolveStringValue(strVal); + } + return strVal; + } + }); + } + + @Override + protected void detectHandlerMethods(Object handler) { + Object handlerObject = (handler instanceof String ? obtainApplicationContext().getBean((String) handler) + : handler); + handlerHolder.set(handlerObject); + super.detectHandlerMethods(handler); + handlerHolder.remove(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/DefaultWebFluxRegistrations.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/DefaultWebFluxRegistrations.java new file mode 100644 index 000000000..951011841 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/DefaultWebFluxRegistrations.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import org.springframework.boot.autoconfigure.web.reactive.WebFluxRegistrations; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; + +@Component +public class DefaultWebFluxRegistrations implements WebFluxRegistrations { + + @Override + public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { + return new DefaultRequestMappingHandlerMapping(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java new file mode 100644 index 000000000..657bb1d0f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp153Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app153" }) + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/TestController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/TestController.java new file mode 100644 index 000000000..1a52abcca --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app153/TestController.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestController { + + @PostMapping("/echo") + public String echo(String content) { + return content; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app184/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app184/HelloController.java new file mode 100644 index 000000000..3c6739705 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app184/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app184; + + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/globalBeanFiltered") + public String globalBeanFiltered() { + return "globalBeanFiltered"; + } + + @GetMapping("/beanFiltered") + public String beanFiltered() { + return "beanFiltered"; + } + + @GetMapping("/group1Filtered") + public String group1Filtered() { + return "group1Filtered"; + } + + @GetMapping("/group2Filtered") + public String group2Filtered() { + return "group2Filtered"; + } + + @GetMapping("/group3Filtered") + public String group3Filtered() { + return "group3Filtered"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java new file mode 100644 index 000000000..0da571075 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java @@ -0,0 +1,132 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app184; + +import java.util.Objects; + +import io.swagger.v3.oas.models.parameters.HeaderParameter; +import io.swagger.v3.oas.models.servers.Server; +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.GlobalOpenApiCustomizer; +import org.springdoc.core.customizers.GlobalOperationCustomizer; +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.filters.GlobalOpenApiMethodFilter; +import org.springdoc.core.filters.OpenApiMethodFilter; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "springdoc.group-configs[0].group=group1", + "springdoc.group-configs[0].paths-to-exclude=/group1Filtered", +}) +public class SpringDocApp184Test extends AbstractSpringDocTest { + + @Test + void testGroup1() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group1").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.1.0/app184-1.json"), true); + } + + @Test + void testGroup2() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group2").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.1.0/app184-2.json"), true); + } + + @Test + void testGroup3() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group3").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.1.0/app184-3.json"), true); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app184" }) + static class SpringDocTestApp { + + @Bean + public GlobalOpenApiCustomizer addUrlGlobalBean() { + return openApi -> openApi.getServers().add(new Server().url("urlGlobalBean")); + } + + @Bean + public OpenApiCustomizer addUrlBean() { + return openApi -> openApi.getServers().add(new Server().url("urlBean")); + } + + @Bean + public GlobalOperationCustomizer addHeaderGlobaBeanl() { + return (operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGlobalBean")); + } + + @Bean + public OperationCustomizer addHeaderBean() { + return (operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerBean")); + } + + @Bean + public GlobalOpenApiMethodFilter globalFilterBean() { + return method -> !Objects.equals(method.getName(), "globalBeanFiltered"); + } + + @Bean + public OpenApiMethodFilter filterBean() { + return method -> !Objects.equals(method.getName(), "beanFiltered"); + } + + @Bean + public GroupedOpenApi group2() { + return GroupedOpenApi.builder() + .group("group2") + .addOpenApiCustomizer(openApi -> openApi.getServers().add(new Server().url("urlGroup2"))) + .addOperationCustomizer((operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGroup2"))) + .addOpenApiMethodFilter(method -> !Objects.equals(method.getName(), "group2Filtered")) + .build(); + } + + @Bean + public GroupedOpenApi group3() { + return GroupedOpenApi.builder() + .group("group3") + .addOpenApiCustomizer(openApi -> openApi.getServers().add(new Server().url("urlGroup3"))) + .addOperationCustomizer((operation, handlerMethod) -> operation.addParametersItem(new HeaderParameter().name("headerGroup3"))) + .addOpenApiMethodFilter(method -> !Objects.equals(method.getName(), "group3Filtered")) + .build(); + } + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app187/DuplicatedPathController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app187/DuplicatedPathController.java new file mode 100644 index 000000000..82f0b0abd --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app187/DuplicatedPathController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app187; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class DuplicatedPathController { + + @GetMapping("/duplicated") + public String duplicated1() { + return "globalBeanFiltered"; + } + + @GetMapping(value = "/duplicated", params = "filter=params") + public String duplicated2() { + return "beanFiltered"; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java new file mode 100644 index 000000000..f8134dbfc --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app187; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.RouterOperationCustomizer; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +class SpringDocApp187Test extends AbstractSpringDocTest { + + @Test + void testAddRouterOperationCustomizerBean() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.1.0/app187.json"), true); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app187" }) + static class SpringDocTestApp { + + @Bean + public RouterOperationCustomizer addRouterOperationCustomizer() { + return (routerOperation, handlerMethod) -> { + if (routerOperation.getParams().length > 0) { + routerOperation.setPath(routerOperation.getPath() + "?" + String.join("&", routerOperation.getParams())); + } + return routerOperation; + }; + } + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app188/OrderDemo.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app188/OrderDemo.java new file mode 100644 index 000000000..ff9cac779 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app188/OrderDemo.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app188; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.tags.Tag; +import org.springdoc.core.customizers.GlobalOpenApiCustomizer; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +public class OrderDemo { + + public static class Customizer2 implements OpenApiCustomizer, GlobalOpenApiCustomizer { + public void customise(OpenAPI openApi) { + openApi.addTagsItem(new Tag().name("2")); + } + } + + public static class Customizer3 implements OpenApiCustomizer, GlobalOpenApiCustomizer { + public void customise(OpenAPI openApi) { + openApi.addTagsItem(new Tag().name("3")); + } + } + + public static class Customizer1 implements OpenApiCustomizer, GlobalOpenApiCustomizer { + public void customise(OpenAPI openApi) { + openApi.addTagsItem(new Tag().name("1")); + } + } + + @RestController + public static class MyController { + + @GetMapping("/test") + public String testingMethod() { + return "foo"; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java new file mode 100644 index 000000000..21f9ccb97 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app188; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Import; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.group-configs[0].group=mygroup", "springdoc.group-configs[0].paths-to-match=/test" }) +class SpringDocApp188Test extends AbstractSpringDocTest { + + @Test + void testApp1() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL +"/mygroup").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.1.0/app188.json"), true); + } + + @SpringBootApplication + @Import({ + OrderDemo.Customizer1.class, + OrderDemo.Customizer2.class, + OrderDemo.Customizer3.class, + }) + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app188" }) + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/HelloController.java new file mode 100644 index 000000000..34aa72d3d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app189; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.http.codec.multipart.FilePart; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + + @Operation(summary = "Parse Resume") + @PostMapping(value = "/parse-resume", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { + MediaType.MULTIPART_FORM_DATA_VALUE }) + @ApiResponses({ @ApiResponse(responseCode = "400", description = "Invalid input") }) + public Mono parse( + @RequestPart(name = "resumeFile") @Parameter(description = "Resume file to be parsed", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) FilePart resumeFile) { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java new file mode 100644 index 000000000..336fdf706 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app189; + +import java.time.Duration; + +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractCommonTest; + +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.test.web.reactive.server.EntityExchangeResult; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@WebFluxTest +public class SpringDocApp189Test extends AbstractCommonTest { + + @Test + public void testWithDifferentLocales() throws Exception { + runTestWithLocale("en-GB"); + runTestWithLocale("de-DE"); + } + private void runTestWithLocale(String locale) throws JSONException { + EntityExchangeResult getResult = webTestClient.mutate().responseTimeout(Duration.ofMinutes(1000)).build() + .get().uri(Constants.DEFAULT_API_DOCS_URL) + .header("Accept-Language", locale) + .exchange() + .expectStatus().isOk().expectBody().returnResult(); + + String result = new String(getResult.getResponseBody()); + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocTestApp.java new file mode 100644 index 000000000..87bf1adb0 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocTestApp.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app189; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app189" }) +public class SpringDocTestApp { + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + + @Bean + OpenApiCustomizer serverUrlCustomizer() { + return openApi -> + openApi.getServers().forEach(server -> { + server.setDescription("customized description"); + server.setUrl("https://customized.url"); + }); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java new file mode 100644 index 000000000..8993213cc --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app190; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractCommonTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.context.annotation.ComponentScan; + +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_DEFAULT_API_DOCS; + +@WebFluxTest(properties = SPRINGDOC_ENABLE_DEFAULT_API_DOCS+"=false") +public class SpringDocApp190Test extends AbstractCommonTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app190" }) + static class SpringDocTestApp {} + + @Test + void test_disable_default_api_docs() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isNotFound(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190bisTest.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190bisTest.java new file mode 100644 index 000000000..2a36670ea --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190bisTest.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app190; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractCommonTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.context.annotation.ComponentScan; + +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_DEFAULT_API_DOCS; + +@WebFluxTest(properties = SPRINGDOC_ENABLE_DEFAULT_API_DOCS+"=true") +public class SpringDocApp190bisTest extends AbstractCommonTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app190" }) + static class SpringDocTestApp {} + + @Test + void test_enable_default_api_docs() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Handler/BaseHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Handler/BaseHandler.java new file mode 100644 index 000000000..7f268fe74 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Handler/BaseHandler.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app191.Handler; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public abstract class BaseHandler { + protected abstract Mono apply (ServerRequest serverRequest); + + public Mono handle(ServerRequest serverRequest) { + return this.apply(serverRequest); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Handler/GetNameHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Handler/GetNameHandler.java new file mode 100644 index 000000000..0c7800d96 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Handler/GetNameHandler.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app191.Handler; + +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class GetNameHandler extends BaseHandler { + @Override + protected Mono apply(ServerRequest serverRequest) { + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .bodyValue("Name API is called"); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Router/GetNameRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Router/GetNameRouter.java new file mode 100644 index 000000000..aea9a759d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/Router/GetNameRouter.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app191.Router; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v31.app191.Handler.GetNameHandler; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.reactive.function.server.RequestPredicates; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + + +@Configuration +public class GetNameRouter { + + @Bean + @RouterOperations( + value = { + @RouterOperation(path = "/v1/name", produces = {MediaType.APPLICATION_JSON_VALUE}, method = RequestMethod.GET, + beanClass = GetNameHandler.class, beanMethod = "handle", operation = @Operation(operationId = "getName", + description = "get name", responses = {@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = String.class)))}) + ) + }) + + public RouterFunction routerFunction(GetNameHandler getNameHandler) { + return RouterFunctions.route(RequestPredicates.GET("/v1/name"), getNameHandler::handle); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/SpringDocApp191Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/SpringDocApp191Test.java new file mode 100644 index 000000000..c0fab9bc1 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app191/SpringDocApp191Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app191; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp191Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app191" }) + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java new file mode 100644 index 000000000..f25576fc3 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +public class SpringDocApp3Test extends AbstractSpringDocTest { + + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/SpringDocTestApp.java new file mode 100644 index 000000000..1b4b32a40 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/SpringDocTestApp.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app3" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/controller/ExceptionTranslator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/controller/ExceptionTranslator.java new file mode 100644 index 000000000..6cc23a4ed --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/controller/ExceptionTranslator.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3.controller; + +import test.org.springdoc.api.v31.app3.exception.TweetConflictException; +import test.org.springdoc.api.v31.app3.exception.TweetNotFoundException; +import test.org.springdoc.api.v31.app3.payload.ErrorResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class ExceptionTranslator { + + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetConflictException.class) + @ResponseStatus(HttpStatus.CONFLICT) + public ResponseEntity handleDuplicateKeyException(TweetConflictException ex) { + return ResponseEntity.status(HttpStatus.CONFLICT) + .body(new ErrorResponse("A Tweet with the same text already exists")); + } + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetNotFoundException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public ResponseEntity handleTweetNotFoundException(TweetNotFoundException ex) { + return ResponseEntity.notFound().build(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/controller/TweetController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/controller/TweetController.java new file mode 100644 index 000000000..13183418b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/controller/TweetController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import jakarta.validation.Valid; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v31.app3.dto.TweetDTO; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +@RestController +public class TweetController { + + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") }) + @GetMapping("/tweets") + public Flux getAllTweets() { + return null; + } + + @PostMapping("/tweets") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "create Tweets") }) + public Mono createTweets(@Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get Tweet By Id"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @GetMapping("/tweets/{id}") + public Mono> getTweetById(@PathVariable(value = "id") String tweetId) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "update Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @PutMapping("/tweets/{id}") + public Mono> updateTweet(@PathVariable(value = "id") String tweetId, + @Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "delete Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @DeleteMapping("/tweets/{id}") + public Mono> deleteTweet(@PathVariable(value = "id") String tweetId) { + return null; + } + + @Operation(description = "Tweets are Sent to the client as Server Sent Events", responses = { + @ApiResponse(responseCode = "200", description = "stream All Tweets") }) + @GetMapping(value = "/stream/tweets", produces = MediaType.TEXT_EVENT_STREAM_VALUE) + public Flux streamAllTweets() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/dto/TweetDTO.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/dto/TweetDTO.java new file mode 100644 index 000000000..42e8d1b44 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/dto/TweetDTO.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3.dto; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +public class TweetDTO { + private String id; + + @NotBlank + @Size(max = 140) + private String text; + + @NotNull + private Date createdAt = new Date(); + + public TweetDTO() { + + } + + public TweetDTO(String text) { + this.text = text; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/exception/TweetConflictException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/exception/TweetConflictException.java new file mode 100644 index 000000000..dc15ac266 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/exception/TweetConflictException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetConflictException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetConflictException(String tweetId) { + super("Tweet conflict with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/exception/TweetNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/exception/TweetNotFoundException.java new file mode 100644 index 000000000..03fc75d75 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/exception/TweetNotFoundException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetNotFoundException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetNotFoundException(String tweetId) { + super("Tweet not found with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/payload/ErrorResponse.java new file mode 100644 index 000000000..81ad86fc2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app3/payload/ErrorResponse.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3.payload; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class ErrorResponse { + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java new file mode 100644 index 000000000..3e78d20a7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app39; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import reactor.core.publisher.Mono; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @Operation(summary = "test Request") + @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) + @PostMapping("/test") + public Mono searchEmployee(String test) { + return Mono.empty(); + } + + @GetMapping("/hello") + public Mono hello() { + return Mono.just("hello"); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java new file mode 100644 index 000000000..5e698e493 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app39; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +public class SpringDocApp39Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java new file mode 100644 index 000000000..4103f7c00 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app39; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.HeaderParameter; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app39" }) +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + StringSchema schema = new StringSchema(); + return new OpenAPI() + .components(new Components().addParameters("myGlobalHeader", new HeaderParameter().required(true).name("My-Global-Header").description("My Global Header").schema(schema))); + } + + @Bean + public OpenApiCustomizer customerGlobalHeaderOpenApiCustomizer() { + return openApi -> openApi.getPaths().values().stream().flatMap(pathItem -> pathItem.readOperations().stream()) + .forEach(operation -> operation.addParametersItem(new HeaderParameter().$ref("#/components/parameters/myGlobalHeader"))); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java new file mode 100644 index 000000000..a4a32610f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.http.codec.multipart.FilePart; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + + @Operation(summary = "Parse Resume") + @PostMapping(value = "/parse-resume", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { + MediaType.MULTIPART_FORM_DATA_VALUE }) + @ApiResponses({ @ApiResponse(responseCode = "400", description = "Invalid input") }) + public Mono parse( + @RequestPart(name = "resumeFile") @Parameter(description = "Resume file to be parsed", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) FilePart resumeFile) { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java new file mode 100644 index 000000000..8fb628b21 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +public class SpringDocApp4Test extends AbstractSpringDocTest { + + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocTestApp.java new file mode 100644 index 000000000..5b3a6e03e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocTestApp.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app4" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/HelloController.java new file mode 100644 index 000000000..844888235 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import reactor.core.publisher.Mono; + +import org.springframework.http.HttpEntity; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/tweets/does-not-work", consumes = MediaType.APPLICATION_JSON_VALUE) + public Mono postNotWorks(@RequestBody Mono tweet) { + return tweet; + } + + @GetMapping("/test") + public Mono> demo2() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java new file mode 100644 index 000000000..b6b390e6e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +public class SpringDocApp5Test extends AbstractSpringDocTest { + + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocTestApp.java new file mode 100644 index 000000000..a5fb689ae --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocTestApp.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app5" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/Tweet.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/Tweet.java new file mode 100644 index 000000000..b81c56339 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app5/Tweet.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +public class Tweet { + private String id; + + @NotBlank + @Size(max = 140) + private String text; + + @NotNull + private Date createdAt = new Date(); + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java new file mode 100644 index 000000000..2fe0962de --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app63; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test") + public void test(String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java new file mode 100644 index 000000000..4bdcc8732 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app63; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.packagesToScan=hell,hello1, hello.me") +public class SpringDocApp63Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app63" }) + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/toto/HelloController2.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/toto/HelloController2.java new file mode 100644 index 000000000..9b8c3ee0b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app63/toto/HelloController2.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app63.toto; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController2 { + + @GetMapping("/test1") + public void test1(String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java new file mode 100644 index 000000000..8f280bafb --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app64; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/v1/test") + public void test1(String hello) { + } + + @GetMapping(value = "/api/balance/abcd") + @Operation(summary = "This is the test endpoint") + public String test2(String from) { + return "This is a fake test"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java new file mode 100644 index 000000000..a40756d95 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app64; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.paths-to-match=/v1, /api/**") +public class SpringDocApp64Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app64" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java new file mode 100644 index 000000000..67a705d26 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app65; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "Health", description = "Health check / ping API") +@RestController +public class HelloController { + + @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") + @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) + public ResponseEntity ping() { + return ResponseEntity.ok("Healthy"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java new file mode 100644 index 000000000..22e127867 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app65; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp65Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app65" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java new file mode 100644 index 000000000..1da8f5f23 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +public class SpringDocApp66Test extends AbstractSpringDocTest { + + public SpringDocApp66Test() { + this.groupName = "/stream"; + } + + @Test + void testApp2() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "streams").exchange() + .expectStatus().isNotFound(); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocTestApp.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocTestApp.java new file mode 100644 index 000000000..88ccee7c7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocTestApp.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app66" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + + @Bean + public GroupedOpenApi streamOpenApi() { + String[] paths = { "/stream/**" }; + String[] packagedToMatch = { "test.org.springdoc.api.v31.app66" }; + return GroupedOpenApi.builder().group("stream").pathsToMatch(paths) + .build(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/controller/ExceptionTranslator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/controller/ExceptionTranslator.java new file mode 100644 index 000000000..3ff39c52f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/controller/ExceptionTranslator.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66.controller; + +import test.org.springdoc.api.v31.app66.exception.TweetConflictException; +import test.org.springdoc.api.v31.app66.exception.TweetNotFoundException; +import test.org.springdoc.api.v31.app66.payload.ErrorResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class ExceptionTranslator { + + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetConflictException.class) + @ResponseStatus(HttpStatus.CONFLICT) + public ResponseEntity handleDuplicateKeyException(TweetConflictException ex) { + return ResponseEntity.status(HttpStatus.CONFLICT) + .body(new ErrorResponse("A Tweet with the same text already exists")); + } + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetNotFoundException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public ResponseEntity handleTweetNotFoundException(TweetNotFoundException ex) { + return ResponseEntity.notFound().build(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/controller/TweetController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/controller/TweetController.java new file mode 100644 index 000000000..545e9b8b7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/controller/TweetController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import jakarta.validation.Valid; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v31.app66.dto.TweetDTO; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +@RestController +public class TweetController { + + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") }) + @GetMapping("/tweets") + public Flux getAllTweets() { + return null; + } + + @PostMapping("/tweets") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "create Tweets") }) + public Mono createTweets(@Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get Tweet By Id"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @GetMapping("/tweets/{id}") + public Mono> getTweetById(@PathVariable(value = "id") String tweetId) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "update Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @PutMapping("/tweets/{id}") + public Mono> updateTweet(@PathVariable(value = "id") String tweetId, + @Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "delete Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @DeleteMapping("/tweets/{id}") + public Mono> deleteTweet(@PathVariable(value = "id") String tweetId) { + return null; + } + + @Operation(description = "Tweets are Sent to the client as Server Sent Events", responses = { + @ApiResponse(responseCode = "200", description = "stream All Tweets") }) + @GetMapping(value = "/stream/tweets", produces = MediaType.TEXT_EVENT_STREAM_VALUE) + public Flux streamAllTweets() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/dto/TweetDTO.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/dto/TweetDTO.java new file mode 100644 index 000000000..1b2647fbe --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/dto/TweetDTO.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66.dto; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +public class TweetDTO { + private String id; + + @NotBlank + @Size(max = 140) + private String text; + + @NotNull + private Date createdAt = new Date(); + + public TweetDTO() { + + } + + public TweetDTO(String text) { + this.text = text; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/exception/TweetConflictException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/exception/TweetConflictException.java new file mode 100644 index 000000000..20215d668 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/exception/TweetConflictException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetConflictException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetConflictException(String tweetId) { + super("Tweet conflict with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/exception/TweetNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/exception/TweetNotFoundException.java new file mode 100644 index 000000000..be6085474 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/exception/TweetNotFoundException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetNotFoundException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetNotFoundException(String tweetId) { + super("Tweet not found with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/payload/ErrorResponse.java new file mode 100644 index 000000000..bdcc3212f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app66/payload/ErrorResponse.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66.payload; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class ErrorResponse { + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java new file mode 100644 index 000000000..5fac5246b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app67; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class HelloController { + + @RequestMapping + public String test() { + return "ok"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java new file mode 100644 index 000000000..e1e853125 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app67; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp67Test extends AbstractSpringDocTest { + + @Test + void testApp() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange().expectStatus().isOk().expectBody() + .jsonPath("$.openapi").isEqualTo("3.1.0") + .jsonPath("$.paths./api.get.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.get.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.post.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.post.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.put.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.put.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.patch.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.patch.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.delete.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.delete.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.options.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.options.responses.200.content.['*/*'].schema.type").isEqualTo("string") + .jsonPath("$.paths./api.head.tags[0]").isEqualTo("hello-controller") + .jsonPath("$.paths./api.head.responses.200.content.['*/*'].schema.type").isEqualTo("string"); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app67" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/SpringDocApp68Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/SpringDocApp68Test.java new file mode 100644 index 000000000..5f373000c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/SpringDocApp68Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "springdoc.group-configs[0].group=stream", + "springdoc.group-configs[0].pathsToMatch=/stream/**" +}) +public class SpringDocApp68Test extends AbstractSpringDocTest { + + public SpringDocApp68Test() { + this.groupName = "/stream"; + } + + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app68" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/controller/ExceptionTranslator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/controller/ExceptionTranslator.java new file mode 100644 index 000000000..f4cf8792c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/controller/ExceptionTranslator.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.controller; + +import test.org.springdoc.api.v31.app68.exception.TweetConflictException; +import test.org.springdoc.api.v31.app68.exception.TweetNotFoundException; +import test.org.springdoc.api.v31.app68.payload.ErrorResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class ExceptionTranslator { + + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetConflictException.class) + @ResponseStatus(HttpStatus.CONFLICT) + public ResponseEntity handleDuplicateKeyException(TweetConflictException ex) { + return ResponseEntity.status(HttpStatus.CONFLICT) + .body(new ErrorResponse("A Tweet with the same text already exists")); + } + + @SuppressWarnings("rawtypes") + @ExceptionHandler(TweetNotFoundException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public ResponseEntity handleTweetNotFoundException(TweetNotFoundException ex) { + return ResponseEntity.notFound().build(); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/controller/TweetController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/controller/TweetController.java new file mode 100644 index 000000000..9b2aa9765 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/controller/TweetController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import jakarta.validation.Valid; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v31.app68.dto.TweetDTO; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +@RestController +public class TweetController { + + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get All Tweets") }) + @GetMapping("/tweets") + public Flux getAllTweets() { + return null; + } + + @PostMapping("/tweets") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "create Tweets") }) + public Mono createTweets(@Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "get Tweet By Id"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @GetMapping("/tweets/{id}") + public Mono> getTweetById(@PathVariable(value = "id") String tweetId) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "update Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @PutMapping("/tweets/{id}") + public Mono> updateTweet(@PathVariable(value = "id") String tweetId, + @Valid @RequestBody TweetDTO tweetDTO) { + return null; + } + + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "delete Tweet"), + @ApiResponse(responseCode = "404", description = "tweet not found") }) + @DeleteMapping("/tweets/{id}") + public Mono> deleteTweet(@PathVariable(value = "id") String tweetId) { + return null; + } + + @Operation(description = "Tweets are Sent to the client as Server Sent Events", responses = { + @ApiResponse(responseCode = "200", description = "stream All Tweets") }) + @GetMapping(value = "/stream/tweets", produces = MediaType.TEXT_EVENT_STREAM_VALUE) + public Flux streamAllTweets() { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/dto/TweetDTO.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/dto/TweetDTO.java new file mode 100644 index 000000000..34e4a2721 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/dto/TweetDTO.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.dto; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +/** + * Created by rajeevkumarsingh on 08/09/17. + */ +public class TweetDTO { + private String id; + + @NotBlank + @Size(max = 140) + private String text; + + @NotNull + private Date createdAt = new Date(); + + public TweetDTO() { + + } + + public TweetDTO(String text) { + this.text = text; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/exception/TweetConflictException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/exception/TweetConflictException.java new file mode 100644 index 000000000..bd07eb40f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/exception/TweetConflictException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetConflictException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetConflictException(String tweetId) { + super("Tweet conflict with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/exception/TweetNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/exception/TweetNotFoundException.java new file mode 100644 index 000000000..c22a909bd --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/exception/TweetNotFoundException.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.exception; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class TweetNotFoundException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TweetNotFoundException(String tweetId) { + super("Tweet not found with id " + tweetId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/payload/ErrorResponse.java new file mode 100644 index 000000000..8ca3b42f9 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app68/payload/ErrorResponse.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.payload; + +/** + * Created by rajeevkumarsingh on 22/10/17. + */ +public class ErrorResponse { + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/RoutingConfiguration.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/RoutingConfiguration.java new file mode 100644 index 000000000..e8be3704f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/RoutingConfiguration.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class RoutingConfiguration { + + @Bean + @RouterOperations({ @RouterOperation(path = "/api/user/index", beanClass = UserRepository.class, beanMethod = "getAllUsers"), + @RouterOperation(path = "/api/user/{id}", beanClass = UserRepository.class, beanMethod = "getUserById"), + @RouterOperation(path = "/api/user/post", beanClass = UserRepository.class, beanMethod = "saveUser"), + @RouterOperation(path = "/api/user/put/{id}", beanClass = UserRepository.class, beanMethod = "putUser"), + @RouterOperation(path = "/api/user/delete/{id}", beanClass = UserRepository.class, beanMethod = "deleteUser") }) + public RouterFunction monoRouterFunction(UserHandler userHandler) { + return route(GET("/api/user/index").and(accept(MediaType.APPLICATION_JSON)), userHandler::getAll) + .andRoute(GET("/api/user/{id}").and(accept(MediaType.APPLICATION_JSON)), userHandler::getUser) + .andRoute(POST("/api/user/post").and(accept(MediaType.APPLICATION_JSON)), userHandler::postUser) + .andRoute(PUT("/api/user/put/{id}").and(accept(MediaType.APPLICATION_JSON)), userHandler::putUser) + .andRoute(DELETE("/api/user/delete/{id}").and(accept(MediaType.APPLICATION_JSON)), userHandler::deleteUser); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java new file mode 100644 index 000000000..a67a07077 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp69Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app69" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/User.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/User.java new file mode 100644 index 000000000..5fc8425fe --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/User.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +public class User { + private long id; + + private String firstname; + + private String lastname; + + private int age; + + public User() { + } + + public User(long id, String firstname, String lastname, int age) { + this.id = id; + this.firstname = firstname; + this.lastname = lastname; + this.age = age; + } + + public long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFirstname() { + return firstname; + } + + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + public String getLastname() { + return lastname; + } + + public void setLastname(String lastname) { + this.lastname = lastname; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + String info = String.format("id = %d, firstname = %s, lastname = %s, age = %d", id, firstname, lastname, age); + return info; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserHandler.java new file mode 100644 index 000000000..bf3798557 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserHandler.java @@ -0,0 +1,119 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.BodyInserters.fromObject; + +@Component +public class UserHandler { + + private final UserRepository customerRepository; + + public UserHandler(UserRepository repository) { + this.customerRepository = repository; + } + + /** + * GET ALL Users + */ + public Mono getAll(ServerRequest request) { + // fetch all customers from repository + Flux customers = customerRepository.getAllUsers(); + + // build response + return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(customers, User.class); + } + + /** + * GET a User by ID + */ + public Mono getUser(ServerRequest request) { + // parse path-variable + long customerId = Long.valueOf(request.queryParam("id").get()); + + // build notFound response + Mono notFound = ServerResponse.notFound().build(); + + // get customer from repository + Mono customerMono = customerRepository.getUserById(customerId); + + // build response + return customerMono + .flatMap(customer -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(customer))) + .switchIfEmpty(notFound); + } + + /** + * POST a User + */ + public Mono postUser(ServerRequest request) { + Mono customer = request.bodyToMono(User.class); + return ServerResponse.ok().build(customerRepository.saveUser(customer)); + } + + /** + * PUT a User + */ + public Mono putUser(ServerRequest request) { + // parse id from path-variable + long customerId = Long.valueOf(request.pathVariable("id")); + + // get customer data from request object + Mono customer = request.bodyToMono(User.class); + + // get customer from repository + Mono responseMono = customerRepository.putUser(customerId, customer); + + // build response + return responseMono + .flatMap(cust -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(cust))); + } + + /** + * DELETE a User + */ + public Mono deleteUser(ServerRequest request) { + // parse id from path-variable + long customerId = Long.valueOf(request.pathVariable("id")); + + // get customer from repository + Mono responseMono = customerRepository.deleteUser(customerId); + + // build response + return responseMono + .flatMap(strMono -> ServerResponse.ok().contentType(MediaType.TEXT_PLAIN).body(fromObject(strMono))); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserRepository.java new file mode 100644 index 000000000..9aca62c39 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserRepository.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public interface UserRepository { + + public Mono getUserById(@Parameter(in = ParameterIn.PATH, description = "The user Id") Long id); + + @Operation(description = "get all the users") + public Flux getAllUsers(); + + @Operation(description = "get all the users by firstname") + public Flux getAllUsers(String firstname); + + public Mono saveUser(Mono user); + + public Mono putUser(@Parameter(in = ParameterIn.PATH) Long id, @RequestBody Mono user); + + public Mono deleteUser(@Parameter(in = ParameterIn.PATH) Long id); +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserRepositoryImpl.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserRepositoryImpl.java new file mode 100644 index 000000000..cda571b61 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app69/UserRepositoryImpl.java @@ -0,0 +1,98 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +import java.util.HashMap; +import java.util.Map; + +import jakarta.annotation.PostConstruct; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Repository; + +@Repository +public class UserRepositoryImpl implements UserRepository { + private Map users = new HashMap(); + + @PostConstruct + public void init() throws Exception { + users.put(Long.valueOf(1), new User(1, "Jack", "Smith", 20)); + users.put(Long.valueOf(2), new User(2, "Peter", "Johnson", 25)); + } + + @Override + public Mono getUserById(Long id) { + return Mono.just(users.get(id)); + } + + @Override + public Flux getAllUsers() { + return Flux.fromIterable(this.users.values()); + } + + @Override + public Flux getAllUsers(String firstname) { + return Flux.fromIterable(this.users.values().stream().filter(user -> user.getFirstname().equals(firstname)).toList()); + } + + @Override + public Mono saveUser(Mono monoUser) { + Mono userMono = monoUser.doOnNext(user -> { + // do post + users.put(user.getId(), user); + + // log on console + System.out.println("########### POST:" + user); + }); + + return userMono.then(); + } + + @Override + public Mono putUser(Long id, Mono monoUser) { + Mono userMono = monoUser.doOnNext(user -> { + // reset user.Id + user.setId(id); + + // do put + users.put(id, user); + + // log on console + System.out.println("########### PUT:" + user); + }); + + return userMono; + } + + @Override + public Mono deleteUser(Long id) { + // delete processing + users.remove(id); + return Mono.just("Delete Succesfully!"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/Coffee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/Coffee.java new file mode 100644 index 000000000..91528daec --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/Coffee.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import java.util.Objects; + +public class Coffee { + + private String id; + + private String name; + + public Coffee() { + } + + public Coffee(String name) { + this.name = name; + } + + public Coffee(String id, String name) { + this.id = id; + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Coffee coffee = (Coffee) o; + return Objects.equals(id, coffee.id) && + Objects.equals(name, coffee.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + return "Coffee{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeOrder.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeOrder.java new file mode 100644 index 000000000..f11aa8d4a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeOrder.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import java.time.Instant; +import java.util.Objects; + +public class CoffeeOrder { + private String coffeeId; + + private Instant whenOrdered; + + public CoffeeOrder() { + } + + public CoffeeOrder(String coffeeId, Instant whenOrdered) { + this.coffeeId = coffeeId; + this.whenOrdered = whenOrdered; + } + + public String getCoffeeId() { + return coffeeId; + } + + public Instant getWhenOrdered() { + return whenOrdered; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CoffeeOrder that = (CoffeeOrder) o; + return Objects.equals(coffeeId, that.coffeeId) && + Objects.equals(whenOrdered, that.whenOrdered); + } + + @Override + public int hashCode() { + return Objects.hash(coffeeId, whenOrdered); + } + + @Override + public String toString() { + return "CoffeeOrder{" + + "coffeeId='" + coffeeId + '\'' + + ", whenOrdered=" + whenOrdered + + '}'; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeRepository.java new file mode 100644 index 000000000..8a8da0ea7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeRepository.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import org.reactivestreams.Publisher; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Repository; + +@Repository +public class CoffeeRepository { + Flux deleteAll() { + return null; + } + + Mono findById(String id) { + return null; + } + + Publisher save(Coffee coffee) { + return null; + } + + Flux findAll() { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeService.java new file mode 100644 index 000000000..634622c20 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/CoffeeService.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import java.time.Duration; +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Service; + +@Service +public class CoffeeService { + private final CoffeeRepository repo; + + public CoffeeService(CoffeeRepository repo) { + this.repo = repo; + } + + Flux getAllCoffees() { + return repo.findAll(); + } + + Mono getCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { + return repo.findById(id); + } + + Flux getOrdersForCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Flux.interval(Duration.ofSeconds(1)) + .onBackpressureDrop() + .map(i -> new CoffeeOrder(id, Instant.now())); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/RouteConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/RouteConfig.java new file mode 100644 index 000000000..a444b8144 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/RouteConfig.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import reactor.core.publisher.Mono; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class RouteConfig { + private final CoffeeService service; + + public RouteConfig(CoffeeService service) { + this.service = service; + } + + @Bean + @RouterOperations({ @RouterOperation(path = "/coffees", beanClass = CoffeeService.class, beanMethod = "getAllCoffees"), + @RouterOperation(path = "/coffees/{id}", beanClass = CoffeeService.class, beanMethod = "getCoffeeById"), + @RouterOperation(path = "/coffees/{id}/orders", beanClass = CoffeeService.class, beanMethod = "getOrdersForCoffeeById") }) + RouterFunction routerFunction() { + return route(GET("/coffees"), this::all) + .andRoute(GET("/coffees/{id}"), this::byId) + .andRoute(GET("/coffees/{id}/orders"), this::orders); + } + + private Mono all(ServerRequest req) { + return ServerResponse.ok() + .body(service.getAllCoffees(), Coffee.class); + } + + private Mono byId(ServerRequest req) { + return ServerResponse.ok() + .body(service.getCoffeeById(req.pathVariable("id")), Coffee.class); + } + + private Mono orders(ServerRequest req) { + return ServerResponse.ok() + .contentType(MediaType.TEXT_EVENT_STREAM) + .body(service.getOrdersForCoffeeById(req.pathVariable("id")), CoffeeOrder.class); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java new file mode 100644 index 000000000..9490d82a1 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp70Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app70" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/Employee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/Employee.java new file mode 100644 index 000000000..44f0e2c81 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/Employee.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +public class Employee { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/EmployeeFunctionalConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/EmployeeFunctionalConfig.java new file mode 100644 index 000000000..f07d94e1a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/EmployeeFunctionalConfig.java @@ -0,0 +1,108 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.BodyExtractors; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +public class EmployeeFunctionalConfig { + + + @Bean + EmployeeRepository employeeRepository() { + return new EmployeeRepository(); + } + + @Bean + @RouterOperation(beanClass = EmployeeRepository.class, beanMethod = "findAllEmployees") + RouterFunction getAllEmployeesRoute() { + return route(GET("/employees").and(accept(MediaType.APPLICATION_JSON)), + req -> ok().body( + employeeRepository().findAllEmployees(), Employee.class)); + } + + @Bean + @RouterOperation(operation = @Operation(operationId = "findEmployeeById", summary = "Find purchase order by ID", tags = { "MyEmployee" }, + parameters = { @Parameter(in = ParameterIn.PATH, name = "id", description = "Employee Id") }, + responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Employee.class))), + @ApiResponse(responseCode = "400", description = "Invalid Employee ID supplied"), + @ApiResponse(responseCode = "404", description = "Employee not found") })) + RouterFunction getEmployeeByIdRoute() { + return route(GET("/employees/{id}"), + req -> ok().body( + employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class)); + } + + + @Bean + @RouterOperation(beanClass = EmployeeRepository.class, beanMethod = "updateEmployee") + RouterFunction updateEmployeeRoute() { + return route(POST("/employees/update").and(accept(MediaType.APPLICATION_XML)), + req -> req.body(BodyExtractors.toMono(Employee.class)) + .doOnNext(employeeRepository()::updateEmployee) + .then(ok().build())); + } + + @Bean + @RouterOperations({ @RouterOperation(path = "/employees-composed/update", beanClass = EmployeeRepository.class, beanMethod = "updateEmployee"), + @RouterOperation(path = "/employees-composed/{id}", beanClass = EmployeeRepository.class, beanMethod = "findEmployeeById"), + @RouterOperation(path = "/employees-composed", beanClass = EmployeeRepository.class, beanMethod = "findAllEmployees") }) + RouterFunction composedRoutes() { + return + route(GET("/employees-composed"), + req -> ok().body( + employeeRepository().findAllEmployees(), Employee.class)) + .and(route(GET("/employees-composed/{id}"), + req -> ok().body( + employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class))) + .and(route(POST("/employees-composed/update"), + req -> req.body(BodyExtractors.toMono(Employee.class)) + .doOnNext(employeeRepository()::updateEmployee) + .then(ok().build()))); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/EmployeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/EmployeeRepository.java new file mode 100644 index 000000000..0a9cbfbf4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/EmployeeRepository.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public class EmployeeRepository { + + static Map employeeData; + + static Map employeeAccessData; + + + public Mono findEmployeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Mono.just(employeeData.get(id)); + } + + public Flux findAllEmployees() { + return Flux.fromIterable(employeeData.values()); + } + + public Mono updateEmployee(Employee employee) { + Employee existingEmployee = employeeData.get(employee.getId()); + if (existingEmployee != null) { + existingEmployee.setName(employee.getName()); + } + return Mono.just(existingEmployee); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java new file mode 100644 index 000000000..14e5f47c9 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp71Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app71" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/SpringDocApp72Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/SpringDocApp72Test.java new file mode 100644 index 000000000..b38f5e05b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/SpringDocApp72Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp72Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app72" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/controller/PersonRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/controller/PersonRouter.java new file mode 100644 index 000000000..a316dfb3e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/controller/PersonRouter.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.controller; + +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v31.app72.handler.PersonHandler; +import test.org.springdoc.api.v31.app72.service.PersonService; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; + +@Configuration +public class PersonRouter { + + @RouterOperations({ @RouterOperation(path = "/getAllPersons", beanClass = PersonService.class, beanMethod = "getAll"), + @RouterOperation(path = "/getPerson/{id}", beanClass = PersonService.class, beanMethod = "getById"), + @RouterOperation(path = "/createPerson", beanClass = PersonService.class, beanMethod = "save"), + @RouterOperation(path = "/deletePerson/{id}", beanClass = PersonService.class, beanMethod = "delete") }) + @Bean + public RouterFunction personRoute(PersonHandler handler) { + return RouterFunctions + .route(GET("/getAllPersons").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) + .andRoute(GET("/getPerson/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) + .andRoute(POST("/createPerson").and(accept(MediaType.APPLICATION_JSON)), handler::save) + .andRoute(DELETE("/deletePerson/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/controller/PositionRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/controller/PositionRouter.java new file mode 100644 index 000000000..3392f7da5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/controller/PositionRouter.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v31.app72.entity.Position; +import test.org.springdoc.api.v31.app72.handler.PositionHandler; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; + +@Configuration +public class PositionRouter { + + @Bean + @RouterOperations({ @RouterOperation(path = "/getAllPositions", operation = @Operation(description = "Get all positions", operationId = "findAll", tags = "positions", + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Position.class)))))), + @RouterOperation(path = "/getPosition/{id}", operation = @Operation(description = "Find all", operationId = "findById", tags = "positions", parameters = @Parameter(name = "id", in = ParameterIn.PATH), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Position.class))))), + @RouterOperation(path = "/createPosition", operation = @Operation(description = "Save position", operationId = "save", tags = "positions", requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = Position.class))), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Position.class))))), + @RouterOperation(path = "/deletePosition/{id}", operation = @Operation(description = "Delete By Id", operationId = "deleteBy", tags = "positions", parameters = @Parameter(name = "id", in = ParameterIn.PATH), + responses = @ApiResponse(responseCode = "200", content = @Content))) }) + public RouterFunction positionRoute(PositionHandler handler) { + return RouterFunctions + .route(GET("/getAllPositions").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) + .andRoute(GET("/getPosition/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) + .andRoute(POST("/createPosition").and(accept(MediaType.APPLICATION_JSON)), handler::save) + .andRoute(DELETE("/deletePosition/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Person.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Person.java new file mode 100644 index 000000000..56312cdca --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Person.java @@ -0,0 +1,100 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.entity; + +public class Person { + + private String id; + + private Sex sex; + + private String firstName; + + private String lastName; + + private String age; + + private String interests; + + private String email; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Sex getSex() { + return sex; + } + + public void setSex(Sex sex) { + this.sex = sex; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getAge() { + return age; + } + + public void setAge(String age) { + this.age = age; + } + + public String getInterests() { + return interests; + } + + public void setInterests(String interests) { + this.interests = interests; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Position.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Position.java new file mode 100644 index 000000000..f0352f835 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Position.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.entity; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +public class Position { + + private String id; + + @NotBlank + @Size(max = 140) + private String positionName; + + private String description; + + @NotNull + private Date createdAt = new Date(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPositionName() { + return positionName; + } + + public void setPositionName(String positionName) { + this.positionName = positionName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Sex.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Sex.java new file mode 100644 index 000000000..7012f44ff --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/entity/Sex.java @@ -0,0 +1,31 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.entity; + +public enum Sex { + MAN, WOMEN +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/exception/PositionNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/exception/PositionNotFoundException.java new file mode 100644 index 000000000..34ed831f7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/exception/PositionNotFoundException.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.exception; + +public class PositionNotFoundException extends RuntimeException { + + public PositionNotFoundException(String positionId) { + super("Position not found with id " + positionId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/handler/PersonHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/handler/PersonHandler.java new file mode 100644 index 000000000..aa692d001 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/handler/PersonHandler.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.handler; + +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v31.app72.entity.Person; +import test.org.springdoc.api.v31.app72.service.PersonService; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Component +@SuppressWarnings({ "deprecared", "unchecked" }) +public class PersonHandler { + + private final PersonService personService; + + public PersonHandler(PersonService personService) { + this.personService = personService; + } + + public Mono findById(ServerRequest request) { + String id = request.pathVariable("id"); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.getById(id), Person.class); + } + + public Mono findAll(ServerRequest request) { + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.getAll(), Person.class); + } + + public Mono save(ServerRequest request) { + final Mono person = request.bodyToMono(Person.class); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(BodyInserters.fromPublisher(person.flatMap(personService::save), Person.class)); + } + + public Mono delete(ServerRequest request) { + String id = request.pathVariable("id"); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.delete(id), Void.class); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/handler/PositionHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/handler/PositionHandler.java new file mode 100644 index 000000000..71e4f584a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/handler/PositionHandler.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.handler; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class PositionHandler { + + + public Mono findById(ServerRequest request) { + String id = request.pathVariable("id"); + return null; + } + + public Mono findAll(ServerRequest request) { + return null; + } + + public Mono save(ServerRequest request) { + return null; + } + + public Mono delete(ServerRequest request) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/payload/ErrorResponse.java new file mode 100644 index 000000000..7c6b5ab47 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/payload/ErrorResponse.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.payload; + +public class ErrorResponse { + + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/service/PersonService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/service/PersonService.java new file mode 100644 index 000000000..774467db8 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app72/service/PersonService.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72.service; + +import java.util.Objects; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v31.app72.entity.Person; + +import org.springframework.stereotype.Service; + +@Service +public class PersonService { + + public Flux getAll() { + return null; + } + + public Mono getById(@Parameter(in = ParameterIn.PATH) final String id) { + return null; + } + + public Mono update(@Parameter(in = ParameterIn.PATH) final String id, final Person person) { + return null; + } + + public Mono save(final Person person) { + return null; + } + + public Mono delete(@Parameter(in = ParameterIn.PATH) final String id) { + final Mono dbPerson = getById(id); + if (Objects.isNull(dbPerson)) { + return Mono.empty(); + } + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/Quote.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/Quote.java new file mode 100644 index 000000000..6f2f76ed4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/Quote.java @@ -0,0 +1,88 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app73; + + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Instant; + +public class Quote { + + private static final MathContext MATH_CONTEXT = new MathContext(2); + + private String ticker; + + private BigDecimal price; + + private Instant instant; + + public Quote() { + } + + public Quote(String ticker, BigDecimal price) { + this.ticker = ticker; + this.price = price; + } + + public Quote(String ticker, Double price) { + this(ticker, new BigDecimal(price, MATH_CONTEXT)); + } + + public String getTicker() { + return ticker; + } + + public void setTicker(String ticker) { + this.ticker = ticker; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Instant getInstant() { + return instant; + } + + public void setInstant(Instant instant) { + this.instant = instant; + } + + @Override + public String toString() { + return "Quote{" + + "ticker='" + ticker + '\'' + + ", price=" + price + + ", instant=" + instant + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteGenerator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteGenerator.java new file mode 100644 index 000000000..02b9ae3b4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteGenerator.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app73; + + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class QuoteGenerator { + + private final MathContext mathContext = new MathContext(2); + + private final Random random = new Random(); + + private final List prices = new ArrayList<>(); + + /** + * Bootstraps the generator with tickers and initial prices + */ + public QuoteGenerator() { + this.prices.add(new Quote("CTXS", 82.26)); + this.prices.add(new Quote("DELL", 63.74)); + this.prices.add(new Quote("GOOG", 847.24)); + this.prices.add(new Quote("MSFT", 65.11)); + this.prices.add(new Quote("ORCL", 45.71)); + this.prices.add(new Quote("RHT", 84.29)); + this.prices.add(new Quote("VMW", 92.21)); + } + + + public Flux fetchQuoteStream(Duration period) { + + // We want to emit quotes with a specific period; + // to do so, we create a Flux.interval + return Flux.interval(period) + // In case of back-pressure, drop events + .onBackpressureDrop() + // For each tick, generate a list of quotes + .map(this::generateQuotes) + // "flatten" that List into a Flux + .flatMapIterable(quotes -> quotes) + .log("io.spring.workshop.stockquotes"); + } + + /* + * Create quotes for all tickers at a single instant. + */ + private List generateQuotes(long interval) { + final Instant instant = Instant.now(); + return prices.stream() + .map(baseQuote -> { + BigDecimal priceChange = baseQuote.getPrice() + .multiply(new BigDecimal(0.05 * this.random.nextDouble()), this.mathContext); + Quote result = new Quote(baseQuote.getTicker(), baseQuote.getPrice().add(priceChange)); + result.setInstant(instant); + return result; + }) + .toList(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteHandler.java new file mode 100644 index 000000000..a1ed9bda2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteHandler.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app73; + + +import java.time.Duration; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class QuoteHandler { + + private final Flux quoteStream; + + public QuoteHandler(QuoteGenerator quoteGenerator) { + this.quoteStream = quoteGenerator.fetchQuoteStream(Duration.ofMillis(1000)).share(); + } + + public Mono hello(ServerRequest request) { + return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) + .body(BodyInserters.fromObject("Hello Spring!")); + } + + public Mono echo(ServerRequest request) { + return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) + .body(request.bodyToMono(String.class), String.class); + } + + public Mono streamQuotes(ServerRequest request) { + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_STREAM_JSON) + .body(this.quoteStream, Quote.class); + } + + public Mono fetchQuotes(ServerRequest request) { + int size = Integer.parseInt(request.queryParam("size").orElse("10")); + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .body(this.quoteStream.take(size), Quote.class); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteRouter.java new file mode 100644 index 000000000..cb5d1075c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/QuoteRouter.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app73; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.http.MediaType.APPLICATION_JSON; +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; +import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; +import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON_VALUE; +import static org.springframework.http.MediaType.TEXT_PLAIN; +import static org.springframework.http.MediaType.TEXT_PLAIN_VALUE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.contentType; + +@Configuration +public class QuoteRouter { + + @RouterOperations({ + @RouterOperation(path = "/hello", operation = @Operation(operationId = "hello", responses = @ApiResponse(responseCode = "200"))), + @RouterOperation(path = "/echo", produces = TEXT_PLAIN_VALUE, operation = @Operation(operationId = "echo", requestBody = @RequestBody(content = @Content(schema = @Schema(type = "string"))), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(type = "string"))))), + @RouterOperation(path = "/echo", produces = APPLICATION_JSON_VALUE, operation = @Operation(operationId = "echo", requestBody = @RequestBody(content = @Content(schema = @Schema(type = "string"))), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(type = "string"))))), + @RouterOperation(path = "/quotes", produces = APPLICATION_JSON_VALUE, operation = @Operation(operationId = "fetchQuotes", parameters = @Parameter(name = "size", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Quote.class)))))), + @RouterOperation(path = "/quotes", produces = APPLICATION_STREAM_JSON_VALUE, operation = @Operation(operationId = "fetchQuotes", + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Quote.class))))) }) + @Bean + public RouterFunction route(QuoteHandler quoteHandler) { + return RouterFunctions + .route(GET("/hello").and(accept(TEXT_PLAIN)), quoteHandler::hello) + .andRoute(POST("/echo").and(accept(TEXT_PLAIN).and(contentType(TEXT_PLAIN))), quoteHandler::echo) + .andRoute(POST("/echo").and(accept(APPLICATION_JSON).and(contentType(APPLICATION_JSON))), quoteHandler::echo) + .andRoute(GET("/quotes").and(accept(APPLICATION_JSON)), quoteHandler::fetchQuotes) + .andRoute(GET("/quotes").and(accept(APPLICATION_STREAM_JSON)), quoteHandler::streamQuotes); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java new file mode 100644 index 000000000..e9b1091f6 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app73; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp73Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app73" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/Book.java new file mode 100644 index 000000000..f34b933e3 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/Book.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app74; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/BookRepository.java new file mode 100644 index 000000000..28ed1dae5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app74; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/BookRouter.java new file mode 100644 index 000000000..3972dbf20 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/BookRouter.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app74; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +class BookRouter { + + @Bean + @RouterOperations({ + @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes(BookRepository br) { + return + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java new file mode 100644 index 000000000..c552b6b7b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app74; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp74Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app74" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/Post.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/Post.java new file mode 100644 index 000000000..57a855854 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/Post.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import java.time.LocalDateTime; + +public class Post { + + private String id; + + private String title; + + private String content; + + private LocalDateTime createdDate; + + public Post(String id, String title, String content) { + this.id = id; + this.title = title; + this.content = content; + this.createdDate = LocalDateTime.now(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public LocalDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(LocalDateTime createdDate) { + this.createdDate = createdDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostHandler.java new file mode 100644 index 000000000..025d6855f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostHandler.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + + +import java.net.URI; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +class PostHandler { + + private final PostRepository posts; + + public PostHandler(PostRepository posts) { + this.posts = posts; + } + + public Mono all(ServerRequest req) { + return ServerResponse.ok().body(this.posts.findAll(), Post.class); + } + + public Mono create(ServerRequest req) { + return req.bodyToMono(Post.class) + .flatMap(post -> this.posts.save(post)) + .flatMap(p -> ServerResponse.created(URI.create("/posts/" + p.getId())).build()); + } + + public Mono get(ServerRequest req) { + return this.posts.findById(req.pathVariable("id")) + .flatMap(post -> ServerResponse.ok().body(Mono.just(post), Post.class)) + .switchIfEmpty(ServerResponse.notFound().build()); + } + + public Mono update(ServerRequest req) { + + return Mono + .zip( + (data) -> { + Post p = (Post) data[0]; + Post p2 = (Post) data[1]; + p.setTitle(p2.getTitle()); + p.setContent(p2.getContent()); + return p; + }, + this.posts.findById(req.pathVariable("id")), + req.bodyToMono(Post.class) + ) + .cast(Post.class) + .flatMap(post -> this.posts.save(post)) + .flatMap(post -> ServerResponse.noContent().build()); + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostRepository.java new file mode 100644 index 000000000..dffdcf460 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostRepository.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; + +@Component +public class PostRepository { + + public Flux findByAuthor(String author) { + return Flux.just(new Post("1", "title1", "author1")); + } + + public Flux findAll() { + return Flux.just(new Post("2", "title2", "author2")); + } + + public Mono findById(String id) { + return Mono.just(new Post("3", "title2", "author2")); + } + + public Mono save(Post post) { + return Mono.just(new Post("4", "title2", "author2")); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostRouter.java new file mode 100644 index 000000000..5d44ba674 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/PostRouter.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; +import static org.springframework.web.reactive.function.server.RequestPredicates.queryParam; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +class PostRouter { + + @RouterOperations({ @RouterOperation(path = "/posts", method = RequestMethod.GET, headers = { "x-header1=test1", "x-header2=test2" }, operation = @Operation(operationId = "all", + parameters = { @Parameter(name = "key", description = "sample description"), @Parameter(name = "test", description = "sample desc") }, + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Post.class)))))), + @RouterOperation(path = "/posts", method = RequestMethod.POST, operation = @Operation(operationId = "create", + requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = Post.class))), responses = @ApiResponse(responseCode = "201"))), + @RouterOperation(path = "/posts/{id}", method = RequestMethod.GET, operation = @Operation(operationId = "get", + parameters = @Parameter(name = "id", in = ParameterIn.PATH), + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = Post.class))))), + @RouterOperation(path = "/posts/{id}", method = RequestMethod.PUT, operation = @Operation(operationId = "update", + parameters = @Parameter(name = "id", in = ParameterIn.PATH), + responses = @ApiResponse(responseCode = "202", content = @Content(schema = @Schema(implementation = Post.class))))) }) + @Bean + public RouterFunction routes(PostHandler postController) { + return route(GET("/posts").and(queryParam("key", "value")), postController::all) + .andRoute(POST("/posts"), postController::create) + .andRoute(GET("/posts/{id}"), postController::get) + .andRoute(PUT("/posts/{id}"), postController::update); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java new file mode 100644 index 000000000..b6aec57b2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp75Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app75" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java new file mode 100644 index 000000000..1e1d4b94e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app78; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import reactor.core.publisher.Flux; + +import org.springframework.http.MediaType; +import org.springframework.http.codec.multipart.FilePart; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @PostMapping(value = "/files", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + @Operation(summary = "files") + public Flux handleFileUpload( + @RequestPart("files") @Parameter(description = "files", + content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) + Flux filePartFux) throws IOException { + File tmp = File.createTempFile("tmp", ""); + return filePartFux.flatMap(filePart -> { + Path path = Paths.get(tmp.toString() + filePart.filename()); + System.out.println(path); + return filePart.transferTo(path); + }); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java new file mode 100644 index 000000000..00d8254cb --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app78; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp78Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app78" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/BaseClientModel.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/BaseClientModel.java new file mode 100644 index 000000000..13689311f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/BaseClientModel.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app79; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public abstract class BaseClientModel { + @JsonProperty("id") + int id; +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/BaseController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/BaseController.java new file mode 100644 index 000000000..0983898c8 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/BaseController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app79; + +import java.util.List; + +import reactor.core.publisher.Mono; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; + +public abstract class BaseController { + @GetMapping("/test1") + Mono> get1() { + return null; + } + + @GetMapping("/test2") + Mono>> get2() { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpecificClientModel.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpecificClientModel.java new file mode 100644 index 000000000..4ba0312a2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpecificClientModel.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app79; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class SpecificClientModel extends BaseClientModel { + @JsonProperty("name") + @Schema(title = "my title", pattern = "this is it", example = "this is example") + String name; +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpecificController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpecificController.java new file mode 100644 index 000000000..93a576e65 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpecificController.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app79; + +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class SpecificController extends BaseController {} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java new file mode 100644 index 000000000..0bddb87b4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app79; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp79Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app79" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/Book.java new file mode 100644 index 000000000..1f94a1bf8 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/Book.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/BookRepository.java new file mode 100644 index 000000000..d131758a7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/BookRouter.java new file mode 100644 index 000000000..20b47ae98 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/BookRouter.java @@ -0,0 +1,113 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +class BookRouter { + + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes(BookRepository br) { + return + nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class))); + } + + @Bean + @RouterOperations({ + @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes1(BookRepository br) { + return + nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + route(GET("/books"), req -> ok().body(br.findAll(), Book.class)) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class))); + } + + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes3(BookRepository br) { + return + nest(path("/greeter").or(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class))); + } + + @Bean + @RouterOperations({ + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes4(BookRepository br) { + return + nest(path("/test"), + nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class))) + .andRoute(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java new file mode 100644 index 000000000..83913761f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp80Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app80" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app81/OperationIdController.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app81/OperationIdController.java new file mode 100644 index 000000000..970a3c675 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app81/OperationIdController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app81; + +import reactor.core.publisher.Mono; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class OperationIdController { + + @GetMapping(path = "/test_0") // gets operationId opIdTest_3 + public Mono opIdTest() { + return null; + } + + @GetMapping(path = "/test_1") // gets operationId opIdTest_2 + public Mono opIdTest(@RequestParam String param) { + return null; + } + + @GetMapping(path = "/test_2") // gets operationId opIdTest_1 + public Mono opIdTest(@RequestParam Integer param) { + return null; + } + + @GetMapping(path = "/test_3") // gets operationId opIdTest + public Mono opIdTest(@RequestParam Boolean param) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java new file mode 100644 index 000000000..a43f23f47 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app81; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.ThreadLocalRandom; + +import org.junit.jupiter.api.RepeatedTest; +import org.springdoc.webflux.api.OpenApiWebfluxResource; +import test.org.springdoc.api.v31.AbstractCommonTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.reactive.result.method.RequestMappingInfo; +import org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springdoc.core.utils.Constants.SPRINGDOC_CACHE_DISABLED; + + +/** + * Tests deterministic creation of operationIds + */ +@WebFluxTest(properties = SPRINGDOC_CACHE_DISABLED + "=true") +public class SpringDocApp81Test extends AbstractCommonTest { + + @Autowired + OpenApiWebfluxResource resource; + + @Autowired + RequestMappingInfoHandlerMapping mappingInfoHandlerMapping; + + @RepeatedTest(10) + public void shouldGenerateOperationIdsDeterministically() throws Exception { + shuffleSpringHandlerMethods(); + + ServerHttpRequest request = mock(ServerHttpRequest.class); + when(request.getURI()).thenReturn(URI.create("http://localhost")); + + String expected = getContent("results/3.1.0/app81.json"); + byte[] openApiBytes =resource.openapiJson(request, "", Locale.US).block(); + String openApi = new String(openApiBytes, StandardCharsets.UTF_8); // for UTF-8 encoding String openApi = resource.openapiJson(request, "", Locale.US).block(); + assertEquals(expected, openApi, true); + } + + private void shuffleSpringHandlerMethods() { + Map handlerMethods = mappingInfoHandlerMapping.getHandlerMethods(); + List> collect = new ArrayList<>(handlerMethods.entrySet()); + collect.sort(Comparator.comparing(a -> ThreadLocalRandom.current().nextBoolean() ? -1 : 1)); + + collect.forEach(e -> mappingInfoHandlerMapping.unregisterMapping(e.getKey())); + collect.forEach(e -> mappingInfoHandlerMapping.registerMapping(e.getKey(), e.getValue().getBean(), e.getValue().getMethod())); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app81" }) + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/RoutingConfiguration.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/RoutingConfiguration.java new file mode 100644 index 000000000..18ae01da5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/RoutingConfiguration.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.http.MediaType.APPLICATION_JSON; +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class RoutingConfiguration { + + @Bean + public RouterFunction monoRouterFunction(UserHandler userHandler) { + return route(GET("/api/user/index").and(accept(APPLICATION_JSON)), userHandler::getAll) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("getAllUsers")) + + .and(route(GET("/api/user/{id}").and(accept(APPLICATION_JSON)), userHandler::getUser) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("getUserById"))) + + .and(route(POST("/api/user/post").and(accept(APPLICATION_JSON)), userHandler::postUser) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("saveUser"))) + + .and(route(PUT("/api/user/put").and(accept(APPLICATION_JSON)), userHandler::putUser) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("putUser"))) + + .and(route(DELETE("/api/user/delete/{id}").and(accept(APPLICATION_JSON)), userHandler::deleteUser) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(UserRepository.class).beanMethod("deleteUser"))); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java new file mode 100644 index 000000000..3b50d1577 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp82Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app82" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/User.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/User.java new file mode 100644 index 000000000..21e5f1030 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/User.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +public class User { + private long id; + + private String firstname; + + private String lastname; + + private int age; + + public User() { + } + + public User(long id, String firstname, String lastname, int age) { + this.id = id; + this.firstname = firstname; + this.lastname = lastname; + this.age = age; + } + + public long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFirstname() { + return firstname; + } + + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + public String getLastname() { + return lastname; + } + + public void setLastname(String lastname) { + this.lastname = lastname; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + String info = String.format("id = %d, firstname = %s, lastname = %s, age = %d", id, firstname, lastname, age); + return info; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserHandler.java new file mode 100644 index 000000000..a7bf08de9 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserHandler.java @@ -0,0 +1,119 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.BodyInserters.fromObject; + +@Component +public class UserHandler { + + private final UserRepository customerRepository; + + public UserHandler(UserRepository repository) { + this.customerRepository = repository; + } + + /** + * GET ALL Users + */ + public Mono getAll(ServerRequest request) { + // fetch all customers from repository + Flux customers = customerRepository.getAllUsers(); + + // build response + return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(customers, User.class); + } + + /** + * GET a User by ID + */ + public Mono getUser(ServerRequest request) { + // parse path-variable + long customerId = Long.valueOf(request.queryParam("id").get()); + + // build notFound response + Mono notFound = ServerResponse.notFound().build(); + + // get customer from repository + Mono customerMono = customerRepository.getUserById(customerId); + + // build response + return customerMono + .flatMap(customer -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(customer))) + .switchIfEmpty(notFound); + } + + /** + * POST a User + */ + public Mono postUser(ServerRequest request) { + Mono customer = request.bodyToMono(User.class); + return ServerResponse.ok().build(customerRepository.saveUser(customer)); + } + + /** + * PUT a User + */ + public Mono putUser(ServerRequest request) { + // parse id from path-variable + long customerId = Long.valueOf(request.pathVariable("id")); + + // get customer data from request object + Mono customer = request.bodyToMono(User.class); + + // get customer from repository + Mono responseMono = customerRepository.putUser(customerId, customer); + + // build response + return responseMono + .flatMap(cust -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(fromObject(cust))); + } + + /** + * DELETE a User + */ + public Mono deleteUser(ServerRequest request) { + // parse id from path-variable + long customerId = Long.valueOf(request.pathVariable("id")); + + // get customer from repository + Mono responseMono = customerRepository.deleteUser(customerId); + + // build response + return responseMono + .flatMap(strMono -> ServerResponse.ok().contentType(MediaType.TEXT_PLAIN).body(fromObject(strMono))); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserRepository.java new file mode 100644 index 000000000..1458d3587 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserRepository.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public interface UserRepository { + + public Mono getUserById(@Parameter(in = ParameterIn.PATH, description = "The user Id") Long id); + + @Operation(description = "get all the users") + public Flux getAllUsers(); + + @Operation(description = "get all the users by firstname") + public Flux getAllUsers(String firstname); + + public Mono saveUser(Mono user); + + public Mono putUser(@Parameter(in = ParameterIn.QUERY) Long id, @RequestBody Mono user); + + public Mono deleteUser(@Parameter(in = ParameterIn.PATH) Long id); +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserRepositoryImpl.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserRepositoryImpl.java new file mode 100644 index 000000000..c3fd23499 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app82/UserRepositoryImpl.java @@ -0,0 +1,98 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +import java.util.HashMap; +import java.util.Map; + +import jakarta.annotation.PostConstruct; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Repository; + +@Repository +public class UserRepositoryImpl implements UserRepository { + private Map users = new HashMap(); + + @PostConstruct + public void init() throws Exception { + users.put(Long.valueOf(1), new User(1, "Jack", "Smith", 20)); + users.put(Long.valueOf(2), new User(2, "Peter", "Johnson", 25)); + } + + @Override + public Mono getUserById(Long id) { + return Mono.just(users.get(id)); + } + + @Override + public Flux getAllUsers() { + return Flux.fromIterable(this.users.values()); + } + + @Override + public Flux getAllUsers(String firstname) { + return Flux.fromIterable(this.users.values().stream().filter(user -> user.getFirstname().equals(firstname)).toList()); + } + + @Override + public Mono saveUser(Mono monoUser) { + Mono userMono = monoUser.doOnNext(user -> { + // do post + users.put(user.getId(), user); + + // log on console + System.out.println("########### POST:" + user); + }); + + return userMono.then(); + } + + @Override + public Mono putUser(Long id, Mono monoUser) { + Mono userMono = monoUser.doOnNext(user -> { + // reset user.Id + user.setId(id); + + // do put + users.put(id, user); + + // log on console + System.out.println("########### PUT:" + user); + }); + + return userMono; + } + + @Override + public Mono deleteUser(Long id) { + // delete processing + users.remove(id); + return Mono.just("Delete Succesfully!"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/Coffee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/Coffee.java new file mode 100644 index 000000000..d4f1c29f4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/Coffee.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import java.util.Objects; + +public class Coffee { + + private String id; + + private String name; + + public Coffee() { + } + + public Coffee(String name) { + this.name = name; + } + + public Coffee(String id, String name) { + this.id = id; + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Coffee coffee = (Coffee) o; + return Objects.equals(id, coffee.id) && + Objects.equals(name, coffee.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + return "Coffee{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeOrder.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeOrder.java new file mode 100644 index 000000000..b7b8b3a2b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeOrder.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import java.time.Instant; +import java.util.Objects; + +public class CoffeeOrder { + private String coffeeId; + + private Instant whenOrdered; + + public CoffeeOrder() { + } + + public CoffeeOrder(String coffeeId, Instant whenOrdered) { + this.coffeeId = coffeeId; + this.whenOrdered = whenOrdered; + } + + public String getCoffeeId() { + return coffeeId; + } + + public Instant getWhenOrdered() { + return whenOrdered; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CoffeeOrder that = (CoffeeOrder) o; + return Objects.equals(coffeeId, that.coffeeId) && + Objects.equals(whenOrdered, that.whenOrdered); + } + + @Override + public int hashCode() { + return Objects.hash(coffeeId, whenOrdered); + } + + @Override + public String toString() { + return "CoffeeOrder{" + + "coffeeId='" + coffeeId + '\'' + + ", whenOrdered=" + whenOrdered + + '}'; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeRepository.java new file mode 100644 index 000000000..ac84cff75 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeRepository.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import org.reactivestreams.Publisher; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Repository; + +@Repository +public class CoffeeRepository { + Flux deleteAll() { + return null; + } + + Mono findById(String id) { + return null; + } + + Publisher save(Coffee coffee) { + return null; + } + + Flux findAll() { + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeService.java new file mode 100644 index 000000000..bd03c970b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/CoffeeService.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import java.time.Duration; +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Service; + +@Service +public class CoffeeService { + private final CoffeeRepository repo; + + public CoffeeService(CoffeeRepository repo) { + this.repo = repo; + } + + Flux getAllCoffees() { + return repo.findAll(); + } + + Mono getCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { + return repo.findById(id); + } + + Flux getOrdersForCoffeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Flux.interval(Duration.ofSeconds(1)) + .onBackpressureDrop() + .map(i -> new CoffeeOrder(id, Instant.now())); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/RouteConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/RouteConfig.java new file mode 100644 index 000000000..17456d03e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/RouteConfig.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import reactor.core.publisher.Mono; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class RouteConfig { + private final CoffeeService service; + + public RouteConfig(CoffeeService service) { + this.service = service; + } + + @Bean + RouterFunction routerFunction() { + return route(GET("/coffees"), this::all) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(CoffeeService.class).beanMethod("getAllCoffees")) + + .and(route(GET("/coffees/{id}"), this::byId) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(CoffeeService.class).beanMethod("getCoffeeById"))) + + .and(route(GET("/coffees/{id}/orders"), this::orders) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(CoffeeService.class).beanMethod("getOrdersForCoffeeById"))); + } + + private Mono all(ServerRequest req) { + return ServerResponse.ok() + .body(service.getAllCoffees(), Coffee.class); + } + + private Mono byId(ServerRequest req) { + return ServerResponse.ok() + .body(service.getCoffeeById(req.pathVariable("id")), Coffee.class); + } + + private Mono orders(ServerRequest req) { + return ServerResponse.ok() + .contentType(MediaType.TEXT_EVENT_STREAM) + .body(service.getOrdersForCoffeeById(req.pathVariable("id")), CoffeeOrder.class); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java new file mode 100644 index 000000000..b04caeadc --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp83Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app83" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/Employee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/Employee.java new file mode 100644 index 000000000..361429fd4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/Employee.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app84; + +public class Employee { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/EmployeeFunctionalConfig.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/EmployeeFunctionalConfig.java new file mode 100644 index 000000000..e088107ae --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/EmployeeFunctionalConfig.java @@ -0,0 +1,107 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app84; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.BodyExtractors; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +public class EmployeeFunctionalConfig { + + + @Bean + EmployeeRepository employeeRepository() { + return new EmployeeRepository(); + } + + @Bean + RouterFunction getAllEmployeesRoute() { + return route(GET("/employees").and(accept(MediaType.APPLICATION_JSON)), + req -> ok().body( + employeeRepository().findAllEmployees(), Employee.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("findAllEmployees")); + } + + @Bean + RouterFunction getEmployeeByIdRoute() { + return route(GET("/employees/{id}"), + req -> ok().body( + employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class)) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("findEmployeeById").summary("Find purchase order by ID").tags(new String[] { "MyEmployee" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id").description("Employee Id")) + .response(responseBuilder().responseCode("200").description("successful operation").implementation(Employee.class)) + .response(responseBuilder().responseCode("400").description("Invalid Employee ID supplied")) + .response(responseBuilder().responseCode("404").description("Employee not found"))); + } + + + @Bean + RouterFunction updateEmployeeRoute() { + return route(POST("/employees/update").and(accept(MediaType.APPLICATION_XML)), + req -> req.body(BodyExtractors.toMono(Employee.class)) + .doOnNext(employeeRepository()::updateEmployee) + .then(ok().build())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("updateEmployee")); + } + + @Bean + RouterFunction composedRoutes() { + return + route(GET("/employees-composed"), + req -> ok().body( + employeeRepository().findAllEmployees(), Employee.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("findAllEmployees")) + + .and(route(GET("/employees-composed/{id}"), req -> ok().body( + employeeRepository().findEmployeeById(req.pathVariable("id")), Employee.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("findEmployeeById"))) + + .and(route(POST("/employees-composed/update"), + req -> req.body(BodyExtractors.toMono(Employee.class)) + .doOnNext(employeeRepository()::updateEmployee) + .then(ok().build())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(EmployeeRepository.class).beanMethod("updateEmployee"))); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/EmployeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/EmployeeRepository.java new file mode 100644 index 000000000..e5df0b3bf --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/EmployeeRepository.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app84; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public class EmployeeRepository { + + static Map employeeData; + + static Map employeeAccessData; + + + public Mono findEmployeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Mono.just(employeeData.get(id)); + } + + public Flux findAllEmployees() { + return Flux.fromIterable(employeeData.values()); + } + + public Mono updateEmployee(Employee employee) { + Employee existingEmployee = employeeData.get(employee.getId()); + if (existingEmployee != null) { + existingEmployee.setName(employee.getName()); + } + return Mono.just(existingEmployee); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java new file mode 100644 index 000000000..83992cf71 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app84; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp84Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app84" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java new file mode 100644 index 000000000..fdcd07744 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp85Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app85" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/controller/PersonRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/controller/PersonRouter.java new file mode 100644 index 000000000..e082b3030 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/controller/PersonRouter.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.controller; + +import test.org.springdoc.api.v31.app85.handler.PersonHandler; +import test.org.springdoc.api.v31.app85.service.PersonService; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + + +@Configuration +public class PersonRouter { + + @Bean + public RouterFunction personRoute(PersonHandler handler) { + return route(GET("/getAllPersons").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("getAll")) + + .and(route(GET("/getPerson/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("getById"))) + + .and(route(POST("/createPerson").and(accept(MediaType.APPLICATION_JSON)), handler::save) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("save"))) + + .and(route(DELETE("/deletePerson/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("delete"))); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/controller/PositionRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/controller/PositionRouter.java new file mode 100644 index 000000000..94bacc458 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/controller/PositionRouter.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.controller; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import test.org.springdoc.api.v31.app85.entity.Position; +import test.org.springdoc.api.v31.app85.handler.PositionHandler; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.content.Builder.contentBuilder; +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.DELETE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class PositionRouter { + + @Bean + public RouterFunction positionRoute(PositionHandler handler) { + return route(GET("/getAllPositions").and(accept(MediaType.APPLICATION_JSON)), handler::findAll) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("findAll").description("Get all positions").tags(new String[] { "positions" }) + .response(responseBuilder().responseCode("200").implementationArray(Position.class))) + + .and(route(GET("/getPosition/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("findById").description("Find all").tags(new String[] { "positions" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").implementation(Position.class)))) + + .and(route(POST("/createPosition").and(accept(MediaType.APPLICATION_JSON)), handler::save) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("save").description("Save position").tags(new String[] { "positions" }) + .requestBody(requestBodyBuilder().implementation(Position.class)) + .response(responseBuilder().responseCode("200").implementation(Position.class)))) + + .and(route(DELETE("/deletePosition/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("deleteBy").description("Delete By Id").tags(new String[] { "positions" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").content(contentBuilder())))); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Person.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Person.java new file mode 100644 index 000000000..8db511b33 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Person.java @@ -0,0 +1,100 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.entity; + +public class Person { + + private String id; + + private Sex sex; + + private String firstName; + + private String lastName; + + private String age; + + private String interests; + + private String email; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Sex getSex() { + return sex; + } + + public void setSex(Sex sex) { + this.sex = sex; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getAge() { + return age; + } + + public void setAge(String age) { + this.age = age; + } + + public String getInterests() { + return interests; + } + + public void setInterests(String interests) { + this.interests = interests; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Position.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Position.java new file mode 100644 index 000000000..97cef62db --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Position.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.entity; + +import java.util.Date; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +public class Position { + + private String id; + + @NotBlank + @Size(max = 140) + private String positionName; + + private String description; + + @NotNull + private Date createdAt = new Date(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPositionName() { + return positionName; + } + + public void setPositionName(String positionName) { + this.positionName = positionName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Sex.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Sex.java new file mode 100644 index 000000000..aaeb1c76d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/entity/Sex.java @@ -0,0 +1,31 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.entity; + +public enum Sex { + MAN, WOMEN +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/exception/PositionNotFoundException.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/exception/PositionNotFoundException.java new file mode 100644 index 000000000..2cc56aadb --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/exception/PositionNotFoundException.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.exception; + +public class PositionNotFoundException extends RuntimeException { + + public PositionNotFoundException(String positionId) { + super("Position not found with id " + positionId); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/handler/PersonHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/handler/PersonHandler.java new file mode 100644 index 000000000..70d331b0f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/handler/PersonHandler.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.handler; + +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v31.app85.entity.Person; +import test.org.springdoc.api.v31.app85.service.PersonService; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Component +@SuppressWarnings({ "deprecared", "unchecked" }) +public class PersonHandler { + + private final PersonService personService; + + public PersonHandler(PersonService personService) { + this.personService = personService; + } + + public Mono findById(ServerRequest request) { + String id = request.pathVariable("id"); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.getById(id), Person.class); + } + + public Mono findAll(ServerRequest request) { + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.getAll(), Person.class); + } + + public Mono save(ServerRequest request) { + final Mono person = request.bodyToMono(Person.class); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(BodyInserters.fromPublisher(person.flatMap(personService::save), Person.class)); + } + + public Mono delete(ServerRequest request) { + String id = request.pathVariable("id"); + return ok() + .contentType(MediaType.APPLICATION_JSON) + .body(personService.delete(id), Void.class); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/handler/PositionHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/handler/PositionHandler.java new file mode 100644 index 000000000..4dc35e2f0 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/handler/PositionHandler.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.handler; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class PositionHandler { + + + public Mono findById(ServerRequest request) { + String id = request.pathVariable("id"); + return null; + } + + public Mono findAll(ServerRequest request) { + return null; + } + + public Mono save(ServerRequest request) { + return null; + } + + public Mono delete(ServerRequest request) { + return null; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/payload/ErrorResponse.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/payload/ErrorResponse.java new file mode 100644 index 000000000..6fd7db683 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/payload/ErrorResponse.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.payload; + +public class ErrorResponse { + + private String message; + + public ErrorResponse(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/service/PersonService.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/service/PersonService.java new file mode 100644 index 000000000..0e503e317 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app85/service/PersonService.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85.service; + +import java.util.Objects; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import test.org.springdoc.api.v31.app85.entity.Person; + +import org.springframework.stereotype.Service; + +@Service +public class PersonService { + + public Flux getAll() { + return null; + } + + public Mono getById(@Parameter(in = ParameterIn.PATH) final String id) { + return null; + } + + public Mono update(@Parameter(in = ParameterIn.PATH) final String id, final Person person) { + return null; + } + + public Mono save(final Person person) { + return null; + } + + public Mono delete(@Parameter(in = ParameterIn.PATH) final String id) { + final Mono dbPerson = getById(id); + if (Objects.isNull(dbPerson)) { + return Mono.empty(); + } + return null; + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/Quote.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/Quote.java new file mode 100644 index 000000000..263b995af --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/Quote.java @@ -0,0 +1,88 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86; + + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Instant; + +public class Quote { + + private static final MathContext MATH_CONTEXT = new MathContext(2); + + private String ticker; + + private BigDecimal price; + + private Instant instant; + + public Quote() { + } + + public Quote(String ticker, BigDecimal price) { + this.ticker = ticker; + this.price = price; + } + + public Quote(String ticker, Double price) { + this(ticker, new BigDecimal(price, MATH_CONTEXT)); + } + + public String getTicker() { + return ticker; + } + + public void setTicker(String ticker) { + this.ticker = ticker; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Instant getInstant() { + return instant; + } + + public void setInstant(Instant instant) { + this.instant = instant; + } + + @Override + public String toString() { + return "Quote{" + + "ticker='" + ticker + '\'' + + ", price=" + price + + ", instant=" + instant + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteGenerator.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteGenerator.java new file mode 100644 index 000000000..9470bdf8c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteGenerator.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86; + + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class QuoteGenerator { + + private final MathContext mathContext = new MathContext(2); + + private final Random random = new Random(); + + private final List prices = new ArrayList<>(); + + /** + * Bootstraps the generator with tickers and initial prices + */ + public QuoteGenerator() { + this.prices.add(new Quote("CTXS", 82.26)); + this.prices.add(new Quote("DELL", 63.74)); + this.prices.add(new Quote("GOOG", 847.24)); + this.prices.add(new Quote("MSFT", 65.11)); + this.prices.add(new Quote("ORCL", 45.71)); + this.prices.add(new Quote("RHT", 84.29)); + this.prices.add(new Quote("VMW", 92.21)); + } + + + public Flux fetchQuoteStream(Duration period) { + + // We want to emit quotes with a specific period; + // to do so, we create a Flux.interval + return Flux.interval(period) + // In case of back-pressure, drop events + .onBackpressureDrop() + // For each tick, generate a list of quotes + .map(this::generateQuotes) + // "flatten" that List into a Flux + .flatMapIterable(quotes -> quotes) + .log("io.spring.workshop.stockquotes"); + } + + /* + * Create quotes for all tickers at a single instant. + */ + private List generateQuotes(long interval) { + final Instant instant = Instant.now(); + return prices.stream() + .map(baseQuote -> { + BigDecimal priceChange = baseQuote.getPrice() + .multiply(new BigDecimal(0.05 * this.random.nextDouble()), this.mathContext); + Quote result = new Quote(baseQuote.getTicker(), baseQuote.getPrice().add(priceChange)); + result.setInstant(instant); + return result; + }) + .toList(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteHandler.java new file mode 100644 index 000000000..16d3ba359 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteHandler.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86; + + +import java.time.Duration; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +public class QuoteHandler { + + private final Flux quoteStream; + + public QuoteHandler(QuoteGenerator quoteGenerator) { + this.quoteStream = quoteGenerator.fetchQuoteStream(Duration.ofMillis(1000)).share(); + } + + public Mono hello(ServerRequest request) { + return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) + .body(BodyInserters.fromObject("Hello Spring!")); + } + + public Mono echo(ServerRequest request) { + return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN) + .body(request.bodyToMono(String.class), String.class); + } + + public Mono streamQuotes(ServerRequest request) { + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_STREAM_JSON) + .body(this.quoteStream, Quote.class); + } + + public Mono fetchQuotes(ServerRequest request) { + int size = Integer.parseInt(request.queryParam("size").orElse("10")); + return ServerResponse.ok() + .contentType(MediaType.APPLICATION_JSON) + .body(this.quoteStream.take(size), Quote.class); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteRouter.java new file mode 100644 index 000000000..116edfdba --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/QuoteRouter.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.http.MediaType.APPLICATION_JSON; +import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; +import static org.springframework.http.MediaType.TEXT_PLAIN; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.contentType; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +public class QuoteRouter { + + @Bean + public RouterFunction myroute(QuoteHandler quoteHandler) { + return route(GET("/hello").and(accept(TEXT_PLAIN)), quoteHandler::hello) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("hello").response(responseBuilder().responseCode("200"))) + + .and(route(POST("/echo").and(accept(TEXT_PLAIN).and(contentType(TEXT_PLAIN))), quoteHandler::echo) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("echo") + .requestBody(requestBodyBuilder().implementation(String.class)) + .response(responseBuilder().responseCode("200").implementation(String.class)))) + + .and(route(POST("/echo").and(accept(APPLICATION_JSON).and(contentType(APPLICATION_JSON))), quoteHandler::echo) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("echo") + .requestBody(requestBodyBuilder().implementation(String.class)) + .response(responseBuilder().responseCode("200").implementation(String.class))) + ) + + .and(route(GET("/quotes").and(accept(APPLICATION_JSON)), quoteHandler::fetchQuotes) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("fetchQuotes") + .parameter(parameterBuilder().in(ParameterIn.QUERY).name("size").implementation(String.class)) + .response(responseBuilder().responseCode("200").implementationArray(Quote.class)))) + + .and(route(GET("/quotes").and(accept(APPLICATION_STREAM_JSON)), quoteHandler::streamQuotes) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().operationId("fetchQuotes") + .response(responseBuilder().responseCode("200").implementation(Quote.class)))); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java new file mode 100644 index 000000000..7007f91e3 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp86Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app86" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/Book.java new file mode 100644 index 000000000..7fe79ced7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/Book.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app87; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/BookRepository.java new file mode 100644 index 000000000..470d1ad77 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app87; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/BookRouter.java new file mode 100644 index 000000000..39b52a67d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/BookRouter.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app87; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +class BookRouter { + + @Bean + RouterFunction routes(BookRepository br) { + return route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .beanClass(BookRepository.class).beanMethod("findByAuthor") + .operationId("findByAuthor").parameter(parameterBuilder().in(ParameterIn.PATH).name("author")))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java new file mode 100644 index 000000000..8153c36cb --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app87; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp87Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app87" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/Post.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/Post.java new file mode 100644 index 000000000..f2d617097 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/Post.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app88; + +import java.time.LocalDateTime; + +public class Post { + + private String id; + + private String title; + + private String content; + + private LocalDateTime createdDate; + + public Post(String id, String title, String content) { + this.id = id; + this.title = title; + this.content = content; + this.createdDate = LocalDateTime.now(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public LocalDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(LocalDateTime createdDate) { + this.createdDate = createdDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostHandler.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostHandler.java new file mode 100644 index 000000000..18378a7aa --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostHandler.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app88; + + +import java.net.URI; + +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.ServerRequest; +import org.springframework.web.reactive.function.server.ServerResponse; + +@Component +class PostHandler { + + private final PostRepository posts; + + public PostHandler(PostRepository posts) { + this.posts = posts; + } + + public Mono all(ServerRequest req) { + return ServerResponse.ok().body(this.posts.findAll(), Post.class); + } + + public Mono create(ServerRequest req) { + return req.bodyToMono(Post.class) + .flatMap(post -> this.posts.save(post)) + .flatMap(p -> ServerResponse.created(URI.create("/posts/" + p.getId())).build()); + } + + public Mono get(ServerRequest req) { + return this.posts.findById(req.pathVariable("id")) + .flatMap(post -> ServerResponse.ok().body(Mono.just(post), Post.class)) + .switchIfEmpty(ServerResponse.notFound().build()); + } + + public Mono update(ServerRequest req) { + + return Mono + .zip( + (data) -> { + Post p = (Post) data[0]; + Post p2 = (Post) data[1]; + p.setTitle(p2.getTitle()); + p.setContent(p2.getContent()); + return p; + }, + this.posts.findById(req.pathVariable("id")), + req.bodyToMono(Post.class) + ) + .cast(Post.class) + .flatMap(post -> this.posts.save(post)) + .flatMap(post -> ServerResponse.noContent().build()); + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostRepository.java new file mode 100644 index 000000000..797897835 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostRepository.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app88; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.stereotype.Component; + +@Component +public class PostRepository { + + public Flux findByAuthor(String author) { + return Flux.just(new Post("1", "title1", "author1")); + } + + public Flux findAll() { + return Flux.just(new Post("2", "title2", "author2")); + } + + public Mono findById(String id) { + return Mono.just(new Post("3", "title2", "author2")); + } + + public Mono save(Post post) { + return Mono.just(new Post("4", "title2", "author2")); + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostRouter.java new file mode 100644 index 000000000..c873b386c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/PostRouter.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app88; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.POST; +import static org.springframework.web.reactive.function.server.RequestPredicates.PUT; +import static org.springframework.web.reactive.function.server.RequestPredicates.queryParam; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +@Configuration +class PostRouter { + + @Bean + public RouterFunction routes(PostHandler postController) { + return route(GET("/posts").and(queryParam("key", "value")), postController::all) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("all") + .parameter(parameterBuilder().name("key").description("sample description")) + .parameter(parameterBuilder().name("test").description("sample desc")) + .response(responseBuilder().responseCode("200").implementationArray(Post.class))) + + .and(route(POST("/posts"), postController::create) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("create") + .requestBody(requestBodyBuilder().implementation(Post.class)) + .response(responseBuilder().responseCode("201")))) + + .and(route(GET("/posts/{id}"), postController::get) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("get") + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").implementation(Post.class)))) + + .and(route(PUT("/posts/{id}"), postController::update) + .withAttribute(OPERATION_ATTRIBUTE, + operationBuilder().operationId("update") + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("202").implementation(Post.class)))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java new file mode 100644 index 000000000..d0a2f5027 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app88; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp88Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app88" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/Book.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/Book.java new file mode 100644 index 000000000..5e70d22a5 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/Book.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app89; + +public class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/BookRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/BookRepository.java new file mode 100644 index 000000000..ddb344e01 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/BookRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app89; + +import reactor.core.publisher.Flux; + +import org.springframework.stereotype.Component; + +@Component +public class BookRepository { + + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/BookRouter.java new file mode 100644 index 000000000..eaaff7589 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/BookRouter.java @@ -0,0 +1,109 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app89; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + +@Configuration +class BookRouter { + + @Bean + RouterFunction routes(BookRepository br) { + return nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll())) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute())) + ); + } + + @Bean + RouterFunction routes1(BookRepository br) { + return nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + route(GET("/books"), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute()))); + } + + @Bean + RouterFunction routes3(BookRepository br) { + return nest(path("/greeter").or(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) + + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll())) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute()))); + } + + @Bean + RouterFunction routes4(BookRepository br) { + return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll()) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll(), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getFindAll())) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")), Book.class)) + .withAttribute(OPERATION_ATTRIBUTE, getRouterAttribute())))); + } + + private org.springdoc.core.fn.builders.operation.Builder getFindAll() { + return operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"); + } + + private org.springdoc.core.fn.builders.operation.Builder getRouterAttribute() { + return operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java new file mode 100644 index 000000000..36e2d3e2c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app89; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp89Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app89" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/HelloRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/HelloRouter.java new file mode 100644 index 000000000..4773ecf55 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/HelloRouter.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class HelloRouter { + + @Bean + RouterFunction routes() { + return route().GET("/foo", HANDLER_FUNCTION, ops -> ops + .operationId("hello") + .parameter(parameterBuilder().name("key1").description("My key1 description")) + .parameter(parameterBuilder().name("key2").description("My key2 description")) + .response(responseBuilder().responseCode("200").description("This is normal response description")) + .response(responseBuilder().responseCode("404").description("This is another response description")) + ).build(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java new file mode 100644 index 000000000..ed87d3672 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +public class SpringDocApp90Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app90" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/book/BookRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/book/BookRouter.java new file mode 100644 index 000000000..db3f06800 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/book/BookRouter.java @@ -0,0 +1,147 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90.book; + +import java.util.function.Consumer; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.server.RouterFunction; + +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.path; +import static org.springframework.web.reactive.function.server.RouterFunctions.nest; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class BookRouter { + + + @Bean + RouterFunction bookRoute(BookRepository br) { + return route().GET("/books", accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), HANDLER_FUNCTION, ops -> ops.operationId("findAll").tag("book") + .beanClass(BookRepository.class).beanMethod("findAll")).build() + + .and(route().GET("/books", accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN), HANDLER_FUNCTION, + ops -> ops.operationId("findAll").tag("book").beanClass(BookRepository.class).beanMethod("findAll")).build()) + + .and(route().GET("/books/{author}", HANDLER_FUNCTION, ops -> ops.tag("book") + .beanClass(BookRepository.class).beanMethod("findByAuthor") + .operationId("findByAuthor").tag("book").parameter(parameterBuilder().in(ParameterIn.PATH).name("author"))).build()); + } + + @Bean + RouterFunction routes2() { + return nest(path("/greeter").and(path("/greeter2")), + route().GET("/books", accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), HANDLER_FUNCTION, getOperation1()).build()) + + .and(route().GET("/books/nest", accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN), HANDLER_FUNCTION, getOperation1()).build()) + + .and(route().GET("/books/nest/{author}", HANDLER_FUNCTION, getOperation2()).build()); + } + + @Bean + RouterFunction routes4() { + return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), + route().GET("/books", accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), HANDLER_FUNCTION, getOperation1()).build() + + .and(route().GET("/books", accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN), HANDLER_FUNCTION, getOperation1()).build()) + + .and(route().GET("/books/{author}", HANDLER_FUNCTION, getOperation2()).build()))); + } + + + private Consumer getOperation1() { + return ops -> ops.operationId("findAll").tag("book").beanClass(BookRepository.class).beanMethod("findAll"); + } + + private Consumer getOperation2() { + return ops -> ops.operationId("findAll").tag("book") + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"); + } + + + @Component + class BookRepository { + + Flux findByAuthor(String author) { + return Flux.just(new Book("1", "title1", "author1")); + } + + Flux findAll() { + return Flux.just(new Book("2", "title2", "author2")); + } + } + + class Book { + + private String id; + + private String title; + + private String author; + + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + } + +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/Employee.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/Employee.java new file mode 100644 index 000000000..ed20e4c2a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/Employee.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90.employee; + +public class Employee { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/EmployeeRepository.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/EmployeeRepository.java new file mode 100644 index 000000000..f8674eb84 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/EmployeeRepository.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90.employee; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public class EmployeeRepository { + + static Map employeeData; + + static Map employeeAccessData; + + + public Mono findEmployeeById(@Parameter(in = ParameterIn.PATH) String id) { + return Mono.just(employeeData.get(id)); + } + + public Flux findAllEmployees() { + return Flux.fromIterable(employeeData.values()); + } + + public Mono updateEmployee(Employee employee) { + Employee existingEmployee = employeeData.get(employee.getId()); + if (existingEmployee != null) { + existingEmployee.setName(employee.getName()); + } + return Mono.just(existingEmployee); + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/EmployeeRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/EmployeeRouter.java new file mode 100644 index 000000000..875888928 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/employee/EmployeeRouter.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90.employee; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import test.org.springdoc.api.v31.app84.Employee; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class EmployeeRouter { + + @Bean + RouterFunction getEmployeeByIdRoute() { + return route().GET("/employees/{id}", HANDLER_FUNCTION, ops -> ops.tag("employee") + .operationId("findEmployeeById").summary("Find purchase order by ID").tags(new String[] { "MyEmployee" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id").description("Employee Id")) + .response(responseBuilder().responseCode("200").description("successful operation").implementation(Employee.class)) + .response(responseBuilder().responseCode("400").description("Invalid Employee ID supplied")) + .response(responseBuilder().responseCode("404").description("Employee not found"))).build(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/position/PositionRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/position/PositionRouter.java new file mode 100644 index 000000000..28c07422b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/position/PositionRouter.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90.position; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import test.org.springdoc.api.v31.app85.entity.Position; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class PositionRouter { + + @Bean + public RouterFunction positionRoute() { + return route().GET("/getAllPositions", accept(MediaType.APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops + .operationId("findAll").description("Get all positions").tags(new String[] { "positions" }) + .response(responseBuilder().responseCode("200").implementationArray(Position.class))).build() + + .and(route().GET("/getPosition/{id}", accept(MediaType.APPLICATION_STREAM_JSON), HANDLER_FUNCTION, ops -> ops + .operationId("findById").description("Find all").tags(new String[] { "positions" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").implementation(Position.class))).build()) + + .and(route().POST("/createPosition", accept(MediaType.APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops + .operationId("save").description("Save position").tags(new String[] { "positions" }) + .requestBody(requestBodyBuilder().implementation(Position.class)) + .response(responseBuilder().responseCode("200").implementation(Position.class))).build()) + + .and(route().DELETE("/deletePosition/{id}", accept(MediaType.APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops + .operationId("deleteBy").description("Delete By Id").tags(new String[] { "positions" }) + .parameter(parameterBuilder().in(ParameterIn.PATH).name("id")) + .response(responseBuilder().responseCode("200").content(org.springdoc.core.fn.builders.content.Builder.contentBuilder()))).build()); + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/quotes/QuotesRouter.java b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/quotes/QuotesRouter.java new file mode 100644 index 000000000..8cecd8435 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31/app90/quotes/QuotesRouter.java @@ -0,0 +1,133 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90.quotes; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.time.Instant; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; + +import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.fn.builders.requestbody.Builder.requestBodyBuilder; +import static org.springdoc.webflux.core.fn.SpringdocRouteBuilder.route; +import static org.springframework.http.MediaType.APPLICATION_JSON; +import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; +import static org.springframework.http.MediaType.TEXT_PLAIN; +import static org.springframework.web.reactive.function.server.RequestPredicates.accept; +import static org.springframework.web.reactive.function.server.RequestPredicates.contentType; +import static test.org.springdoc.api.v30.AbstractSpringDocTest.HANDLER_FUNCTION; + +@Configuration +class QuotesRouter { + + @Bean + RouterFunction myroute() { + return route().GET("/hello", accept(TEXT_PLAIN), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("hello").response(responseBuilder().responseCode("200"))).build() + + .and(route().POST("/echo", accept(TEXT_PLAIN).and(contentType(TEXT_PLAIN)), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("echo") + .requestBody(requestBodyBuilder().implementation(String.class)) + .response(responseBuilder().responseCode("200").implementation(String.class))).build()) + + .and(route().POST("/echo", accept(APPLICATION_JSON).and(contentType(APPLICATION_JSON)), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("echo") + .requestBody(requestBodyBuilder().implementation(String.class)) + .response(responseBuilder().responseCode("200").implementation(String.class))).build()) + + .and(route().GET("/quotes", accept(APPLICATION_JSON), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("fetchQuotes") + .parameter(parameterBuilder().in(ParameterIn.QUERY).name("size").implementation(String.class)) + .response(responseBuilder().responseCode("200").implementationArray(Quote.class))).build()) + + .and(route().GET("/quotes", accept(APPLICATION_STREAM_JSON), HANDLER_FUNCTION, ops -> ops.tag("quotes") + .operationId("fetchQuotes") + .response(responseBuilder().responseCode("200").implementation(Quote.class))).build()); + } + + + class Quote { + + private String ticker; + + private BigDecimal price; + + private Instant instant; + + public Quote() { + } + + public Quote(String ticker, BigDecimal price) { + this.ticker = ticker; + this.price = price; + } + + public Quote(String ticker, Double price) { + this(ticker, new BigDecimal(price, new MathContext(2))); + } + + public String getTicker() { + return ticker; + } + + public void setTicker(String ticker) { + this.ticker = ticker; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Instant getInstant() { + return instant; + } + + public void setInstant(Instant instant) { + this.instant = instant; + } + + @Override + public String toString() { + return "Quote{" + + "ticker='" + ticker + '\'' + + ", price=" + price + + ", instant=" + instant + + '}'; + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app102.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app102.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app102.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app102.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app149.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app149.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app149.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app149.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app150.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app150.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app150.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app150.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app151.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app151.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app151.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app151.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app152.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app152.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app152.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app152.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app153.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app153.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app153.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app153.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app154.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app154.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app154.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app154.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app184-1.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app184-1.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app184-1.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app184-1.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app184-2.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app184-2.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app184-2.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app184-2.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app184-3.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app184-3.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app184-3.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app184-3.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app184.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app184.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app184.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app184.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app187.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app187.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app187.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app187.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app188.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app188.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app188.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app188.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app189.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app189.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app189.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app189.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app191.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app191.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app191.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app191.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app3.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app3.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app3.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app3.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app39.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app39.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app39.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app39.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app4.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app4.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app4.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app4.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app5.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app5.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app5.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app5.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app63.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app63.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app63.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app63.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app64.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app64.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app64.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app64.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app65.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app65.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app65.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app65.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app66.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app66.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app66.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app66.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app67.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app67.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app67.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app67.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app68.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app68.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app68.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app68.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app69.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app69.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app69.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app69.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app70.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app70.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app70.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app70.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app71.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app71.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app71.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app71.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app72.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app72.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app72.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app72.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app73.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app73.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app73.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app73.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app74.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app74.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app74.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app74.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app75.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app75.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app75.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app75.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app78.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app78.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app78.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app78.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app79.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app79.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app79.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app79.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app80.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app80.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app80.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app80.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app81.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app81.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app81.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app81.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app82.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app82.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app82.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app82.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app83.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app83.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app83.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app83.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app84.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app84.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app84.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app84.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app85.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app85.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app85.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app85.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app86.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app86.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app86.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app86.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app87.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app87.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app87.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app87.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app88.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app88.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app88.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app88.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app89.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app89.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app89.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app89.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/app90.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app90.json similarity index 100% rename from springdoc-openapi-starter-webflux-api/src/test/resources/results/app90.json rename to springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app90.json diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app102.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app102.json new file mode 100644 index 000000000..f43ac6133 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app102.json @@ -0,0 +1,144 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "test-controller" + ], + "operationId": "getTest", + "parameters": [ + { + "name": "param", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "childParam", + "in": "query", + "description": "parameter from child of RequestParams", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam", + "in": "query", + "description": "string parameter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam1", + "in": "query", + "required": false, + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam2", + "in": "query", + "description": "string parameter2", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "intParam", + "in": "query", + "description": "int parameter", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "intParam2", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "intParam3", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param1", + "in": "query", + "description": "nested string parameter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param2", + "in": "query", + "description": "nested BigInteger parameter", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "nestedList", + "in": "query", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Nested" + } + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Nested": { + "type": "object", + "properties": { + "param1": { + "type": "string" + }, + "param2": { + "type": "integer" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app149.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app149.json new file mode 100644 index 000000000..b8e8a3f50 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app149.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloMessage" + } + } + } + } + } + } + }, + "/message": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "message", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloMessage" + } + } + } + } + } + } + }, + "/helloModelAndView": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "helloModelAndView", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloMessage" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloMessage": { + "type": "object", + "properties": { + "number": { + "type": "integer", + "format": "int32" + }, + "text": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app150.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app150.json new file mode 100644 index 000000000..15af99852 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app150.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/users/test/greeter": { + "get": { + "operationId": "get-users", + "responses": {} + } + }, + "/users/test/greeter/greeter3/titi": { + "post": { + "operationId": "create-user-group-special", + "responses": {} + } + }, + "/users/test/greeter/greeter3/toto": { + "get": { + "operationId": "get-user-groups", + "responses": {} + } + }, + "/users/test/greeter/greeter4/titi": { + "post": { + "operationId": "create-user-group-special_1", + "responses": {} + } + }, + "/users/test/greeter/greeter4/toto": { + "get": { + "operationId": "get-user-groups_1", + "responses": {} + } + }, + "/users/test/greeter/groups/titi": { + "post": { + "operationId": "create-user-group-special_2", + "responses": {} + } + }, + "/users/test/greeter/groups/toto": { + "get": { + "operationId": "get-user-groups_2", + "responses": {} + } + }, + "/users/test/greeter/groups2/titi": { + "post": { + "operationId": "create-user-group-special_3", + "responses": {} + } + }, + "/users/test/greeter/groups2/toto": { + "get": { + "operationId": "get-user-groups_3", + "responses": {} + } + }, + "/users/test/greeter/special": { + "post": { + "operationId": "create-user-special", + "responses": {} + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app151.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app151.json new file mode 100644 index 000000000..15af99852 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app151.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/users/test/greeter": { + "get": { + "operationId": "get-users", + "responses": {} + } + }, + "/users/test/greeter/greeter3/titi": { + "post": { + "operationId": "create-user-group-special", + "responses": {} + } + }, + "/users/test/greeter/greeter3/toto": { + "get": { + "operationId": "get-user-groups", + "responses": {} + } + }, + "/users/test/greeter/greeter4/titi": { + "post": { + "operationId": "create-user-group-special_1", + "responses": {} + } + }, + "/users/test/greeter/greeter4/toto": { + "get": { + "operationId": "get-user-groups_1", + "responses": {} + } + }, + "/users/test/greeter/groups/titi": { + "post": { + "operationId": "create-user-group-special_2", + "responses": {} + } + }, + "/users/test/greeter/groups/toto": { + "get": { + "operationId": "get-user-groups_2", + "responses": {} + } + }, + "/users/test/greeter/groups2/titi": { + "post": { + "operationId": "create-user-group-special_3", + "responses": {} + } + }, + "/users/test/greeter/groups2/toto": { + "get": { + "operationId": "get-user-groups_3", + "responses": {} + } + }, + "/users/test/greeter/special": { + "post": { + "operationId": "create-user-special", + "responses": {} + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app152.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app152.json new file mode 100644 index 000000000..d199de3d1 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app152.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app153.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app153.json new file mode 100644 index 000000000..62552f3ac --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app153.json @@ -0,0 +1,46 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/echo": { + "post": { + "tags": [ + "test-controller" + ], + "operationId": "echo", + "parameters": [ + { + "name": "content", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app154.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app154.json new file mode 100644 index 000000000..4e3b84627 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app154.json @@ -0,0 +1,303 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/toto/lowercase": { + "post": { + "description": "lowercase function", + "operationId": "lowercase_POST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/toto/lowercase/{lowercase}": { + "get": { + "description": "lowercase function", + "operationId": "lowercase_GET", + "parameters": [ + { + "name": "lowercase", + "in": "path", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/toto/reverseString": { + "post": { + "description": "reverseString function", + "operationId": "reverseString_POST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/toto/reverseString/{reverseString}": { + "get": { + "description": "reverseString function", + "operationId": "reverseString_GET", + "parameters": [ + { + "name": "reverseString", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/toto/titi": { + "get": { + "description": "titi supplier", + "operationId": "titi_GET", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/toto/uppercase": { + "post": { + "description": "uppercase function", + "operationId": "uppercase_POST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/toto/uppercase/{uppercase}": { + "get": { + "description": "uppercase function", + "operationId": "uppercase_GET", + "parameters": [ + { + "name": "uppercase", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/toto/words": { + "get": { + "description": "words supplier", + "operationId": "words_GET", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-1.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-1.json new file mode 100644 index 000000000..fa364a7ab --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-1.json @@ -0,0 +1,97 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + }, + { + "url": "urlGlobalBean" + } + ], + "paths": { + "/group3Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group3Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group2Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group2Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/beanFiltered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "beanFiltered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-2.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-2.json new file mode 100644 index 000000000..c2217d892 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-2.json @@ -0,0 +1,112 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + }, + { + "url": "urlGlobalBean" + }, + { + "url": "urlGroup2" + } + ], + "paths": { + "/group3Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group3Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup2", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group1Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group1Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup2", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/beanFiltered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "beanFiltered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup2", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-3.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-3.json new file mode 100644 index 000000000..4a2d1129e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184-3.json @@ -0,0 +1,112 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + }, + { + "url": "urlGlobalBean" + }, + { + "url": "urlGroup3" + } + ], + "paths": { + "/group2Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group2Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup3", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group1Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group1Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup3", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/beanFiltered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "beanFiltered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerGroup3", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184.json new file mode 100644 index 000000000..b09f390f4 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app184.json @@ -0,0 +1,112 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + }, + { + "url": "urlGlobalBean" + }, + { + "url": "urlBean" + } + ], + "paths": { + "/group3Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group3Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group2Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group2Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/group1Filtered": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "group1Filtered", + "parameters": [ + { + "name": "headerGlobalBean", + "in": "header" + }, + { + "name": "headerBean", + "in": "header" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app187.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app187.json new file mode 100644 index 000000000..dfeedc7fd --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app187.json @@ -0,0 +1,56 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/duplicated": { + "get": { + "tags": [ + "duplicated-path-controller" + ], + "operationId": "duplicated1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/duplicated?filter=params": { + "get": { + "tags": [ + "duplicated-path-controller" + ], + "operationId": "duplicated2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app188.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app188.json new file mode 100644 index 000000000..080c57047 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app188.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "1" + }, + { + "name": "2" + }, + { + "name": "3" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "my-controller" + ], + "operationId": "testingMethod", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app189.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app189.json new file mode 100644 index 000000000..fbfed5874 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app189.json @@ -0,0 +1,67 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Tweet API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "https://customized.url", + "description": "customized description" + } + ], + "paths": { + "/parse-resume": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Parse Resume", + "operationId": "parse", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "resumeFile" + ], + "type": "object", + "properties": { + "resumeFile": { + "type": "string", + "description": "Resume file to be parsed", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "400": { + "description": "Invalid input", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app191.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app191.json new file mode 100644 index 000000000..b60e699c0 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app191.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/v1/name": { + "get": { + "tags": [ + "get-name-handler" + ], + "description": "get name", + "operationId": "getName", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app3.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app3.json new file mode 100644 index 000000000..af92076cd --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app3.json @@ -0,0 +1,334 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Tweet API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/tweets": { + "get": { + "tags": [ + "tweet-controller" + ], + "operationId": "getAllTweets", + "responses": { + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "get All Tweets", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TweetDTO" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "tweet-controller" + ], + "operationId": "createTweets", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TweetDTO" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "create Tweets", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/TweetDTO" + } + } + } + } + } + } + }, + "/tweets/{id}": { + "get": { + "tags": [ + "tweet-controller" + ], + "operationId": "getTweetById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "tweet not found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "get Tweet By Id", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/TweetDTO" + } + } + } + } + } + }, + "put": { + "tags": [ + "tweet-controller" + ], + "operationId": "updateTweet", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TweetDTO" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "tweet not found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "update Tweet", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/TweetDTO" + } + } + } + } + } + }, + "delete": { + "tags": [ + "tweet-controller" + ], + "operationId": "deleteTweet", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "tweet not found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "delete Tweet" + } + } + } + }, + "/stream/tweets": { + "get": { + "tags": [ + "tweet-controller" + ], + "description": "Tweets are Sent to the client as Server Sent Events", + "operationId": "streamAllTweets", + "responses": { + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "stream All Tweets", + "content": { + "text/event-stream": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TweetDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TweetDTO": { + "required": [ + "createdAt", + "text" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "maxLength": 140, + "minLength": 0, + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app39.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app39.json new file mode 100644 index 000000000..560343aa6 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app39.json @@ -0,0 +1,85 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "parameters": [ + { + "in": "header", + "$ref": "#/components/parameters/myGlobalHeader" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "test Request", + "operationId": "searchEmployee", + "parameters": [ + { + "in": "header", + "$ref": "#/components/parameters/myGlobalHeader" + } + ], + "requestBody": { + "description": "test value", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "parameters": { + "myGlobalHeader": { + "name": "My-Global-Header", + "in": "header", + "description": "My Global Header", + "required": true, + "schema": { + "type": "string" + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app4.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app4.json new file mode 100644 index 000000000..d3aaa555e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app4.json @@ -0,0 +1,67 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Tweet API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/parse-resume": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Parse Resume", + "operationId": "parse", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "resumeFile" + ], + "type": "object", + "properties": { + "resumeFile": { + "type": "string", + "description": "Resume file to be parsed", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "400": { + "description": "Invalid input", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app5.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app5.json new file mode 100644 index 000000000..8981c818b --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app5.json @@ -0,0 +1,100 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Tweet API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/tweets/does-not-work": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "postNotWorks", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tweet" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Tweet" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Tweet": { + "required": [ + "createdAt", + "text" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "maxLength": 140, + "minLength": 0, + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app63.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app63.json new file mode 100644 index 000000000..f6bf5a2ed --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app63.json @@ -0,0 +1,15 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": {}, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app64.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app64.json new file mode 100644 index 000000000..868bddccf --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app64.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/api/balance/abcd": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "This is the test endpoint", + "operationId": "test2", + "parameters": [ + { + "name": "from", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app65.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app65.json new file mode 100644 index 000000000..20e7401da --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app65.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Health", + "description": "Health check / ping API" + } + ], + "paths": { + "/health": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ping": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_1", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_2", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app66.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app66.json new file mode 100644 index 000000000..afd650cbe --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app66.json @@ -0,0 +1,94 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Tweet API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/stream/tweets": { + "get": { + "tags": [ + "tweet-controller" + ], + "description": "Tweets are Sent to the client as Server Sent Events", + "operationId": "streamAllTweets", + "responses": { + "200": { + "description": "stream All Tweets", + "content": { + "text/event-stream": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TweetDTO" + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TweetDTO": { + "required": [ + "createdAt", + "text" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "maxLength": 140, + "minLength": 0, + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app67.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app67.json new file mode 100644 index 000000000..d800773bf --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app67.json @@ -0,0 +1,144 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/api": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "tags": [ + "hello-controller" + ], + "operationId": "test_2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "test_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "hello-controller" + ], + "operationId": "test_3", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "options": { + "tags": [ + "hello-controller" + ], + "operationId": "test_6", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "head": { + "tags": [ + "hello-controller" + ], + "operationId": "test_5", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "patch": { + "tags": [ + "hello-controller" + ], + "operationId": "test_4", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app68.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app68.json new file mode 100644 index 000000000..cba35f247 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app68.json @@ -0,0 +1,94 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Tweet API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/stream/tweets": { + "get": { + "tags": [ + "tweet-controller" + ], + "description": "Tweets are Sent to the client as Server Sent Events", + "operationId": "streamAllTweets", + "responses": { + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "stream All Tweets", + "content": { + "text/event-stream": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TweetDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TweetDTO": { + "required": [ + "createdAt", + "text" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "maxLength": 140, + "minLength": 0, + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app69.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app69.json new file mode 100644 index 000000000..26ca11c6d --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app69.json @@ -0,0 +1,188 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/api/user/delete/{id}": { + "delete": { + "tags": [ + "user-repository-impl" + ], + "operationId": "deleteUser", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/user/index": { + "get": { + "tags": [ + "user-repository-impl" + ], + "description": "get all the users", + "operationId": "getAllUsers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "/api/user/post": { + "post": { + "tags": [ + "user-repository-impl" + ], + "operationId": "saveUser", + "parameters": [ + { + "name": "monoUser", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/User" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/user/put/{id}": { + "put": { + "tags": [ + "user-repository-impl" + ], + "operationId": "putUser", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + }, + "/api/user/{id}": { + "get": { + "tags": [ + "user-repository-impl" + ], + "operationId": "getUserById", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The user Id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app70.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app70.json new file mode 100644 index 000000000..2848a341a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app70.json @@ -0,0 +1,128 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/coffees": { + "get": { + "tags": [ + "coffee-service" + ], + "operationId": "getAllCoffees", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Coffee" + } + } + } + } + } + } + } + }, + "/coffees/{id}": { + "get": { + "tags": [ + "coffee-service" + ], + "operationId": "getCoffeeById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Coffee" + } + } + } + } + } + } + }, + "/coffees/{id}/orders": { + "get": { + "tags": [ + "coffee-service" + ], + "operationId": "getOrdersForCoffeeById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CoffeeOrder" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Coffee": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "CoffeeOrder": { + "type": "object", + "properties": { + "coffeeId": { + "type": "string" + }, + "whenOrdered": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app71.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app71.json new file mode 100644 index 000000000..922fb84f2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app71.json @@ -0,0 +1,204 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/employees": { + "get": { + "tags": [ + "employee-repository" + ], + "operationId": "findAllEmployees", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + } + }, + "/employees/{id}": { + "get": { + "tags": [ + "MyEmployee" + ], + "summary": "Find purchase order by ID", + "operationId": "findEmployeeById", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Employee Id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + } + }, + "400": { + "description": "Invalid Employee ID supplied" + }, + "404": { + "description": "Employee not found" + } + } + } + }, + "/employees/update": { + "post": { + "tags": [ + "employee-repository" + ], + "operationId": "updateEmployee", + "parameters": [ + { + "name": "employee", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + }, + "/employees-composed": { + "get": { + "tags": [ + "employee-repository" + ], + "operationId": "findAllEmployees_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + } + }, + "/employees-composed/update": { + "post": { + "tags": [ + "employee-repository" + ], + "operationId": "updateEmployee_1", + "parameters": [ + { + "name": "employee", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + }, + "/employees-composed/{id}": { + "get": { + "tags": [ + "employee-repository" + ], + "operationId": "findEmployeeById_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Employee": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app72.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app72.json new file mode 100644 index 000000000..0d6ca8afb --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app72.json @@ -0,0 +1,296 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/createPerson": { + "post": { + "tags": [ + "person-service" + ], + "operationId": "save", + "parameters": [ + { + "name": "person", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/deletePerson/{id}": { + "delete": { + "tags": [ + "person-service" + ], + "operationId": "delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/getAllPersons": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "getAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/getPerson/{id}": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "getById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/stream+json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/createPosition": { + "post": { + "tags": [ + "positions" + ], + "description": "Save position", + "operationId": "save_1", + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Position" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Position" + } + } + } + } + } + } + }, + "/deletePosition/{id}": { + "delete": { + "tags": [ + "positions" + ], + "description": "Delete By Id", + "operationId": "deleteBy", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/getAllPositions": { + "get": { + "tags": [ + "positions" + ], + "description": "Get all positions", + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Position" + } + } + } + } + } + } + } + }, + "/getPosition/{id}": { + "get": { + "tags": [ + "positions" + ], + "description": "Find all", + "operationId": "findById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/stream+json": { + "schema": { + "$ref": "#/components/schemas/Position" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "sex": { + "type": "string", + "enum": [ + "MAN", + "WOMEN" + ] + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "age": { + "type": "string" + }, + "interests": { + "type": "string" + }, + "email": { + "type": "string" + } + } + }, + "Position": { + "required": [ + "createdAt", + "positionName" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "positionName": { + "maxLength": 140, + "minLength": 0, + "type": "string" + }, + "description": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app73.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app73.json new file mode 100644 index 000000000..0b5640c8c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app73.json @@ -0,0 +1,114 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/echo": { + "post": { + "operationId": "echo", + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/hello": { + "get": { + "operationId": "hello", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/quotes": { + "get": { + "operationId": "fetchQuotes", + "parameters": [ + { + "name": "size", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Quote" + } + } + }, + "application/stream+json": { + "schema": { + "$ref": "#/components/schemas/Quote" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Quote": { + "type": "object", + "properties": { + "ticker": { + "type": "string" + }, + "price": { + "type": "number" + }, + "instant": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app74.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app74.json new file mode 100644 index 000000000..563d5c142 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app74.json @@ -0,0 +1,105 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app75.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app75.json new file mode 100644 index 000000000..48a13cd8f --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app75.json @@ -0,0 +1,166 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/posts": { + "get": { + "operationId": "all", + "parameters": [ + { + "name": "key", + "in": "query", + "description": "sample description", + "required": true, + "schema": { + "type": "string", + "default": "value" + } + }, + { + "name": "test", + "in": "query", + "description": "sample desc", + "schema": { + "type": "string" + } + }, + { + "name": "x-header1", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "test1" + ] + } + }, + { + "name": "x-header2", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "test2" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Post" + } + } + } + } + } + } + }, + "post": { + "operationId": "create", + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Post" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + } + } + } + }, + "/posts/{id}": { + "get": { + "operationId": "get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Post" + } + } + } + } + } + }, + "put": { + "operationId": "update", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "202": { + "description": "Accepted", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Post" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Post": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "createdDate": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app78.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app78.json new file mode 100644 index 000000000..251c9cc88 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app78.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/files": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "files", + "operationId": "handleFileUpload", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "files" + ], + "type": "object", + "properties": { + "files": { + "type": "array", + "description": "files", + "items": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app79.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app79.json new file mode 100644 index 000000000..bf1794cf7 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app79.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/test2": { + "get": { + "tags": [ + "specific-controller" + ], + "operationId": "get2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecificClientModel" + } + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "specific-controller" + ], + "operationId": "get1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SpecificClientModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SpecificClientModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "title": "my title", + "pattern": "this is it", + "type": "string", + "example": "this is example" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app80.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app80.json new file mode 100644 index 000000000..20fd9dc38 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app80.json @@ -0,0 +1,393 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_1", + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_1", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_2", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_2", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_3", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_3", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_4", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_4", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app81.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app81.json new file mode 100644 index 000000000..56b29f1ca --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app81.json @@ -0,0 +1,127 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test_3": { + "get": { + "tags": [ + "operation-id-controller" + ], + "operationId": "opIdTest", + "parameters": [ + { + "name": "param", + "in": "query", + "required": true, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test_2": { + "get": { + "tags": [ + "operation-id-controller" + ], + "operationId": "opIdTest_1", + "parameters": [ + { + "name": "param", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test_1": { + "get": { + "tags": [ + "operation-id-controller" + ], + "operationId": "opIdTest_2", + "parameters": [ + { + "name": "param", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test_0": { + "get": { + "tags": [ + "operation-id-controller" + ], + "operationId": "opIdTest_3", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app82.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app82.json new file mode 100644 index 000000000..bf2b7ed71 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app82.json @@ -0,0 +1,188 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/api/user/delete/{id}": { + "delete": { + "tags": [ + "user-repository-impl" + ], + "operationId": "deleteUser", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/user/index": { + "get": { + "tags": [ + "user-repository-impl" + ], + "description": "get all the users", + "operationId": "getAllUsers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "/api/user/post": { + "post": { + "tags": [ + "user-repository-impl" + ], + "operationId": "saveUser", + "parameters": [ + { + "name": "monoUser", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/User" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/user/put": { + "put": { + "tags": [ + "user-repository-impl" + ], + "operationId": "putUser", + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + }, + "/api/user/{id}": { + "get": { + "tags": [ + "user-repository-impl" + ], + "operationId": "getUserById", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The user Id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app83.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app83.json new file mode 100644 index 000000000..2848a341a --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app83.json @@ -0,0 +1,128 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/coffees": { + "get": { + "tags": [ + "coffee-service" + ], + "operationId": "getAllCoffees", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Coffee" + } + } + } + } + } + } + } + }, + "/coffees/{id}": { + "get": { + "tags": [ + "coffee-service" + ], + "operationId": "getCoffeeById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Coffee" + } + } + } + } + } + } + }, + "/coffees/{id}/orders": { + "get": { + "tags": [ + "coffee-service" + ], + "operationId": "getOrdersForCoffeeById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CoffeeOrder" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Coffee": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "CoffeeOrder": { + "type": "object", + "properties": { + "coffeeId": { + "type": "string" + }, + "whenOrdered": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app84.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app84.json new file mode 100644 index 000000000..922fb84f2 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app84.json @@ -0,0 +1,204 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/employees": { + "get": { + "tags": [ + "employee-repository" + ], + "operationId": "findAllEmployees", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + } + }, + "/employees/{id}": { + "get": { + "tags": [ + "MyEmployee" + ], + "summary": "Find purchase order by ID", + "operationId": "findEmployeeById", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Employee Id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + } + }, + "400": { + "description": "Invalid Employee ID supplied" + }, + "404": { + "description": "Employee not found" + } + } + } + }, + "/employees/update": { + "post": { + "tags": [ + "employee-repository" + ], + "operationId": "updateEmployee", + "parameters": [ + { + "name": "employee", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + }, + "/employees-composed": { + "get": { + "tags": [ + "employee-repository" + ], + "operationId": "findAllEmployees_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + } + }, + "/employees-composed/update": { + "post": { + "tags": [ + "employee-repository" + ], + "operationId": "updateEmployee_1", + "parameters": [ + { + "name": "employee", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + }, + "/employees-composed/{id}": { + "get": { + "tags": [ + "employee-repository" + ], + "operationId": "findEmployeeById_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Employee": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app85.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app85.json new file mode 100644 index 000000000..0d6ca8afb --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app85.json @@ -0,0 +1,296 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/createPerson": { + "post": { + "tags": [ + "person-service" + ], + "operationId": "save", + "parameters": [ + { + "name": "person", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/deletePerson/{id}": { + "delete": { + "tags": [ + "person-service" + ], + "operationId": "delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/getAllPersons": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "getAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/getPerson/{id}": { + "get": { + "tags": [ + "person-service" + ], + "operationId": "getById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/stream+json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/createPosition": { + "post": { + "tags": [ + "positions" + ], + "description": "Save position", + "operationId": "save_1", + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Position" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Position" + } + } + } + } + } + } + }, + "/deletePosition/{id}": { + "delete": { + "tags": [ + "positions" + ], + "description": "Delete By Id", + "operationId": "deleteBy", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/getAllPositions": { + "get": { + "tags": [ + "positions" + ], + "description": "Get all positions", + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Position" + } + } + } + } + } + } + } + }, + "/getPosition/{id}": { + "get": { + "tags": [ + "positions" + ], + "description": "Find all", + "operationId": "findById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/stream+json": { + "schema": { + "$ref": "#/components/schemas/Position" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "sex": { + "type": "string", + "enum": [ + "MAN", + "WOMEN" + ] + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "age": { + "type": "string" + }, + "interests": { + "type": "string" + }, + "email": { + "type": "string" + } + } + }, + "Position": { + "required": [ + "createdAt", + "positionName" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "positionName": { + "maxLength": 140, + "minLength": 0, + "type": "string" + }, + "description": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app86.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app86.json new file mode 100644 index 000000000..0b5640c8c --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app86.json @@ -0,0 +1,114 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/echo": { + "post": { + "operationId": "echo", + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/hello": { + "get": { + "operationId": "hello", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/quotes": { + "get": { + "operationId": "fetchQuotes", + "parameters": [ + { + "name": "size", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Quote" + } + } + }, + "application/stream+json": { + "schema": { + "$ref": "#/components/schemas/Quote" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Quote": { + "type": "object", + "properties": { + "ticker": { + "type": "string" + }, + "price": { + "type": "number" + }, + "instant": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app87.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app87.json new file mode 100644 index 000000000..563d5c142 --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app87.json @@ -0,0 +1,105 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app88.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app88.json new file mode 100644 index 000000000..02a8ac4be --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app88.json @@ -0,0 +1,146 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/posts": { + "get": { + "operationId": "all", + "parameters": [ + { + "name": "key", + "in": "query", + "description": "sample description", + "required": true, + "schema": { + "type": "string", + "default": "value" + } + }, + { + "name": "test", + "in": "query", + "description": "sample desc", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Post" + } + } + } + } + } + } + }, + "post": { + "operationId": "create", + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Post" + } + } + } + }, + "responses": { + "201": { + "description": "Created" + } + } + } + }, + "/posts/{id}": { + "get": { + "operationId": "get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Post" + } + } + } + } + } + }, + "put": { + "operationId": "update", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "202": { + "description": "Accepted", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Post" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Post": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "createdDate": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app89.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app89.json new file mode 100644 index 000000000..77e73364e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app89.json @@ -0,0 +1,393 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_1", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_1", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_2", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_2", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_3", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_3", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findAll_4", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "operationId": "findByAuthor_4", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app90.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app90.json new file mode 100644 index 000000000..1197cd09e --- /dev/null +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app90.json @@ -0,0 +1,591 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/foo": { + "get": { + "operationId": "hello", + "parameters": [ + { + "name": "key1", + "in": "query", + "description": "My key1 description", + "schema": { + "type": "string" + } + }, + { + "name": "key2", + "in": "query", + "description": "My key2 description", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "This is normal response description" + }, + "404": { + "description": "This is another response description" + } + } + } + }, + "/books": { + "get": { + "tags": [ + "book" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/{author}": { + "get": { + "tags": [ + "book", + "book" + ], + "operationId": "findByAuthor", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/nest": { + "get": { + "tags": [ + "book" + ], + "operationId": "findAll_1", + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/nest/{author}": { + "get": { + "tags": [ + "book" + ], + "operationId": "findByAuthor_1", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books": { + "get": { + "tags": [ + "book" + ], + "operationId": "findAll_2", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books": { + "get": { + "tags": [ + "book" + ], + "operationId": "findAll_3", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book" + ], + "operationId": "findByAuthor_2", + "parameters": [ + { + "name": "author", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/employees/{id}": { + "get": { + "tags": [ + "MyEmployee" + ], + "summary": "Find purchase order by ID", + "operationId": "findEmployeeById", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Employee Id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + } + }, + "400": { + "description": "Invalid Employee ID supplied" + }, + "404": { + "description": "Employee not found" + } + } + } + }, + "/createPosition": { + "post": { + "tags": [ + "positions" + ], + "description": "Save position", + "operationId": "save", + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Position" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Position" + } + } + } + } + } + } + }, + "/deletePosition/{id}": { + "delete": { + "tags": [ + "positions" + ], + "description": "Delete By Id", + "operationId": "deleteBy", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + } + } + } + }, + "/getAllPositions": { + "get": { + "tags": [ + "positions" + ], + "description": "Get all positions", + "operationId": "findAll_4", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Position" + } + } + } + } + } + } + } + }, + "/getPosition/{id}": { + "get": { + "tags": [ + "positions" + ], + "description": "Find all", + "operationId": "findById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/stream+json": { + "schema": { + "$ref": "#/components/schemas/Position" + } + } + } + } + } + } + }, + "/echo": { + "post": { + "tags": [ + "quotes" + ], + "operationId": "echo", + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/hello": { + "get": { + "tags": [ + "quotes" + ], + "operationId": "hello_1", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/quotes": { + "get": { + "tags": [ + "quotes" + ], + "operationId": "fetchQuotes", + "parameters": [ + { + "name": "size", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Quote" + } + } + }, + "application/stream+json": { + "schema": { + "$ref": "#/components/schemas/Quote" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + } + } + }, + "Employee": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "Position": { + "required": [ + "createdAt", + "positionName" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "positionName": { + "maxLength": 140, + "minLength": 0, + "type": "string" + }, + "description": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, + "Quote": { + "type": "object", + "properties": { + "ticker": { + "type": "string" + }, + "price": { + "type": "number" + }, + "instant": { + "type": "string", + "format": "date-time" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/HelloController.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/HelloController.java index 0720d7cc1..899df5d01 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/HelloController.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/HelloController.java @@ -39,7 +39,7 @@ public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { public GroupedOpenApi userOpenApi() { return GroupedOpenApi.builder() .group("users") - .packagesToScan("test.org.springdoc.api.app145") + .packagesToScan("test.org.springdoc.api.v30.app145") .build(); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/HelloController.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/HelloController.java index a397c47d5..ccbdc8d78 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/HelloController.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/HelloController.java @@ -39,7 +39,7 @@ public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { public GroupedOpenApi userOpenApi() { return GroupedOpenApi.builder() .group("users") - .packagesToScan("test.org.springdoc.api.app145") + .packagesToScan("test.org.springdoc.api.v30.app145") .build(); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java index 5f23af5e7..189643268 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java @@ -41,7 +41,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "management.endpoints.web.exposure.include=*", "springdoc.use-management-port=true", - "management.server.port=9284", + "management.server.port=9295", "management.server.base-path=/test", "management.endpoints.web.base-path=/application" }) class SpringDocApp16Test extends AbstractSpringDocActuatorTest { diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/HelloController.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/HelloController.java index 875c7ddee..49d4058e7 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/HelloController.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/HelloController.java @@ -39,7 +39,7 @@ public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { public GroupedOpenApi userOpenApi() { return GroupedOpenApi.builder() .group("users") - .packagesToScan("test.org.springdoc.api.app145") + .packagesToScan("test.org.springdoc.api.v30.app145") .build(); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/HelloController.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/HelloController.java index f49f7800b..87c214d44 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/HelloController.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/HelloController.java @@ -39,7 +39,7 @@ public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { public GroupedOpenApi userOpenApi() { return GroupedOpenApi.builder() .group("users") - .packagesToScan("test.org.springdoc.api.app145") + .packagesToScan("test.org.springdoc.api.v30.app145") .build(); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app16-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app16-1.json index 99b357cfe..7de5abf41 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app16-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app16-1.json @@ -1,6 +1,6 @@ { "configUrl": "/test/application/swagger-ui/swagger-config", - "oauth2RedirectUrl": "http://localhost:9284/test/application/webjars/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9295/test/application/webjars/swagger-ui/oauth2-redirect.html", "urls": [ { "url": "/test/application/openapi/users", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..43b5c977e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.AbstractCommonTest; + +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest +public abstract class AbstractSpringDocTest extends AbstractCommonTest { + + public static String className; + + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java deleted file mode 100644 index 1c3f0ffca..000000000 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocV31Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.v31; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractCommonTest; - -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@SpringBootTest -public abstract class AbstractSpringDocV31Test extends AbstractCommonTest { - - public static String className; - - @Test - protected void testApp() throws Exception { - className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - String expected = getContent("results/3.1.0/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } -} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java index cfaf5d013..f7ae35969 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java @@ -29,14 +29,14 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.security.SecurityScheme; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = { "springdoc.default-produces-media-type=application/json", "prop.toto=tea" }) -public class SpringDocApp1Test extends AbstractSpringDocV31Test { +public class SpringDocApp1Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java index af96adf03..0d0384cc5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java @@ -18,11 +18,11 @@ package test.org.springdoc.api.v31.app10; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp10Test extends AbstractSpringDocV31Test { +public class SpringDocApp10Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java index eee8650ee..f3e68d3aa 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java @@ -25,11 +25,11 @@ package test.org.springdoc.api.v31.app100; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp100Test extends AbstractSpringDocV31Test { +public class SpringDocApp100Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java index f66477825..28d945f69 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java @@ -25,13 +25,13 @@ package test.org.springdoc.api.v31.app101; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.ActiveProfiles; @ActiveProfiles("101") -public class SpringDocApp101Test extends AbstractSpringDocV31Test { +public class SpringDocApp101Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java index 56ee20aec..e94f102b7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app102; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp102Test extends AbstractSpringDocV31Test { +public class SpringDocApp102Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java index a3db241ca..265852f70 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app103; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp103Test extends AbstractSpringDocV31Test { +public class SpringDocApp103Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java index 27119691b..37d8e669e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app104; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp104Test extends AbstractSpringDocV31Test { +public class SpringDocApp104Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java index acfbfd77a..b68e94a80 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java @@ -31,7 +31,7 @@ import io.swagger.v3.oas.models.security.SecurityScheme; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @@ -55,7 +55,7 @@ "springdoc.group-configs[3].paths-to-exclude=/v1/users", "springdoc.group-configs[3].packages-to-scan=test.org.springdoc.api.v31.app105.api.user,test.org.springdoc.api.v31.app105.api.store", }) -public class SpringDocApp105Test extends AbstractSpringDocV31Test { +public class SpringDocApp105Test extends AbstractSpringDocTest { public static String className; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java index 9ede8356f..e10d11f8b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app106; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp106Test extends AbstractSpringDocV31Test { +public class SpringDocApp106Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java index 0b5d086da..c9fb54029 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app107; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp107Test extends AbstractSpringDocV31Test { +public class SpringDocApp107Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java index 1b8b43bb3..93ee2717a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app108; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp108Test extends AbstractSpringDocV31Test { +public class SpringDocApp108Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java index ff6cb37f8..5079c7443 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app109; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp109Test extends AbstractSpringDocV31Test { +public class SpringDocApp109Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java index 46a2e117f..d0e22275c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app11; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp11Test extends AbstractSpringDocV31Test { +public class SpringDocApp11Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java index 06e97ac27..d0639c8d1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java @@ -27,7 +27,7 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -37,7 +37,7 @@ @TestPropertySource(properties = { "application-description=description", "application-version=v1" }) -public class SpringDocApp110Test extends AbstractSpringDocV31Test { +public class SpringDocApp110Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java index baa3d692b..f8b8954ba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java @@ -27,7 +27,7 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -37,7 +37,7 @@ @TestPropertySource(properties = { "application-description=description", "application-version=v1" }) -public class SpringDocApp111Test extends AbstractSpringDocV31Test { +public class SpringDocApp111Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java index 91f260b22..308852152 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java @@ -27,7 +27,7 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -37,7 +37,7 @@ @TestPropertySource(properties = { "application-description=description", "application-version=v1" }) -public class SpringDocApp112Test extends AbstractSpringDocV31Test { +public class SpringDocApp112Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java index d003a01c4..1edb293f2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app113; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp113Test extends AbstractSpringDocV31Test { +public class SpringDocApp113Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java index 603fdb1c3..e283f9c88 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java @@ -29,12 +29,12 @@ import javax.money.MonetaryAmount; import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp114Test extends AbstractSpringDocV31Test { +public class SpringDocApp114Test extends AbstractSpringDocTest { static { SpringDocUtils.getConfig() diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java index f59f723e1..097d70d76 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java @@ -26,6 +26,7 @@ import java.time.Duration; import java.util.Map; +import java.util.Set; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Content; @@ -47,7 +48,7 @@ public Operation customize(Operation operation, HandlerMethod handlerMethod) { if (content.containsKey(MediaType.APPLICATION_JSON_VALUE)) { Schema schema = content.get(MediaType.APPLICATION_JSON_VALUE).getSchema(); schema.getProperties().clear(); - schema.setType("string"); + schema.types(Set.of("string")); } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java index 6251c0888..d399eb272 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app115; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp115Test extends AbstractSpringDocV31Test { +public class SpringDocApp115Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java index fd117917c..3c8d9cf4b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app116; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp116Test extends AbstractSpringDocV31Test { +public class SpringDocApp116Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java index e7f39f1dd..f6eab3cfd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app117; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp117Test extends AbstractSpringDocV31Test { +public class SpringDocApp117Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java index 615340fb6..55b3af8e9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app118; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp118Test extends AbstractSpringDocV31Test { +public class SpringDocApp118Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java index 622d03bb5..ca309ce1b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app119; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp119Test extends AbstractSpringDocV31Test { +public class SpringDocApp119Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java index 55c5a37d3..72a64d4a0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app12; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp12Test extends AbstractSpringDocV31Test { +public class SpringDocApp12Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java index e6c03fbf3..ec685cb1c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app120; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp120Test extends AbstractSpringDocV31Test { +public class SpringDocApp120Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java index 5feb19927..679c0bf9f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app121; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp121Test extends AbstractSpringDocV31Test { +public class SpringDocApp121Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java index df9dfd8d8..4559e8d3f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app122; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp122Test extends AbstractSpringDocV31Test { +public class SpringDocApp122Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java index db3e495d7..b54b9e1a1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app123; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp123Test extends AbstractSpringDocV31Test { +public class SpringDocApp123Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java index b00a4a020..ae548662b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app124; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp124Test extends AbstractSpringDocV31Test { +public class SpringDocApp124Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java index 2158ff8d2..ad0b2d6aa 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java @@ -31,7 +31,7 @@ import io.swagger.v3.core.converter.ResolvedSchema; import io.swagger.v3.oas.models.responses.ApiResponse; import org.springdoc.core.customizers.OpenApiCustomizer; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @@ -40,7 +40,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp126Test extends AbstractSpringDocV31Test { +public class SpringDocApp126Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java index cd6249b1b..27626d005 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.web.servlet.MvcResult; @@ -38,7 +38,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp127Test extends AbstractSpringDocV31Test { +public class SpringDocApp127Test extends AbstractSpringDocTest { @Test protected void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java index d7664659a..9885ca6c3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app129; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp129Test extends AbstractSpringDocV31Test { +public class SpringDocApp129Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java index 8b206d4a3..5dc816b23 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app13; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp13Test extends AbstractSpringDocV31Test { +public class SpringDocApp13Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java index 90baa73bd..dfff87af8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app130; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp130Test extends AbstractSpringDocV31Test { +public class SpringDocApp130Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java index 17bd6a8d2..bb2e613c1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app131; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp131Test extends AbstractSpringDocV31Test { +public class SpringDocApp131Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java index 18754ed00..e7f15ea43 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app132; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp132Test extends AbstractSpringDocV31Test { +public class SpringDocApp132Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java index f9fcd29d5..c8e4f1cc0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app133; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp133Test extends AbstractSpringDocV31Test { +public class SpringDocApp133Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java index 7db7de622..a741a014c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -39,7 +39,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp134Test extends AbstractSpringDocV31Test { +public class SpringDocApp134Test extends AbstractSpringDocTest { @Test protected void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java index e6b8e1bab..d680aa304 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app135; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp135Test extends AbstractSpringDocV31Test { +public class SpringDocApp135Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java index 00a8270ca..210f5fecc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app137; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -33,7 +33,7 @@ * Tests Spring meta-annotations as method parameters */ @TestPropertySource(properties = { "test.server=http://test.toto.com", "test.desc=toto desc" }) -public class SpringDocApp137Test extends AbstractSpringDocV31Test { +public class SpringDocApp137Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java index e5d7e456f..b625777ee 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -55,7 +55,7 @@ * Tests Spring meta-annotations as method parameters */ @TestPropertySource(properties = "springdoc.writer-with-order-by-keys=true") -public class SpringDocApp138Test extends AbstractSpringDocV31Test { +public class SpringDocApp138Test extends AbstractSpringDocTest { @Autowired ObjectMapperProvider objectMapperProvider; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java index eb668d465..d2c46fef9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app139; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -33,7 +33,7 @@ * Tests Spring meta-annotations as method parameters */ @TestPropertySource(properties = { "test.name=text", "test.value=text", "test.default-value=default-text" }) -public class SpringDocApp139Test extends AbstractSpringDocV31Test { +public class SpringDocApp139Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java index 103358ab9..71cc95987 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java @@ -28,11 +28,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp14Test extends AbstractSpringDocV31Test { +public class SpringDocApp14Test extends AbstractSpringDocTest { private static Locale DEFAULT_LOCALE; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java index 50bc5b2e5..f14b164f8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app140; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp140Test extends AbstractSpringDocV31Test { +public class SpringDocApp140Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java index 3ff28cc9f..5efba1c67 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java @@ -23,7 +23,7 @@ */ package test.org.springdoc.api.v31.app141; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,7 +31,7 @@ /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp141Test extends AbstractSpringDocV31Test { +public class SpringDocApp141Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java index a97bd8032..a793b1c86 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app142; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp142Test extends AbstractSpringDocV31Test { +public class SpringDocApp142Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/SpringDocApp143Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/SpringDocApp143Test.java index 615978187..c4b733b0a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/SpringDocApp143Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app143/SpringDocApp143Test.java @@ -24,7 +24,7 @@ package test.org.springdoc.api.v31.app143; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -36,7 +36,7 @@ @TestPropertySource(properties = { "management.endpoints.enabled-by-default=true", "springdoc.show-actuator=true", "management.endpoints.web.exposure.exclude=functions" }) -public class SpringDocApp143Test extends AbstractSpringDocV31Test { +public class SpringDocApp143Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java index 99089738f..89d398b04 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java @@ -26,13 +26,13 @@ import org.junit.jupiter.api.BeforeAll; import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.model-and-view-allowed=true") -public class SpringDocApp149Test extends AbstractSpringDocV31Test { +public class SpringDocApp149Test extends AbstractSpringDocTest { @BeforeAll public static void init() { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java index adc0c3bdb..2e7355723 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java @@ -28,7 +28,7 @@ import io.swagger.v3.oas.annotations.info.Contact; import io.swagger.v3.oas.annotations.info.Info; import io.swagger.v3.oas.annotations.info.License; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -45,7 +45,7 @@ "springdoc.openapidefinition.info.contact.email=My contact email", "springdoc.openapidefinition.info.contact.url=My contact url" }) -public class SpringDocApp15Test extends AbstractSpringDocV31Test { +public class SpringDocApp15Test extends AbstractSpringDocTest { @SpringBootApplication @OpenAPIDefinition(info = @Info( diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java index 4bf8db2dd..4d9b01f56 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java @@ -25,14 +25,14 @@ package test.org.springdoc.api.v31.app150; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp150Test extends AbstractSpringDocV31Test { +public class SpringDocApp150Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java index eebecf638..c39c30f26 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java @@ -25,14 +25,14 @@ package test.org.springdoc.api.v31.app151; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp151Test extends AbstractSpringDocV31Test { +public class SpringDocApp151Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java index 39f8701b3..52837ecbd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java @@ -25,14 +25,14 @@ package test.org.springdoc.api.v31.app152; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp152Test extends AbstractSpringDocV31Test { +public class SpringDocApp152Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java index b1439c000..b855f41bc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java @@ -25,14 +25,14 @@ package test.org.springdoc.api.v31.app153; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp153Test extends AbstractSpringDocV31Test { +public class SpringDocApp153Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java index aeae6dc9b..20e7cf26e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java @@ -25,14 +25,14 @@ package test.org.springdoc.api.v31.app154; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp154Test extends AbstractSpringDocV31Test { +public class SpringDocApp154Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java index 89633882f..27116df31 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java @@ -25,14 +25,14 @@ package test.org.springdoc.api.v31.app155; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp155Test extends AbstractSpringDocV31Test { +public class SpringDocApp155Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java index 56d609527..54f636e89 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java @@ -25,14 +25,14 @@ package test.org.springdoc.api.v31.app156; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp156Test extends AbstractSpringDocV31Test { +public class SpringDocApp156Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java index 7d8c447ea..9930508ab 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -47,7 +47,7 @@ * the type is enclosed in an ignored wrapper. We test this by setting up a model converter which * adds "stringy" to the "required" property of a schema's parent, when the sub schema is a String. */ -public class SpringDocApp157Test extends AbstractSpringDocV31Test { +public class SpringDocApp157Test extends AbstractSpringDocTest { /** * The Converters. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java index 547700c61..9711707c1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app158; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp158Test extends AbstractSpringDocV31Test { +public class SpringDocApp158Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java index 21d4861b5..fd6e297ba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app159; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp159Test extends AbstractSpringDocV31Test { +public class SpringDocApp159Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java index 60b5fed17..73f17a928 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.SpringBootConfiguration; import org.springframework.test.context.TestPropertySource; @@ -35,7 +35,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @TestPropertySource(properties = "springdoc.api-docs.enabled=false") -public class SpringDocApp16Test extends AbstractSpringDocV31Test { +public class SpringDocApp16Test extends AbstractSpringDocTest { @Test protected void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java index 871b7feb4..acf906ba7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -38,7 +38,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") -public class SpringDocApp160Test extends AbstractSpringDocV31Test { +public class SpringDocApp160Test extends AbstractSpringDocTest { @Test void testApp2() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java index 3904634cb..044e9e091 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java @@ -27,11 +27,11 @@ import java.util.Locale; import org.junit.jupiter.api.Test; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp161Test extends AbstractSpringDocV31Test { +public class SpringDocApp161Test extends AbstractSpringDocTest { @Test protected void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java index 119b2a5b8..b03a53ec5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java @@ -25,11 +25,11 @@ package test.org.springdoc.api.v31.app162; import org.junit.jupiter.api.Test; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp162Test extends AbstractSpringDocV31Test { +public class SpringDocApp162Test extends AbstractSpringDocTest { @Test void testApp2() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java index 4a5c5ebf7..8592121e3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app163; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; -public class SpringDocApp163Test extends AbstractSpringDocV31Test { +public class SpringDocApp163Test extends AbstractSpringDocTest { @SpringBootApplication @Import({ Examples.class, ExampleRegistrationCustomizer.class }) diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java index b6854a913..59b1a57e5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java @@ -24,13 +24,13 @@ package test.org.springdoc.api.v31.app164; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") -public class SpringDocApp164Test extends AbstractSpringDocV31Test { +public class SpringDocApp164Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/SpringDocApp165Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/SpringDocApp165Test.java index fbb6f7994..30f4827dd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/SpringDocApp165Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app165/SpringDocApp165Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app165; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp165Test extends AbstractSpringDocV31Test { +public class SpringDocApp165Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java index 04d29b9d1..169fd2791 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java @@ -24,7 +24,7 @@ package test.org.springdoc.api.v31.app166; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -34,7 +34,7 @@ * Exactly, that the local handler takes precedence over the global one * */ @TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") -public class SpringDocApp166Test extends AbstractSpringDocV31Test { +public class SpringDocApp166Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java index 6b9a882ce..1006e95fc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java @@ -24,14 +24,14 @@ package test.org.springdoc.api.v31.app167; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.disable-i18n=true") -public class SpringDocApp167Test extends AbstractSpringDocV31Test { +public class SpringDocApp167Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java index bae10c3a3..04c6fc926 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java @@ -30,14 +30,14 @@ import io.swagger.v3.core.converter.ModelConverters; import org.springdoc.core.converters.PolymorphicModelConverter; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = Constants.SPRINGDOC_POLYMORPHIC_CONVERTER_ENABLED + "=false") -public class SpringDocApp168Test extends AbstractSpringDocV31Test { +public class SpringDocApp168Test extends AbstractSpringDocTest { static { Optional modelConverterOptional = diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java index 26611564f..bda13ca64 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app169; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp169Test extends AbstractSpringDocV31Test { +public class SpringDocApp169Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java index 812978613..e5332b64c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app17; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp17Test extends AbstractSpringDocV31Test { +public class SpringDocApp17Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java index 0e3900c98..c06f59f9b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java @@ -26,13 +26,13 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.customizers.OpenApiCustomizer; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -public class SpringDocApp170Test extends AbstractSpringDocV31Test { +public class SpringDocApp170Test extends AbstractSpringDocTest { @Test void testApp1() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java index e908519e9..6c2c4d17d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.customizers.OpenApiLocaleCustomizer; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -46,7 +46,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @TestPropertySource(properties = Constants.SPRINGDOC_CACHE_DISABLED + "=false") -public class SpringDocApp171Test extends AbstractSpringDocV31Test { +public class SpringDocApp171Test extends AbstractSpringDocTest { @Test @Override diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/SpringDocApp172Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/SpringDocApp172Test.java index bfd701b29..b80f75f16 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/SpringDocApp172Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app172/SpringDocApp172Test.java @@ -29,7 +29,7 @@ import org.springdoc.core.customizers.OperationCustomizer; import org.springdoc.core.models.GroupedOpenApi; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @@ -43,7 +43,7 @@ @TestPropertySource(properties = { "springdoc.show-actuator=true", "management.endpoints.enabled-by-default=true", "management.endpoints.web.exposure.include = tenant" }) -public class SpringDocApp172Test extends AbstractSpringDocV31Test { +public class SpringDocApp172Test extends AbstractSpringDocTest { @Test protected void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java index a0ee8321e..6724b015a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java @@ -31,7 +31,7 @@ import io.swagger.v3.oas.models.info.Info; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @@ -44,7 +44,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public class SpringDocApp173Test extends AbstractSpringDocV31Test { +public class SpringDocApp173Test extends AbstractSpringDocTest { @Test @Override diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/SpringDocApp177Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/SpringDocApp177Test.java index 133adbc80..abc05f695 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/SpringDocApp177Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app177/SpringDocApp177Test.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -36,7 +36,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -class SpringDocApp177Test extends AbstractSpringDocV31Test { +class SpringDocApp177Test extends AbstractSpringDocTest { @Test void testFilterOnlyPicksUpMatchedMethods() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/SpringDocApp178Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/SpringDocApp178Test.java index 33f5e7ea7..dd26be040 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/SpringDocApp178Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app178/SpringDocApp178Test.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -36,7 +36,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -class SpringDocApp178Test extends AbstractSpringDocV31Test { +class SpringDocApp178Test extends AbstractSpringDocTest { @Test void testFilterOnlyPicksUpMatchedMethods() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/SpringDocApp179Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/SpringDocApp179Test.java index 35e13f330..550760710 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/SpringDocApp179Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app179/SpringDocApp179Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app179; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp179Test extends AbstractSpringDocV31Test { +public class SpringDocApp179Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java index f0dff7717..9baa2e0f7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java @@ -24,13 +24,13 @@ package test.org.springdoc.api.v31.app18; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.pre-loading-enabled=true") -public class SpringDocApp18Test extends AbstractSpringDocV31Test { +public class SpringDocApp18Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/SpringDocApp180Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/SpringDocApp180Test.java index 7fbefa669..b90b21361 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/SpringDocApp180Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app180/SpringDocApp180Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app180; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -class SpringDocApp180Test extends AbstractSpringDocV31Test { +class SpringDocApp180Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/SpringDocApp181Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/SpringDocApp181Test.java index 36dfa6d20..193eee4da 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/SpringDocApp181Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app181/SpringDocApp181Test.java @@ -25,14 +25,14 @@ package test.org.springdoc.api.v31.app181; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Tests Spring meta-annotations as method parameters */ -public class SpringDocApp181Test extends AbstractSpringDocV31Test { +public class SpringDocApp181Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/SpringDocApp182Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/SpringDocApp182Test.java index ebdcc964e..6263b9991 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/SpringDocApp182Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app182/SpringDocApp182Test.java @@ -24,14 +24,14 @@ package test.org.springdoc.api.v31.app182; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @author bnasslahsen */ -public class SpringDocApp182Test extends AbstractSpringDocV31Test { +public class SpringDocApp182Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/SpringDocApp183Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/SpringDocApp183Test.java index c2a280015..34ba0b7e1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/SpringDocApp183Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app183/SpringDocApp183Test.java @@ -24,7 +24,7 @@ package test.org.springdoc.api.v31.app183; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.core.convert.converter.Converter; @@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -public class SpringDocApp183Test extends AbstractSpringDocV31Test { +public class SpringDocApp183Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java index 40734b9b6..5a2cb6182 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app184/SpringDocApp184Test.java @@ -37,7 +37,7 @@ import org.springdoc.core.filters.OpenApiMethodFilter; import org.springdoc.core.models.GroupedOpenApi; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @@ -51,7 +51,7 @@ "springdoc.group-configs[0].group=group1", "springdoc.group-configs[0].paths-to-exclude=/group1Filtered", }) -public class SpringDocApp184Test extends AbstractSpringDocV31Test { +public class SpringDocApp184Test extends AbstractSpringDocTest { @Test void testGroup1() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/SpringDocApp185Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/SpringDocApp185Test.java index 81d8c6c7b..287f2c132 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/SpringDocApp185Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app185/SpringDocApp185Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app185; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp185Test extends AbstractSpringDocV31Test { +public class SpringDocApp185Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java index 37400187a..8a03f3098 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app187/SpringDocApp187Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app187; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp187Test extends AbstractSpringDocV31Test { +public class SpringDocApp187Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/HelloController.java index 729cde606..d1f60c51a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/HelloController.java @@ -68,7 +68,7 @@ public OperationCustomizer operationCustomizer(OpenAPI api) { api.getComponents(), ErrorResponse.class, null, - null, SpecVersion.V30 + null, SpecVersion.V31 ); ApiResponse errorApiResponse = new ApiResponse().content(new Content().addMediaType( diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java index 02627c6ae..00098ebcb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app188/SpringDocApp188Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app188; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp188Test extends AbstractSpringDocV31Test { +public class SpringDocApp188Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java index b9f7126c3..660376be3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app189/SpringDocApp189Test.java @@ -22,13 +22,13 @@ package test.org.springdoc.api.v31.app189; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.default-support-form-data=true") -public class SpringDocApp189Test extends AbstractSpringDocV31Test { +public class SpringDocApp189Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java index a468e89ba..50af0170b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app19; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp19Test extends AbstractSpringDocV31Test { +public class SpringDocApp19Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java index 8b2134819..6e45987b1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app190/SpringDocApp190Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app190; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp190Test extends AbstractSpringDocV31Test { +public class SpringDocApp190Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocApp192Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocApp192Test.java index 9a8311f09..0666614fd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocApp192Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app192/SpringDocApp192Test.java @@ -23,12 +23,12 @@ package test.org.springdoc.api.v31.app192; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp192Test extends AbstractSpringDocV31Test { +public class SpringDocApp192Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/SpringDocApp194Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/SpringDocApp194Test.java index b295d71c2..ec414ad59 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/SpringDocApp194Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app194/SpringDocApp194Test.java @@ -22,13 +22,13 @@ package test.org.springdoc.api.v31.app194; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.default-support-form-data=false") -public class SpringDocApp194Test extends AbstractSpringDocV31Test { +public class SpringDocApp194Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/SpringDocApp195Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/SpringDocApp195Test.java index 532e291e5..c769a2878 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/SpringDocApp195Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app195/SpringDocApp195Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app195; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp195Test extends AbstractSpringDocV31Test { +public class SpringDocApp195Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/SpringDocApp196Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/SpringDocApp196Test.java index 3aa6f7e7b..0487687d3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/SpringDocApp196Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app196/SpringDocApp196Test.java @@ -22,14 +22,14 @@ package test.org.springdoc.api.v31.app196; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = { "springdoc.show-actuator=true", "springdoc.model-and-view-allowed=false" }) -public class SpringDocApp196Test extends AbstractSpringDocV31Test { +public class SpringDocApp196Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/SpringDocApp197Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/SpringDocApp197Test.java index d0e65539d..1fbd484ac 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/SpringDocApp197Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app197/SpringDocApp197Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app197; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp197Test extends AbstractSpringDocV31Test { +public class SpringDocApp197Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/SpringDocApp198Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/SpringDocApp198Test.java index cc2d2d891..43ea7d0c0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/SpringDocApp198Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app198/SpringDocApp198Test.java @@ -26,11 +26,11 @@ import io.swagger.v3.oas.models.media.Schema; import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp198Test extends AbstractSpringDocV31Test { +public class SpringDocApp198Test extends AbstractSpringDocTest { static { SpringDocUtils.getConfig().replaceWithSchema( diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/SpringDocApp199Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/SpringDocApp199Test.java index a9b452889..3f518d9f8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/SpringDocApp199Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app199/SpringDocApp199Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app199; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp199Test extends AbstractSpringDocV31Test { +public class SpringDocApp199Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java index e594c537f..1825d93d7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java @@ -29,12 +29,12 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.security.SecurityScheme; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -public class SpringDocApp2Test extends AbstractSpringDocV31Test { +public class SpringDocApp2Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java index e1d833e5b..98bff6314 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app20; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp20Test extends AbstractSpringDocV31Test { +public class SpringDocApp20Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/SpringDocApp200Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/SpringDocApp200Test.java index ac35e45b0..6e25880b5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/SpringDocApp200Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app200/SpringDocApp200Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app200; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp200Test extends AbstractSpringDocV31Test { +public class SpringDocApp200Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringDocApp201Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringDocApp201Test.java index e5326cb61..dc8b630f4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringDocApp201Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app201/SpringDocApp201Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app201; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp201Test extends AbstractSpringDocV31Test { +public class SpringDocApp201Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/SpringDocApp202Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/SpringDocApp202Test.java index 32d826980..b0b354ee1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/SpringDocApp202Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app202/SpringDocApp202Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app202; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp202Test extends AbstractSpringDocV31Test { +public class SpringDocApp202Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/SpringDocApp203Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/SpringDocApp203Test.java index 78e88e89b..440badb3c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/SpringDocApp203Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app203/SpringDocApp203Test.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; @@ -37,7 +37,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @TestPropertySource(properties = { "springdoc.group-configs[0].group=mygroup", "springdoc.group-configs[0].paths-to-match=/test" }) -public class SpringDocApp203Test extends AbstractSpringDocV31Test { +public class SpringDocApp203Test extends AbstractSpringDocTest { @SpringBootApplication @Import({ diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/SpringDocApp204Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/SpringDocApp204Test.java index 321ea265d..540fc89f3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/SpringDocApp204Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app204/SpringDocApp204Test.java @@ -22,13 +22,13 @@ package test.org.springdoc.api.v31.app204; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = { "springdoc.default-flat-param-object=true" }) -public class SpringDocApp204Test extends AbstractSpringDocV31Test { +public class SpringDocApp204Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/SpringdocApp205Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/SpringdocApp205Test.java index e3a966937..52e9f0256 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/SpringdocApp205Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app205/SpringdocApp205Test.java @@ -4,7 +4,7 @@ * @author bnasslahsen */ -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -13,7 +13,7 @@ * Fix regression in #2031 */ @TestPropertySource(properties = { "springdoc.group-configs[0].group=mygroup", "springdoc.group-configs[0].paths-to-match=/test" }) -public class SpringdocApp205Test extends AbstractSpringDocV31Test { +public class SpringdocApp205Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/SpringdocApp206Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/SpringdocApp206Test.java index a5b8f4fd3..f9d4e2829 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/SpringdocApp206Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app206/SpringdocApp206Test.java @@ -1,10 +1,10 @@ package test.org.springdoc.api.v31.app206; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringdocApp206Test extends AbstractSpringDocV31Test { +public class SpringdocApp206Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/SpringdocApp207Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/SpringdocApp207Test.java index c5792a193..ffc85cc3b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/SpringdocApp207Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app207/SpringdocApp207Test.java @@ -1,10 +1,10 @@ package test.org.springdoc.api.v31.app207; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringdocApp207Test extends AbstractSpringDocV31Test { +public class SpringdocApp207Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/SpringdocApp208Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/SpringdocApp208Test.java index aad3005db..f8a5e767d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/SpringdocApp208Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app208/SpringdocApp208Test.java @@ -1,12 +1,12 @@ package test.org.springdoc.api.v31.app208; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = { "springdoc.default-flat-param-object=true" }) -public class SpringdocApp208Test extends AbstractSpringDocV31Test { +public class SpringdocApp208Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java index de657fbae..07ab6ff6a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java @@ -24,13 +24,13 @@ package test.org.springdoc.api.v31.app21; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.oAuthFlow.authorizationUrl=http://personstore.swagger.io/oauth/dialog") -public class SpringDocApp21Test extends AbstractSpringDocV31Test { +public class SpringDocApp21Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/SpringDocApp211Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/SpringDocApp211Test.java index a677445ab..66b4e95f3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/SpringDocApp211Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app211/SpringDocApp211Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app211; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp211Test extends AbstractSpringDocV31Test { +public class SpringDocApp211Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/SpringDocApp212Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/SpringDocApp212Test.java index 5ff33d815..6d3219a8d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/SpringDocApp212Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app212/SpringDocApp212Test.java @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.customizers.SpecPropertiesCustomizer; import org.springdoc.core.models.GroupedOpenApi; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @@ -37,7 +37,7 @@ * A test for {@link SpecPropertiesCustomizer} */ @ActiveProfiles("212") -public class SpringDocApp212Test extends AbstractSpringDocV31Test { +public class SpringDocApp212Test extends AbstractSpringDocTest { /** * The type Spring doc test app. diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/SpringDocApp213Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/SpringDocApp213Test.java index d3ffa5b1f..89af14b8c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/SpringDocApp213Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app213/SpringDocApp213Test.java @@ -19,7 +19,7 @@ package test.org.springdoc.api.v31.app213; import org.springdoc.core.customizers.SpecPropertiesCustomizer; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; @@ -31,7 +31,7 @@ */ @SpringBootTest @ActiveProfiles("213") -public class SpringDocApp213Test extends AbstractSpringDocV31Test { +public class SpringDocApp213Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/SpringDocApp216Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/SpringDocApp216Test.java index 7082d1b6a..5298bb3c0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/SpringDocApp216Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app216/SpringDocApp216Test.java @@ -19,7 +19,7 @@ package test.org.springdoc.api.v31.app216; import org.springdoc.core.customizers.SpecPropertiesCustomizer; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; @@ -29,7 +29,7 @@ * A test for {@link SpecPropertiesCustomizer} */ @SpringBootTest -public class SpringDocApp216Test extends AbstractSpringDocV31Test { +public class SpringDocApp216Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/SpringDocApp217Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/SpringDocApp217Test.java index 556e405ab..31335635f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/SpringDocApp217Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app217/SpringDocApp217Test.java @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.customizers.SpecPropertiesCustomizer; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; @@ -39,7 +39,7 @@ */ @SpringBootTest @ActiveProfiles("217") -public class SpringDocApp217Test extends AbstractSpringDocV31Test { +public class SpringDocApp217Test extends AbstractSpringDocTest { @Test diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/SpringDocApp218Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/SpringDocApp218Test.java index 1613acc45..077a4cc85 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/SpringDocApp218Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app218/SpringDocApp218Test.java @@ -19,7 +19,7 @@ package test.org.springdoc.api.v31.app218; import org.springdoc.core.customizers.SpecPropertiesCustomizer; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; @@ -29,7 +29,7 @@ * A test for {@link SpecPropertiesCustomizer} */ @SpringBootTest -public class SpringDocApp218Test extends AbstractSpringDocV31Test { +public class SpringDocApp218Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/SpringDocApp219Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/SpringDocApp219Test.java index d88c0d2e5..9b1798335 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/SpringDocApp219Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app219/SpringDocApp219Test.java @@ -24,13 +24,13 @@ package test.org.springdoc.api.v31.app219; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.ActiveProfiles; @ActiveProfiles("219") -public class SpringDocApp219Test extends AbstractSpringDocV31Test { +public class SpringDocApp219Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java index 378843370..d6a25493e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app22; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp22Test extends AbstractSpringDocV31Test { +public class SpringDocApp22Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/SpringDocApp220Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/SpringDocApp220Test.java index 4269e21fe..7cd56061d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/SpringDocApp220Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app220/SpringDocApp220Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app220; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp220Test extends AbstractSpringDocV31Test { +public class SpringDocApp220Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/SpringDocApp221Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/SpringDocApp221Test.java index 0f52c106f..28eaee9d5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/SpringDocApp221Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app221/SpringDocApp221Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app221; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp221Test extends AbstractSpringDocV31Test { +public class SpringDocApp221Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/SpringDocApp222Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/SpringDocApp222Test.java index eaac7c8bd..ffa9bb163 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/SpringDocApp222Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app222/SpringDocApp222Test.java @@ -28,11 +28,11 @@ import com.fasterxml.jackson.annotation.JsonSubTypes.Type; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp222Test extends AbstractSpringDocV31Test { +public class SpringDocApp222Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/SpringDocApp223Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/SpringDocApp223Test.java index ce7271e27..7e7580ad9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/SpringDocApp223Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app223/SpringDocApp223Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app223; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp223Test extends AbstractSpringDocV31Test { +public class SpringDocApp223Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/SpringDocApp224Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/SpringDocApp224Test.java index 91f027489..da2f5ab13 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/SpringDocApp224Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/SpringDocApp224Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app224; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp224Test extends AbstractSpringDocV31Test { +public class SpringDocApp224Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/SpringDocApp225Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/SpringDocApp225Test.java index 6aaa0635a..600f9484b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/SpringDocApp225Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app225/SpringDocApp225Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app225; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp225Test extends AbstractSpringDocV31Test { +public class SpringDocApp225Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/SpringDocApp226Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/SpringDocApp226Test.java index d74b4634e..a260efdf9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/SpringDocApp226Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app226/SpringDocApp226Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app226; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp226Test extends AbstractSpringDocV31Test { +public class SpringDocApp226Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/SpringDocApp227Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/SpringDocApp227Test.java index f57c2fa38..13bbf1f87 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/SpringDocApp227Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app227/SpringDocApp227Test.java @@ -18,11 +18,11 @@ package test.org.springdoc.api.v31.app227; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp227Test extends AbstractSpringDocV31Test { +public class SpringDocApp227Test extends AbstractSpringDocTest { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/SpringDocApp228Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/SpringDocApp228Test.java index 2abf63e2d..9c4ca8b4a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/SpringDocApp228Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app228/SpringDocApp228Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app228; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp228Test extends AbstractSpringDocV31Test { +public class SpringDocApp228Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/SpringDocApp229Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/SpringDocApp229Test.java index 097ad4076..45ee13cfc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/SpringDocApp229Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app229/SpringDocApp229Test.java @@ -26,11 +26,11 @@ package test.org.springdoc.api.v31.app229; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp229Test extends AbstractSpringDocV31Test { +public class SpringDocApp229Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java index b029a1994..87a11bf47 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app23; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp23Test extends AbstractSpringDocV31Test { +public class SpringDocApp23Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/SpringDocApp230Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/SpringDocApp230Test.java index 48deb80f5..24bb726e8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/SpringDocApp230Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app230/SpringDocApp230Test.java @@ -26,14 +26,14 @@ package test.org.springdoc.api.v31.app230; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @author edudar */ -public class SpringDocApp230Test extends AbstractSpringDocV31Test { +public class SpringDocApp230Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SpringDocApp231Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SpringDocApp231Test.java index d0f478d9b..bd968441b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SpringDocApp231Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app231/SpringDocApp231Test.java @@ -26,14 +26,14 @@ package test.org.springdoc.api.v31.app231; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @author bnasslahsen */ -public class SpringDocApp231Test extends AbstractSpringDocV31Test { +public class SpringDocApp231Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/SpringDocApp232Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/SpringDocApp232Test.java index e72a9f3ae..8b224cde2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/SpringDocApp232Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app232/SpringDocApp232Test.java @@ -27,7 +27,7 @@ package test.org.springdoc.api.v31.app232; import org.springdoc.core.customizers.OperationCustomizer; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @@ -35,7 +35,7 @@ /** * @author bnasslahsen */ -public class SpringDocApp232Test extends AbstractSpringDocV31Test { +public class SpringDocApp232Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java index b1644f6d0..1636f52a4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java @@ -39,7 +39,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.web.servlet.MvcResult; @@ -54,7 +54,7 @@ /** * @author bnasslahsen, michael.clarke */ -class SpringDocApp233Test extends AbstractSpringDocV31Test { +class SpringDocApp233Test extends AbstractSpringDocTest { @CsvSource({"requiredNotNullParameterObject.requiredNotNullField, true", "requiredNotNullParameterObject.requiredNoValidationField, true", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/SpringDocApp234Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/SpringDocApp234Test.java index 7790c7a0e..e5c00df48 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/SpringDocApp234Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app234/SpringDocApp234Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app234; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp234Test extends AbstractSpringDocV31Test { +public class SpringDocApp234Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/SpringDocApp235Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/SpringDocApp235Test.java index 0e89e9469..ca319c40f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/SpringDocApp235Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app235/SpringDocApp235Test.java @@ -26,11 +26,11 @@ package test.org.springdoc.api.v31.app235; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp235Test extends AbstractSpringDocV31Test { +public class SpringDocApp235Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/SpringDocApp236Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/SpringDocApp236Test.java index a1ed6d0e3..7266e0f04 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/SpringDocApp236Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app236/SpringDocApp236Test.java @@ -26,11 +26,11 @@ package test.org.springdoc.api.v31.app236; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp236Test extends AbstractSpringDocV31Test { +public class SpringDocApp236Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java index 86cc7a42f..2475d2856 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java @@ -24,9 +24,9 @@ package test.org.springdoc.api.v31.app24; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; -public class SpringDocApp24Test extends AbstractSpringDocV31Test { +public class SpringDocApp24Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java index 0f6206665..c17d2ea9c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app25; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp25Test extends AbstractSpringDocV31Test { +public class SpringDocApp25Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java index cf44ab1a9..70bc0053e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app26; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp26Test extends AbstractSpringDocV31Test { +public class SpringDocApp26Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java index d45525ff0..ce1419da0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -36,7 +36,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public class SpringDocApp27Test extends AbstractSpringDocV31Test { +public class SpringDocApp27Test extends AbstractSpringDocTest { @Test protected void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java index 5f0838323..2f5b9feda 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app28; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp28Test extends AbstractSpringDocV31Test { +public class SpringDocApp28Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java index 158519a89..dbf4d0d6b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app29; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp29Test extends AbstractSpringDocV31Test { +public class SpringDocApp29Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java index 6190ed802..7822a66ce 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app30; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp30Test extends AbstractSpringDocV31Test { +public class SpringDocApp30Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java index a34f35e18..8ef855f8b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app31; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp31Test extends AbstractSpringDocV31Test { +public class SpringDocApp31Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java index b452bfcba..8c9843653 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app32; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp32Test extends AbstractSpringDocV31Test { +public class SpringDocApp32Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java index f1adc727b..faf667c9a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app33; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp33Test extends AbstractSpringDocV31Test { +public class SpringDocApp33Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java index 2683450cf..e87b88992 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app34; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp34Test extends AbstractSpringDocV31Test { +public class SpringDocApp34Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java index 220cad3e4..5b69dd104 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java @@ -24,13 +24,13 @@ package test.org.springdoc.api.v31.app35; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import static org.springdoc.core.utils.SpringDocUtils.getConfig; -public class SpringDocApp35Test extends AbstractSpringDocV31Test { +public class SpringDocApp35Test extends AbstractSpringDocTest { static { getConfig().addRestControllers(HelloController.class); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java index 6940d6550..2197587cf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app37; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp37Test extends AbstractSpringDocV31Test { +public class SpringDocApp37Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java index 53eb32da4..255e0ad51 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app38; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp38Test extends AbstractSpringDocV31Test { +public class SpringDocApp38Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java index bbf9cb18c..c01e13c0f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java @@ -24,9 +24,9 @@ package test.org.springdoc.api.v31.app39; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; -public class SpringDocApp39Test extends AbstractSpringDocV31Test { +public class SpringDocApp39Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java index 4524da731..e084d3af8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java @@ -26,13 +26,13 @@ import io.swagger.v3.core.jackson.TypeNameResolver; import org.junit.jupiter.api.AfterAll; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.use-fqn=true") -public class SpringDocApp4Test extends AbstractSpringDocV31Test { +public class SpringDocApp4Test extends AbstractSpringDocTest { @AfterAll static void restore() { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java index 574cf12ae..1771729a7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app40; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp40Test extends AbstractSpringDocV31Test { +public class SpringDocApp40Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java index 5ab88f36e..57fd432c5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.web.servlet.MvcResult; @@ -41,7 +41,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public class SpringDocApp411Test extends AbstractSpringDocV31Test { +public class SpringDocApp411Test extends AbstractSpringDocTest { @Test protected void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java index 92c71fedc..4225e1f6f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -43,7 +43,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @TestPropertySource(properties = "springdoc.cache.disabled=true") -public class SpringDocApp41Test extends AbstractSpringDocV31Test { +public class SpringDocApp41Test extends AbstractSpringDocTest { @Test protected void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java index a22993b25..463734fb5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java @@ -27,12 +27,12 @@ import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.StringSchema; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -public class SpringDocApp42Test extends AbstractSpringDocV31Test { +public class SpringDocApp42Test extends AbstractSpringDocTest { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java index d263624ec..26efbbf47 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app43; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp43Test extends AbstractSpringDocV31Test { +public class SpringDocApp43Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java index 806597b82..caf251b63 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -36,7 +36,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public class SpringDocApp44Test extends AbstractSpringDocV31Test { +public class SpringDocApp44Test extends AbstractSpringDocTest { @Test public void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java index 244f337d2..714bb040e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app45; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp45Test extends AbstractSpringDocV31Test { +public class SpringDocApp45Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java index 5a7595e2f..03ff032cc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app46; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp46Test extends AbstractSpringDocV31Test { +public class SpringDocApp46Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java index ff4f11ec7..f1617be93 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app47; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp47Test extends AbstractSpringDocV31Test { +public class SpringDocApp47Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java index 49fb83e85..678f6efa7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app48; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp48Test extends AbstractSpringDocV31Test { +public class SpringDocApp48Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java index f0ccb5f87..73d5c6db4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java @@ -24,9 +24,9 @@ package test.org.springdoc.api.v31.app49; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; -public class SpringDocApp49Test extends AbstractSpringDocV31Test { +public class SpringDocApp49Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java index 166fa1974..dfb2f26e3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java @@ -3,7 +3,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.customizers.RouterOperationCustomizer; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @@ -16,7 +16,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -class SpringDocApp5Test extends AbstractSpringDocV31Test { +class SpringDocApp5Test extends AbstractSpringDocTest { @Test void testAddRouterOperationCustomizerBean() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java index cbfe6386d..5806b235f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java @@ -24,9 +24,9 @@ package test.org.springdoc.api.v31.app50; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; -public class SpringDocApp50Test extends AbstractSpringDocV31Test { +public class SpringDocApp50Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java index 63a94b2ae..0d768df4f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app51; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp51Test extends AbstractSpringDocV31Test { +public class SpringDocApp51Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java index 9d363ec42..8831e9bcd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app52; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp52Test extends AbstractSpringDocV31Test { +public class SpringDocApp52Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java index c482f7efb..6185f2a25 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app53; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp53Test extends AbstractSpringDocV31Test { +public class SpringDocApp53Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java index 4d52e5a9a..aae9a1e67 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app54; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp54Test extends AbstractSpringDocV31Test { +public class SpringDocApp54Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java index 995e5e975..9debd320d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app55; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp55Test extends AbstractSpringDocV31Test { +public class SpringDocApp55Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java index 0f0d4b4ad..6712f24c4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app56; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp56Test extends AbstractSpringDocV31Test { +public class SpringDocApp56Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java index 102bb08b9..29aaced64 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app57; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp57Test extends AbstractSpringDocV31Test { +public class SpringDocApp57Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java index d396b1590..c05748a14 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app58; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp58Test extends AbstractSpringDocV31Test { +public class SpringDocApp58Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java index 11a838af5..612e61504 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app59; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp59Test extends AbstractSpringDocV31Test { +public class SpringDocApp59Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java index a334374b3..01b7906b9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app6; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp6Test extends AbstractSpringDocV31Test { +public class SpringDocApp6Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java index 45c8365a6..2f4ffaffd 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app60; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp60Test extends AbstractSpringDocV31Test { +public class SpringDocApp60Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java index 2f1feeff3..0d633f3a5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app61; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp61Test extends AbstractSpringDocV31Test { +public class SpringDocApp61Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java index 34d2dd007..ce529cecb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app62; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp62Test extends AbstractSpringDocV31Test { +public class SpringDocApp62Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java index 1f40a7c40..ce18e4a06 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java @@ -24,7 +24,7 @@ package test.org.springdoc.api.v31.app63; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -33,7 +33,7 @@ @TestPropertySource(properties = { "springdoc.packagesToScan=hell,hello1, hello.me", "springdoc.packagesToExclude=test.org.springdoc.api.app63.65" }) -public class SpringDocApp63Test extends AbstractSpringDocV31Test { +public class SpringDocApp63Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java index 8646ab74a..10f51cd93 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java @@ -24,13 +24,13 @@ package test.org.springdoc.api.v31.app64; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.paths-to-match=/v1, /api/**") -public class SpringDocApp64Test extends AbstractSpringDocV31Test { +public class SpringDocApp64Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java index 1e712e6b9..3421d9a62 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app65; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp65Test extends AbstractSpringDocV31Test { +public class SpringDocApp65Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java index 247d3f71f..45eda738d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app66; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp66Test extends AbstractSpringDocV31Test { +public class SpringDocApp66Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java index a3f287387..83644b486 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app67; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp67Test extends AbstractSpringDocV31Test { +public class SpringDocApp67Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java index b91110de9..dab360b27 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app69; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp69Test extends AbstractSpringDocV31Test { +public class SpringDocApp69Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java index 22d05ba05..c0016bf8d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app7; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp7Test extends AbstractSpringDocV31Test { +public class SpringDocApp7Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java index b8c67fd30..d8eb61abb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app70; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp70Test extends AbstractSpringDocV31Test { +public class SpringDocApp70Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java index bf0126c5f..4f1ff9e95 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app71; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp71Test extends AbstractSpringDocV31Test { +public class SpringDocApp71Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java index 5dedb91e1..f95961aaf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app73; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp73Test extends AbstractSpringDocV31Test { +public class SpringDocApp73Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java index 596d5ff8d..2f1b9835a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app74; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp74Test extends AbstractSpringDocV31Test { +public class SpringDocApp74Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java index ad236b208..802d2cdc3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app75; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp75Test extends AbstractSpringDocV31Test { +public class SpringDocApp75Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java index 087424658..d63d70bc9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java @@ -30,12 +30,12 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -public class SpringDocApp76Test extends AbstractSpringDocV31Test { +public class SpringDocApp76Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java index 4f0da18f1..9cc234dd6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app77; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp77Test extends AbstractSpringDocV31Test { +public class SpringDocApp77Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java index be455c17c..95fd647b4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app78; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp78Test extends AbstractSpringDocV31Test { +public class SpringDocApp78Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java index 358b6ddf3..33406a06d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java @@ -24,12 +24,12 @@ package test.org.springdoc.api.v31.app79; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp79Test extends AbstractSpringDocV31Test { +public class SpringDocApp79Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java index 5864b1d8c..c35e6a856 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java @@ -22,11 +22,11 @@ package test.org.springdoc.api.v31.app8; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp8Test extends AbstractSpringDocV31Test { +public class SpringDocApp8Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java index 8cb0c2a04..a6e57cd21 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java @@ -24,13 +24,13 @@ package test.org.springdoc.api.v31.app80; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.ActiveProfiles; @ActiveProfiles("80") -public class SpringDocApp80Test extends AbstractSpringDocV31Test { +public class SpringDocApp80Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java index 6d6e86d0f..fcfa5af68 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -37,7 +37,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public class SpringDocApp81Test extends AbstractSpringDocV31Test { +public class SpringDocApp81Test extends AbstractSpringDocTest { @Test protected void testApp() throws Exception { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java index f37ee6793..8acc948d9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app82; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp82Test extends AbstractSpringDocV31Test { +public class SpringDocApp82Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java index 1092d262c..a458d41ac 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app83; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp83Test extends AbstractSpringDocV31Test { +public class SpringDocApp83Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java index 378619bc3..5492dd0d5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app84; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp84Test extends AbstractSpringDocV31Test { +public class SpringDocApp84Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java index 5fea0fe0c..316be129b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app85; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp85Test extends AbstractSpringDocV31Test { +public class SpringDocApp85Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java index 7d959e496..09a8b31d9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java @@ -24,7 +24,7 @@ package test.org.springdoc.api.v31.app86; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -32,7 +32,7 @@ @TestPropertySource(properties = { "springdoc.packagesToScan=test.org.springdoc.api.v31.app86", "springdoc.packagesToExclude=test.org.springdoc.api.v31.app86.test" }) -public class SpringDocApp86Test extends AbstractSpringDocV31Test { +public class SpringDocApp86Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java index 305875fab..90532b8ef 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java @@ -24,11 +24,11 @@ package test.org.springdoc.api.v31.app87; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp87Test extends AbstractSpringDocV31Test { +public class SpringDocApp87Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java index b6e44b556..3f64cdbeb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java @@ -24,13 +24,13 @@ package test.org.springdoc.api.v31.app88; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.auto-tag-classes=false") -public class SpringDocApp88Test extends AbstractSpringDocV31Test { +public class SpringDocApp88Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java index c89cfb36e..5d371964a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java @@ -26,7 +26,7 @@ import io.swagger.v3.oas.models.media.ObjectSchema; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @@ -35,7 +35,7 @@ import static org.springdoc.core.utils.SpringDocUtils.getConfig; @TestPropertySource(properties = "springdoc.model-and-view-allowed=true") -public class SpringDocApp89Test extends AbstractSpringDocV31Test { +public class SpringDocApp89Test extends AbstractSpringDocTest { static { getConfig().replaceWithSchema(ModelAndView.class, new ObjectSchema()); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java index 737b8aa3a..8eca5dc7a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java @@ -22,13 +22,13 @@ package test.org.springdoc.api.v31.app9; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.remove-broken-reference-definitions=false") -public class SpringDocApp9Test extends AbstractSpringDocV31Test { +public class SpringDocApp9Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java index 4cd61de46..4601c8d00 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java @@ -25,8 +25,8 @@ package test.org.springdoc.api.v31.app90; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; -public class SpringDocApp90Test extends AbstractSpringDocV31Test { +public class SpringDocApp90Test extends AbstractSpringDocTest { } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java index bba9b1674..78e550d68 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java @@ -25,13 +25,13 @@ package test.org.springdoc.api.v31.app91; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = "springdoc.override-with-generic-response=false") -public class SpringDocApp91Test extends AbstractSpringDocV31Test { +public class SpringDocApp91Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java index bf2c4fa88..ffbe38057 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java @@ -25,11 +25,11 @@ package test.org.springdoc.api.v31.app92; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp92Test extends AbstractSpringDocV31Test { +public class SpringDocApp92Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java index 135a61f4e..322381d80 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java @@ -25,11 +25,11 @@ package test.org.springdoc.api.v31.app93; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp93Test extends AbstractSpringDocV31Test { +public class SpringDocApp93Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java index 01677475b..9da963a94 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java @@ -40,7 +40,7 @@ import org.springdoc.core.service.OpenAPIService; import org.springdoc.core.service.OperationService; import org.springdoc.webmvc.api.OpenApiWebMvcResource; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import test.org.springdoc.api.v31.app91.Greeting; import org.springframework.beans.BeansException; @@ -62,7 +62,7 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; @TestPropertySource(properties = "springdoc.default-produces-media-type=application/json") -public class SpringDocApp94Test extends AbstractSpringDocV31Test { +public class SpringDocApp94Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp implements ApplicationContextAware { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java index 542c13970..20305eb2b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java @@ -25,13 +25,13 @@ package test.org.springdoc.api.v31.app95; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.ActiveProfiles; @ActiveProfiles("95") -public class SpringDocApp95Test extends AbstractSpringDocV31Test { +public class SpringDocApp95Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java index 920025d73..496407c1b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java @@ -25,11 +25,11 @@ package test.org.springdoc.api.v31.app96; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp96Test extends AbstractSpringDocV31Test { +public class SpringDocApp96Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java index 5b697407e..ab024ee98 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java @@ -25,11 +25,11 @@ package test.org.springdoc.api.v31.app97; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp97Test extends AbstractSpringDocV31Test { +public class SpringDocApp97Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java index c01a3567b..2fe0748b5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java @@ -26,11 +26,11 @@ import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; -public class SpringDocApp98Test extends AbstractSpringDocV31Test { +public class SpringDocApp98Test extends AbstractSpringDocTest { static { SpringDocUtils.getConfig().addAnnotationsToIgnore(IgnoredAnnotationParameter.class); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java index 0fb89eb58..581da4173 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java @@ -25,13 +25,13 @@ package test.org.springdoc.api.v31.app99; -import test.org.springdoc.api.v31.AbstractSpringDocV31Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.ActiveProfiles; @ActiveProfiles("99") -public class SpringDocApp99Test extends AbstractSpringDocV31Test { +public class SpringDocApp99Test extends AbstractSpringDocTest { @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/application-217.yml b/springdoc-openapi-starter-webmvc-api/src/test/resources/application-217.yml index 169c3e06c..eb7a49fd5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/application-217.yml +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/application-217.yml @@ -4,6 +4,7 @@ springdoc: display-name: Example Interfaces packages-to-scan: - test.org.springdoc.api.v30.app217 + - test.org.springdoc.api.v31.app217 open-api: info: title: Example Interfaces @@ -24,6 +25,7 @@ springdoc: display-name: User Interfaces packages-to-scan: - test.org.springdoc.api.v30.app217 + - test.org.springdoc.api.v31.app217 open-api: info: title: User Interfaces diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json index 72ec88a1f..27d5cdfab 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app1.json @@ -87,6 +87,10 @@ "content": { "application/x-www-form-urlencoded": { "schema": { + "required": [ + "firstName", + "lastName" + ], "type": "object", "properties": { "firstName": { @@ -97,11 +101,7 @@ "type": "string", "description": "Last Name" } - }, - "required": [ - "firstName", - "lastName" - ] + } } } } @@ -210,9 +210,9 @@ "in": "query", "required": true, "schema": { - "type": "string", "maxLength": 6, - "minLength": 4 + "minLength": 4, + "type": "string" } }, { @@ -220,10 +220,10 @@ "in": "query", "required": true, "schema": { - "type": "integer", - "format": "int32", "maximum": 6, - "minimum": 4 + "minimum": 4, + "type": "integer", + "format": "int32" } }, { @@ -231,6 +231,7 @@ "in": "query", "required": false, "schema": { + "type": "string", "format": "date-time", "example": "1970-01-01T00:00:00.000Z" } @@ -242,7 +243,9 @@ "explode": false, "schema": { "type": "array", - "items": {} + "items": { + "type": "string" + } } } ], @@ -337,9 +340,9 @@ "description": "number of records to skip for pagination", "required": true, "schema": { + "minimum": 0, "type": "integer", - "format": "int32", - "minimum": 0 + "format": "int32" } }, { @@ -348,10 +351,10 @@ "description": "maximum number of records to return", "required": true, "schema": { - "type": "integer", - "format": "int32", "maximum": 50, - "minimum": 0 + "minimum": 0, + "type": "integer", + "format": "int32" } } ], @@ -564,6 +567,12 @@ } }, "InventoryItem": { + "required": [ + "id", + "manufacturer", + "name", + "releaseDate" + ], "type": "object", "properties": { "id": { @@ -582,15 +591,12 @@ "manufacturer": { "$ref": "#/components/schemas/Manufacturer" } - }, - "required": [ - "id", - "manufacturer", - "name", - "releaseDate" - ] + } }, "Manufacturer": { + "required": [ + "name" + ], "type": "object", "properties": { "name": { @@ -605,10 +611,7 @@ "type": "string", "example": "408-867-5309" } - }, - "required": [ - "name" - ] + } }, "ItemDTO": { "type": "object", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app10.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app10.json index c20537fa9..849627a53 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app10.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app10.json @@ -46,7 +46,5 @@ } } }, - "components": { - - } -} \ No newline at end of file + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app101.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app101.json index eea1fe64e..e2a1e07eb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app101.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app101.json @@ -1 +1,50 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello":{"get":{"tags":["hello-controller"],"operationId":"hello","responses":{"default":{"description":"default response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/HelloDTO","description":"${test.app101.operation.hello.response.schema.description}"}}}}}}}},"components":{"schemas":{"HelloDTO":{"type":"object","description":"Description of schema of hello entity","properties":{"id":{"type":"string","description":"Description of schema of param id for api hello"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "default": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloDTO", + "description": "${test.app101.operation.hello.response.schema.description}" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloDTO": { + "type": "object", + "description": "Description of schema of hello entity", + "properties": { + "id": { + "type": "string", + "description": "Description of schema of param id for api hello" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-1.json index fcc8b3feb..fd9d09128 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-1.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-1.json @@ -23,53 +23,6 @@ } ], "paths": { - "/store/order": { - "post": { - "tags": [ - "store" - ], - "summary": "Place an order for a pet", - "operationId": "placeOrder", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Order" - } - } - }, - "required": true - }, - "responses": { - "400": { - "description": "Invalid Order", - "content": { - "*/*": { - "schema": { - "type": "object", - "additionalProperties": {} - } - } - } - }, - "200": { - "description": "successful operation", - "content": { - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Order" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/Order" - } - } - } - } - } - } - }, "/store/order/{orderId}": { "get": { "tags": [ @@ -84,10 +37,10 @@ "description": "ID of pet that needs to be fetched", "required": true, "schema": { - "type": "integer", - "format": "int64", "maximum": 5, - "minimum": 1 + "minimum": 1, + "type": "integer", + "format": "int64" } } ], @@ -98,13 +51,15 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } }, - "404": { - "description": "Order not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -118,8 +73,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "Order not found", "content": { "application/xml": { "schema": { @@ -159,7 +114,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -170,6 +127,55 @@ } } }, + "/store/order": { + "post": { + "tags": [ + "store" + ], + "summary": "Place an order for a pet", + "operationId": "placeOrder", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid Order", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + } + } + } + }, "/store/inventory": { "get": { "tags": [ @@ -185,7 +191,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -196,7 +204,9 @@ "application/json": { "schema": { "type": "array", - "items": {} + "items": { + "type": "string" + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-2.json index e386419da..13b1cee9f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-2.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-2.json @@ -23,6 +23,126 @@ } ], "paths": { + "/user/createWithList": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "operationId": "createUsersWithListInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/createWithArray": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "operationId": "createUsersWithArrayInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user": { + "post": { + "tags": [ + "user" + ], + "summary": "Create user", + "operationId": "createUser", + "requestBody": { + "description": "Created user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, "/user/{username}": { "get": { "tags": [ @@ -48,7 +168,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -120,7 +242,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -153,121 +277,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} - } - } - } - }, - "200": { - "description": "successful operation" - } - } - } - }, - "/user": { - "post": { - "tags": [ - "user" - ], - "summary": "Create user", - "operationId": "createUser", - "requestBody": { - "description": "Created user object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - }, - "required": true - }, - "responses": { - "400": { - "description": "Bad Request", - "content": { - "*/*": { - "schema": { - "type": "object", - "additionalProperties": {} - } - } - } - }, - "200": { - "description": "successful operation" - } - } - } - }, - "/user/createWithList": { - "post": { - "tags": [ - "user" - ], - "summary": "Creates list of users with given input array", - "operationId": "createUsersWithListInput", - "requestBody": { - "description": "List of user object", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/User" - } - } - } - }, - "required": true - }, - "responses": { - "400": { - "description": "Bad Request", - "content": { - "*/*": { - "schema": { - "type": "object", - "additionalProperties": {} - } - } - } - }, - "200": { - "description": "successful operation" - } - } - } - }, - "/user/createWithArray": { - "post": { - "tags": [ - "user" - ], - "summary": "Creates list of users with given input array", - "operationId": "createUsersWithArrayInput", - "requestBody": { - "description": "List of user object", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/User" - } - } - } - }, - "required": true - }, - "responses": { - "400": { - "description": "Bad Request", - "content": { - "*/*": { - "schema": { - "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -292,7 +304,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -337,7 +351,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -390,8 +406,8 @@ }, "userStatus": { "type": "integer", - "format": "int32", - "description": "User Status" + "description": "User Status", + "format": "int32" } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-3.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-3.json index 12f49ef26..661ff52b7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-3.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-3.json @@ -53,7 +53,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -103,7 +105,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -149,13 +153,15 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } }, - "404": { - "description": "Pet not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -169,8 +175,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "Pet not found", "content": { "application/xml": { "schema": { @@ -235,7 +241,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -286,7 +294,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -337,17 +347,17 @@ "content": { "multipart/form-data": { "schema": { + "required": [ + "file" + ], "type": "object", "properties": { "file": { "type": "string", - "format": "binary", - "description": "file detail" + "description": "file detail", + "format": "binary" } - }, - "required": [ - "file" - ] + } } } } @@ -359,7 +369,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -414,7 +426,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -480,7 +494,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -533,6 +549,10 @@ } }, "Pet": { + "required": [ + "name", + "photoUrls" + ], "type": "object", "properties": { "id": { @@ -567,11 +587,7 @@ "sold" ] } - }, - "required": [ - "name", - "photoUrls" - ] + } }, "Tag": { "type": "object", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json index 71f333acb..f393a5154 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json @@ -46,7 +46,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app106.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app106.json index 58a416c8c..4caa60636 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app106.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app106.json @@ -25,6 +25,7 @@ "description": "DateTime", "required": false, "schema": { + "type": "string", "format": "date-time" }, "example": "2020-01-01T00:00:00.000Z" diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app108.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app108.json index c6640eaaf..e25da4126 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app108.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app108.json @@ -1 +1,72 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/":{"post":{"tags":["hello-controller"],"operationId":"update","parameters":[{"name":"toto","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ActionResultVoid"}}}}}}}},"components":{"schemas":{"ActionResultVoid":{"type":"object","properties":{"value":{"type":"object"},"success":{"type":"boolean"},"errorCode":{"type":"string"},"message":{"type":"string"},"errorValue":{},"targetUrl":{"type":"string"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "update", + "parameters": [ + { + "name": "toto", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ActionResultVoid" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ActionResultVoid": { + "type": "object", + "properties": { + "value": { + "type": "object" + }, + "success": { + "type": "boolean" + }, + "errorCode": { + "type": "string" + }, + "message": { + "type": "string" + }, + "errorValue": { + "type": "object" + }, + "targetUrl": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app109.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app109.json index bcc81417a..f54c1edb9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app109.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app109.json @@ -1 +1,58 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/api/v1/resource":{"get":{"tags":["hello-controller"],"operationId":"getResource","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v1/bytearray":{"get":{"tags":["hello-controller"],"operationId":"getByteArray","responses":{"default":{"description":"default response","content":{"*/*":{"schema":{"format":"binary"}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/v1/resource": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getResource", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/api/v1/bytearray": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getByteArray", + "responses": { + "default": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app115.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app115.json index 79dea40bf..f3685cb97 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app115.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app115.json @@ -23,7 +23,7 @@ "content": { "application/json": { "schema": { - "type": "object", + "type": "string", "properties": {} } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app118.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app118.json index 1592778dc..297312880 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app118.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app118.json @@ -1 +1,223 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/class-hierarchy/concrete-parent":{"post":{"tags":["controller"],"operationId":"concreteParent","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ConcreteParent"},{"$ref":"#/components/schemas/ChildOfConcrete1"},{"$ref":"#/components/schemas/ChildOfConcrete2"}]}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}},"/class-hierarchy/abstract-parent":{"post":{"tags":["controller"],"operationId":"abstractParent","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ChildOfAbstract1"},{"$ref":"#/components/schemas/ChildOfAbstract2"}]}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}},"components":{"schemas":{"ChildOfConcrete1":{"allOf":[{"$ref":"#/components/schemas/ConcreteParent"},{"type":"object","properties":{"concreteChild1Param":{"type":"string"}}}]},"ChildOfConcrete2":{"allOf":[{"$ref":"#/components/schemas/ConcreteParent"},{"type":"object","properties":{"concreteChild2Param":{"type":"string"}}}]},"ConcreteParent":{"type":"object","discriminator":{"propertyName":"type"},"properties":{"id":{"type":"integer","format":"int32"},"type":{"type":"string"}},"required":["type"]},"AbstractParent":{"type":"object","discriminator":{"propertyName":"type"},"properties":{"id":{"type":"integer","format":"int32"},"type":{"type":"string"}},"required":["type"]},"ChildOfAbstract1":{"allOf":[{"$ref":"#/components/schemas/AbstractParent"},{"type":"object","properties":{"abstrachChild1Param":{"type":"string"}}}]},"ChildOfAbstract2":{"allOf":[{"$ref":"#/components/schemas/AbstractParent"},{"type":"object","properties":{"abstractChild2Param":{"type":"string"}}}]},"Response":{"type":"object","properties":{"abstractParent":{"oneOf":[{"$ref":"#/components/schemas/ChildOfAbstract1"},{"$ref":"#/components/schemas/ChildOfAbstract2"}]},"concreteParents":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/ConcreteParent"},{"$ref":"#/components/schemas/ChildOfConcrete1"},{"$ref":"#/components/schemas/ChildOfConcrete2"}]}}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/class-hierarchy/concrete-parent": { + "post": { + "tags": [ + "controller" + ], + "operationId": "concreteParent", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete1" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + }, + "/class-hierarchy/abstract-parent": { + "post": { + "tags": [ + "controller" + ], + "operationId": "abstractParent", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildOfAbstract1" + }, + { + "$ref": "#/components/schemas/ChildOfAbstract2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ChildOfConcrete1": { + "allOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "type": "object", + "properties": { + "concreteChild1Param": { + "type": "string" + } + } + } + ] + }, + "ChildOfConcrete2": { + "allOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "type": "object", + "properties": { + "concreteChild2Param": { + "type": "string" + } + } + } + ] + }, + "ConcreteParent": { + "type": "object", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + "AbstractParent": { + "type": "object", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + "ChildOfAbstract1": { + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "abstrachChild1Param": { + "type": "string" + } + } + } + ] + }, + "ChildOfAbstract2": { + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "abstractChild2Param": { + "type": "string" + } + } + } + ] + }, + "Response": { + "type": "object", + "properties": { + "abstractParent": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildOfAbstract1" + }, + { + "$ref": "#/components/schemas/ChildOfAbstract2" + } + ] + }, + "concreteParents": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete1" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete2" + } + ] + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app123.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app123.json index e0df022c4..092050ac2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app123.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app123.json @@ -37,22 +37,26 @@ } ], "responses": { - "404": { - "description": "Not here" - }, "502": { "description": "Bad Gateway", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } }, + "404": { + "description": "Not here" + }, "418": { "description": "I'm a teapot", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app124.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app124.json index c7b77c0d0..092050ac2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app124.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app124.json @@ -1 +1,68 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello/{numTelco}":{"get":{"tags":["hello-controller"],"summary":"GET Persons","operationId":"index","parameters":[{"name":"numTelco","in":"path","required":true,"schema":{"type":"string"}},{"name":"adresse","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not here"},"502":{"description":"Bad Gateway","content":{"*/*":{"schema":{}}}},"418":{"description":"I'm a teapot","content":{"*/*":{"schema":{}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello/{numTelco}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GET Persons", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "502": { + "description": "Bad Gateway", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not here" + }, + "418": { + "description": "I'm a teapot", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json index d330aab33..a20e02a5f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json @@ -58,17 +58,19 @@ }, "parameters": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } + }, + "status": { + "type": "integer", + "format": "int32" }, "title": { "type": "string" }, "detail": { "type": "string" - }, - "status": { - "type": "integer", - "format": "int32" } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app133.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app133.json index ef679bb99..41b2012aa 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app133.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app133.json @@ -11,19 +11,25 @@ } ], "paths": { - "/test3": { + "/test1": { "get": { "tags": [ "hello-controller" ], - "operationId": "getMessageFromHeader3", + "operationId": "getMessageFromHeader1", "parameters": [ { "name": "myHeader", "in": "header", "description": "A header", "required": true, - "schema": {} + "schema": { + "type": "string", + "enum": [ + "foo", + "bar" + ] + } } ], "responses": { @@ -52,7 +58,9 @@ "in": "header", "description": "A header", "required": true, - "schema": {} + "schema": { + "type": "integer" + } } ], "responses": { @@ -69,12 +77,12 @@ } } }, - "/test1": { + "/test3": { "get": { "tags": [ "hello-controller" ], - "operationId": "getMessageFromHeader1", + "operationId": "getMessageFromHeader3", "parameters": [ { "name": "myHeader", @@ -82,10 +90,7 @@ "description": "A header", "required": true, "schema": { - "enum": [ - "foo", - "bar" - ] + "type": "integer" } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app138.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app138.json index 29733ee9b..066691692 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app138.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app138.json @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/testA":{"get":{"operationId":"testA","parameters":[{"in":"query","name":"hello","required":true,"schema":{"type":["string"],"example":null}}],"responses":{"200":{"description":"OK"}},"tags":["hello-controller"]}},"/testB":{"get":{"operationId":"testB","parameters":[{"in":"query","name":"hello","required":true,"schema":{"type":["string"],"example":null}}],"responses":{"200":{"description":"OK"}},"tags":["hello-controller"]}}},"components":{},"x-my-vendor-extensions":{"property1":"value1","property2":null}} \ No newline at end of file +{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/testA":{"get":{"operationId":"testA","parameters":[{"in":"query","name":"hello","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}},"tags":["hello-controller"]}},"/testB":{"get":{"operationId":"testB","parameters":[{"in":"query","name":"hello","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}},"tags":["hello-controller"]}}},"components":{},"x-my-vendor-extensions":{"property1":"value1","property2":null}} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app143.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app143.json index 317ac46a4..394ce3f0d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app143.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app143.json @@ -1 +1,120 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"tags":[{"name":"Actuator","description":"Monitor and interact","externalDocs":{"description":"Spring Boot Actuator Web API Documentation","url":"https://docs.spring.io/spring-boot/docs/current/actuator-api/html/"}}],"paths":{"/actuator":{"get":{"tags":["Actuator"],"summary":"Actuator root web endpoint","operationId":"links","responses":{"200":{"description":"OK","content":{"application/vnd.spring-boot.actuator.v3+json":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Link"}}}},"application/vnd.spring-boot.actuator.v2+json":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Link"}}}},"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Link"}}}}}}}}},"/actuator/health":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'health'","operationId":"health","responses":{"200":{"description":"OK","content":{"application/vnd.spring-boot.actuator.v3+json":{"schema":{}},"application/vnd.spring-boot.actuator.v2+json":{"schema":{}},"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Link":{"type":"object","properties":{"href":{"type":"string"},"templated":{"type":"boolean"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/actuator": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + }, + "/actuator/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app150.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app150.json index f6cba6c41..87be08a80 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app150.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app150.json @@ -48,13 +48,13 @@ "required": false, "schema": { "type": "array", + "items": { + "type": "string" + }, "default": [ "users", "123" - ], - "items": { - "type": "string" - } + ] } } ], @@ -77,6 +77,7 @@ "in": "query", "required": true, "schema": { + "type": "boolean", "default": false } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app153.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app153.json index f2b2c06ae..fe556ae12 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app153.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app153.json @@ -1 +1,51 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/orders":{"get":{"tags":["test-controller"],"operationId":"method","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"finished","enum":["finished","new"]}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/orders": { + "get": { + "tags": [ + "test-controller" + ], + "operationId": "method", + "parameters": [ + { + "name": "state", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "finished", + "new" + ], + "default": "finished" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app154.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app154.json index bc0505787..c6e6cc6d5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app154.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app154.json @@ -1 +1,172 @@ -{"openapi":"3.1.0","info":{"title":"toto","version":"1.0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"security":[{"basicAuth":[]},{"bearerToken":[]}],"paths":{"/personsone":{"post":{"tags":["hello-controller"],"operationId":"createone","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/persons":{"post":{"tags":["hello-controller"],"operationId":"create","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/createtwo":{"post":{"tags":["hello-controller"],"operationId":"createtwo","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK"}}}},"/createthree":{"post":{"tags":["hello-controller"],"operationId":"createthree","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK"}}}},"/":{"get":{"tags":["hello-controller"],"operationId":"hello","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}}},"components":{"securitySchemes":{"bearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"basicAuth":{"type":"http","scheme":"basic"}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "toto", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "security": [ + { + "basicAuth": [] + }, + { + "bearerToken": [] + } + ], + "paths": { + "/personsone": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "createone", + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/persons": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "create", + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/createtwo": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "createtwo", + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/createthree": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "createthree", + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "bearerToken": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + }, + "basicAuth": { + "type": "http", + "scheme": "basic" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app155.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app155.json index 50d513314..1ec6f0b6a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app155.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app155.json @@ -90,6 +90,7 @@ "in": "query", "required": false, "schema": { + "type": "string", "enum": [ "ONE", "TWO" diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app156.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app156.json index 71cfa6b19..f95ffc308 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app156.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app156.json @@ -48,7 +48,9 @@ "name": "someText", "in": "query", "description": "Second decs", - "schema": {} + "schema": { + "type": "string" + } } ], "responses": { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app157.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app157.json index 2df4c0fd2..cf4bea57e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app157.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app157.json @@ -1,8 +1,8 @@ { "openapi": "3.1.0", "info": { - "title": "OpenAPI definition", - "version": "v0" + "title": "API Examples", + "version": "1.0" }, "servers": [ { @@ -10,40 +10,35 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "Operations" + } + ], "paths": { - "/foo": { + "/api/foo": { "get": { "tags": [ "hello-controller" ], - "operationId": "getFoo", + "operationId": "hello", "responses": { - "200": { - "description": "OK", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/Foo" + "$ref": "#/components/schemas/ErrorDTO" } } } - } - } - } - }, - "/bar": { - "get": { - "tags": [ - "hello-controller" - ], - "operationId": "getBar", - "responses": { + }, "200": { "description": "OK", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/Bar" + "$ref": "#/components/schemas/SimpleDTO" } } } @@ -54,21 +49,20 @@ }, "components": { "schemas": { - "Foo": { + "ErrorDTO": { "type": "object", "properties": { - "child": { + "message": { "type": "string" } - }, - "required": [ - "stringy" - ] + } }, - "Bar": { + "SimpleDTO": { "type": "object", "properties": { - "child": {} + "payload": { + "type": "string" + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app164.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app164.json index e747ff02b..9ffea82bc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app164.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app164.json @@ -52,7 +52,7 @@ "listBlah": { "type": "array", "items": { - "description": "${blahDescription.value}" + "description": "test" } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app168.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app168.json index d8126e7bb..dcf6f53d0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app168.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app168.json @@ -75,10 +75,10 @@ "components": { "schemas": { "ConcreteParent": { + "required": [ + "type" + ], "type": "object", - "discriminator": { - "propertyName": "type" - }, "properties": { "id": { "type": "integer", @@ -88,15 +88,15 @@ "type": "string" } }, - "required": [ - "type" - ] + "discriminator": { + "propertyName": "type" + } }, "AbstractParent": { + "required": [ + "type" + ], "type": "object", - "discriminator": { - "propertyName": "type" - }, "properties": { "id": { "type": "integer", @@ -106,9 +106,9 @@ "type": "string" } }, - "required": [ - "type" - ] + "discriminator": { + "propertyName": "type" + } }, "Response": { "type": "object", @@ -126,4 +126,4 @@ } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-1.json index 8594622ac..0b0365e20 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-1.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-1.json @@ -51,4 +51,4 @@ } }, "components": {} -} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-2.json index 659051922..99e914caa 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-2.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-2.json @@ -33,4 +33,4 @@ } }, "components": {} -} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-3.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-3.json index 0f76a96fc..f060a7a7c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-3.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app177-3.json @@ -69,4 +69,4 @@ } }, "components": {} -} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app180.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app180.json index bb6457b04..2596d5e9a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app180.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app180.json @@ -79,6 +79,7 @@ "Body": { "type": "object", "additionalProperties": { + "type": "object", "description": "Body", "example": { "key": "value" diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app182.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app182.json index c7b77c0d0..11b8af150 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app182.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app182.json @@ -1 +1,68 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello/{numTelco}":{"get":{"tags":["hello-controller"],"summary":"GET Persons","operationId":"index","parameters":[{"name":"numTelco","in":"path","required":true,"schema":{"type":"string"}},{"name":"adresse","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not here"},"502":{"description":"Bad Gateway","content":{"*/*":{"schema":{}}}},"418":{"description":"I'm a teapot","content":{"*/*":{"schema":{}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello/{numTelco}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GET Persons", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "502": { + "description": "Bad Gateway", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not here" + }, + "418": { + "description": "I'm a teapot", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app188.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app188.json index b7d58f899..600c11506 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app188.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app188.json @@ -1 +1,104 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test":{"get":{"tags":["hello-controller"],"operationId":"test","responses":{"200":{"description":"OK"},"5xx":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/example/{fooBar}":{"get":{"tags":["hello-controller"],"operationId":"getFooBar","parameters":[{"name":"fooBar","in":"path","required":true,"schema":{"type":"string","enum":["foo","bar"]}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}},"5xx":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"properties":{"timestamp":{"type":"string","format":"date-time","example":"2022-05-09T00:00:00Z"},"data":{"type":"object","additionalProperties":{"type":"object","example":{"param1":"val1","param2":"val2"}},"example":{"param1":"val1","param2":"val2"}}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK" + }, + "5xx": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/example/{fooBar}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getFooBar", + "parameters": [ + { + "name": "fooBar", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "foo", + "bar" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "5xx": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorResponse": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "example": "2022-05-09T00:00:00.000Z" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "example": { + "param1": "val1", + "param2": "val2" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193-1.json index 2e5ae2d85..85c860f06 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193-1.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app193-1.json @@ -1 +1,150 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test":{"get":{"tags":["basic-controller"],"summary":"get","description":"Provides a list of books.","operationId":"get","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Books"}]}}}}}}},"/test1":{"get":{"tags":["basic-controller"],"summary":"get1","description":"Provides an animal.","operationId":"get1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Cat"},{"$ref":"#/components/schemas/Dog"}]}}}}}}}},"components":{"schemas":{"Book":{"type":"object","description":"Represents a Book.","properties":{"title":{"type":"string"}}},"Books":{"allOf":[{"$ref":"#/components/schemas/Knowledge"},{"type":"object","properties":{"empty":{"type":"boolean"},"first":{"$ref":"#/components/schemas/Book"},"last":{"$ref":"#/components/schemas/Book"}}}],"description":"Represents a list of Books."},"Knowledge":{"type":"object","description":"Represents the knowledge."},"Animal":{"type":"object","description":"Represents an Animal class."},"Cat":{"allOf":[{"$ref":"#/components/schemas/Animal"},{"type":"object","properties":{"speed":{"type":"integer","format":"int32"}}}],"description":"Represents a Cat class."},"Dog":{"allOf":[{"$ref":"#/components/schemas/Animal"},{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer","format":"int32"}}}],"description":"Represents a Dog class."}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "basic-controller" + ], + "summary": "get", + "description": "Provides a list of books.", + "operationId": "get", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Books" + } + ] + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "basic-controller" + ], + "summary": "get1", + "description": "Provides an animal.", + "operationId": "get1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Cat" + }, + { + "$ref": "#/components/schemas/Dog" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "description": "Represents a Book.", + "properties": { + "title": { + "type": "string" + } + } + }, + "Books": { + "allOf": [ + { + "$ref": "#/components/schemas/Knowledge" + }, + { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "first": { + "$ref": "#/components/schemas/Book" + }, + "last": { + "$ref": "#/components/schemas/Book" + } + } + } + ], + "description": "Represents a list of Books." + }, + "Knowledge": { + "type": "object", + "description": "Represents the knowledge." + }, + "Animal": { + "type": "object", + "description": "Represents an Animal class." + }, + "Cat": { + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "speed": { + "type": "integer", + "format": "int32" + } + } + } + ], + "description": "Represents a Cat class." + }, + "Dog": { + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + } + } + ], + "description": "Represents a Dog class." + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app196.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app196.json index 979345088..a5ca0bd5a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app196.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app196.json @@ -102,13 +102,19 @@ "description": "OK", "content": { "application/vnd.spring-boot.actuator.v3+json": { - "schema": {} + "schema": { + "type": "object" + } }, "application/vnd.spring-boot.actuator.v2+json": { - "schema": {} + "schema": { + "type": "object" + } }, "application/json": { - "schema": {} + "schema": { + "type": "object" + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app197.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app197.json index e510d4be3..e16e5789c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app197.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app197.json @@ -18,6 +18,9 @@ ], "operationId": "index", "responses": { + "200": { + "description": "OK" + }, "400": { "description": "Bad Request", "content": { @@ -34,13 +37,12 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } - }, - "200": { - "description": "OK" } } } @@ -52,6 +54,9 @@ ], "operationId": "index_1", "responses": { + "200": { + "description": "OK" + }, "404": { "description": "Not Found", "content": { @@ -68,13 +73,12 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } - }, - "200": { - "description": "OK" } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app198.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app198.json index d231502d1..06c29c3a0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app198.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app198.json @@ -1 +1,57 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/":{"get":{"tags":["hello-controller"],"operationId":"test","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}},"components":{"schemas":{"Response":{"type":"object","properties":{"val1":{"format":"decimal","deprecated":true},"val2":{"format":"decimal"},"val3":{"format":"decimal"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Response": { + "type": "object", + "properties": { + "val1": { + "type": "string", + "format": "decimal", + "deprecated": true + }, + "val2": { + "type": "string", + "format": "decimal" + }, + "val3": { + "type": "string", + "format": "decimal" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json index eb04abe53..e368e60b3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app2.json @@ -56,7 +56,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -128,7 +130,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -161,7 +165,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -202,7 +208,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -252,7 +260,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -296,7 +306,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -335,7 +347,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -374,7 +388,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -409,7 +425,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -459,7 +477,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -545,7 +565,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -596,7 +618,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -647,17 +671,17 @@ "content": { "multipart/form-data": { "schema": { + "required": [ + "file" + ], "type": "object", "properties": { "file": { "type": "string", - "format": "binary", - "description": "file detail" + "description": "file detail", + "format": "binary" } - }, - "required": [ - "file" - ] + } } } } @@ -669,7 +693,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -709,7 +735,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -754,7 +782,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -791,10 +821,10 @@ "description": "ID of pet that needs to be fetched", "required": true, "schema": { - "type": "integer", - "format": "int64", "maximum": 5, - "minimum": 1 + "minimum": 1, + "type": "integer", + "format": "int64" } } ], @@ -805,13 +835,15 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } }, - "200": { - "description": "successful operation", + "404": { + "description": "Order not found", "content": { "application/xml": { "schema": { @@ -825,8 +857,8 @@ } } }, - "404": { - "description": "Order not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -866,7 +898,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -892,7 +926,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -903,7 +939,9 @@ "application/json": { "schema": { "type": "array", - "items": {} + "items": { + "type": "string" + } } } } @@ -945,7 +983,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -1011,7 +1051,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -1078,8 +1120,8 @@ }, "userStatus": { "type": "integer", - "format": "int32", - "description": "User Status" + "description": "User Status", + "format": "int32" } } }, @@ -1096,6 +1138,10 @@ } }, "Pet": { + "required": [ + "name", + "photoUrls" + ], "type": "object", "properties": { "id": { @@ -1130,11 +1176,7 @@ "sold" ] } - }, - "required": [ - "name", - "photoUrls" - ] + } }, "Tag": { "type": "object", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app202.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app202.json index 61ab97f67..e16e5789c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app202.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app202.json @@ -1 +1,88 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/example2/":{"get":{"tags":["example-2-controller"],"operationId":"index","responses":{"400":{"description":"Bad Request","content":{"*/*":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}},"200":{"description":"OK"}}}},"/example/":{"get":{"tags":["example-controller"],"operationId":"index_1","responses":{"404":{"description":"Not Found","content":{"*/*":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}},"200":{"description":"OK"}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/example2/": { + "get": { + "tags": [ + "example-2-controller" + ], + "operationId": "index", + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + }, + "/example/": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "index_1", + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app211.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app211.json index 40f7f80e3..9b89bf4d0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app211.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app211.json @@ -1 +1,79 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/":{"get":{"tags":["hello-controller"],"operationId":"index","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PagedObject"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}}}}},"components":{"schemas":{"PagedObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"Paging":{"type":"object","properties":{"page":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int32"},"lastPage":{"type":"integer","format":"int32"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "index", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PagedObject" + } + }, + "paging": { + "$ref": "#/components/schemas/Paging" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PagedObject": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Paging": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int32" + }, + "total": { + "type": "integer", + "format": "int32" + }, + "lastPage": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app213.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app213.json index 534280009..d8ac4d797 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app213.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app213.json @@ -4,7 +4,15 @@ "title": "MKMTestWS (Test Microservice API)", "description": "This API exposes endpoints for testing anything", "termsOfService": "https://www.test.ca/terms", - "version": "1.0" + "version": "1.0", + "x-amazon-apigateway-integration": { + "passthroughBehavior": "when_no_match", + "connectionId": "1rqafw", + "type": "http_proxy", + "httpMethod": "GET", + "uri": "http://my-vpc/nlb-link/testcontroller/getTest", + "connectionType": "VPC_LINK" + } }, "servers": [ { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-1.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-1.json index bcf9a4ebf..837008658 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-1.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-1.json @@ -1 +1,55 @@ -{"openapi":"3.1.0","info":{"title":"Example Interfaces","description":"List of Example Interfaces","termsOfService":"http://localhost:8080/","license":{"name":"Apache 2.0"},"version":"v1.0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{},"components":{"schemas":{"PersonDTO":{"description":"Description for PersonDTO component","properties":{"name":{"description":"Description for 'name' property","example":"Example value for 'name' property"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "Example Interfaces", + "description": "List of Example Interfaces", + "termsOfService": "http://localhost:8080/", + "license": { + "name": "Apache 2.0" + }, + "version": "v1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Description for 'name' property", + "example": "Example value for 'name' property" + } + }, + "description": "Description for PersonDTO component" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-2.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-2.json index a51dd73bf..0406d93f7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-2.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app217-2.json @@ -1 +1,55 @@ -{"openapi":"3.1.0","info":{"title":"User Interfaces","description":"List of User Interfaces","termsOfService":"http://localhost:8080/","license":{"name":"Apache 2.0"},"version":"v1.0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{},"components":{"schemas":{"PersonDTO":{"description":"Description for PersonDTO component","properties":{"name":{"description":"Description for 'name' property","example":"Example value for 'name' property"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "User Interfaces", + "description": "List of User Interfaces", + "termsOfService": "http://localhost:8080/", + "license": { + "name": "Apache 2.0" + }, + "version": "v1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Description for 'name' property", + "example": "Example value for 'name' property" + } + }, + "description": "Description for PersonDTO component" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app219.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app219.json index a322d4b8a..6d81662c2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app219.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app219.json @@ -19,12 +19,12 @@ "operationId": "testpost", "requestBody": { "content": { - "application/json;charset=UTF-8": { + "application/json": { "schema": { "$ref": "#/components/schemas/TestObject" } }, - "application/json": { + "application/json;charset=UTF-8": { "schema": { "$ref": "#/components/schemas/TestObject" } @@ -41,12 +41,12 @@ "200": { "description": "OK", "content": { - "application/json": { + "application/xml": { "schema": { "$ref": "#/components/schemas/TestObject" } }, - "application/xml": { + "application/json": { "schema": { "$ref": "#/components/schemas/TestObject" } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app220.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app220.json index 4b15bda0d..9cbd404b2 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app220.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app220.json @@ -1 +1,128 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/parent":{"post":{"tags":["hello-controller"],"operationId":"parentEndpoint","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Superclass"},{"$ref":"#/components/schemas/IntermediateClass"},{"$ref":"#/components/schemas/Image"},{"$ref":"#/components/schemas/Mail"},{"$ref":"#/components/schemas/Home"}]}}},"required":true},"responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"Home":{"allOf":[{"$ref":"#/components/schemas/Mail"}]},"Image":{"allOf":[{"$ref":"#/components/schemas/IntermediateClass"}]},"IntermediateClass":{"allOf":[{"$ref":"#/components/schemas/Superclass"},{"type":"object","properties":{"@type":{"type":"string"}}}],"discriminator":{"propertyName":"@type"},"required":["@type"]},"Mail":{"allOf":[{"$ref":"#/components/schemas/IntermediateClass"},{"type":"object","properties":{"@type":{"type":"string"}}}],"discriminator":{"propertyName":"@type"},"required":["@type"]},"Superclass":{"type":"object","discriminator":{"propertyName":"@type"},"properties":{"@type":{"type":"string"}},"required":["@type"]}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/parent": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "parentEndpoint", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Superclass" + }, + { + "$ref": "#/components/schemas/IntermediateClass" + }, + { + "$ref": "#/components/schemas/Image" + }, + { + "$ref": "#/components/schemas/Mail" + }, + { + "$ref": "#/components/schemas/Home" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Home": { + "allOf": [ + { + "$ref": "#/components/schemas/Mail" + } + ] + }, + "Image": { + "allOf": [ + { + "$ref": "#/components/schemas/IntermediateClass" + } + ] + }, + "IntermediateClass": { + "allOf": [ + { + "$ref": "#/components/schemas/Superclass" + }, + { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + } + } + ], + "discriminator": { + "propertyName": "@type" + }, + "required": [ + "@type" + ] + }, + "Mail": { + "allOf": [ + { + "$ref": "#/components/schemas/IntermediateClass" + }, + { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + } + } + ], + "discriminator": { + "propertyName": "@type" + }, + "required": [ + "@type" + ] + }, + "Superclass": { + "type": "object", + "discriminator": { + "propertyName": "@type" + }, + "properties": { + "@type": { + "type": "string" + } + }, + "required": [ + "@type" + ] + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app223.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app223.json index 4692e7ccf..bb0b80ca3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app223.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app223.json @@ -1 +1,224 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/parent":{"post":{"tags":["a-rest-controller"],"operationId":"parentEndpoint","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ParentType1"},{"$ref":"#/components/schemas/ParentType2"}]}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}},"/child":{"post":{"tags":["a-rest-controller"],"operationId":"childEndpoint","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ChildType1"},{"$ref":"#/components/schemas/ChildType2"}]}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}},"components":{"schemas":{"AbstractChild":{"type":"object","discriminator":{"propertyName":"type"},"properties":{"id":{"type":"integer","format":"int32"},"type":{"type":"string"}},"required":["type"]},"AbstractParent":{"type":"object","discriminator":{"propertyName":"type"},"properties":{"id":{"type":"integer","format":"int32"},"type":{"type":"string"}},"required":["type"]},"ChildType1":{"allOf":[{"$ref":"#/components/schemas/AbstractChild"},{"type":"object","properties":{"childType1Param":{"type":"string"}}}]},"ChildType2":{"allOf":[{"$ref":"#/components/schemas/AbstractChild"},{"type":"object","properties":{"childType2Param":{"type":"string"}}}]},"ParentType1":{"allOf":[{"$ref":"#/components/schemas/AbstractParent"},{"type":"object","properties":{"parentType1Param":{"type":"string"},"abstractChild":{"oneOf":[{"$ref":"#/components/schemas/ChildType1"},{"$ref":"#/components/schemas/ChildType2"}]}}}]},"ParentType2":{"allOf":[{"$ref":"#/components/schemas/AbstractParent"},{"type":"object","properties":{"parentType2Param":{"type":"string"}}}]},"Response":{"type":"object","properties":{"abstractParent":{"oneOf":[{"$ref":"#/components/schemas/ParentType1"},{"$ref":"#/components/schemas/ParentType2"}]},"abstractChild":{"oneOf":[{"$ref":"#/components/schemas/ChildType1"},{"$ref":"#/components/schemas/ChildType2"}]}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/parent": { + "post": { + "tags": [ + "a-rest-controller" + ], + "operationId": "parentEndpoint", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ParentType1" + }, + { + "$ref": "#/components/schemas/ParentType2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + }, + "/child": { + "post": { + "tags": [ + "a-rest-controller" + ], + "operationId": "childEndpoint", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildType1" + }, + { + "$ref": "#/components/schemas/ChildType2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractChild": { + "type": "object", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + "AbstractParent": { + "type": "object", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + "ChildType1": { + "allOf": [ + { + "$ref": "#/components/schemas/AbstractChild" + }, + { + "type": "object", + "properties": { + "childType1Param": { + "type": "string" + } + } + } + ] + }, + "ChildType2": { + "allOf": [ + { + "$ref": "#/components/schemas/AbstractChild" + }, + { + "type": "object", + "properties": { + "childType2Param": { + "type": "string" + } + } + } + ] + }, + "ParentType1": { + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "parentType1Param": { + "type": "string" + }, + "abstractChild": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildType1" + }, + { + "$ref": "#/components/schemas/ChildType2" + } + ] + } + } + } + ] + }, + "ParentType2": { + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "parentType2Param": { + "type": "string" + } + } + } + ] + }, + "Response": { + "type": "object", + "properties": { + "abstractParent": { + "oneOf": [ + { + "$ref": "#/components/schemas/ParentType1" + }, + { + "$ref": "#/components/schemas/ParentType2" + } + ] + }, + "abstractChild": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildType1" + }, + { + "$ref": "#/components/schemas/ChildType2" + } + ] + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app228.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app228.json index a60d4d146..8e4bb868e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app228.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app228.json @@ -74,35 +74,11 @@ } ] }, - "Child3": { - "allOf": [ - { - "$ref": "#/components/schemas/Parent" - }, - { - "type": "object", - "properties": { - "childProperty3": { - "type": "string" - } - } - } - ] - }, "MyRequest": { "type": "object", "properties": { "parent": { "oneOf": [ - { - "$ref": "#/components/schemas/Child1" - }, - { - "$ref": "#/components/schemas/Child2" - }, - { - "$ref": "#/components/schemas/Child3" - }, { "$ref": "#/components/schemas/Child1" }, diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app229.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app229.json index cf799c997..2ccf3fc5f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app229.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app229.json @@ -1 +1,81 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/":{"get":{"tags":["x-controller"],"operationId":"manualTranslationUpdateRun","parameters":[{"name":"locale","in":"query","required":true,"schema":{"type":"string","maxLength":16,"minLength":2,"pattern":"\\w+([-.]?\\w+)*"},"examples":{"el-gr":{"description":"el-gr"},"pl-pl":{"description":"pl-pl"},"de-de":{"description":"de-de"},"hu-hu":{"description":"hu-hu"},"en-us.src":{"description":"en-us.src"},"ro-ro":{"description":"ro-ro"},"sk-sk":{"description":"sk-sk"},"bg-bg":{"description":"bg-bg"},"ar-ae":{"description":"ar-ae"},"cs-cz":{"description":"cs-cz"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "x-controller" + ], + "operationId": "manualTranslationUpdateRun", + "parameters": [ + { + "name": "locale", + "in": "query", + "required": true, + "schema": { + "maxLength": 16, + "minLength": 2, + "pattern": "\\w+([-.]?\\w+)*", + "type": "string" + }, + "examples": { + "el-gr": { + "description": "el-gr" + }, + "pl-pl": { + "description": "pl-pl" + }, + "de-de": { + "description": "de-de" + }, + "hu-hu": { + "description": "hu-hu" + }, + "en-us.src": { + "description": "en-us.src" + }, + "ro-ro": { + "description": "ro-ro" + }, + "sk-sk": { + "description": "sk-sk" + }, + "bg-bg": { + "description": "bg-bg" + }, + "ar-ae": { + "description": "ar-ae" + }, + "cs-cz": { + "description": "cs-cz" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app233.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app233.json index 627e6b909..526d7dfc1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app233.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app233.json @@ -378,4 +378,4 @@ } }, "components": {} -} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app25.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app25.json index 50fbba377..acdbf5e3a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app25.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app25.json @@ -1 +1,162 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/values/{trackerId}/data":{"get":{"tags":["hello-controller"],"description":"Get last data from a tracker","operationId":"thirdList","parameters":[{"name":"trackerId","in":"path","required":true,"schema":{"example":"the-tracker-id"}},{"name":"start","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:00:00.000Z"}},{"name":"end","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:10:00.000Z"}},{"name":"limit","in":"query","required":false,"schema":{"example":10}}],"responses":{"200":{"description":"OK"}}}},"/secondlist/{trackerId}":{"get":{"tags":["hello-controller"],"operationId":"secondlist","parameters":[{"name":"trackerId","in":"path","required":true,"schema":{"example":"the-tracker-id"}},{"name":"start","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:00:00.000Z"}},{"name":"end","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:10:00.000Z"}}],"responses":{"200":{"description":"OK"}}}},"/list":{"get":{"tags":["hello-controller"],"operationId":"list","parameters":[{"name":"start","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:00:00.000Z"}},{"name":"end","in":"query","required":false,"schema":{"format":"date-time","example":"1970-01-01T00:10:00.000Z"}}],"responses":{"200":{"description":"OK"}}}},"/check":{"get":{"tags":["hello-controller"],"operationId":"check","responses":{"200":{"description":"OK"}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/values/{trackerId}/data": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Get last data from a tracker", + "operationId": "thirdList", + "parameters": [ + { + "name": "trackerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "example": "the-tracker-id" + } + }, + { + "name": "start", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:00:00.000Z" + } + }, + { + "name": "end", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:10:00.000Z" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "number", + "example": 10 + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/secondlist/{trackerId}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "secondlist", + "parameters": [ + { + "name": "trackerId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "example": "the-tracker-id" + } + }, + { + "name": "start", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:00:00.000Z" + } + }, + { + "name": "end", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:10:00.000Z" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/list": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "list", + "parameters": [ + { + "name": "start", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:00:00.000Z" + } + }, + { + "name": "end", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:10:00.000Z" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/check": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "check", + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app31.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app31.json index 4d9c39eb1..9f1c0376e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app31.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app31.json @@ -1 +1,103 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test":{"post":{"tags":["hello-controller"],"description":"subscribes a client to updates relevant to the requestor's account, as identified by the input token. The supplied url will be used as the delivery address for response payloads","operationId":"subscribe","parameters":[{"name":"x-auth-token","in":"header","description":"the authentication token provided after initially authenticating to the application","required":true,"schema":{"type":"string","description":"the authentication token provided after initially authenticating to the application"}},{"name":"url","in":"query","description":"the URL to call with response data","required":true,"schema":{"type":"string","description":"the URL to call with response data"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}}},"callbacks":{"subscription":{"http://$request.query.url":{"post":{"description":"payload data will be sent","parameters":[{"name":"subscriptionId","in":"path","required":true,"schema":{"format":"uuid","description":"the generated UUID","readOnly":true}}],"responses":{"200":{"description":"Return this code if the callback was received and processed successfully"},"205":{"description":"Return this code to unsubscribe from future data updates"},"default":{"description":"All other response codes will disable this callback subscription"}}}}}}}}},"components":{"schemas":{"SubscriptionResponse":{"type":"object","properties":{"subscriptionUuid":{"type":"string"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "description": "subscribes a client to updates relevant to the requestor's account, as identified by the input token. The supplied url will be used as the delivery address for response payloads", + "operationId": "subscribe", + "parameters": [ + { + "name": "x-auth-token", + "in": "header", + "description": "the authentication token provided after initially authenticating to the application", + "required": true, + "schema": { + "type": "string", + "description": "the authentication token provided after initially authenticating to the application" + } + }, + { + "name": "url", + "in": "query", + "description": "the URL to call with response data", + "required": true, + "schema": { + "type": "string", + "description": "the URL to call with response data" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SubscriptionResponse" + } + } + } + } + }, + "callbacks": { + "subscription": { + "http://$request.query.url": { + "post": { + "description": "payload data will be sent", + "parameters": [ + { + "name": "subscriptionId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "the generated UUID", + "format": "uuid", + "readOnly": true + } + } + ], + "responses": { + "200": { + "description": "Return this code if the callback was received and processed successfully" + }, + "205": { + "description": "Return this code to unsubscribe from future data updates" + }, + "default": { + "description": "All other response codes will disable this callback subscription" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SubscriptionResponse": { + "type": "object", + "properties": { + "subscriptionUuid": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app33.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app33.json index 582e2aa8f..bb37ea7ab 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app33.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app33.json @@ -1 +1,55 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello/{numTelco}":{"get":{"tags":["hello-controller"],"summary":"GET Persons","operationId":"index","parameters":[{"name":"numTelco","in":"path","required":true,"schema":{"type":"string"}},{"name":"adresse","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"418":{"description":"I'm a teapot","content":{"*/*":{"schema":{}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello/{numTelco}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GET Persons", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "418": { + "description": "I'm a teapot", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app34.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app34.json index 582e2aa8f..bb37ea7ab 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app34.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app34.json @@ -1 +1,55 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/hello/{numTelco}":{"get":{"tags":["hello-controller"],"summary":"GET Persons","operationId":"index","parameters":[{"name":"numTelco","in":"path","required":true,"schema":{"type":"string"}},{"name":"adresse","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"418":{"description":"I'm a teapot","content":{"*/*":{"schema":{}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello/{numTelco}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GET Persons", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "418": { + "description": "I'm a teapot", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app4.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app4.json index 584edad37..06c7dd2f7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app4.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app4.json @@ -45,6 +45,11 @@ "components": { "schemas": { "test.org.springdoc.api.v31.app4.TrackerData": { + "required": [ + "timestamp", + "trackerId", + "value" + ], "type": "object", "properties": { "trackerId": { @@ -58,16 +63,11 @@ }, "value": { "type": "number", - "format": "double", "description": "The data value", + "format": "double", "example": 19.0 } - }, - "required": [ - "timestamp", - "trackerId", - "value" - ] + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app41.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app41.json index d20756135..6fb3d61a0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app41.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app41.json @@ -1 +1,69 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/file":{"get":{"tags":["hello-controller"],"description":"Download file","operationId":"getFile","parameters":[{"name":"path","in":"query","description":"File path","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Wrong request","content":{"application/json":{"schema":{}}}},"200":{"description":"File resource","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/file": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Download file", + "operationId": "getFile", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "File path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "500": { + "description": "Unexpected error", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "File resource", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "Wrong request", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app46.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app46.json index 33102e5a5..43bb151a6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app46.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app46.json @@ -1 +1,58 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/persons/{subscriptionId}":{"get":{"tags":["Example Tag"],"summary":"Operation Summary","description":"Operation Description","externalDocs":{"description":"External documentation description","url":"http://url.com"},"operationId":"operationId","parameters":[{"name":"subscriptionId","in":"path","description":"parameter description","required":true,"allowEmptyValue":true,"allowReserved":true,"schema":{"format":"uuid","description":"the generated UUID","readOnly":true}}],"responses":{"200":{"description":"voila!","content":{"application/json":{"schema":{"type":"string"}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons/{subscriptionId}": { + "get": { + "tags": [ + "Example Tag" + ], + "summary": "Operation Summary", + "description": "Operation Description", + "externalDocs": { + "description": "External documentation description", + "url": "http://url.com" + }, + "operationId": "operationId", + "parameters": [ + { + "name": "subscriptionId", + "in": "path", + "description": "parameter description", + "required": true, + "allowEmptyValue": true, + "allowReserved": true, + "schema": { + "type": "string", + "description": "the generated UUID", + "format": "uuid", + "readOnly": true + } + } + ], + "responses": { + "200": { + "description": "voila!", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app47.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app47.json index db3d4bf63..1b4b05960 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app47.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app47.json @@ -1 +1,98 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/documents/{locale}":{"get":{"tags":["hello-controller"],"operationId":"getDocumentsWithLocale","parameters":[{"name":"locale","in":"path","required":true,"schema":{}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/":{"get":{"tags":["basic-controller"],"operationId":"get1","parameters":[{"name":"foo","in":"header","schema":{"type":"string","enum":["bar"]}},{"name":"fi","in":"header","schema":{"type":"string","enum":["ri"]}},{"name":"User-Agent","in":"header","schema":{"type":"string","enum":["MyUserAgent"]}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/documents/{locale}": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getDocumentsWithLocale", + "parameters": [ + { + "name": "locale", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/": { + "get": { + "tags": [ + "basic-controller" + ], + "operationId": "get1", + "parameters": [ + { + "name": "foo", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "bar" + ] + } + }, + { + "name": "fi", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "ri" + ] + } + }, + { + "name": "User-Agent", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "MyUserAgent" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app51.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app51.json index 16c0f1719..280eab52e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app51.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app51.json @@ -22,7 +22,9 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } }, @@ -35,7 +37,9 @@ "*/*": { "schema": { "type": "object", - "additionalProperties": {} + "additionalProperties": { + "type": "object" + } } } } @@ -55,6 +59,7 @@ "in": "header", "required": true, "schema": { + "type": "string", "example": "rherherherherh" } }, @@ -64,6 +69,7 @@ "description": "desc1", "required": true, "schema": { + "type": "string", "example": "something" } } @@ -94,6 +100,7 @@ "in": "header", "required": true, "schema": { + "type": "string", "example": "rherherherherh" } }, @@ -132,6 +139,7 @@ "in": "header", "required": true, "schema": { + "type": "string", "example": "rherherherherh" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app58.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app58.json index 5bda4b078..a3551a5d7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app58.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app58.json @@ -1 +1,119 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/examplePost":{"post":{"tags":["hello-controller"],"summary":"schema example","operationId":"example","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{}}}}}}},"/foo":{"get":{"tags":["hello-controller"],"operationId":"foobar","parameters":[{"name":"user","in":"query","description":"User","required":true,"schema":{"$ref":"#/components/schemas/PersonDTO"}}],"responses":{"200":{"description":"OK"}}}},"/foo1":{"get":{"tags":["hello-controller"],"operationId":"foobar1","parameters":[{"name":"user","in":"query","description":"User","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonDTO"}}}}],"responses":{"200":{"description":"OK"}}}},"/example":{"get":{"tags":["hello-controller"],"operationId":"test","responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"PersonDTO":{"type":"object","properties":{"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/example": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/examplePost": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "schema example", + "operationId": "example", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/foo": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "foobar", + "parameters": [ + { + "name": "user", + "in": "query", + "description": "User", + "required": true, + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/foo1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "foobar1", + "parameters": [ + { + "name": "user", + "in": "query", + "description": "User", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app59.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app59.json index a5f0edb21..1bbe411e6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app59.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app59.json @@ -28,19 +28,23 @@ "required": true }, "responses": { - "500": { - "description": "An unknown error occurred", + "400": { + "description": "The request is malformed or information is missing.", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } }, - "400": { - "description": "The request is malformed or information is missing.", + "500": { + "description": "An unknown error occurred", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } }, @@ -74,19 +78,23 @@ "required": true }, "responses": { - "500": { - "description": "An unknown error occurred", + "400": { + "description": "The request is malformed or information is missing.", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } }, - "400": { - "description": "The request is malformed or information is missing.", + "500": { + "description": "An unknown error occurred", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } }, @@ -111,19 +119,23 @@ ], "operationId": "test", "responses": { - "500": { - "description": "An unknown error occurred", + "400": { + "description": "The request is malformed or information is missing.", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } }, - "400": { - "description": "The request is malformed or information is missing.", + "500": { + "description": "An unknown error occurred", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } }, @@ -141,19 +153,23 @@ ], "operationId": "test_1", "responses": { - "500": { - "description": "An unknown error occurred", + "400": { + "description": "The request is malformed or information is missing.", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } }, - "400": { - "description": "The request is malformed or information is missing.", + "500": { + "description": "An unknown error occurred", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } }, @@ -168,15 +184,15 @@ "components": { "schemas": { "HelloBody": { + "required": [ + "helloValue" + ], "type": "object", "properties": { "helloValue": { "type": "string" } - }, - "required": [ - "helloValue" - ] + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app60.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app60.json index d239d9164..e613245c1 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app60.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app60.json @@ -11,18 +11,18 @@ } ], "paths": { - "/hello2": { + "/hello1": { "get": { "tags": [ "hello-controller" ], - "summary": "summary2", - "operationId": "list2", + "summary": "summary1", + "operationId": "list1", "parameters": [ { "name": "page", "in": "query", - "description": "desc page from Annotated interface", + "description": "The page", "required": true, "schema": { "type": "string" @@ -31,16 +31,7 @@ { "name": "size", "in": "query", - "description": "desc page from Annotated interface", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "sort", - "in": "query", - "description": "desc sort from Annotated interface", + "description": "The size", "required": true, "schema": { "type": "string" @@ -54,7 +45,9 @@ "*/*": { "schema": { "type": "array", - "items": {} + "items": { + "type": "object" + } } } } @@ -62,18 +55,18 @@ } } }, - "/hello1": { + "/hello2": { "get": { "tags": [ "hello-controller" ], - "summary": "summary1", - "operationId": "list1", + "summary": "summary2", + "operationId": "list2", "parameters": [ { "name": "page", "in": "query", - "description": "The page", + "description": "desc page from Annotated interface", "required": true, "schema": { "type": "string" @@ -82,7 +75,16 @@ { "name": "size", "in": "query", - "description": "The size", + "description": "desc page from Annotated interface", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "sort", + "in": "query", + "description": "desc sort from Annotated interface", "required": true, "schema": { "type": "string" @@ -96,7 +98,9 @@ "*/*": { "schema": { "type": "array", - "items": {} + "items": { + "type": "object" + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app61.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app61.json index e28ff3499..992f4efd4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app61.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app61.json @@ -46,7 +46,9 @@ "*/*": { "schema": { "type": "array", - "items": {} + "items": { + "type": "string" + } } } } @@ -57,12 +59,13 @@ "description": "createdRange", "required": true, "schema": { + "maxItems": 2, + "minItems": 2, "type": "array", "items": { + "type": "string", "format": "date" - }, - "maxItems": 2, - "minItems": 2 + } } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app67.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app67.json index 7f4ef7ef6..eeb238d51 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app67.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app67.json @@ -1 +1,178 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/demo/operation4":{"get":{"tags":["hello-controller"],"summary":"Operation 4 (expected result - 3 parameters)","operationId":"operation4","parameters":[{"name":"pageNumber","in":"query","description":"page number","schema":{}},{"name":"pageSize","in":"query","description":"page size","schema":{}},{"name":"sort","in":"query","description":"sort specification","schema":{}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/demo/operation3":{"get":{"tags":["hello-controller"],"summary":"Operation 3 (expected result - 3 parameters)","operationId":"operation3","parameters":[{"name":"pageNumber","in":"query","description":"page number","schema":{}},{"name":"pageSize","in":"query","description":"page size","schema":{}},{"name":"sort","in":"query","description":"sort specification","schema":{}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/demo/operation2":{"get":{"tags":["hello-controller"],"summary":"Operation 2 (expected result - 3 parameters)","operationId":"operation2","parameters":[{"name":"pageNumber","in":"query","description":"page number","schema":{}},{"name":"pageSize","in":"query","description":"page size","schema":{}},{"name":"sort","in":"query","description":"sort specification","schema":{}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/demo/operation1":{"get":{"tags":["hello-controller"],"summary":"Operation 1 (expected result - no parameters)","operationId":"operation1","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/demo/operation1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Operation 1 (expected result - no parameters)", + "operationId": "operation1", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/demo/operation2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Operation 2 (expected result - 3 parameters)", + "operationId": "operation2", + "parameters": [ + { + "name": "pageNumber", + "in": "query", + "description": "page number", + "schema": { + "type": "integer" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "page size", + "schema": { + "type": "integer" + } + }, + { + "name": "sort", + "in": "query", + "description": "sort specification", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/demo/operation4": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Operation 4 (expected result - 3 parameters)", + "operationId": "operation4", + "parameters": [ + { + "name": "pageNumber", + "in": "query", + "description": "page number", + "schema": { + "type": "integer" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "page size", + "schema": { + "type": "integer" + } + }, + { + "name": "sort", + "in": "query", + "description": "sort specification", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/demo/operation3": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Operation 3 (expected result - 3 parameters)", + "operationId": "operation3", + "parameters": [ + { + "name": "pageNumber", + "in": "query", + "description": "page number", + "schema": { + "type": "integer" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "page size", + "schema": { + "type": "integer" + } + }, + { + "name": "sort", + "in": "query", + "description": "sort specification", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app70.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app70.json index e396f47a2..1bc5135c8 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app70.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app70.json @@ -1 +1,62 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/example/{test}":{"get":{"tags":["hello-controller"],"description":"Some operation, customized operation!","operationId":"test","parameters":[{"name":"test","in":"path","description":"Parameter description, customized parameter!","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiType"}}}}}}}},"components":{"schemas":{"ApiType":{"type":"object","properties":{"someProperty":{"type":"string","format":"duration","description":"Test description","properties":{}}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/example/{test}": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation, customized operation!", + "operationId": "test", + "parameters": [ + { + "name": "test", + "in": "path", + "description": "Parameter description, customized parameter!", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ApiType" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ApiType": { + "type": "object", + "properties": { + "someProperty": { + "type": "string", + "format": "duration", + "description": "Test description", + "properties": {} + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app75.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app75.json index e36b96f3a..fb2f9393f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app75.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app75.json @@ -1 +1,168 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test3/{uuid}":{"post":{"tags":["hello-controller"],"summary":"Example api that realize an ECHO operation","description":"The result of the echo is the input value of the api","operationId":"postMyRequestBody3","parameters":[{"name":"uuid","in":"path","description":"Is the identification of the document","required":true,"schema":{"example":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{}}}}},"201":{"description":"other possible response","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/test2/{uuid}":{"post":{"tags":["hello-controller"],"summary":"Example api that realize an ECHO operation","description":"The result of the echo is the input value of the api","operationId":"postMyRequestBody2","parameters":[{"name":"uuid","in":"path","description":"Is the identification of the document","required":true,"schema":{"example":"uuid"}}],"responses":{"200":{"description":"Successful Operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonDTO"}}}},"201":{"description":"other possible response","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/test1/{uuid}":{"post":{"tags":["hello-controller"],"summary":"Example api that realize an ECHO operation","description":"The result of the echo is the input value of the api","operationId":"postMyRequestBody1","parameters":[{"name":"uuid","in":"path","description":"Is the identification of the document","required":true,"schema":{"example":"uuid"}}],"responses":{"200":{"description":"Successful Operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonDTO"}}}},"201":{"description":"other possible response","content":{"*/*":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"PersonDTO":{"type":"object","properties":{"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"}}}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test1/{uuid}": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Example api that realize an ECHO operation", + "description": "The result of the echo is the input value of the api", + "operationId": "postMyRequestBody1", + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "Is the identification of the document", + "required": true, + "schema": { + "type": "string", + "example": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Successful Operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + }, + "201": { + "description": "other possible response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2/{uuid}": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Example api that realize an ECHO operation", + "description": "The result of the echo is the input value of the api", + "operationId": "postMyRequestBody2", + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "Is the identification of the document", + "required": true, + "schema": { + "type": "string", + "example": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Successful Operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + }, + "201": { + "description": "other possible response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test3/{uuid}": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Example api that realize an ECHO operation", + "description": "The result of the echo is the input value of the api", + "operationId": "postMyRequestBody3", + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "Is the identification of the document", + "required": true, + "schema": { + "type": "string", + "example": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "201": { + "description": "other possible response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app77.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app77.json index 338fcfc64..ba0083f4b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app77.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app77.json @@ -1 +1,78 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/persons":{"get":{"tags":["hello-controller"],"operationId":"persons","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"default response","content":{"*/*":{"schema":{}}},"x-is-file":"true"}}}},"/persons2":{"get":{"tags":["hello-controller"],"operationId":"persons2","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"default response","content":{"*/*":{"schema":{}}},"x-is-file":"true"}}}}},"components":{}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons2", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-is-file": "true" + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-is-file": "true" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app82.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app82.json index 6efed1a5f..6c48000cf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app82.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app82.json @@ -48,7 +48,9 @@ "description": "OK", "content": { "*/*": { - "schema": {} + "schema": { + "type": "object" + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app83.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app83.json index 6b92220a2..c793dd357 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app83.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app83.json @@ -31,20 +31,21 @@ "content": { "multipart/form-data": { "schema": { + "required": [ + "configuration", + "file" + ], "type": "object", "properties": { "configuration": { + "type": "string", "format": "binary" }, "file": { "type": "string", "format": "binary" } - }, - "required": [ - "configuration", - "file" - ] + } } } } @@ -54,7 +55,9 @@ "description": "OK", "content": { "application/json": { - "schema": {} + "schema": { + "type": "object" + } } } } @@ -71,14 +74,16 @@ "content": { "multipart/form-data": { "schema": { + "required": [ + "file" + ], + "type": "object", "properties": { "file": { + "type": "string", "format": "binary" } - }, - "required": [ - "file" - ] + } } } } @@ -88,7 +93,9 @@ "description": "OK", "content": { "application/json": { - "schema": {} + "schema": { + "type": "object" + } } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app90.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app90.json index 51f49fab1..b63c8ebf5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app90.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app90.json @@ -1 +1,142 @@ -{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/test2":{"post":{"tags":["hello-controller"],"operationId":"test2","requestBody":{"description":"Details of the Item to be created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"examples":{"An example request with the minimum required fields to create.":{"summary":"Minimal request","description":"An example request with the minimum required fields to create.","value":"min"},"An example request with all fields provided with example values.":{"summary":"Full request","description":"An example request with all fields provided with example values.","value":"full"}}}},"required":true},"responses":{"200":{"description":"OK"}}}},"/test":{"get":{"tags":["hello-controller"],"operationId":"test1","parameters":[{"name":"hello","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"examples":{"500":{"$ref":"#/components/examples/http500Example"}}},"application/xml":{"schema":{"$ref":"#/components/schemas/User"}}}}}}}},"components":{"schemas":{"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":10},"username":{"type":"string","example":"theUser"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"James"},"email":{"type":"string","example":"john@email.com"},"password":{"type":"string","example":12345},"phone":{"type":"string","example":12345},"userStatus":{"type":"integer","format":"int32","description":"User Status","example":1}}}},"examples":{"http500Example":{"summary":"HTTP 500 JSON Body response example","description":"An example of HTTP response in case an error occurs on server side. instance attribute reference a traceId to ease server side analysis.","value":"{\"500\":{\"$ref\":\"#/components/examples/http500Example\"}}"}}}} +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test2": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "test2", + "requestBody": { + "description": "Details of the Item to be created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + }, + "examples": { + "An example request with the minimum required fields to create.": { + "summary": "Minimal request", + "description": "An example request with the minimum required fields to create.", + "value": "min" + }, + "An example request with all fields provided with example values.": { + "summary": "Full request", + "description": "An example request with all fields provided with example values.", + "value": "full" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test1", + "parameters": [ + { + "name": "hello", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + }, + "examples": { + "500": { + "$ref": "#/components/examples/http500Example" + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "example": 10 + }, + "username": { + "type": "string", + "example": "theUser" + }, + "firstName": { + "type": "string", + "example": "John" + }, + "lastName": { + "type": "string", + "example": "James" + }, + "email": { + "type": "string", + "example": "john@email.com" + }, + "password": { + "type": "string", + "example": 12345 + }, + "phone": { + "type": "string", + "example": 12345 + }, + "userStatus": { + "type": "integer", + "format": "int32", + "description": "User Status", + "example": 1 + } + } + } + }, + "examples": { + "http500Example": { + "summary": "HTTP 500 JSON Body response example", + "description": "An example of HTTP response in case an error occurs on server side. instance attribute reference a traceId to ease server side analysis.", + "value": "{\"500\":{\"$ref\":\"#/components/examples/http500Example\"}}" + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigTest.java index fedbb254b..11a020f81 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigTest.java @@ -35,7 +35,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "spring.jackson.property-naming-strategy=UPPER_CAMEL_CASE", "springdoc.show-actuator=true", "management.endpoints.web.base-path=/management", - "server.servlet.context-path=/demo/api", "management.server.port=9201", "management.server.base-path=/demo/api" }) + "server.servlet.context-path=/demo/api", "management.server.port=9301", "management.server.base-path=/demo/api" }) public class SpringDocSwaggerConfigTest extends AbstractSpringDocActuatorTest { @Test diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigWithBothFileGeneratedSpecsTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigWithBothFileGeneratedSpecsTest.java index 201a63717..69cbf8726 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigWithBothFileGeneratedSpecsTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocSwaggerConfigWithBothFileGeneratedSpecsTest.java @@ -39,7 +39,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "spring.jackson.property-naming-strategy=UPPER_CAMEL_CASE", "springdoc.show-actuator=true", "management.endpoints.web.base-path=/management", - "server.servlet.context-path=/demo/api", "management.server.port=9002", "management.server.base-path=/demo/api", + "server.servlet.context-path=/demo/api", "management.server.port=9302", "management.server.base-path=/demo/api", "springdoc.swagger-ui.urls[0].url=/api-docs/xxx/v1/openapi.yml", "springdoc.swagger-ui.urls[0].name=toto", }) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java index 4ef00a02a..ca4b91e7d 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java @@ -33,7 +33,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "management.endpoints.web.exposure.include=*", "springdoc.use-management-port=true", - "management.server.port=9292", "management.endpoints.web.base-path=/application" }) + "management.server.port=9392", "management.endpoints.web.base-path=/application" }) class SpringDocApp13Test extends AbstractSpringDocActuatorTest { @Test diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/HelloController.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/HelloController.java index eae081732..a122ff906 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/HelloController.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/HelloController.java @@ -40,7 +40,7 @@ public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { public GroupedOpenApi userOpenApi() { return GroupedOpenApi.builder() .group("users") - .packagesToScan("test.org.springdoc.api.app145") + .packagesToScan("test.org.springdoc.api.v30.app145") .build(); } } diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java index b0974c254..57427c878 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java @@ -33,7 +33,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "management.endpoints.web.exposure.include=*", "springdoc.use-management-port=true", - "management.server.port=9293", "management.endpoints.web.base-path=/application" }) + "management.server.port=9393", "management.endpoints.web.base-path=/application" }) class SpringDocApp14Test extends AbstractSpringDocActuatorTest { @Test diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java index d22960442..88675ccba 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java @@ -34,7 +34,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "management.endpoints.web.exposure.include=*", "springdoc.use-management-port=true", - "management.server.port=9294", + "management.server.port=9394", "management.server.base-path=/test", "management.endpoints.web.base-path=/application" }) class SpringDocApp15Test extends AbstractSpringDocActuatorTest { diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/HelloController.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/HelloController.java index a397c47d5..ccbdc8d78 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/HelloController.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/HelloController.java @@ -39,7 +39,7 @@ public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { public GroupedOpenApi userOpenApi() { return GroupedOpenApi.builder() .group("users") - .packagesToScan("test.org.springdoc.api.app145") + .packagesToScan("test.org.springdoc.api.v30.app145") .build(); } } diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java index 1e904ba5c..e7a9d7eea 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java @@ -34,7 +34,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "management.endpoints.web.exposure.include=*", "springdoc.use-management-port=true", - "management.server.port=9295", + "management.server.port=9395", "management.server.base-path=/test", "management.endpoints.web.base-path=/application" }) class SpringDocApp16Test extends AbstractSpringDocActuatorTest { diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java index ec462eb8e..a74aabf93 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java @@ -33,7 +33,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "management.endpoints.web.exposure.include=*", "springdoc.show-actuator=true", - "management.server.port=9296", + "management.server.port=9396", "server.servlet.context-path=/sample", "management.server.base-path=/test", "management.endpoints.web.base-path=/application" }) diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app13-1.json b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app13-1.json index 324ce7cb0..b52718be9 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app13-1.json +++ b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app13-1.json @@ -1,6 +1,6 @@ { "configUrl": "/application/swagger-ui/swagger-config", - "oauth2RedirectUrl": "http://localhost:9292/application/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9392/application/swagger-ui/oauth2-redirect.html", "url": "/application/openapi", "validatorUrl": "" } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app14-1.json b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app14-1.json index 8a0e78ae8..4ff87fb65 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app14-1.json +++ b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app14-1.json @@ -1,6 +1,6 @@ { "configUrl": "/application/swagger-ui/swagger-config", - "oauth2RedirectUrl": "http://localhost:9293/application/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9393/application/swagger-ui/oauth2-redirect.html", "urls": [ { "url": "/application/openapi/users", diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app15-1.json b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app15-1.json index e4a59fac8..b408d4b00 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app15-1.json +++ b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app15-1.json @@ -1,6 +1,6 @@ { "configUrl": "/test/application/swagger-ui/swagger-config", - "oauth2RedirectUrl": "http://localhost:9294/test/application/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9394/test/application/swagger-ui/oauth2-redirect.html", "url": "/test/application/openapi", "validatorUrl": "" } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app16-1.json b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app16-1.json index e8f48875b..4686ed28b 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app16-1.json +++ b/springdoc-openapi-starter-webmvc-ui/src/test/resources/results/app16-1.json @@ -1,6 +1,6 @@ { "configUrl": "/test/application/swagger-ui/swagger-config", - "oauth2RedirectUrl": "http://localhost:9295/test/application/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9395/test/application/swagger-ui/oauth2-redirect.html", "urls": [ { "url": "/test/application/openapi/users", diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java deleted file mode 100644 index 9100ddb4e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springdoc.core.utils.Constants; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.reactive.server.EntityExchangeResult; -import org.springframework.test.web.reactive.server.WebTestClient; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - -@AutoConfigureWebTestClient(timeout = "3600000") -@ActiveProfiles("test") -@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" , "springdoc.api-docs.version=openapi_3_0" }) -public abstract class AbstractCommonTest { - - protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); - - @Autowired - protected WebTestClient webTestClient; - - protected String getContent(String fileName) { - try { - Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } - - protected void testApp(String testId, String groupName) throws Exception{ - String result = null; - try { - EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + groupName).exchange() - .expectStatus().isOk().expectBody().returnResult(); - result = new String(getResult.getResponseBody()); - String expected = getContent("results/app" + testId + ".json"); - assertEquals(expected, result, true); - } - catch (AssertionError e) { - LOGGER.error(result); - throw e; - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java deleted file mode 100644 index d40f8cbd6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api; - -import jakarta.annotation.PostConstruct; - -import org.springframework.boot.test.web.server.LocalManagementPort; -import org.springframework.test.context.TestPropertySource; -import org.springframework.web.reactive.function.client.WebClient; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - -@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true" }) -public abstract class AbstractSpringDocActuatorTest extends AbstractCommonTest { - - protected WebClient webClient; - - @LocalManagementPort - private int managementPort; - - @PostConstruct - void init() { - webClient = WebClient.builder().baseUrl("http://localhost:" + this.managementPort) - .build(); - } - - protected void testWithWebClient(String testId, String uri) throws Exception{ - String result = null; - try { - result = webClient.get().uri(uri).retrieve() - .bodyToMono(String.class).block(); - String expected = getContent("results/app"+testId+".json"); - assertEquals(expected, result, true); - } - catch (AssertionError e) { - LOGGER.error(result); - throw e; - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index 208bea214..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import org.apache.commons.lang3.StringUtils; -import org.junit.jupiter.api.Test; - -import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; - - -@WebFluxTest -public abstract class AbstractSpringDocTest extends AbstractCommonTest { - - @Test - protected void testApp() throws Exception { - String className = getClass().getSimpleName(); - String testId = className.replaceAll("[^0-9]", ""); - testApp(testId, StringUtils.EMPTY); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/HelloController.java deleted file mode 100644 index 59fee7564..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/HelloController.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app144; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java deleted file mode 100644 index cddabb844..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app144; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - - -@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "server.port=52555", - "springdoc.use-management-port=true", - "management.server.port=9289", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp144Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() - .expectStatus().isNotFound(); - } - - @Test - void testApp1() throws Exception { - String result = webClient.get().uri("/application/openapi").retrieve() - .bodyToMono(String.class) - .block(); - String expected = getContent("results/app144.json"); - assertEquals(expected, result, true); - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/HelloController.java deleted file mode 100644 index 8174acd71..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/HelloController.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app145; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@Configuration -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1451Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1451Test.java deleted file mode 100644 index f47274bb2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1451Test.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app145; - -import org.junit.jupiter.api.Test; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.http.HttpStatus; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.web.reactive.function.client.WebClientResponseException; - -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - -@DirtiesContext -@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "server.port=52594", - "springdoc.use-management-port=true", - "springdoc.group-configs[0].group=users", - "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.app145", - "management.server.port=9294", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp1451Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() { - try { - webClient.get().uri("/application/openapi").retrieve() - .bodyToMono(String.class).block(); - fail(); - } - catch (WebClientResponseException ex) { - if (ex.getStatusCode() == HttpStatus.NOT_FOUND) - assertTrue(true); - else - fail(); - } - } - - @Test - void testApp2() throws Exception { - try { - String result = webClient.get().uri("/application/openapi/users").retrieve() - .bodyToMono(String.class).block(); - String expected = getContent("results/app145-1.json"); - assertEquals(expected, result, true); - } - catch (WebClientResponseException ex) { - fail(); - } - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1452Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1452Test.java deleted file mode 100644 index b2efc928a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp1452Test.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app145; - -import org.junit.jupiter.api.Test; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.web.reactive.function.client.WebClientResponseException; - -import static org.junit.jupiter.api.Assertions.fail; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - - -@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "server.port=52595", - "springdoc.use-management-port=true", - "springdoc.group-configs[0].group=users", - "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.app145", - "management.server.port=9285", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp1452Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() throws Exception { - try { - String result = webClient.get().uri("/application/openapi/users").retrieve() - .bodyToMono(String.class).block(); - String expected = getContent("results/app145-2.json"); - assertEquals(expected, result, true); - } - catch (WebClientResponseException ex) { - fail(); - } - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java deleted file mode 100644 index d723f920b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app145; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.http.HttpStatus; -import org.springframework.web.reactive.function.client.WebClientResponseException; - -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - - -@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "server.port=52593", - "springdoc.use-management-port=true", - "springdoc.group-configs[0].group=users", - "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.app145", - "management.server.port=9300", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp145Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/users") - .exchange() - .expectStatus().isNotFound(); - } - - @Test - void testApp3() throws Exception { - try { - webClient.get().uri("/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME).retrieve() - .bodyToMono(String.class).block(); - fail(); - } - catch (WebClientResponseException ex) { - if (ex.getStatusCode() == HttpStatus.NOT_FOUND) - assertTrue(true); - else - fail(); - } - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/HelloController.java deleted file mode 100644 index 9bacb38df..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/HelloController.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app146; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java deleted file mode 100644 index 593016888..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app146/SpringDocApp146Test.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app146; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "springdoc.show-actuator=true", - "management.server.port=9286", - "management.endpoints.web.exposure.exclude=functions, shutdown", - "management.server.base-path=/test", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp146Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() throws Exception { - super.testApp("146-1", Constants.ACTUATOR_DEFAULT_GROUP); - } - - @Test - void testApp1() throws Exception { - super.testApp("146-2", Constants.DEFAULT_GROUP_NAME); - } - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app146" }) - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/HelloController.java deleted file mode 100644 index 056601a28..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/HelloController.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app147; - -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.context.annotation.Bean; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - - @Bean - public GroupedOpenApi userOpenApi() { - return GroupedOpenApi.builder() - .group("users") - .packagesToScan("test.org.springdoc.api.app147") - .build(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java deleted file mode 100644 index 158bfd4d0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app147; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; - - -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "springdoc.show-actuator=true", - "management.endpoints.web.exposure.exclude=functions, shutdown", - "management.server.port=9297", - "management.server.base-path=/test", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp147Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() throws Exception { - super.testApp("147-1", Constants.ACTUATOR_DEFAULT_GROUP); - } - - @Test - void testApp1() throws Exception { - super.testApp("147-2", Constants.ACTUATOR_DEFAULT_GROUP); - - } - - @Test - void testApp2() throws Exception { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.DEFAULT_GROUP_NAME) - .exchange() - .expectStatus().isNotFound(); - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/HelloController.java deleted file mode 100644 index 9fd033a99..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app148; - - -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.context.annotation.Bean; -import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - - @Bean - @Order(Ordered.HIGHEST_PRECEDENCE) - public GroupedOpenApi userOpenApi() { - return GroupedOpenApi.builder() - .group("users") - .packagesToScan("test.org.springdoc.api.app148") - .build(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java deleted file mode 100644 index 0db1f4cd3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app148; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.http.HttpStatus; -import org.springframework.web.reactive.function.client.WebClientResponseException; - -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - - -@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "springdoc.show-actuator=true", - "management.endpoints.web.exposure.exclude=functions, shutdown", - "management.server.port=9288", - "server.port=6266", - "springdoc.use-management-port=true", - "management.server.base-path=/test", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() throws Exception { - super.testWithWebClient("148-1","/test/application/openapi/users"); - } - - @Test - void testApp2() throws Exception { - super.testWithWebClient("148-2","/test/application/openapi/x-actuator"); - } - - @Test - void testApp3() throws Exception { - try { - webClient.get().uri("/test/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME).retrieve() - .bodyToMono(String.class).block(); - fail(); - } - catch (WebClientResponseException ex) { - if (ex.getStatusCode() == HttpStatus.NOT_FOUND) - assertTrue(true); - else - fail(); - } - } - - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java deleted file mode 100644 index 7b6509736..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app186; - - -import org.junit.jupiter.api.Test; -import org.springdoc.core.customizers.OperationCustomizer; -import org.springdoc.core.models.GroupedOpenApi; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractCommonTest; - -import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; - -import static org.springdoc.core.utils.Constants.ALL_PATTERN; - -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -@TestPropertySource(properties = { "springdoc.show-actuator=true", - "springdoc.group-configs[0].group=group-actuator-as-properties", - "springdoc.group-configs[0].paths-to-match=${management.endpoints.web.base-path:/actuator}/**", - "management.endpoints.enabled-by-default=true", - "management.endpoints.web.exposure.include=*", - "management.endpoints.web.exposure.exclude=functions, shutdown" }) -public class SpringDocApp186Test extends AbstractCommonTest { - - @Test - void testApp() throws Exception { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() - .expectStatus().isOk() - .expectBody().json(getContent("results/app186.json"), true); - } - - @Test - void testGroupActuatorAsCodeCheckBackwardsCompatibility() { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code-check-backwards-compatibility").exchange() - .expectStatus().isOk() - .expectBody().json(getContent("results/app186.json"), true); - } - - @Test - void testGroupActuatorAsCode() { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code").exchange() - .expectStatus().isOk() - .expectBody().json(getContent("results/app186.json"), true); - } - - @Test - void testGroupActuatorAsProperties() { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-properties").exchange() - .expectStatus().isOk() - .expectBody().json(getContent("results/app186.json"), true); - } - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app186" }) - static class SpringDocTestApp { - - @Bean - public GroupedOpenApi asCodeCheckBackwardsCompatibility(OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { - return GroupedOpenApi.builder() - .group("group-actuator-as-code-check-backwards-compatibility") - .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) - .addOperationCustomizer(actuatorCustomizer) - .build(); - } - - @Bean - public GroupedOpenApi asCode(WebEndpointProperties endpointProperties) { - return GroupedOpenApi.builder() - .group("group-actuator-as-code") - .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) - .build(); - } - } -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java deleted file mode 100644 index 902637398..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app76; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import reactor.core.publisher.Mono; - -import org.springframework.http.MediaType; -import org.springframework.http.codec.multipart.FilePart; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -public class HelloController { - - - @Operation(summary = "Parse Resume") - @PostMapping(value = "/parse-resume", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { - MediaType.MULTIPART_FORM_DATA_VALUE }) - @ApiResponses({ @ApiResponse(responseCode = "400", description = "Invalid input") }) - public Mono parse( - @RequestPart(name = "resumeFile") @Parameter(description = "Resume file to be parsed", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) FilePart resumeFile) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java deleted file mode 100644 index ac7d1a833..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app76; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = { - "springdoc.show-actuator=true", - "management.endpoints.enabled-by-default=true" -}) -public class SpringDocApp76Test extends AbstractSpringDocTest { - - @Test - protected void testApp() { - webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/actuator").exchange().expectStatus().isOk().expectBody() - .jsonPath("$.openapi").isEqualTo("3.0.1") - .jsonPath("$.paths./actuator/health.get.operationId").exists(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocTestApp.java deleted file mode 100644 index 628a8a691..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/app76/SpringDocTestApp.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app76; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.endpoint.web.reactive.WebFluxEndpointManagementContextConfiguration; -import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.web.reactive.ReactiveManagementContextAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Import; - -@SpringBootApplication -@Import({ WebEndpointAutoConfiguration.class, - EndpointAutoConfiguration.class, - InfoEndpointAutoConfiguration.class, - HealthEndpointAutoConfiguration.class, - WebFluxEndpointManagementContextConfiguration.class, - ReactiveManagementContextAutoConfiguration.class }) -@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app76" }) -public class SpringDocTestApp { - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Tweet API").version("v0") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - - - @Bean - public GroupedOpenApi actuatorApi() { - return GroupedOpenApi.builder().group("actuator") - .pathsToMatch("/actuator/**") - .pathsToExclude("/actuator/health/*") - .build(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java new file mode 100644 index 000000000..a9ca71da1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java @@ -0,0 +1,82 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.reactive.server.EntityExchangeResult; +import org.springframework.test.web.reactive.server.WebTestClient; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@AutoConfigureWebTestClient(timeout = "3600000") +@ActiveProfiles("test") +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" , "springdoc.api-docs.version=openapi_3_0" }) +public abstract class AbstractCommonTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); + + @Autowired + protected WebTestClient webTestClient; + + protected String getContent(String fileName) { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + protected void testApp(String testId, String groupName) throws Exception{ + String result = null; + try { + EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + groupName).exchange() + .expectStatus().isOk().expectBody().returnResult(); + result = new String(getResult.getResponseBody()); + String expected = getContent("results/3.0.1/app" + testId + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocActuatorTest.java new file mode 100644 index 000000000..9cf22257e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocActuatorTest.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import jakarta.annotation.PostConstruct; + +import org.springframework.boot.test.web.server.LocalManagementPort; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.reactive.function.client.WebClient; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true" }) +public abstract class AbstractSpringDocActuatorTest extends AbstractCommonTest { + + protected WebClient webClient; + + @LocalManagementPort + private int managementPort; + + @PostConstruct + void init() { + webClient = WebClient.builder().baseUrl("http://localhost:" + this.managementPort) + .build(); + } + + protected void testWithWebClient(String testId, String uri) throws Exception{ + String result = null; + try { + result = webClient.get().uri(uri).retrieve() + .bodyToMono(String.class).block(); + String expected = getContent("results/3.0.1/app"+testId+".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..e48725728 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import org.apache.commons.lang3.StringUtils; +import org.junit.jupiter.api.Test; + +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; + + +@WebFluxTest +public abstract class AbstractSpringDocTest extends AbstractCommonTest { + + @Test + protected void testApp() throws Exception { + String className = getClass().getSimpleName(); + String testId = className.replaceAll("[^0-9]", ""); + testApp(testId, StringUtils.EMPTY); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app144/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app144/HelloController.java new file mode 100644 index 000000000..a5027a7c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app144/HelloController.java @@ -0,0 +1,32 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app144; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app144/SpringDocApp144Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app144/SpringDocApp144Test.java new file mode 100644 index 000000000..999675edc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app144/SpringDocApp144Test.java @@ -0,0 +1,58 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app144; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=52555", + "springdoc.use-management-port=true", + "management.server.port=9289", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp144Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isNotFound(); + } + + @Test + void testApp1() throws Exception { + String result = webClient.get().uri("/application/openapi").retrieve() + .bodyToMono(String.class) + .block(); + String expected = getContent("results/3.0.1/app144.json"); + assertEquals(expected, result, true); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/HelloController.java new file mode 100644 index 000000000..7f962e07a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/HelloController.java @@ -0,0 +1,34 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app145; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Configuration +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp1451Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp1451Test.java new file mode 100644 index 000000000..4332992fa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp1451Test.java @@ -0,0 +1,77 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app145; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@DirtiesContext +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=52594", + "springdoc.use-management-port=true", + "springdoc.group-configs[0].group=users", + "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.v30.app145", + "management.server.port=9284", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp1451Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() { + try { + webClient.get().uri("/application/openapi").retrieve() + .bodyToMono(String.class).block(); + fail(); + } + catch (WebClientResponseException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + else + fail(); + } + } + + @Test + void testApp2() throws Exception { + try { + String result = webClient.get().uri("/application/openapi/users").retrieve() + .bodyToMono(String.class).block(); + String expected = getContent("results/3.0.1/app145-1.json"); + assertEquals(expected, result, true); + } + catch (WebClientResponseException ex) { + fail(); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp1452Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp1452Test.java new file mode 100644 index 000000000..2a1bb3030 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp1452Test.java @@ -0,0 +1,59 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app145; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import static org.junit.jupiter.api.Assertions.fail; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=52595", + "springdoc.use-management-port=true", + "springdoc.group-configs[0].group=users", + "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.v30.app145", + "management.server.port=9285", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp1452Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + try { + String result = webClient.get().uri("/application/openapi/users").retrieve() + .bodyToMono(String.class).block(); + String expected = getContent("results/3.0.1/app145-2.json"); + assertEquals(expected, result, true); + } + catch (WebClientResponseException ex) { + fail(); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp145Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp145Test.java new file mode 100644 index 000000000..44024ebbc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp145Test.java @@ -0,0 +1,70 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app145; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=53593", + "springdoc.use-management-port=true", + "springdoc.group-configs[0].group=users", + "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.v30.app145", + "management.server.port=9283", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp145Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/users") + .exchange() + .expectStatus().isNotFound(); + } + + @Test + void testApp3() throws Exception { + try { + webClient.get().uri("/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME).retrieve() + .bodyToMono(String.class).block(); + fail(); + } + catch (WebClientResponseException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + else + fail(); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app146/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app146/HelloController.java new file mode 100644 index 000000000..6465eb350 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app146/HelloController.java @@ -0,0 +1,32 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app146; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app146/SpringDocApp146Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app146/SpringDocApp146Test.java new file mode 100644 index 000000000..42743fbad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app146/SpringDocApp146Test.java @@ -0,0 +1,52 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app146; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.server.port=9286", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp146Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + super.testApp("146-1", Constants.ACTUATOR_DEFAULT_GROUP); + } + + @Test + void testApp1() throws Exception { + super.testApp("146-2", Constants.DEFAULT_GROUP_NAME); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app146" }) + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app147/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app147/HelloController.java new file mode 100644 index 000000000..cb48d6693 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app147/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app147; + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v30.app147") + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app147/SpringDocApp147Test.java new file mode 100644 index 000000000..02ea134ae --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app147/SpringDocApp147Test.java @@ -0,0 +1,59 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app147; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; + + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "management.server.port=9287", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp147Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + super.testApp("147-1", Constants.ACTUATOR_DEFAULT_GROUP); + } + + @Test + void testApp1() throws Exception { + super.testApp("147-2", Constants.ACTUATOR_DEFAULT_GROUP); + + } + + @Test + void testApp2() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.DEFAULT_GROUP_NAME) + .exchange() + .expectStatus().isNotFound(); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app148/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app148/HelloController.java new file mode 100644 index 000000000..14ccf700e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app148/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app148; + + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + @Bean + @Order(Ordered.HIGHEST_PRECEDENCE) + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v30.app148") + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app148/SpringDocApp148Test.java new file mode 100644 index 000000000..d47194eb5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app148/SpringDocApp148Test.java @@ -0,0 +1,73 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app148; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "management.server.port=9288", + "server.port=6266", + "springdoc.use-management-port=true", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + super.testWithWebClient("148-1","/test/application/openapi/users"); + } + + @Test + void testApp2() throws Exception { + super.testWithWebClient("148-2","/test/application/openapi/x-actuator"); + } + + @Test + void testApp3() throws Exception { + try { + webClient.get().uri("/test/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME).retrieve() + .bodyToMono(String.class).block(); + fail(); + } + catch (WebClientResponseException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + else + fail(); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app186/SpringDocApp186Test.java new file mode 100644 index 000000000..882079630 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app186/SpringDocApp186Test.java @@ -0,0 +1,102 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app186; + + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractCommonTest; + +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +import static org.springdoc.core.utils.Constants.ALL_PATTERN; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@TestPropertySource(properties = { "springdoc.show-actuator=true", + "springdoc.group-configs[0].group=group-actuator-as-properties", + "springdoc.group-configs[0].paths-to-match=${management.endpoints.web.base-path:/actuator}/**", + "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.include=*", + "management.endpoints.web.exposure.exclude=functions, shutdown" }) +public class SpringDocApp186Test extends AbstractCommonTest { + + @Test + void testApp() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.0.1/app186.json"), true); + } + + @Test + void testGroupActuatorAsCodeCheckBackwardsCompatibility() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code-check-backwards-compatibility").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.0.1/app186.json"), true); + } + + @Test + void testGroupActuatorAsCode() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.0.1/app186.json"), true); + } + + @Test + void testGroupActuatorAsProperties() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-properties").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.0.1/app186.json"), true); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app186" }) + static class SpringDocTestApp { + + @Bean + public GroupedOpenApi asCodeCheckBackwardsCompatibility(OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { + return GroupedOpenApi.builder() + .group("group-actuator-as-code-check-backwards-compatibility") + .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) + .addOperationCustomizer(actuatorCustomizer) + .build(); + } + + @Bean + public GroupedOpenApi asCode(WebEndpointProperties endpointProperties) { + return GroupedOpenApi.builder() + .group("group-actuator-as-code") + .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) + .build(); + } + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java new file mode 100644 index 000000000..9f73e3a5a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2020 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + * + */ + +package test.org.springdoc.api.v30.app76; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.http.codec.multipart.FilePart; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + + @Operation(summary = "Parse Resume") + @PostMapping(value = "/parse-resume", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { + MediaType.MULTIPART_FORM_DATA_VALUE }) + @ApiResponses({ @ApiResponse(responseCode = "400", description = "Invalid input") }) + public Mono parse( + @RequestPart(name = "resumeFile") @Parameter(description = "Resume file to be parsed", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) FilePart resumeFile) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java new file mode 100644 index 000000000..c7206c094 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2020 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + * + */ + +package test.org.springdoc.api.v30.app76; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "springdoc.show-actuator=true", + "management.endpoints.enabled-by-default=true" +}) +public class SpringDocApp76Test extends AbstractSpringDocTest { + + @Test + protected void testApp() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/actuator").exchange().expectStatus().isOk().expectBody() + .jsonPath("$.openapi").isEqualTo("3.0.1") + .jsonPath("$.paths./actuator/health.get.operationId").exists(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocTestApp.java new file mode 100644 index 000000000..ce3b20223 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocTestApp.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2020 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + * + */ + +package test.org.springdoc.api.v30.app76; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.endpoint.web.reactive.WebFluxEndpointManagementContextConfiguration; +import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.web.reactive.ReactiveManagementContextAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Import; + +@SpringBootApplication +@Import({ WebEndpointAutoConfiguration.class, + EndpointAutoConfiguration.class, + InfoEndpointAutoConfiguration.class, + HealthEndpointAutoConfiguration.class, + WebFluxEndpointManagementContextConfiguration.class, + ReactiveManagementContextAutoConfiguration.class }) +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app76" }) +public class SpringDocTestApp { + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + + + @Bean + public GroupedOpenApi actuatorApi() { + return GroupedOpenApi.builder().group("actuator") + .pathsToMatch("/actuator/**") + .pathsToExclude("/actuator/health/*") + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java new file mode 100644 index 000000000..72fdba6df --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java @@ -0,0 +1,82 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.reactive.server.EntityExchangeResult; +import org.springframework.test.web.reactive.server.WebTestClient; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@AutoConfigureWebTestClient(timeout = "3600000") +@ActiveProfiles("test") +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" }) +public abstract class AbstractCommonTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); + + @Autowired + protected WebTestClient webTestClient; + + protected String getContent(String fileName) { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + protected void testApp(String testId, String groupName) throws Exception{ + String result = null; + try { + EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + groupName).exchange() + .expectStatus().isOk().expectBody().returnResult(); + result = new String(getResult.getResponseBody()); + String expected = getContent("results/3.1.0/app" + testId + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocActuatorTest.java new file mode 100644 index 000000000..f6c67f5be --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocActuatorTest.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import jakarta.annotation.PostConstruct; + +import org.springframework.boot.test.web.server.LocalManagementPort; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.reactive.function.client.WebClient; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true" }) +public abstract class AbstractSpringDocActuatorTest extends AbstractCommonTest { + + protected WebClient webClient; + + @LocalManagementPort + private int managementPort; + + @PostConstruct + void init() { + webClient = WebClient.builder().baseUrl("http://localhost:" + this.managementPort) + .build(); + } + + protected void testWithWebClient(String testId, String uri) throws Exception{ + String result = null; + try { + result = webClient.get().uri(uri).retrieve() + .bodyToMono(String.class).block(); + String expected = getContent("results/3.1.0/app"+testId+".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..f2b629759 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import org.apache.commons.lang3.StringUtils; +import org.junit.jupiter.api.Test; + +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; + + +@WebFluxTest +public abstract class AbstractSpringDocTest extends AbstractCommonTest { + + @Test + protected void testApp() throws Exception { + String className = getClass().getSimpleName(); + String testId = className.replaceAll("[^0-9]", ""); + testApp(testId, StringUtils.EMPTY); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app144/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app144/HelloController.java new file mode 100644 index 000000000..6fea3caac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app144/HelloController.java @@ -0,0 +1,32 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app144; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app144/SpringDocApp144Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app144/SpringDocApp144Test.java new file mode 100644 index 000000000..05740ac52 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app144/SpringDocApp144Test.java @@ -0,0 +1,58 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app144; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=53355", + "springdoc.use-management-port=true", + "management.server.port=9389", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp144Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isNotFound(); + } + + @Test + void testApp1() throws Exception { + String result = webClient.get().uri("/application/openapi").retrieve() + .bodyToMono(String.class) + .block(); + String expected = getContent("results/3.1.0/app144.json"); + assertEquals(expected, result, true); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/HelloController.java new file mode 100644 index 000000000..a0f2bfab3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/HelloController.java @@ -0,0 +1,34 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app145; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Configuration +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp1451Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp1451Test.java new file mode 100644 index 000000000..2b0d0960b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp1451Test.java @@ -0,0 +1,77 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app145; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@DirtiesContext +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=53594", + "springdoc.use-management-port=true", + "springdoc.group-configs[0].group=users", + "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.v31.app145", + "management.server.port=9394", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp1451Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() { + try { + webClient.get().uri("/application/openapi").retrieve() + .bodyToMono(String.class).block(); + fail(); + } + catch (WebClientResponseException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + else + fail(); + } + } + + @Test + void testApp2() throws Exception { + try { + String result = webClient.get().uri("/application/openapi/users").retrieve() + .bodyToMono(String.class).block(); + String expected = getContent("results/3.1.0/app145-1.json"); + assertEquals(expected, result, true); + } + catch (WebClientResponseException ex) { + fail(); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp1452Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp1452Test.java new file mode 100644 index 000000000..432a34960 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp1452Test.java @@ -0,0 +1,59 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app145; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import static org.junit.jupiter.api.Assertions.fail; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=53595", + "springdoc.use-management-port=true", + "springdoc.group-configs[0].group=users", + "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.v31.app145", + "management.server.port=9385", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp1452Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + try { + String result = webClient.get().uri("/application/openapi/users").retrieve() + .bodyToMono(String.class).block(); + String expected = getContent("results/3.1.0/app145-2.json"); + assertEquals(expected, result, true); + } + catch (WebClientResponseException ex) { + fail(); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp145Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp145Test.java new file mode 100644 index 000000000..b02c6a551 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp145Test.java @@ -0,0 +1,70 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app145; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=52593", + "springdoc.use-management-port=true", + "springdoc.group-configs[0].group=users", + "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.v31.app145", + "management.server.port=9300", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp145Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/users") + .exchange() + .expectStatus().isNotFound(); + } + + @Test + void testApp3() throws Exception { + try { + webClient.get().uri("/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME).retrieve() + .bodyToMono(String.class).block(); + fail(); + } + catch (WebClientResponseException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + else + fail(); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app146/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app146/HelloController.java new file mode 100644 index 000000000..5c4fd9873 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app146/HelloController.java @@ -0,0 +1,32 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app146; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app146/SpringDocApp146Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app146/SpringDocApp146Test.java new file mode 100644 index 000000000..cfd9aec48 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app146/SpringDocApp146Test.java @@ -0,0 +1,52 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app146; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.server.port=9386", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp146Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + super.testApp("146-1", Constants.ACTUATOR_DEFAULT_GROUP); + } + + @Test + void testApp1() throws Exception { + super.testApp("146-2", Constants.DEFAULT_GROUP_NAME); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app146" }) + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app147/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app147/HelloController.java new file mode 100644 index 000000000..e2ed42864 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app147/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app147; + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v31.app147") + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app147/SpringDocApp147Test.java new file mode 100644 index 000000000..e18bd77e0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app147/SpringDocApp147Test.java @@ -0,0 +1,59 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app147; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; + + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "management.server.port=9397", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp147Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + super.testApp("147-1", Constants.ACTUATOR_DEFAULT_GROUP); + } + + @Test + void testApp1() throws Exception { + super.testApp("147-2", Constants.ACTUATOR_DEFAULT_GROUP); + + } + + @Test + void testApp2() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.DEFAULT_GROUP_NAME) + .exchange() + .expectStatus().isNotFound(); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app148/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app148/HelloController.java new file mode 100644 index 000000000..cae08da76 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app148/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app148; + + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + @Bean + @Order(Ordered.HIGHEST_PRECEDENCE) + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v31.app148") + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app148/SpringDocApp148Test.java new file mode 100644 index 000000000..bc6a1a27d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app148/SpringDocApp148Test.java @@ -0,0 +1,73 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app148; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "management.server.port=9388", + "server.port=6366", + "springdoc.use-management-port=true", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + super.testWithWebClient("148-1","/test/application/openapi/users"); + } + + @Test + void testApp2() throws Exception { + super.testWithWebClient("148-2","/test/application/openapi/x-actuator"); + } + + @Test + void testApp3() throws Exception { + try { + webClient.get().uri("/test/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME).retrieve() + .bodyToMono(String.class).block(); + fail(); + } + catch (WebClientResponseException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + else + fail(); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app186/SpringDocApp186Test.java new file mode 100644 index 000000000..c0c45c86b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app186/SpringDocApp186Test.java @@ -0,0 +1,102 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app186; + + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractCommonTest; + +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; + +import static org.springdoc.core.utils.Constants.ALL_PATTERN; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@TestPropertySource(properties = { "springdoc.show-actuator=true", + "springdoc.group-configs[0].group=group-actuator-as-properties", + "springdoc.group-configs[0].paths-to-match=${management.endpoints.web.base-path:/actuator}/**", + "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.include=*", + "management.endpoints.web.exposure.exclude=functions, shutdown" }) +public class SpringDocApp186Test extends AbstractCommonTest { + + @Test + void testApp() throws Exception { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.1.0/app186.json"), true); + } + + @Test + void testGroupActuatorAsCodeCheckBackwardsCompatibility() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code-check-backwards-compatibility").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.1.0/app186.json"), true); + } + + @Test + void testGroupActuatorAsCode() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.1.0/app186.json"), true); + } + + @Test + void testGroupActuatorAsProperties() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-properties").exchange() + .expectStatus().isOk() + .expectBody().json(getContent("results/3.1.0/app186.json"), true); + } + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app186" }) + static class SpringDocTestApp { + + @Bean + public GroupedOpenApi asCodeCheckBackwardsCompatibility(OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { + return GroupedOpenApi.builder() + .group("group-actuator-as-code-check-backwards-compatibility") + .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) + .addOperationCustomizer(actuatorCustomizer) + .build(); + } + + @Bean + public GroupedOpenApi asCode(WebEndpointProperties endpointProperties) { + return GroupedOpenApi.builder() + .group("group-actuator-as-code") + .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) + .build(); + } + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java new file mode 100644 index 000000000..86d4f01cd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2020 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + * + */ + +package test.org.springdoc.api.v31.app76; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.http.codec.multipart.FilePart; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + + @Operation(summary = "Parse Resume") + @PostMapping(value = "/parse-resume", produces = { MediaType.APPLICATION_JSON_VALUE }, consumes = { + MediaType.MULTIPART_FORM_DATA_VALUE }) + @ApiResponses({ @ApiResponse(responseCode = "400", description = "Invalid input") }) + public Mono parse( + @RequestPart(name = "resumeFile") @Parameter(description = "Resume file to be parsed", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE)) FilePart resumeFile) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java new file mode 100644 index 000000000..ee3ed0054 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2020 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + * + */ + +package test.org.springdoc.api.v31.app76; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { + "springdoc.show-actuator=true", + "management.endpoints.enabled-by-default=true" +}) +public class SpringDocApp76Test extends AbstractSpringDocTest { + + @Test + protected void testApp() { + webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + "/actuator").exchange().expectStatus().isOk().expectBody() + .jsonPath("$.openapi").isEqualTo("3.1.0") + .jsonPath("$.paths./actuator/health.get.operationId").exists(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocTestApp.java new file mode 100644 index 000000000..e3c869246 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocTestApp.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * Copyright 2019-2020 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + * + */ + +package test.org.springdoc.api.v31.app76; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.endpoint.web.reactive.WebFluxEndpointManagementContextConfiguration; +import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.web.reactive.ReactiveManagementContextAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Import; + +@SpringBootApplication +@Import({ WebEndpointAutoConfiguration.class, + EndpointAutoConfiguration.class, + InfoEndpointAutoConfiguration.class, + HealthEndpointAutoConfiguration.class, + WebFluxEndpointManagementContextConfiguration.class, + ReactiveManagementContextAutoConfiguration.class }) +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app76" }) +public class SpringDocTestApp { + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Tweet API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + + + @Bean + public GroupedOpenApi actuatorApi() { + return GroupedOpenApi.builder().group("actuator") + .pathsToMatch("/actuator/**") + .pathsToExclude("/actuator/health/*") + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app144.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app144.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app144.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app144.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app145-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app145-1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app145-1.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app145-1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app145-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app145-2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app145-2.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app145-2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app145.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app145.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app145.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app145.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app146-1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-1.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app146-1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app146-2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app146-2.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app146-2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app147-1.json new file mode 100644 index 000000000..63f747bca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app147-1.json @@ -0,0 +1,891 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:9287/test", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app147-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app147-2.json new file mode 100644 index 000000000..63f747bca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app147-2.json @@ -0,0 +1,891 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:9287/test", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app148-1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-1.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app148-1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app148-2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app148-2.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app148-2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app186.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app186.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.0.1/app186.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app144.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app144.json new file mode 100644 index 000000000..27fb1ca55 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app144.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:53355", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145-1.json new file mode 100644 index 000000000..db94c7193 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145-1.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:53594", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145-2.json new file mode 100644 index 000000000..7d811e2ae --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145-2.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:53595", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145.json new file mode 100644 index 000000000..2c1fea2c7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app145.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:52594", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app146-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app146-1.json new file mode 100644 index 000000000..c8d3ea0cc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app146-1.json @@ -0,0 +1,891 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:9386/test", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app146-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app146-2.json new file mode 100644 index 000000000..909227c33 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app146-2.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app147-1.json new file mode 100644 index 000000000..9a9d79015 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app147-1.json @@ -0,0 +1,891 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:9397/test", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app147-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app147-2.json new file mode 100644 index 000000000..9a9d79015 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app147-2.json @@ -0,0 +1,891 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:9397/test", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app148-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app148-1.json new file mode 100644 index 000000000..9c3ceaeee --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app148-1.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:6366", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app148-2.json new file mode 100644 index 000000000..84c6cc722 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app148-2.json @@ -0,0 +1,891 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:9388/test", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app186.json new file mode 100644 index 000000000..d1e373988 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/3.1.0/app186.json @@ -0,0 +1,938 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/actuator/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/actuator/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/health/{path}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health-path'", + "operationId": "health", + "parameters": [ + { + "name": "path", + "in": "path", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health_1", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/actuator/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json deleted file mode 100644 index 0c8297c8f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-1.json +++ /dev/null @@ -1,891 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "OpenAPI definition", - "version": "v0" - }, - "servers": [ - { - "url": "http://localhost:9297/test", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "Actuator", - "description": "Monitor and interact", - "externalDocs": { - "description": "Spring Boot Actuator Web API Documentation", - "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" - } - } - ], - "paths": { - "/application/loggers/{name}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggerLevels", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - }, - "post": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "configureLogLevel", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "enum": [ - "TRACE", - "DEBUG", - "INFO", - "WARN", - "ERROR", - "FATAL", - "OFF" - ] - } - } - } - }, - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/application/threaddump": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threadDump", - "responses": { - "200": { - "description": "OK", - "content": { - "text/plain;charset=UTF-8": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/scheduledtasks": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledTasks", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/sbom/{id}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/sbom": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'sbom'", - "operationId": "sboms", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/metrics/{requiredMetricName}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metric", - "parameters": [ - { - "name": "requiredMetricName", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "tag", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/metrics": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'metrics'", - "operationId": "listNames", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/mappings": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'mappings'", - "operationId": "mappings", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/loggers": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'loggers'", - "operationId": "loggers", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/info": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'info'", - "operationId": "info", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/heapdump": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapDump", - "parameters": [ - { - "name": "live", - "in": "query", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/health": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'health'", - "operationId": "health", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/env/{toMatch}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "environmentEntry", - "parameters": [ - { - "name": "toMatch", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/env": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'env'", - "operationId": "environment", - "parameters": [ - { - "name": "pattern", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/configprops/{prefix}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configurationPropertiesWithPrefix", - "parameters": [ - { - "name": "prefix", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/configprops": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'configprops'", - "operationId": "configurationProperties", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/conditions": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'conditions'", - "operationId": "conditions", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/caches/{cache}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "cache", - "parameters": [ - { - "name": "cache", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "cacheManager", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - }, - "delete": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "clearCache", - "parameters": [ - { - "name": "cache", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "cacheManager", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/caches": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'caches'", - "operationId": "caches", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'caches'", - "operationId": "clearCaches", - "responses": { - "204": { - "description": "No Content" - } - } - } - }, - "/application/beans": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'beans'", - "operationId": "beans", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator root web endpoint", - "operationId": "links", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - } - } - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - } - } - } - }, - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - } - } - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "Link": { - "type": "object", - "properties": { - "href": { - "type": "string" - }, - "templated": { - "type": "boolean" - } - } - } - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json deleted file mode 100644 index 0c8297c8f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/src/test/resources/results/app147-2.json +++ /dev/null @@ -1,891 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "OpenAPI definition", - "version": "v0" - }, - "servers": [ - { - "url": "http://localhost:9297/test", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "Actuator", - "description": "Monitor and interact", - "externalDocs": { - "description": "Spring Boot Actuator Web API Documentation", - "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" - } - } - ], - "paths": { - "/application/loggers/{name}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "loggerLevels", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - }, - "post": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'loggers-name'", - "operationId": "configureLogLevel", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "enum": [ - "TRACE", - "DEBUG", - "INFO", - "WARN", - "ERROR", - "FATAL", - "OFF" - ] - } - } - } - }, - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/application/threaddump": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'threaddump'", - "operationId": "threadDump", - "responses": { - "200": { - "description": "OK", - "content": { - "text/plain;charset=UTF-8": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/scheduledtasks": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'scheduledtasks'", - "operationId": "scheduledTasks", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/sbom/{id}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'sbom-id'", - "operationId": "sbom", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/sbom": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'sbom'", - "operationId": "sboms", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/metrics/{requiredMetricName}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'metrics-requiredMetricName'", - "operationId": "metric", - "parameters": [ - { - "name": "requiredMetricName", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "tag", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/metrics": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'metrics'", - "operationId": "listNames", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/mappings": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'mappings'", - "operationId": "mappings", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/loggers": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'loggers'", - "operationId": "loggers", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/info": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'info'", - "operationId": "info", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/heapdump": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'heapdump'", - "operationId": "heapDump", - "parameters": [ - { - "name": "live", - "in": "query", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/octet-stream": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/health": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'health'", - "operationId": "health", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/env/{toMatch}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'env-toMatch'", - "operationId": "environmentEntry", - "parameters": [ - { - "name": "toMatch", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/env": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'env'", - "operationId": "environment", - "parameters": [ - { - "name": "pattern", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/configprops/{prefix}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'configprops-prefix'", - "operationId": "configurationPropertiesWithPrefix", - "parameters": [ - { - "name": "prefix", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/configprops": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'configprops'", - "operationId": "configurationProperties", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/conditions": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'conditions'", - "operationId": "conditions", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application/caches/{cache}": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "cache", - "parameters": [ - { - "name": "cache", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "cacheManager", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "404": { - "description": "Not Found" - } - } - }, - "delete": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'caches-cache'", - "operationId": "clearCache", - "parameters": [ - { - "name": "cache", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "cacheManager", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/application/caches": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'caches'", - "operationId": "caches", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'caches'", - "operationId": "clearCaches", - "responses": { - "204": { - "description": "No Content" - } - } - } - }, - "/application/beans": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'beans'", - "operationId": "beans", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" - } - }, - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/application": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator root web endpoint", - "operationId": "links", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - } - } - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - } - } - } - }, - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - } - } - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "Link": { - "type": "object", - "properties": { - "href": { - "type": "string" - }, - "templated": { - "type": "boolean" - } - } - } - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java deleted file mode 100644 index 3ecba115c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.servlet.MockMvc; - -@AutoConfigureMockMvc -@ActiveProfiles("test") -@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" , "springdoc.api-docs.version=openapi_3_0" }) -public abstract class AbstractCommonTest { - - @Autowired - protected MockMvc mockMvc; - - protected String getContent(String fileName) { - try { - Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java deleted file mode 100644 index fb674a750..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocActuatorTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api; - -import jakarta.annotation.PostConstruct; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.web.server.LocalManagementPort; -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.test.context.TestPropertySource; -import org.springframework.web.client.RestTemplate; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - -@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true" }) -public abstract class AbstractSpringDocActuatorTest extends AbstractCommonTest { - - protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); - - protected RestTemplate actuatorRestTemplate; - - @LocalManagementPort - private int managementPort; - - @Autowired - private RestTemplateBuilder restTemplateBuilder; - - @PostConstruct - void init() { - actuatorRestTemplate = restTemplateBuilder - .rootUri("http://localhost:" + this.managementPort).build(); - } - - protected void testWithRestTemplate(String testId, String uri) throws Exception { - String result = null; - try { - result = actuatorRestTemplate.getForObject(uri, String.class); - String expected = getContent("results/app" + testId + ".json"); - assertEquals(expected, result, true); - } - catch (AssertionError e) { - LOGGER.error(result); - throw e; - } - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index 5824868a0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; - -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@SpringBootTest -public abstract class AbstractSpringDocTest extends AbstractCommonTest { - - public static String className; - - @Test - protected void testApp() throws Exception { - className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/HelloController.java deleted file mode 100644 index ea8209be8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/HelloController.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app128; - - -import org.springframework.boot.actuate.endpoint.web.annotation.RestControllerEndpoint; -import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; - -@RestControllerEndpoint(id = "tenant") -@Component -public class HelloController { - - @GetMapping("/customer/{id}") - public String getTenantById(@PathVariable("id") String customerId) { - return "Tenant_" + customerId; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/SpringDocApp128Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/SpringDocApp128Test.java deleted file mode 100644 index c938ce64f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app128/SpringDocApp128Test.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app128; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController; -import org.springframework.test.context.TestPropertySource; - -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - - -/** - * Tests Spring meta-annotations as method parameters - */ -@TestPropertySource(properties = { "springdoc.show-actuator=true", - "management.endpoints.enabled-by-default=true", - "management.endpoints.web.exposure.include = tenant" }) -public class SpringDocApp128Test extends AbstractSpringDocTest { - - static { - SpringDocUtils.getConfig().addHiddenRestControllers(BasicErrorController.class); - } - - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.operationId", containsString("getTenantById"))) - .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.parameters[0].in", is("path"))) - .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.parameters[0].name", is("id"))); - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/HelloController.java deleted file mode 100644 index 59fee7564..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/HelloController.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app144; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java deleted file mode 100644 index d80cb4239..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app144/SpringDocApp144Test.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app144; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - - -@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "server.port=52554", - "springdoc.use-management-port=true", - "management.server.port=9290", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp144Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) - .andExpect(status().isNotFound()); - } - - @Test - void testApp1() throws Exception { - String result = actuatorRestTemplate.getForObject("/application/openapi", String.class); - String expected = getContent("results/app144.json"); - assertEquals(expected, result, true); - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/HelloController.java deleted file mode 100644 index 12891a39e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/HelloController.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app145; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java deleted file mode 100644 index b45e5135a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app145/SpringDocApp145Test.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app145; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.http.HttpStatus; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.HttpStatusCodeException; - -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - - -@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "server.port=52556", - "springdoc.use-management-port=true", - "springdoc.group-configs[0].group=users", - "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.app145", - "management.server.port=9291", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp145Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) - .andExpect(status().isNotFound()); - } - - @Test - void testApp1() throws Exception { - try { - actuatorRestTemplate.getForObject("/application/openapi", String.class); - fail(); - } - catch (HttpClientErrorException ex) { - if (ex.getStatusCode() == HttpStatus.NOT_FOUND) - assertTrue(true); - else - fail(); - } - } - - @Test - void testApp2() throws Exception { - String result = actuatorRestTemplate.getForObject("/application/openapi/users", String.class); - String expected = getContent("results/app145.json"); - assertEquals(expected, result, true); - } - - @Test - void testApp3() throws Exception { - try { - actuatorRestTemplate.getForObject("/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME, String.class); - fail(); - } - catch (HttpStatusCodeException ex) { - if (ex.getStatusCode() == HttpStatus.NOT_FOUND) - assertTrue(true); - } - } - - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/HelloController.java deleted file mode 100644 index 98af45e13..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/HelloController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app147; - - -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.context.annotation.Bean; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - - @Bean - public GroupedOpenApi userOpenApi() { - return GroupedOpenApi.builder() - .group("users") - .packagesToScan("test.org.springdoc.api.app147") - .build(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java deleted file mode 100644 index ff34a846c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app147/SpringDocApp147Test.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app147; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; - -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - - -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "springdoc.show-actuator=true", - "management.server.port=9287", - "management.endpoints.web.exposure.exclude=functions, shutdown", - "server.servlet.context-path=/sample", - "management.server.base-path=/test", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp147Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.ACTUATOR_DEFAULT_GROUP)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app147-1.json"), true)); - } - - @Test - void testApp1() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app147-2.json"), true)); - } - - @Test - void testApp2() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.DEFAULT_GROUP_NAME)) - .andExpect(status().isNotFound()); - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/HelloController.java deleted file mode 100644 index d4a7dd5a6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/HelloController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app148; - - -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.context.annotation.Bean; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - - @Bean - public GroupedOpenApi userOpenApi() { - return GroupedOpenApi.builder() - .group("users") - .packagesToScan("test.org.springdoc.api.app148") - .build(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java deleted file mode 100644 index 089f9835c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app148/SpringDocApp148Test.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app148; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocActuatorTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.http.HttpStatus; -import org.springframework.web.client.HttpStatusCodeException; - -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - - -@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, - properties = { "management.endpoints.web.exposure.include=*", - "springdoc.show-actuator=true", - "management.server.port=9298", - "server.port=6276", - "server.servlet.context-path=/toto", - "springdoc.use-management-port=true", - "spring.mvc.servlet.path=/titi", - "management.endpoints.web.exposure.exclude=functions, shutdown", - "management.server.base-path=/test", - "management.endpoints.web.base-path=/application" }) -public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { - - @Test - void testApp() throws Exception { - super.testWithRestTemplate("148-1","/test/application/openapi/users"); - } - - @Test - void testApp2() throws Exception { - super.testWithRestTemplate("148-2","/test/application/openapi/x-actuator"); - } - - @Test - void testApp3() throws Exception { - try { - actuatorRestTemplate.getForObject("/test/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME, String.class); - fail(); - } - catch (HttpStatusCodeException ex) { - if (ex.getStatusCode() == HttpStatus.NOT_FOUND) - assertTrue(true); - } - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java deleted file mode 100644 index e448b6403..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app186/SpringDocApp186Test.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app186; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.customizers.OperationCustomizer; -import org.springdoc.core.models.GroupedOpenApi; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -import static org.hamcrest.Matchers.is; -import static org.springdoc.core.utils.Constants.ALL_PATTERN; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@TestPropertySource(properties = { "springdoc.show-actuator=true", - "springdoc.group-configs[0].group=group-actuator-as-properties", - "springdoc.group-configs[0].paths-to-match=${management.endpoints.web.base-path:/actuator}/**", - "management.endpoints.enabled-by-default=true", - "management.endpoints.web.exposure.include=*", - "management.endpoints.web.exposure.exclude=functions, shutdown" }) -public class SpringDocApp186Test extends AbstractSpringDocTest { - - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(status().isOk()) - .andExpect(content().json(getContent("results/app186.json"), true)); - } - - @Test - void testGroupActuatorAsCodeCheckBackwardsCompatibility() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code-check-backwards-compatibility")) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(status().isOk()) - .andExpect(content().json(getContent("results/app186.json"), true)); - } - - @Test - void testGroupActuatorAsCode() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code")) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(status().isOk()) - .andExpect(content().json(getContent("results/app186.json"), true)); - } - - @Test - void testGroupActuatorAsProperties() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-properties")) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(status().isOk()) - .andExpect(content().json(getContent("results/app186.json"), true)); - } - - @SpringBootApplication - static class SpringDocTestApp { - - @Bean - public GroupedOpenApi asCodeCheckBackwardsCompatibility(OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { - return GroupedOpenApi.builder() - .group("group-actuator-as-code-check-backwards-compatibility") - .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) - .addOperationCustomizer(actuatorCustomizer) - .build(); - } - - @Bean - public GroupedOpenApi asCode(WebEndpointProperties endpointProperties) { - return GroupedOpenApi.builder() - .group("group-actuator-as-code") - .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) - .build(); - } - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/HelloController.java deleted file mode 100644 index b383255fc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/HelloController.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app36; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/persons") - public String persons() { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java deleted file mode 100644 index e51e85383..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app36; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@TestPropertySource(properties = { - "springdoc.show-actuator=true", "management.endpoints.enabled-by-default=true", - "management.endpoints.web.exposure.include=*" }) -public class SpringDocApp36Test extends AbstractSpringDocTest { - - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(jsonPath("$.paths./actuator/info.get.operationId", containsString("info"))) - .andExpect(jsonPath("$.paths./actuator/health.get.operationId", containsString("health"))) - .andExpect(jsonPath("$.paths./actuator/metrics/{requiredMetricName}.get.parameters[0].in", is("path"))) - .andExpect(jsonPath("$.paths./actuator/metrics/{requiredMetricName}.get.parameters[0].name", is("requiredMetricName"))); - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/CustomizedOperation.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/CustomizedOperation.java deleted file mode 100644 index 146b41c33..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/CustomizedOperation.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.RUNTIME) -public @interface CustomizedOperation { - String addition() default "customized operation!"; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java deleted file mode 100644 index 0cbbe9cf3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocApp68Test.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68; - -import org.hamcrest.Matchers; -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.test.context.TestPropertySource; - -import static org.hamcrest.Matchers.contains; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true", "springdoc.show-actuator=true" }) -public class SpringDocApp68Test extends AbstractSpringDocTest { - - - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app68-1.json"), true)); - } - - @Test - void testApp2() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app68-2.json"), true)); - } - - @Test - void testApp3() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app68-3.json"), true)); - } - - @Test - void testApp4() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app68-4.json"), true)); - } - - @Test - void testActuator() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(jsonPath("$.paths./actuator/health.get.summary", Matchers.is("Actuator web endpoint 'health'"))) - .andExpect(jsonPath("$.paths./actuator/health.get.operationId", containsString("health"))); - } - - @Test - void testActuatorDescription() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(jsonPath("$.tags", hasSize(4))) - .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].name", contains(Constants.SPRINGDOC_ACTUATOR_TAG))) - .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].description", contains(Constants.SPRINGDOC_ACTUATOR_DESCRIPTION))) - .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].externalDocs.description", contains(Constants.SPRINGDOC_ACTUATOR_DOC_DESCRIPTION))) - .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].externalDocs.url", contains(Constants.SPRINGDOC_ACTUATOR_DOC_URL))); - } - - @Test - void testApp5() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/user")) - .andExpect(status().isNotFound()); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocConfiguration.java deleted file mode 100644 index 0dfedc891..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/SpringDocConfiguration.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68; - -import java.util.ArrayList; -import java.util.List; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; -import io.swagger.v3.oas.models.servers.Server; -import org.apache.commons.lang3.StringUtils; -import org.springdoc.core.customizers.OpenApiCustomizer; -import org.springdoc.core.customizers.OperationCustomizer; -import org.springdoc.core.models.GroupedOpenApi; -import org.springdoc.core.utils.Constants; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.method.HandlerMethod; - -@Configuration -public class SpringDocConfiguration { - - @SpringBootApplication - static class SpringDocTestApp {} - - @Bean - public GroupedOpenApi storeOpenApi() { - return GroupedOpenApi.builder() - .group("stores") - .pathsToMatch("/store/**") - .build(); - } - - @Bean - public GroupedOpenApi userOpenApi() { - return GroupedOpenApi.builder() - .group("users") - .packagesToScan("test.org.springdoc.api.app68.api.user").addOpenApiCustomizer(serverOpenApiCustomizer1()) - .addOperationCustomizer(operationCustomizer()) - .build(); - } - - public OpenApiCustomizer serverOpenApiCustomizer1() { - Server server = new Server().url("http://toto.v1.com").description("myserver1"); - List servers = new ArrayList<>(); - servers.add(server); - return openApi -> openApi.setServers(servers); - } - - public OpenApiCustomizer serverOpenApiCustomizer2() { - Server server = new Server().url("http://toto.v2.com").description("myserver2"); - List servers = new ArrayList<>(); - servers.add(server); - return openApi -> openApi.setServers(servers); - } - - OperationCustomizer operationCustomizer() { - return (Operation operation, HandlerMethod handlerMethod) -> { - CustomizedOperation annotation = handlerMethod.getMethodAnnotation(CustomizedOperation.class); - if (annotation != null) { - operation.description(StringUtils.defaultIfBlank(operation.getDescription(), Constants.DEFAULT_DESCRIPTION) + ", " + annotation.addition()); - } - return operation; - }; - } - - @Bean - public GroupedOpenApi petOpenApi() { - return GroupedOpenApi.builder() - .group("pets") - .pathsToMatch("/pet/**").addOpenApiCustomizer(serverOpenApiCustomizer2()) - .build(); - } - - @Bean - public GroupedOpenApi groupOpenApi() { - return GroupedOpenApi.builder() - .group("groups test") - .pathsToMatch("/v1/**").pathsToExclude("/v1/users") - .packagesToScan("test.org.springdoc.api.app68.api.user", "test.org.springdoc.api.app68.api.store") - .build(); - } - - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Petstore API").version("v0").description( - "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") - .termsOfService("http://swagger.io/terms/") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/ApiUtil.java deleted file mode 100644 index 64657f7dc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/ApiUtil.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api; - -import java.io.IOException; - -import jakarta.servlet.http.HttpServletResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.server.ResponseStatusException; - -public class ApiUtil { - - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); - req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - - public static void checkApiKey(NativeWebRequest req) { - if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { - throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/ExceptionTranslator.java deleted file mode 100644 index 0c4fb85cb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/ExceptionTranslator.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api; - -import java.util.Map; - -import jakarta.validation.ConstraintViolationException; - -import org.springframework.boot.web.error.ErrorAttributeOptions; -import org.springframework.boot.web.servlet.error.ErrorAttributes; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.WebRequest; - -@RestControllerAdvice -public class ExceptionTranslator { - - private final ErrorAttributes errorAttributes; - - public ExceptionTranslator(ErrorAttributes errorAttributes) { - this.errorAttributes = errorAttributes; - } - - @ExceptionHandler(ConstraintViolationException.class) - @ResponseStatus(HttpStatus.BAD_REQUEST) - public Map processConstraintViolationException(WebRequest request) { - request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); - return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/HomeController.java deleted file mode 100644 index 9476bf058..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/HomeController.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; -import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; -import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; - -/** - * Home redirection to swagger api documentation - */ -@Controller -public class HomeController { - - @Value(SWAGGER_UI_PATH) - private String swaggerUiPath; - - @GetMapping(DEFAULT_PATH_SEPARATOR) - public String index() { - return REDIRECT_URL_PREFIX + swaggerUiPath; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApi.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApi.java deleted file mode 100644 index 76d849eb1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApi.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package test.org.springdoc.api.app68.api.pet; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.security.OAuthFlow; -import io.swagger.v3.oas.annotations.security.OAuthFlows; -import io.swagger.v3.oas.annotations.security.OAuthScope; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.security.SecurityScheme; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; -import test.org.springdoc.api.app68.model.ModelApiResponse; -import test.org.springdoc.api.app68.model.Pet; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { - @OAuthScope(name = "write:pets", description = "modify pets in your account"), - @OAuthScope(name = "read:pets", description = "read your pets") }))) -@Tag(name = "pet", description = "the pet API") -@ResponseBody -public interface PetApi { - - default PetApiDelegate getDelegate() { - return new PetApiDelegate() { - }; - } - - @Operation(summary = "Add a new pet to the store", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) - @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) - default void addPet( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { - // return getDelegate().addPet(pet); - } - - @Operation(summary = "Deletes a pet", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") }) - @DeleteMapping(value = "/pet/{petId}") - default ResponseEntity deletePet( - @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { - return getDelegate().deletePet(petId, apiKey); - } - - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), - @ApiResponse(responseCode = "400", description = "Invalid status value") }) - @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) - default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { - return getDelegate().findPetsByStatus(status); - } - - @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), - @ApiResponse(responseCode = "400", description = "Invalid tag value") }) - @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) - default ResponseEntity> findPetsByTags( - @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { - return getDelegate().findPetsByTags(tags); - } - - @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { - @SecurityRequirement(name = "api_key") }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") }) - @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) - default ResponseEntity getPetById( - @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { - return getDelegate().getPetById(petId); - } - - @Operation(summary = "Update an existing pet", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") }) - @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) - default ResponseEntity updatePet( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { - return getDelegate().updatePet(pet); - } - - @Operation(summary = "Updates a pet in the store with form data", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) - @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) - default ResponseEntity updatePetWithForm( - @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, - @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { - return getDelegate().updatePetWithForm(petId, name, status); - } - - @Operation(summary = "uploads an image", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) - @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { - "multipart/form-data" }) - default ResponseEntity uploadFile( - @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { - return getDelegate().uploadFile(petId, additionalMetadata, file); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiController.java deleted file mode 100644 index 3b974cb0c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api.pet; - -import java.util.Optional; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@RestController -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class PetApiController implements PetApi { - - private final PetApiDelegate delegate; - - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { - }); - } - - @Override - public PetApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiDelegate.java deleted file mode 100644 index 9f01a36e4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiDelegate.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api.pet; - -import java.util.List; -import java.util.Optional; - -import jakarta.validation.Valid; -import test.org.springdoc.api.app68.api.ApiUtil; -import test.org.springdoc.api.app68.model.ModelApiResponse; -import test.org.springdoc.api.app68.model.Pet; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -/** - * A delegate to be called by the {@link PetApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -public interface PetApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * @see PetApi#addPet - */ - default void addPet(Pet pet) { - - } - - /** - * @see PetApi#deletePet - */ - default ResponseEntity deletePet(Long petId, - String apiKey) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see PetApi#findPetsByStatus - */ - default ResponseEntity> findPetsByStatus(List status) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - default void extract() { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); - break; - } - } - }); - } - - /** - * @see PetApi#findPetsByTags - */ - default ResponseEntity> findPetsByTags(List tags) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see PetApi#getPetById - */ - default ResponseEntity getPetById(Long petId) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see PetApi#updatePet - */ - default ResponseEntity updatePet(Pet pet) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see PetApi#updatePetWithForm - */ - default ResponseEntity updatePetWithForm(Long petId, - String name, - String status) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see PetApi#uploadFile - */ - default ResponseEntity uploadFile(Long petId, - String additionalMetadata, - @Valid MultipartFile file) { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiDelegateImpl.java deleted file mode 100644 index 5a70c357f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/pet/PetApiDelegateImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api.pet; - -import org.springframework.stereotype.Service; - -@Service -public class PetApiDelegateImpl implements PetApiDelegate { - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApi.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApi.java deleted file mode 100644 index d026561f7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApi.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package test.org.springdoc.api.app68.api.store; - -import java.util.Map; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotBlank; -import test.org.springdoc.api.app68.model.Order; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@Tag(name = "store", description = "the store API") -public interface StoreApi { - - default StoreApiDelegate getDelegate() { - return new StoreApiDelegate() { - }; - } - - @Operation(summary = "Delete purchase order by ID", tags = { "store" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") }) - @DeleteMapping(value = "/store/order/{orderId}") - default ResponseEntity deleteOrder( - @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { - return getDelegate().deleteOrder(orderId); - } - - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { - @SecurityRequirement(name = "api_key") }, tags = { "store" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) - @GetMapping(value = "/store/inventory", produces = { "application/json" }) - default ResponseEntity> getInventory() { - return getDelegate().getInventory(); - } - - @Operation(summary = "Find purchase order by ID", tags = { "store" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") }) - @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { - return getDelegate().getOrderById(orderId); - } - - @Operation(summary = "Place an order for a pet", tags = { "store" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), - @ApiResponse(responseCode = "400", description = "Invalid Order") }) - @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { - "application/json" }) - default ResponseEntity placeOrder( - @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { - return getDelegate().placeOrder(order); - } - - @GetMapping(value = "/v1/stores") - default void stores(@Valid @NotBlank String name) { - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiController.java deleted file mode 100644 index d97bee1d6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api.store; - -import java.util.Optional; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@RestController -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class StoreApiController implements StoreApi { - - private final StoreApiDelegate delegate; - - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { - }); - } - - @Override - public StoreApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiDelegate.java deleted file mode 100644 index 3446bc839..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiDelegate.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api.store; - -import java.util.Map; -import java.util.Optional; - -import test.org.springdoc.api.app68.api.ApiUtil; -import test.org.springdoc.api.app68.model.Order; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; - -/** - * A delegate to be called by the {@link StoreApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -public interface StoreApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * @see StoreApi#deleteOrder - */ - default ResponseEntity deleteOrder(String orderId) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see StoreApi#getInventory - */ - default ResponseEntity> getInventory() { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see StoreApi#getOrderById - */ - default ResponseEntity getOrderById(Long orderId) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - default void extract() { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); - break; - } - } - }); - } - - /** - * @see StoreApi#placeOrder - */ - default ResponseEntity placeOrder(Order order) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiDelegateImpl.java deleted file mode 100644 index 3e81c002b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/store/StoreApiDelegateImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api.store; - -import org.springframework.stereotype.Service; - -@Service -public class StoreApiDelegateImpl implements StoreApiDelegate { - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApi.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApi.java deleted file mode 100644 index 12891ac4d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApi.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package test.org.springdoc.api.app68.api.user; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; -import test.org.springdoc.api.app68.model.User; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; - -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@Tag(name = "user", description = "the user API") -public interface UserApi { - - default UserApiDelegate getDelegate() { - return new UserApiDelegate() { - }; - } - - @Operation(summary = "Create user", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - @PostMapping(value = "/user", consumes = { "application/json" }) - default ResponseEntity createUser( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { - return getDelegate().createUser(user); - } - - @Operation(summary = "Creates list of users with given input array", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - - @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) - default ResponseEntity createUsersWithArrayInput( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { - return getDelegate().createUsersWithArrayInput(user); - } - - @Operation(summary = "Creates list of users with given input array", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) - default ResponseEntity createUsersWithListInput( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { - return getDelegate().createUsersWithListInput(user); - } - - @Operation(summary = "Creates list of users with given input array", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - - @DeleteMapping(value = "/user/{username}") - default ResponseEntity deleteUser( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { - return getDelegate().deleteUser(username); - } - - @Operation(summary = "Get user by user name", tags = { "user" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") }) - - @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) - default ResponseEntity getUserByName( - @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { - return getDelegate().getUserByName(username); - } - - @Operation(summary = "Logs user into the system", tags = { "user" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), - @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) - @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) - default ResponseEntity loginUser( - @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { - return getDelegate().loginUser(username, password); - } - - @Operation(summary = "Logs out current logged in user session", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - @GetMapping(value = "/user/logout") - default ResponseEntity logoutUser() { - return getDelegate().logoutUser(); - } - - @Operation(summary = "Updated user", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), - @ApiResponse(responseCode = "404", description = "User not found") }) - @PutMapping(value = "/user/{username}", consumes = { "application/json" }) - default ResponseEntity updateUser( - @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { - return getDelegate().updateUser(username, user); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiController.java deleted file mode 100644 index d20572a65..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api.user; - -import java.util.Optional; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@RestController -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -public class UserApiController implements UserApi { - - private final UserApiDelegate delegate; - - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { - }); - } - - @Override - public UserApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiDelegate.java deleted file mode 100644 index 7c98d9edd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiDelegate.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api.user; - -import java.util.List; -import java.util.Optional; - -import test.org.springdoc.api.app68.api.ApiUtil; -import test.org.springdoc.api.app68.model.User; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; - -/** - * A delegate to be called by the {@link UserApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -public interface UserApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * @see UserApi#createUser - */ - default ResponseEntity createUser(User user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see UserApi#createUsersWithArrayInput - */ - default ResponseEntity createUsersWithArrayInput(List user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see UserApi#createUsersWithListInput - */ - default ResponseEntity createUsersWithListInput(List user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see UserApi#deleteUser - */ - default ResponseEntity deleteUser(String username) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see UserApi#getUserByName - */ - default ResponseEntity getUserByName(String username) { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see UserApi#loginUser - */ - default ResponseEntity loginUser(String username, - String password) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see UserApi#logoutUser - */ - default ResponseEntity logoutUser() { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * @see UserApi#updateUser - */ - default ResponseEntity updateUser(String username, - User user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiDelegateImpl.java deleted file mode 100644 index dee9cd208..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserApiDelegateImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.api.user; - -import org.springframework.stereotype.Service; - -@Service -public class UserApiDelegateImpl implements UserApiDelegate { - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserClient.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserClient.java deleted file mode 100644 index 16ed71112..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/api/user/UserClient.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app68.api.user; - -import test.org.springdoc.api.app68.model.User; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; - -@RequestMapping(value = "/users", consumes = "application/json") -@Controller -public class UserClient { - - @GetMapping("/{id}") - public User findById(@PathVariable Integer id) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Body.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Body.java deleted file mode 100644 index c2076e97f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Body.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -public class Body { - - @Schema(description = "Updated name of the pet") - /** - * Updated name of the pet - **/ - private String name = null; - - @Schema(description = "Updated status of the pet") - /** - * Updated status of the pet - **/ - private String status = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Updated name of the pet - * - * @return name - **/ - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Body name(String name) { - this.name = name; - return this; - } - - /** - * Updated status of the pet - * - * @return status - **/ - @JsonProperty("status") - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Body status(String status) { - this.status = status; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Body {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Body1.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Body1.java deleted file mode 100644 index 9fa7c2baf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Body1.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.model; - -import java.io.File; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -public class Body1 { - - @Schema(description = "Additional data to pass to server") - /** - * Additional data to pass to server - **/ - private String additionalMetadata = null; - - @Schema(description = "file to upload") - /** - * file to upload - **/ - private File file = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Additional data to pass to server - * - * @return additionalMetadata - **/ - @JsonProperty("additionalMetadata") - public String getAdditionalMetadata() { - return additionalMetadata; - } - - public void setAdditionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - } - - public Body1 additionalMetadata(String additionalMetadata) { - this.additionalMetadata = additionalMetadata; - return this; - } - - /** - * file to upload - * - * @return file - **/ - @JsonProperty("file") - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public Body1 file(File file) { - this.file = file; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Body1 {\n"); - - sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Category.java deleted file mode 100644 index d131574f9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Category.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -public class Category { - - @Schema(description = "") - private Long id = null; - - @Schema(description = "") - private String name = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id - **/ - @JsonProperty("id") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get name - * - * @return name - **/ - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Category name(String name) { - this.name = name; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/ModelApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/ModelApiResponse.java deleted file mode 100644 index 521ecb8e6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/ModelApiResponse.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -public class ModelApiResponse { - - @Schema(description = "") - private Integer code = null; - - @Schema(description = "") - private String type = null; - - @Schema(description = "") - private String message = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get code - * - * @return code - **/ - @JsonProperty("code") - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get type - * - * @return type - **/ - @JsonProperty("type") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get message - * - * @return message - **/ - @JsonProperty("message") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Order.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Order.java deleted file mode 100644 index feede5ec3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Order.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.model; - -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.v3.oas.annotations.media.Schema; - -public class Order { - - @Schema(description = "") - private Long id = null; - - @Schema(description = "") - private Long petId = null; - - @Schema(description = "") - private Integer quantity = null; - - @Schema(description = "") - private Date shipDate = null; - - @Schema(description = "Order Status") - /** - * Order Status - **/ - private StatusEnum status = null; - - @Schema(description = "") - private Boolean complete = false; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id - **/ - @JsonProperty("id") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get petId - * - * @return petId - **/ - @JsonProperty("petId") - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get quantity - * - * @return quantity - **/ - @JsonProperty("quantity") - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get shipDate - * - * @return shipDate - **/ - @JsonProperty("shipDate") - public Date getShipDate() { - return shipDate; - } - - public void setShipDate(Date shipDate) { - this.shipDate = shipDate; - } - - public Order shipDate(Date shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Order Status - * - * @return status - **/ - @JsonProperty("status") - public String getStatus() { - if (status == null) { - return null; - } - return status.getValue(); - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Get complete - * - * @return complete - **/ - @JsonProperty("complete") - public Boolean isisComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public enum StatusEnum { - PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Pet.java deleted file mode 100644 index fc122c620..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Pet.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.model; - -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; - -public class Pet { - - @Schema(description = "") - private Long id = null; - - @Schema(description = "") - private Category category = null; - - @Schema(example = "doggie", required = true, description = "") - private String name = null; - - @Schema(required = true, description = "") - private List photoUrls = new ArrayList(); - - @Schema(description = "") - private List tags = null; - - @Schema(description = "pet status in the store") - /** - * pet status in the store - **/ - private StatusEnum status = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id - **/ - @JsonProperty("id") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get category - * - * @return category - **/ - @JsonProperty("category") - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get name - * - * @return name - **/ - @JsonProperty("name") - @NotNull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get photoUrls - * - * @return photoUrls - **/ - @JsonProperty("photoUrls") - @NotNull - public List getPhotoUrls() { - return photoUrls; - } - - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get tags - * - * @return tags - **/ - @JsonProperty("tags") - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * pet status in the store - * - * @return status - **/ - @JsonProperty("status") - public StatusEnum getStatus() { - if (status == null) { - return null; - } - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public enum StatusEnum { - AVAILABLE("available"), PENDING("pending"), SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Tag.java deleted file mode 100644 index 585aec5db..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/Tag.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -public class Tag { - - @Schema(description = "") - private Long id = null; - - @Schema(description = "") - private String name = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id - **/ - @JsonProperty("id") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get name - * - * @return name - **/ - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/User.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/User.java deleted file mode 100644 index 0e3f8c6e2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app68/model/User.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app68.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -public class User { - - @Schema(description = "") - private Long id = null; - - @Schema(description = "") - private String username = null; - - @Schema(description = "") - private String firstName = null; - - @Schema(description = "") - private String lastName = null; - - @Schema(description = "") - private String email = null; - - @Schema(description = "") - private String password = null; - - @Schema(description = "") - private String phone = null; - - @Schema(description = "User Status") - /** - * User Status - **/ - private Integer userStatus = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id - **/ - @JsonProperty("id") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get username - * - * @return username - **/ - @JsonProperty("username") - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get firstName - * - * @return firstName - **/ - @JsonProperty("firstName") - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get lastName - * - * @return lastName - **/ - @JsonProperty("lastName") - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get email - * - * @return email - **/ - @JsonProperty("email") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get password - * - * @return password - **/ - @JsonProperty("password") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get phone - * - * @return phone - **/ - @JsonProperty("phone") - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * User Status - * - * @return userStatus - **/ - @JsonProperty("userStatus") - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java deleted file mode 100644 index 50037fee8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app72; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.FilteredClassLoader; -import org.springframework.boot.test.context.runner.ApplicationContextRunner; -import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.context.annotation.Bean; - -import static org.assertj.core.api.Assertions.assertThat; - -class BlockingAutoConfigurationTest { - - private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() - .withUserConfiguration(TestApp.class); - - @Test - void configurations_successfully_loaded() { - contextRunner - .withPropertyValues("springdoc.show-actuator=true") - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .hasBean("actuatorProvider") - .hasBean("multipleOpenApiResource") - ); - } - - @Test - void configurations_not_loaded_when_application_is_not_web() { - new ApplicationContextRunner() - .withUserConfiguration(TestApp.class) - .run(context -> assertThat(context) - .hasNotFailed() - .doesNotHaveBean("openApiResource") - .doesNotHaveBean("actuatorProvider") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - @Test - void actuator_configuration_not_loaded_when_not_enabled_explicitly() { - contextRunner - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .doesNotHaveBean("actuatorPprrovider") - .hasBean("multipleOpenApiResource") - ); - } - - @Test - void configurations_not_loaded_when_disabled() { - contextRunner - .withPropertyValues("springdoc.api-docs.enabled=false") - .run(context -> assertThat(context) - .hasNotFailed() - .doesNotHaveBean("openApiResource") - .doesNotHaveBean("actuatorProvider") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - @Test - void configurations_not_loaded_when_mvc_is_not_on_class_path() { - contextRunner - .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) - .run(context -> assertThat(context) - .hasNotFailed() - .doesNotHaveBean("openApiResource") - .doesNotHaveBean("actuatorProvider") - .doesNotHaveBean("multipleOpenApiResource") - ); - - } - - @SpringBootApplication - static class TestApp { - @Bean - GroupedOpenApi testGroupedOpenApi() { - return GroupedOpenApi.builder() - .group("test-group") - .packagesToScan("org.test") - .build(); - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java deleted file mode 100644 index d1b91cef0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app72; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.runner.WebApplicationContextRunner; - -import static org.assertj.core.api.Assertions.assertThat; - -public class CacheAutoConfigurationTest1 { - - private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() - .withUserConfiguration(TestApp.class); - - @Test - void cache_configuration_loaded_when_not_disabled_explicitly() { - contextRunner - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .doesNotHaveBean("springdocBeanFactoryPostProcessor") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - @Test - void cache_configuration_loaded_when_disabled_explicitly() { - contextRunner - .withPropertyValues("springdoc.cache.disabled=false") - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .doesNotHaveBean("springdocBeanFactoryPostProcessor") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - @Test - void cache_configurations_successfully_disabled() { - contextRunner - .withPropertyValues("springdoc.cache.disabled=true") - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .hasBean("springdocBeanFactoryPostProcessor") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - @Test - void group_configuration_loaded() { - contextRunner - .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .hasBean("multipleOpenApiResource") - .hasBean("springdocBeanFactoryPostProcessor") - ); - } - - - @EnableAutoConfiguration - static class TestApp { - - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java deleted file mode 100644 index ef634e5a7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app72; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.context.annotation.Bean; - -import static org.assertj.core.api.Assertions.assertThat; - -public class GroupAutoConfigurationTest { - - private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() - .withUserConfiguration(TestApp.class); - - @Test - void group_configuration_loaded() { - contextRunner - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .hasBean("springdocBeanFactoryPostProcessor") - .hasBean("multipleOpenApiResource") - ); - } - - @EnableAutoConfiguration - static class TestApp { - @Bean - GroupedOpenApi testGroupedOpenApi() { - return GroupedOpenApi.builder() - .group("test-group") - .packagesToScan("org.test") - .build(); - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java new file mode 100644 index 000000000..f3e9a665e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MockMvc; + +@AutoConfigureMockMvc +@ActiveProfiles("test") +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false" , "springdoc.api-docs.version=openapi_3_0" }) +public abstract class AbstractCommonTest { + + @Autowired + protected MockMvc mockMvc; + + protected String getContent(String fileName) { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocActuatorTest.java new file mode 100644 index 000000000..9884a05b8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocActuatorTest.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import jakarta.annotation.PostConstruct; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.web.server.LocalManagementPort; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.client.RestTemplate; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true" }) +public abstract class AbstractSpringDocActuatorTest extends AbstractCommonTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); + + protected RestTemplate actuatorRestTemplate; + + @LocalManagementPort + private int managementPort; + + @Autowired + private RestTemplateBuilder restTemplateBuilder; + + @PostConstruct + void init() { + actuatorRestTemplate = restTemplateBuilder + .rootUri("http://localhost:" + this.managementPort).build(); + } + + protected void testWithRestTemplate(String testId, String uri) throws Exception { + String result = null; + try { + result = actuatorRestTemplate.getForObject(uri, String.class); + String expected = getContent("results/3.0.1/app" + testId + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..a4e6f57e5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest +public abstract class AbstractSpringDocTest extends AbstractCommonTest { + + public static String className; + + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app128/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app128/HelloController.java new file mode 100644 index 000000000..5431305c5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app128/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app128; + + +import org.springframework.boot.actuate.endpoint.web.annotation.RestControllerEndpoint; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +@RestControllerEndpoint(id = "tenant") +@Component +public class HelloController { + + @GetMapping("/customer/{id}") + public String getTenantById(@PathVariable("id") String customerId) { + return "Tenant_" + customerId; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app128/SpringDocApp128Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app128/SpringDocApp128Test.java new file mode 100644 index 000000000..b1febbe53 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app128/SpringDocApp128Test.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app128; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = { "springdoc.show-actuator=true", + "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.include = tenant" }) +public class SpringDocApp128Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().addHiddenRestControllers(BasicErrorController.class); + } + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.operationId", containsString("getTenantById"))) + .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.parameters[0].in", is("path"))) + .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.parameters[0].name", is("id"))); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app144/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app144/HelloController.java new file mode 100644 index 000000000..a5027a7c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app144/HelloController.java @@ -0,0 +1,32 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app144; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app144/SpringDocApp144Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app144/SpringDocApp144Test.java new file mode 100644 index 000000000..1ea455b4f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app144/SpringDocApp144Test.java @@ -0,0 +1,58 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app144; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=52554", + "springdoc.use-management-port=true", + "management.server.port=9290", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp144Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isNotFound()); + } + + @Test + void testApp1() throws Exception { + String result = actuatorRestTemplate.getForObject("/application/openapi", String.class); + String expected = getContent("results/3.0.1/app144.json"); + assertEquals(expected, result, true); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app145/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app145/HelloController.java new file mode 100644 index 000000000..96e1706cc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app145/HelloController.java @@ -0,0 +1,32 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app145; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp145Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp145Test.java new file mode 100644 index 000000000..3ac609f88 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app145/SpringDocApp145Test.java @@ -0,0 +1,90 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app145; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpStatusCodeException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=53556", + "springdoc.use-management-port=true", + "springdoc.group-configs[0].group=users", + "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.v30.app145", + "management.server.port=9391", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp145Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) + .andExpect(status().isNotFound()); + } + + @Test + void testApp1() throws Exception { + try { + actuatorRestTemplate.getForObject("/application/openapi", String.class); + fail(); + } + catch (HttpClientErrorException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + else + fail(); + } + } + + @Test + void testApp2() throws Exception { + String result = actuatorRestTemplate.getForObject("/application/openapi/users", String.class); + String expected = getContent("results/3.0.1/app145.json"); + assertEquals(expected, result, true); + } + + @Test + void testApp3() throws Exception { + try { + actuatorRestTemplate.getForObject("/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME, String.class); + fail(); + } + catch (HttpStatusCodeException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app147/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app147/HelloController.java new file mode 100644 index 000000000..edb329231 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app147/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app147; + + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v30.app147") + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app147/SpringDocApp147Test.java new file mode 100644 index 000000000..24195e622 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app147/SpringDocApp147Test.java @@ -0,0 +1,70 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app147; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.server.port=9287", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "server.servlet.context-path=/sample", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp147Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.ACTUATOR_DEFAULT_GROUP)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app147-1.json"), true)); + } + + @Test + void testApp1() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app147-2.json"), true)); + } + + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.DEFAULT_GROUP_NAME)) + .andExpect(status().isNotFound()); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app148/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app148/HelloController.java new file mode 100644 index 000000000..4bc86013a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app148/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app148; + + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v30.app148") + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app148/SpringDocApp148Test.java new file mode 100644 index 000000000..7723a6703 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app148/SpringDocApp148Test.java @@ -0,0 +1,73 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app148; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.web.client.HttpStatusCodeException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.server.port=9298", + "server.port=6276", + "server.servlet.context-path=/toto", + "springdoc.use-management-port=true", + "spring.mvc.servlet.path=/titi", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + super.testWithRestTemplate("148-1","/test/application/openapi/users"); + } + + @Test + void testApp2() throws Exception { + super.testWithRestTemplate("148-2","/test/application/openapi/x-actuator"); + } + + @Test + void testApp3() throws Exception { + try { + actuatorRestTemplate.getForObject("/test/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME, String.class); + fail(); + } + catch (HttpStatusCodeException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app186/SpringDocApp186Test.java new file mode 100644 index 000000000..e8b773c45 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app186/SpringDocApp186Test.java @@ -0,0 +1,106 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app186; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springdoc.core.utils.Constants.ALL_PATTERN; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { "springdoc.show-actuator=true", + "springdoc.group-configs[0].group=group-actuator-as-properties", + "springdoc.group-configs[0].paths-to-match=${management.endpoints.web.base-path:/actuator}/**", + "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.include=*", + "management.endpoints.web.exposure.exclude=functions, shutdown" }) +public class SpringDocApp186Test extends AbstractSpringDocTest { + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.0.1/app186.json"), true)); + } + + @Test + void testGroupActuatorAsCodeCheckBackwardsCompatibility() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code-check-backwards-compatibility")) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.0.1/app186.json"), true)); + } + + @Test + void testGroupActuatorAsCode() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code")) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.0.1/app186.json"), true)); + } + + @Test + void testGroupActuatorAsProperties() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-properties")) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.0.1/app186.json"), true)); + } + + @SpringBootApplication + static class SpringDocTestApp { + + @Bean + public GroupedOpenApi asCodeCheckBackwardsCompatibility(OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { + return GroupedOpenApi.builder() + .group("group-actuator-as-code-check-backwards-compatibility") + .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) + .addOperationCustomizer(actuatorCustomizer) + .build(); + } + + @Bean + public GroupedOpenApi asCode(WebEndpointProperties endpointProperties) { + return GroupedOpenApi.builder() + .group("group-actuator-as-code") + .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) + .build(); + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app36/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app36/HelloController.java new file mode 100644 index 000000000..513fcfb32 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app36/HelloController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app36; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app36/SpringDocApp36Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app36/SpringDocApp36Test.java new file mode 100644 index 000000000..b7f92e0a9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app36/SpringDocApp36Test.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app36; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { + "springdoc.show-actuator=true", "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.include=*" }) +public class SpringDocApp36Test extends AbstractSpringDocTest { + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(jsonPath("$.paths./actuator/info.get.operationId", containsString("info"))) + .andExpect(jsonPath("$.paths./actuator/health.get.operationId", containsString("health"))) + .andExpect(jsonPath("$.paths./actuator/metrics/{requiredMetricName}.get.parameters[0].in", is("path"))) + .andExpect(jsonPath("$.paths./actuator/metrics/{requiredMetricName}.get.parameters[0].name", is("requiredMetricName"))); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/CustomizedOperation.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/CustomizedOperation.java new file mode 100644 index 000000000..d3bbb4377 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/CustomizedOperation.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedOperation { + String addition() default "customized operation!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/SpringDocApp68Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/SpringDocApp68Test.java new file mode 100644 index 000000000..59736e946 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/SpringDocApp68Test.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68; + +import org.hamcrest.Matchers; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true", "springdoc.show-actuator=true" }) +public class SpringDocApp68Test extends AbstractSpringDocTest { + + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app68-1.json"), true)); + } + + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app68-2.json"), true)); + } + + @Test + void testApp3() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app68-3.json"), true)); + } + + @Test + void testApp4() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app68-4.json"), true)); + } + + @Test + void testActuator() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(jsonPath("$.paths./actuator/health.get.summary", Matchers.is("Actuator web endpoint 'health'"))) + .andExpect(jsonPath("$.paths./actuator/health.get.operationId", containsString("health"))); + } + + @Test + void testActuatorDescription() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(jsonPath("$.tags", hasSize(4))) + .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].name", contains(Constants.SPRINGDOC_ACTUATOR_TAG))) + .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].description", contains(Constants.SPRINGDOC_ACTUATOR_DESCRIPTION))) + .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].externalDocs.description", contains(Constants.SPRINGDOC_ACTUATOR_DOC_DESCRIPTION))) + .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].externalDocs.url", contains(Constants.SPRINGDOC_ACTUATOR_DOC_URL))); + } + + @Test + void testApp5() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/user")) + .andExpect(status().isNotFound()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/SpringDocConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/SpringDocConfiguration.java new file mode 100644 index 000000000..0e9507d2d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/SpringDocConfiguration.java @@ -0,0 +1,125 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.servers.Server; +import org.apache.commons.lang3.StringUtils; +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.method.HandlerMethod; + +@Configuration +public class SpringDocConfiguration { + + @SpringBootApplication + static class SpringDocTestApp {} + + @Bean + public GroupedOpenApi storeOpenApi() { + return GroupedOpenApi.builder() + .group("stores") + .pathsToMatch("/store/**") + .build(); + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v30.app68.api.user").addOpenApiCustomizer(serverOpenApiCustomizer1()) + .addOperationCustomizer(operationCustomizer()) + .build(); + } + + public OpenApiCustomizer serverOpenApiCustomizer1() { + Server server = new Server().url("http://toto.v1.com").description("myserver1"); + List servers = new ArrayList<>(); + servers.add(server); + return openApi -> openApi.setServers(servers); + } + + public OpenApiCustomizer serverOpenApiCustomizer2() { + Server server = new Server().url("http://toto.v2.com").description("myserver2"); + List servers = new ArrayList<>(); + servers.add(server); + return openApi -> openApi.setServers(servers); + } + + OperationCustomizer operationCustomizer() { + return (Operation operation, HandlerMethod handlerMethod) -> { + CustomizedOperation annotation = handlerMethod.getMethodAnnotation(CustomizedOperation.class); + if (annotation != null) { + operation.description(StringUtils.defaultIfBlank(operation.getDescription(), Constants.DEFAULT_DESCRIPTION) + ", " + annotation.addition()); + } + return operation; + }; + } + + @Bean + public GroupedOpenApi petOpenApi() { + return GroupedOpenApi.builder() + .group("pets") + .pathsToMatch("/pet/**").addOpenApiCustomizer(serverOpenApiCustomizer2()) + .build(); + } + + @Bean + public GroupedOpenApi groupOpenApi() { + return GroupedOpenApi.builder() + .group("groups test") + .pathsToMatch("/v1/**").pathsToExclude("/v1/users") + .packagesToScan("test.org.springdoc.api.v30.app68.api.user", "test.org.springdoc.api.v30.app68.api.store") + .build(); + } + + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/ApiUtil.java new file mode 100644 index 000000000..60e24fdae --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/ApiUtil.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api; + +import java.io.IOException; + +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.server.ResponseStatusException; + +public class ApiUtil { + + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); + req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static void checkApiKey(NativeWebRequest req) { + if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { + throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/ExceptionTranslator.java new file mode 100644 index 000000000..cdb1592e2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/ExceptionTranslator.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api; + +import java.util.Map; + +import jakarta.validation.ConstraintViolationException; + +import org.springframework.boot.web.error.ErrorAttributeOptions; +import org.springframework.boot.web.servlet.error.ErrorAttributes; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.WebRequest; + +@RestControllerAdvice +public class ExceptionTranslator { + + private final ErrorAttributes errorAttributes; + + public ExceptionTranslator(ErrorAttributes errorAttributes) { + this.errorAttributes = errorAttributes; + } + + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Map processConstraintViolationException(WebRequest request) { + request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); + return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/HomeController.java new file mode 100644 index 000000000..91fabfb4e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/HomeController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; +import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; + +/** + * Home redirection to swagger api documentation + */ +@Controller +public class HomeController { + + @Value(SWAGGER_UI_PATH) + private String swaggerUiPath; + + @GetMapping(DEFAULT_PATH_SEPARATOR) + public String index() { + return REDIRECT_URL_PREFIX + swaggerUiPath; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApi.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApi.java new file mode 100644 index 000000000..95665ae15 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApi.java @@ -0,0 +1,169 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v30.app68.api.pet; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v30.app68.model.ModelApiResponse; +import test.org.springdoc.api.v30.app68.model.Pet; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; + +@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { + @OAuthScope(name = "write:pets", description = "modify pets in your account"), + @OAuthScope(name = "read:pets", description = "read your pets") }))) +@Tag(name = "pet", description = "the pet API") +@ResponseBody +public interface PetApi { + + default PetApiDelegate getDelegate() { + return new PetApiDelegate() { + }; + } + + @Operation(summary = "Add a new pet to the store", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default void addPet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + // return getDelegate().addPet(pet); + } + + @Operation(summary = "Deletes a pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @DeleteMapping(value = "/pet/{petId}") + default ResponseEntity deletePet( + @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + return getDelegate().deletePet(petId, apiKey); + } + + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid status value") }) + @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByStatus( + @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { + return getDelegate().findPetsByStatus(status); + } + + @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid tag value") }) + @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByTags( + @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + return getDelegate().findPetsByTags(tags); + } + + @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { + @SecurityRequirement(name = "api_key") }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getPetById( + @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + return getDelegate().getPetById(petId); + } + + @Operation(summary = "Update an existing pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") }) + @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default ResponseEntity updatePet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + return getDelegate().updatePet(pet); + } + + @Operation(summary = "Updates a pet in the store with form data", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) + default ResponseEntity updatePetWithForm( + @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, + @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { + return getDelegate().updatePetWithForm(petId, name, status); + } + + @Operation(summary = "uploads an image", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) + @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { + "multipart/form-data" }) + default ResponseEntity uploadFile( + @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { + return getDelegate().uploadFile(petId, additionalMetadata, file); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiController.java new file mode 100644 index 000000000..e3923c258 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.pet; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +public class PetApiController implements PetApi { + + private final PetApiDelegate delegate; + + public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { + }); + } + + @Override + public PetApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiDelegate.java new file mode 100644 index 000000000..0846d81bc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiDelegate.java @@ -0,0 +1,149 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.pet; + +import java.util.List; +import java.util.Optional; + +import jakarta.validation.Valid; +import test.org.springdoc.api.v30.app68.api.ApiUtil; +import test.org.springdoc.api.v30.app68.model.ModelApiResponse; +import test.org.springdoc.api.v30.app68.model.Pet; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface PetApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * @see PetApi#addPet + */ + default void addPet(Pet pet) { + + } + + /** + * @see PetApi#deletePet + */ + default ResponseEntity deletePet(Long petId, + String apiKey) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#findPetsByStatus + */ + default ResponseEntity> findPetsByStatus(List status) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + break; + } + } + }); + } + + /** + * @see PetApi#findPetsByTags + */ + default ResponseEntity> findPetsByTags(List tags) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#getPetById + */ + default ResponseEntity getPetById(Long petId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#updatePet + */ + default ResponseEntity updatePet(Pet pet) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#updatePetWithForm + */ + default ResponseEntity updatePetWithForm(Long petId, + String name, + String status) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#uploadFile + */ + default ResponseEntity uploadFile(Long petId, + String additionalMetadata, + @Valid MultipartFile file) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiDelegateImpl.java new file mode 100644 index 000000000..4eb2fccc7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/pet/PetApiDelegateImpl.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.pet; + +import org.springframework.stereotype.Service; + +@Service +public class PetApiDelegateImpl implements PetApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApi.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApi.java new file mode 100644 index 000000000..2f3cea9ab --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApi.java @@ -0,0 +1,112 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v30.app68.api.store; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import test.org.springdoc.api.v30.app68.model.Order; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() { + }; + } + + @Operation(summary = "Delete purchase order by ID", tags = { "store" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @DeleteMapping(value = "/store/order/{orderId}") + default ResponseEntity deleteOrder( + @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { + return getDelegate().deleteOrder(orderId); + } + + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { + @SecurityRequirement(name = "api_key") }, tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) + @GetMapping(value = "/store/inventory", produces = { "application/json" }) + default ResponseEntity> getInventory() { + return getDelegate().getInventory(); + } + + @Operation(summary = "Find purchase order by ID", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { + return getDelegate().getOrderById(orderId); + } + + @Operation(summary = "Place an order for a pet", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid Order") }) + @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { + "application/json" }) + default ResponseEntity placeOrder( + @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { + return getDelegate().placeOrder(order); + } + + @GetMapping(value = "/v1/stores") + default void stores(@Valid @NotBlank String name) { + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiController.java new file mode 100644 index 000000000..13da99064 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.store; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +public class StoreApiController implements StoreApi { + + private final StoreApiDelegate delegate; + + public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { + }); + } + + @Override + public StoreApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiDelegate.java new file mode 100644 index 000000000..17cb050b3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiDelegate.java @@ -0,0 +1,101 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.store; + +import java.util.Map; +import java.util.Optional; + +import test.org.springdoc.api.v30.app68.api.ApiUtil; +import test.org.springdoc.api.v30.app68.model.Order; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface StoreApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * @see StoreApi#deleteOrder + */ + default ResponseEntity deleteOrder(String orderId) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see StoreApi#getInventory + */ + default ResponseEntity> getInventory() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see StoreApi#getOrderById + */ + default ResponseEntity getOrderById(Long orderId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + break; + } + } + }); + } + + /** + * @see StoreApi#placeOrder + */ + default ResponseEntity placeOrder(Order order) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiDelegateImpl.java new file mode 100644 index 000000000..1eb776ad8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/store/StoreApiDelegateImpl.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.store; + +import org.springframework.stereotype.Service; + +@Service +public class StoreApiDelegateImpl implements StoreApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApi.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApi.java new file mode 100644 index 000000000..5545f62b3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApi.java @@ -0,0 +1,140 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v30.app68.api.user; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v30.app68.model.User; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "user", description = "the user API") +public interface UserApi { + + default UserApiDelegate getDelegate() { + return new UserApiDelegate() { + }; + } + + @Operation(summary = "Create user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user", consumes = { "application/json" }) + default ResponseEntity createUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { + return getDelegate().createUser(user); + } + + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) + default ResponseEntity createUsersWithArrayInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithArrayInput(user); + } + + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) + default ResponseEntity createUsersWithListInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithListInput(user); + } + + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @DeleteMapping(value = "/user/{username}") + default ResponseEntity deleteUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + return getDelegate().deleteUser(username); + } + + @Operation(summary = "Get user by user name", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + + @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) + default ResponseEntity getUserByName( + @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + return getDelegate().getUserByName(username); + } + + @Operation(summary = "Logs user into the system", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) + @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) + default ResponseEntity loginUser( + @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + return getDelegate().loginUser(username, password); + } + + @Operation(summary = "Logs out current logged in user session", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @GetMapping(value = "/user/logout") + default ResponseEntity logoutUser() { + return getDelegate().logoutUser(); + } + + @Operation(summary = "Updated user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + @PutMapping(value = "/user/{username}", consumes = { "application/json" }) + default ResponseEntity updateUser( + @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { + return getDelegate().updateUser(username, user); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiController.java new file mode 100644 index 000000000..2e58ecb3a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.user; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +public class UserApiController implements UserApi { + + private final UserApiDelegate delegate; + + public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { + }); + } + + @Override + public UserApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiDelegate.java new file mode 100644 index 000000000..b16423c01 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiDelegate.java @@ -0,0 +1,130 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.user; + +import java.util.List; +import java.util.Optional; + +import test.org.springdoc.api.v30.app68.api.ApiUtil; +import test.org.springdoc.api.v30.app68.model.User; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface UserApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * @see UserApi#createUser + */ + default ResponseEntity createUser(User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#createUsersWithArrayInput + */ + default ResponseEntity createUsersWithArrayInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#createUsersWithListInput + */ + default ResponseEntity createUsersWithListInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#deleteUser + */ + default ResponseEntity deleteUser(String username) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#getUserByName + */ + default ResponseEntity getUserByName(String username) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#loginUser + */ + default ResponseEntity loginUser(String username, + String password) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#logoutUser + */ + default ResponseEntity logoutUser() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#updateUser + */ + default ResponseEntity updateUser(String username, + User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiDelegateImpl.java new file mode 100644 index 000000000..864b26523 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserApiDelegateImpl.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.user; + +import org.springframework.stereotype.Service; + +@Service +public class UserApiDelegateImpl implements UserApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserClient.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserClient.java new file mode 100644 index 000000000..381c1656e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/api/user/UserClient.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.api.user; + +import test.org.springdoc.api.v30.app68.model.User; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +@RequestMapping(value = "/users", consumes = "application/json") +@Controller +public class UserClient { + + @GetMapping("/{id}") + public User findById(@PathVariable Integer id) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Body.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Body.java new file mode 100644 index 000000000..b97ad69b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Body.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Body { + + @Schema(description = "Updated name of the pet") + /** + * Updated name of the pet + **/ + private String name = null; + + @Schema(description = "Updated status of the pet") + /** + * Updated status of the pet + **/ + private String status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Updated name of the pet + * + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Body name(String name) { + this.name = name; + return this; + } + + /** + * Updated status of the pet + * + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Body status(String status) { + this.status = status; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Body {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Body1.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Body1.java new file mode 100644 index 000000000..ac8663f5e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Body1.java @@ -0,0 +1,107 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.model; + +import java.io.File; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Body1 { + + @Schema(description = "Additional data to pass to server") + /** + * Additional data to pass to server + **/ + private String additionalMetadata = null; + + @Schema(description = "file to upload") + /** + * file to upload + **/ + private File file = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Additional data to pass to server + * + * @return additionalMetadata + **/ + @JsonProperty("additionalMetadata") + public String getAdditionalMetadata() { + return additionalMetadata; + } + + public void setAdditionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + } + + public Body1 additionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + return this; + } + + /** + * file to upload + * + * @return file + **/ + @JsonProperty("file") + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } + + public Body1 file(File file) { + this.file = file; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Body1 {\n"); + + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Category.java new file mode 100644 index 000000000..832005c87 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Category.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Category { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/ModelApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/ModelApiResponse.java new file mode 100644 index 000000000..6412dee05 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/ModelApiResponse.java @@ -0,0 +1,122 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class ModelApiResponse { + + @Schema(description = "") + private Integer code = null; + + @Schema(description = "") + private String type = null; + + @Schema(description = "") + private String message = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get code + * + * @return code + **/ + @JsonProperty("code") + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * + * @return type + **/ + @JsonProperty("type") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * + * @return message + **/ + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Order.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Order.java new file mode 100644 index 000000000..55c58ab09 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Order.java @@ -0,0 +1,234 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.model; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Order { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private Long petId = null; + + @Schema(description = "") + private Integer quantity = null; + + @Schema(description = "") + private Date shipDate = null; + + @Schema(description = "Order Status") + /** + * Order Status + **/ + private StatusEnum status = null; + + @Schema(description = "") + private Boolean complete = false; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * + * @return petId + **/ + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * + * @return quantity + **/ + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * + * @return shipDate + **/ + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + if (status == null) { + return null; + } + return status.getValue(); + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * + * @return complete + **/ + @JsonProperty("complete") + public Boolean isisComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public enum StatusEnum { + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Pet.java new file mode 100644 index 000000000..68e05dbb6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Pet.java @@ -0,0 +1,248 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.model; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +public class Pet { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private Category category = null; + + @Schema(example = "doggie", required = true, description = "") + private String name = null; + + @Schema(required = true, description = "") + private List photoUrls = new ArrayList(); + + @Schema(description = "") + private List tags = null; + + @Schema(description = "pet status in the store") + /** + * pet status in the store + **/ + private StatusEnum status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * + * @return category + **/ + @JsonProperty("category") + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * + * @return name + **/ + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * + * @return photoUrls + **/ + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * + * @return tags + **/ + @JsonProperty("tags") + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * + * @return status + **/ + @JsonProperty("status") + public StatusEnum getStatus() { + if (status == null) { + return null; + } + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public enum StatusEnum { + AVAILABLE("available"), PENDING("pending"), SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Tag.java new file mode 100644 index 000000000..795b7445b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/Tag.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Tag { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/User.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/User.java new file mode 100644 index 000000000..ed63e6134 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app68/model/User.java @@ -0,0 +1,240 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class User { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private String username = null; + + @Schema(description = "") + private String firstName = null; + + @Schema(description = "") + private String lastName = null; + + @Schema(description = "") + private String email = null; + + @Schema(description = "") + private String password = null; + + @Schema(description = "") + private String phone = null; + + @Schema(description = "User Status") + /** + * User Status + **/ + private Integer userStatus = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * + * @return username + **/ + @JsonProperty("username") + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * + * @return firstName + **/ + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * + * @return lastName + **/ + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * + * @return email + **/ + @JsonProperty("email") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * + * @return password + **/ + @JsonProperty("password") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * + * @return phone + **/ + @JsonProperty("phone") + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * + * @return userStatus + **/ + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java new file mode 100644 index 000000000..e9ec70e8d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.FilteredClassLoader; +import org.springframework.boot.test.context.runner.ApplicationContextRunner; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +class BlockingAutoConfigurationTest { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void configurations_successfully_loaded() { + contextRunner + .withPropertyValues("springdoc.show-actuator=true") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("actuatorProvider") + .hasBean("multipleOpenApiResource") + ); + } + + @Test + void configurations_not_loaded_when_application_is_not_web() { + new ApplicationContextRunner() + .withUserConfiguration(TestApp.class) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void actuator_configuration_not_loaded_when_not_enabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("actuatorPprrovider") + .hasBean("multipleOpenApiResource") + ); + } + + @Test + void configurations_not_loaded_when_disabled() { + contextRunner + .withPropertyValues("springdoc.api-docs.enabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void configurations_not_loaded_when_mvc_is_not_on_class_path() { + contextRunner + .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + + } + + @SpringBootApplication + static class TestApp { + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java new file mode 100644 index 000000000..3dd7c0012 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java @@ -0,0 +1,93 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72; + +import org.junit.jupiter.api.Test; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +public class CacheAutoConfigurationTest1 { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void cache_configuration_loaded_when_not_disabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void cache_configuration_loaded_when_disabled_explicitly() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void cache_configurations_successfully_disabled() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=true") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void group_configuration_loaded() { + contextRunner + .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("multipleOpenApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + ); + } + + + @EnableAutoConfiguration + static class TestApp { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java new file mode 100644 index 000000000..05e9fb181 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +public class GroupAutoConfigurationTest { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void group_configuration_loaded() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .hasBean("multipleOpenApiResource") + ); + } + + @EnableAutoConfiguration + static class TestApp { + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java new file mode 100644 index 000000000..fde99f3fb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MockMvc; + +@AutoConfigureMockMvc +@ActiveProfiles("test") +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=false"}) +public abstract class AbstractCommonTest { + + @Autowired + protected MockMvc mockMvc; + + protected String getContent(String fileName) { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocActuatorTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocActuatorTest.java new file mode 100644 index 000000000..aed753fc1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocActuatorTest.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import jakarta.annotation.PostConstruct; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.web.server.LocalManagementPort; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.client.RestTemplate; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true" }) +public abstract class AbstractSpringDocActuatorTest extends AbstractCommonTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); + + protected RestTemplate actuatorRestTemplate; + + @LocalManagementPort + private int managementPort; + + @Autowired + private RestTemplateBuilder restTemplateBuilder; + + @PostConstruct + void init() { + actuatorRestTemplate = restTemplateBuilder + .rootUri("http://localhost:" + this.managementPort).build(); + } + + protected void testWithRestTemplate(String testId, String uri) throws Exception { + String result = null; + try { + result = actuatorRestTemplate.getForObject(uri, String.class); + String expected = getContent("results/3.1.0/app" + testId + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..959c70cac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest +public abstract class AbstractSpringDocTest extends AbstractCommonTest { + + public static String className; + + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app128/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app128/HelloController.java new file mode 100644 index 000000000..a60a93147 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app128/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app128; + + +import org.springframework.boot.actuate.endpoint.web.annotation.RestControllerEndpoint; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +@RestControllerEndpoint(id = "tenant") +@Component +public class HelloController { + + @GetMapping("/customer/{id}") + public String getTenantById(@PathVariable("id") String customerId) { + return "Tenant_" + customerId; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app128/SpringDocApp128Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app128/SpringDocApp128Test.java new file mode 100644 index 000000000..9f186b54f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app128/SpringDocApp128Test.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app128; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = { "springdoc.show-actuator=true", + "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.include = tenant" }) +public class SpringDocApp128Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().addHiddenRestControllers(BasicErrorController.class); + } + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.operationId", containsString("getTenantById"))) + .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.parameters[0].in", is("path"))) + .andExpect(jsonPath("$.paths./actuator/tenant/customer/{id}.get.parameters[0].name", is("id"))); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app144/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app144/HelloController.java new file mode 100644 index 000000000..6fea3caac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app144/HelloController.java @@ -0,0 +1,32 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app144; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app144/SpringDocApp144Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app144/SpringDocApp144Test.java new file mode 100644 index 000000000..19c78b23e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app144/SpringDocApp144Test.java @@ -0,0 +1,58 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app144; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=53554", + "springdoc.use-management-port=true", + "management.server.port=9390", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp144Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isNotFound()); + } + + @Test + void testApp1() throws Exception { + String result = actuatorRestTemplate.getForObject("/application/openapi", String.class); + String expected = getContent("results/3.1.0/app144.json"); + assertEquals(expected, result, true); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app145/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app145/HelloController.java new file mode 100644 index 000000000..62cafda2f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app145/HelloController.java @@ -0,0 +1,32 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app145; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp145Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp145Test.java new file mode 100644 index 000000000..a2b9b22f1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app145/SpringDocApp145Test.java @@ -0,0 +1,90 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app145; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpStatusCodeException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "server.port=52556", + "springdoc.use-management-port=true", + "springdoc.group-configs[0].group=users", + "springdoc.group-configs[0].packages-to-scan=test.org.springdoc.api.v31.app145", + "management.server.port=9291", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp145Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) + .andExpect(status().isNotFound()); + } + + @Test + void testApp1() throws Exception { + try { + actuatorRestTemplate.getForObject("/application/openapi", String.class); + fail(); + } + catch (HttpClientErrorException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + else + fail(); + } + } + + @Test + void testApp2() throws Exception { + String result = actuatorRestTemplate.getForObject("/application/openapi/users", String.class); + String expected = getContent("results/3.1.0/app145.json"); + assertEquals(expected, result, true); + } + + @Test + void testApp3() throws Exception { + try { + actuatorRestTemplate.getForObject("/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME, String.class); + fail(); + } + catch (HttpStatusCodeException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app147/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app147/HelloController.java new file mode 100644 index 000000000..816625454 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app147/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app147; + + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v31.app147") + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app147/SpringDocApp147Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app147/SpringDocApp147Test.java new file mode 100644 index 000000000..5fa24acca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app147/SpringDocApp147Test.java @@ -0,0 +1,70 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app147; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.server.port=9387", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "server.servlet.context-path=/sample", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp147Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.ACTUATOR_DEFAULT_GROUP)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app147-1.json"), true)); + } + + @Test + void testApp1() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app147-2.json"), true)); + } + + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/" + Constants.DEFAULT_GROUP_NAME)) + .andExpect(status().isNotFound()); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app148/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app148/HelloController.java new file mode 100644 index 000000000..1b6912bc3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app148/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app148; + + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v31.app148") + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app148/SpringDocApp148Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app148/SpringDocApp148Test.java new file mode 100644 index 000000000..740c1951f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app148/SpringDocApp148Test.java @@ -0,0 +1,73 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app148; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocActuatorTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.HttpStatus; +import org.springframework.web.client.HttpStatusCodeException; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + + +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT, + properties = { "management.endpoints.web.exposure.include=*", + "springdoc.show-actuator=true", + "management.server.port=9398", + "server.port=6376", + "server.servlet.context-path=/toto", + "springdoc.use-management-port=true", + "spring.mvc.servlet.path=/titi", + "management.endpoints.web.exposure.exclude=functions, shutdown", + "management.server.base-path=/test", + "management.endpoints.web.base-path=/application" }) +public class SpringDocApp148Test extends AbstractSpringDocActuatorTest { + + @Test + void testApp() throws Exception { + super.testWithRestTemplate("148-1","/test/application/openapi/users"); + } + + @Test + void testApp2() throws Exception { + super.testWithRestTemplate("148-2","/test/application/openapi/x-actuator"); + } + + @Test + void testApp3() throws Exception { + try { + actuatorRestTemplate.getForObject("/test/application/openapi" + "/" + Constants.DEFAULT_GROUP_NAME, String.class); + fail(); + } + catch (HttpStatusCodeException ex) { + if (ex.getStatusCode() == HttpStatus.NOT_FOUND) + assertTrue(true); + } + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app186/SpringDocApp186Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app186/SpringDocApp186Test.java new file mode 100644 index 000000000..b8204437f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app186/SpringDocApp186Test.java @@ -0,0 +1,106 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app186; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springdoc.core.utils.Constants.ALL_PATTERN; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { "springdoc.show-actuator=true", + "springdoc.group-configs[0].group=group-actuator-as-properties", + "springdoc.group-configs[0].paths-to-match=${management.endpoints.web.base-path:/actuator}/**", + "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.include=*", + "management.endpoints.web.exposure.exclude=functions, shutdown" }) +public class SpringDocApp186Test extends AbstractSpringDocTest { + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.1.0/app186.json"), true)); + } + + @Test + void testGroupActuatorAsCodeCheckBackwardsCompatibility() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code-check-backwards-compatibility")) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.1.0/app186.json"), true)); + } + + @Test + void testGroupActuatorAsCode() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-code")) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.1.0/app186.json"), true)); + } + + @Test + void testGroupActuatorAsProperties() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/group-actuator-as-properties")) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(status().isOk()) + .andExpect(content().json(getContent("results/3.1.0/app186.json"), true)); + } + + @SpringBootApplication + static class SpringDocTestApp { + + @Bean + public GroupedOpenApi asCodeCheckBackwardsCompatibility(OperationCustomizer actuatorCustomizer, WebEndpointProperties endpointProperties) { + return GroupedOpenApi.builder() + .group("group-actuator-as-code-check-backwards-compatibility") + .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) + .addOperationCustomizer(actuatorCustomizer) + .build(); + } + + @Bean + public GroupedOpenApi asCode(WebEndpointProperties endpointProperties) { + return GroupedOpenApi.builder() + .group("group-actuator-as-code") + .pathsToMatch(endpointProperties.getBasePath() + ALL_PATTERN) + .build(); + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app36/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app36/HelloController.java new file mode 100644 index 000000000..b44dd6ba2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app36/HelloController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app36; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app36/SpringDocApp36Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app36/SpringDocApp36Test.java new file mode 100644 index 000000000..4ea433bf2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app36/SpringDocApp36Test.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app36; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { + "springdoc.show-actuator=true", "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.include=*" }) +public class SpringDocApp36Test extends AbstractSpringDocTest { + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.paths./actuator/info.get.operationId", containsString("info"))) + .andExpect(jsonPath("$.paths./actuator/health.get.operationId", containsString("health"))) + .andExpect(jsonPath("$.paths./actuator/metrics/{requiredMetricName}.get.parameters[0].in", is("path"))) + .andExpect(jsonPath("$.paths./actuator/metrics/{requiredMetricName}.get.parameters[0].name", is("requiredMetricName"))); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/CustomizedOperation.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/CustomizedOperation.java new file mode 100644 index 000000000..79d64bb21 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/CustomizedOperation.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedOperation { + String addition() default "customized operation!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/SpringDocApp68Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/SpringDocApp68Test.java new file mode 100644 index 000000000..0c45fcf17 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/SpringDocApp68Test.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68; + +import org.hamcrest.Matchers; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = { "management.endpoints.enabled-by-default=true", "springdoc.show-actuator=true" }) +public class SpringDocApp68Test extends AbstractSpringDocTest { + + + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app68-1.json"), true)); + } + + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app68-2.json"), true)); + } + + @Test + void testApp3() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app68-3.json"), true)); + } + + @Test + void testApp4() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app68-4.json"), true)); + } + + @Test + void testActuator() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.paths./actuator/health.get.summary", Matchers.is("Actuator web endpoint 'health'"))) + .andExpect(jsonPath("$.paths./actuator/health.get.operationId", containsString("health"))); + } + + @Test + void testActuatorDescription() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.tags", hasSize(4))) + .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].name", contains(Constants.SPRINGDOC_ACTUATOR_TAG))) + .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].description", contains(Constants.SPRINGDOC_ACTUATOR_DESCRIPTION))) + .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].externalDocs.description", contains(Constants.SPRINGDOC_ACTUATOR_DOC_DESCRIPTION))) + .andExpect(jsonPath("$.tags[?(@.name == '" + Constants.SPRINGDOC_ACTUATOR_TAG + "')].externalDocs.url", contains(Constants.SPRINGDOC_ACTUATOR_DOC_URL))); + } + + @Test + void testApp5() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/user")) + .andExpect(status().isNotFound()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/SpringDocConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/SpringDocConfiguration.java new file mode 100644 index 000000000..8265a1f94 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/SpringDocConfiguration.java @@ -0,0 +1,125 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.servers.Server; +import org.apache.commons.lang3.StringUtils; +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springdoc.core.customizers.OperationCustomizer; +import org.springdoc.core.models.GroupedOpenApi; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.method.HandlerMethod; + +@Configuration +public class SpringDocConfiguration { + + @SpringBootApplication + static class SpringDocTestApp {} + + @Bean + public GroupedOpenApi storeOpenApi() { + return GroupedOpenApi.builder() + .group("stores") + .pathsToMatch("/store/**") + .build(); + } + + @Bean + public GroupedOpenApi userOpenApi() { + return GroupedOpenApi.builder() + .group("users") + .packagesToScan("test.org.springdoc.api.v31.app68.api.user").addOpenApiCustomizer(serverOpenApiCustomizer1()) + .addOperationCustomizer(operationCustomizer()) + .build(); + } + + public OpenApiCustomizer serverOpenApiCustomizer1() { + Server server = new Server().url("http://toto.v1.com").description("myserver1"); + List servers = new ArrayList<>(); + servers.add(server); + return openApi -> openApi.setServers(servers); + } + + public OpenApiCustomizer serverOpenApiCustomizer2() { + Server server = new Server().url("http://toto.v2.com").description("myserver2"); + List servers = new ArrayList<>(); + servers.add(server); + return openApi -> openApi.setServers(servers); + } + + OperationCustomizer operationCustomizer() { + return (Operation operation, HandlerMethod handlerMethod) -> { + CustomizedOperation annotation = handlerMethod.getMethodAnnotation(CustomizedOperation.class); + if (annotation != null) { + operation.description(StringUtils.defaultIfBlank(operation.getDescription(), Constants.DEFAULT_DESCRIPTION) + ", " + annotation.addition()); + } + return operation; + }; + } + + @Bean + public GroupedOpenApi petOpenApi() { + return GroupedOpenApi.builder() + .group("pets") + .pathsToMatch("/pet/**").addOpenApiCustomizer(serverOpenApiCustomizer2()) + .build(); + } + + @Bean + public GroupedOpenApi groupOpenApi() { + return GroupedOpenApi.builder() + .group("groups test") + .pathsToMatch("/v1/**").pathsToExclude("/v1/users") + .packagesToScan("test.org.springdoc.api.v31.app68.api.user", "test.org.springdoc.api.v31.app68.api.store") + .build(); + } + + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/ApiUtil.java new file mode 100644 index 000000000..a225320c3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/ApiUtil.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api; + +import java.io.IOException; + +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.server.ResponseStatusException; + +public class ApiUtil { + + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); + req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static void checkApiKey(NativeWebRequest req) { + if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { + throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/ExceptionTranslator.java new file mode 100644 index 000000000..0d9c3513b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/ExceptionTranslator.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api; + +import java.util.Map; + +import jakarta.validation.ConstraintViolationException; + +import org.springframework.boot.web.error.ErrorAttributeOptions; +import org.springframework.boot.web.servlet.error.ErrorAttributes; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.WebRequest; + +@RestControllerAdvice +public class ExceptionTranslator { + + private final ErrorAttributes errorAttributes; + + public ExceptionTranslator(ErrorAttributes errorAttributes) { + this.errorAttributes = errorAttributes; + } + + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Map processConstraintViolationException(WebRequest request) { + request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); + return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/HomeController.java new file mode 100644 index 000000000..911050848 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/HomeController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; +import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; + +/** + * Home redirection to swagger api documentation + */ +@Controller +public class HomeController { + + @Value(SWAGGER_UI_PATH) + private String swaggerUiPath; + + @GetMapping(DEFAULT_PATH_SEPARATOR) + public String index() { + return REDIRECT_URL_PREFIX + swaggerUiPath; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApi.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApi.java new file mode 100644 index 000000000..40ef935aa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApi.java @@ -0,0 +1,169 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app68.api.pet; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v31.app68.model.ModelApiResponse; +import test.org.springdoc.api.v31.app68.model.Pet; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; + +@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { + @OAuthScope(name = "write:pets", description = "modify pets in your account"), + @OAuthScope(name = "read:pets", description = "read your pets") }))) +@Tag(name = "pet", description = "the pet API") +@ResponseBody +public interface PetApi { + + default PetApiDelegate getDelegate() { + return new PetApiDelegate() { + }; + } + + @Operation(summary = "Add a new pet to the store", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default void addPet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + // return getDelegate().addPet(pet); + } + + @Operation(summary = "Deletes a pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @DeleteMapping(value = "/pet/{petId}") + default ResponseEntity deletePet( + @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + return getDelegate().deletePet(petId, apiKey); + } + + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid status value") }) + @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByStatus( + @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { + return getDelegate().findPetsByStatus(status); + } + + @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid tag value") }) + @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByTags( + @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + return getDelegate().findPetsByTags(tags); + } + + @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { + @SecurityRequirement(name = "api_key") }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getPetById( + @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + return getDelegate().getPetById(petId); + } + + @Operation(summary = "Update an existing pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") }) + @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default ResponseEntity updatePet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + return getDelegate().updatePet(pet); + } + + @Operation(summary = "Updates a pet in the store with form data", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) + default ResponseEntity updatePetWithForm( + @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, + @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { + return getDelegate().updatePetWithForm(petId, name, status); + } + + @Operation(summary = "uploads an image", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) + @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { + "multipart/form-data" }) + default ResponseEntity uploadFile( + @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { + return getDelegate().uploadFile(petId, additionalMetadata, file); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiController.java new file mode 100644 index 000000000..7a5089d2c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.pet; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +public class PetApiController implements PetApi { + + private final PetApiDelegate delegate; + + public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { + }); + } + + @Override + public PetApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiDelegate.java new file mode 100644 index 000000000..665775682 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiDelegate.java @@ -0,0 +1,149 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.pet; + +import java.util.List; +import java.util.Optional; + +import jakarta.validation.Valid; +import test.org.springdoc.api.v31.app68.api.ApiUtil; +import test.org.springdoc.api.v31.app68.model.ModelApiResponse; +import test.org.springdoc.api.v31.app68.model.Pet; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface PetApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * @see PetApi#addPet + */ + default void addPet(Pet pet) { + + } + + /** + * @see PetApi#deletePet + */ + default ResponseEntity deletePet(Long petId, + String apiKey) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#findPetsByStatus + */ + default ResponseEntity> findPetsByStatus(List status) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + break; + } + } + }); + } + + /** + * @see PetApi#findPetsByTags + */ + default ResponseEntity> findPetsByTags(List tags) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#getPetById + */ + default ResponseEntity getPetById(Long petId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#updatePet + */ + default ResponseEntity updatePet(Pet pet) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#updatePetWithForm + */ + default ResponseEntity updatePetWithForm(Long petId, + String name, + String status) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see PetApi#uploadFile + */ + default ResponseEntity uploadFile(Long petId, + String additionalMetadata, + @Valid MultipartFile file) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiDelegateImpl.java new file mode 100644 index 000000000..24d1da938 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/pet/PetApiDelegateImpl.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.pet; + +import org.springframework.stereotype.Service; + +@Service +public class PetApiDelegateImpl implements PetApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApi.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApi.java new file mode 100644 index 000000000..9c89eec98 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApi.java @@ -0,0 +1,112 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app68.api.store; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import test.org.springdoc.api.v31.app68.model.Order; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() { + }; + } + + @Operation(summary = "Delete purchase order by ID", tags = { "store" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @DeleteMapping(value = "/store/order/{orderId}") + default ResponseEntity deleteOrder( + @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { + return getDelegate().deleteOrder(orderId); + } + + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { + @SecurityRequirement(name = "api_key") }, tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) + @GetMapping(value = "/store/inventory", produces = { "application/json" }) + default ResponseEntity> getInventory() { + return getDelegate().getInventory(); + } + + @Operation(summary = "Find purchase order by ID", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { + return getDelegate().getOrderById(orderId); + } + + @Operation(summary = "Place an order for a pet", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid Order") }) + @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { + "application/json" }) + default ResponseEntity placeOrder( + @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { + return getDelegate().placeOrder(order); + } + + @GetMapping(value = "/v1/stores") + default void stores(@Valid @NotBlank String name) { + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiController.java new file mode 100644 index 000000000..40929f9a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.store; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +public class StoreApiController implements StoreApi { + + private final StoreApiDelegate delegate; + + public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { + }); + } + + @Override + public StoreApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiDelegate.java new file mode 100644 index 000000000..5d181918d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiDelegate.java @@ -0,0 +1,101 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.store; + +import java.util.Map; +import java.util.Optional; + +import test.org.springdoc.api.v31.app68.api.ApiUtil; +import test.org.springdoc.api.v31.app68.model.Order; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface StoreApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * @see StoreApi#deleteOrder + */ + default ResponseEntity deleteOrder(String orderId) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see StoreApi#getInventory + */ + default ResponseEntity> getInventory() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see StoreApi#getOrderById + */ + default ResponseEntity getOrderById(Long orderId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + break; + } + } + }); + } + + /** + * @see StoreApi#placeOrder + */ + default ResponseEntity placeOrder(Order order) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiDelegateImpl.java new file mode 100644 index 000000000..e2f1b8787 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/store/StoreApiDelegateImpl.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.store; + +import org.springframework.stereotype.Service; + +@Service +public class StoreApiDelegateImpl implements StoreApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApi.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApi.java new file mode 100644 index 000000000..b4eddbc31 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApi.java @@ -0,0 +1,140 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app68.api.user; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v31.app68.model.User; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "user", description = "the user API") +public interface UserApi { + + default UserApiDelegate getDelegate() { + return new UserApiDelegate() { + }; + } + + @Operation(summary = "Create user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user", consumes = { "application/json" }) + default ResponseEntity createUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { + return getDelegate().createUser(user); + } + + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) + default ResponseEntity createUsersWithArrayInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithArrayInput(user); + } + + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) + default ResponseEntity createUsersWithListInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithListInput(user); + } + + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @DeleteMapping(value = "/user/{username}") + default ResponseEntity deleteUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + return getDelegate().deleteUser(username); + } + + @Operation(summary = "Get user by user name", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + + @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) + default ResponseEntity getUserByName( + @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + return getDelegate().getUserByName(username); + } + + @Operation(summary = "Logs user into the system", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) + @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) + default ResponseEntity loginUser( + @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + return getDelegate().loginUser(username, password); + } + + @Operation(summary = "Logs out current logged in user session", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @GetMapping(value = "/user/logout") + default ResponseEntity logoutUser() { + return getDelegate().logoutUser(); + } + + @Operation(summary = "Updated user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + @PutMapping(value = "/user/{username}", consumes = { "application/json" }) + default ResponseEntity updateUser( + @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { + return getDelegate().updateUser(username, user); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiController.java new file mode 100644 index 000000000..26f8d55d0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.user; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +public class UserApiController implements UserApi { + + private final UserApiDelegate delegate; + + public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { + }); + } + + @Override + public UserApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiDelegate.java new file mode 100644 index 000000000..08d4d25f2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiDelegate.java @@ -0,0 +1,130 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.user; + +import java.util.List; +import java.util.Optional; + +import test.org.springdoc.api.v31.app68.api.ApiUtil; +import test.org.springdoc.api.v31.app68.model.User; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface UserApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * @see UserApi#createUser + */ + default ResponseEntity createUser(User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#createUsersWithArrayInput + */ + default ResponseEntity createUsersWithArrayInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#createUsersWithListInput + */ + default ResponseEntity createUsersWithListInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#deleteUser + */ + default ResponseEntity deleteUser(String username) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#getUserByName + */ + default ResponseEntity getUserByName(String username) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#loginUser + */ + default ResponseEntity loginUser(String username, + String password) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#logoutUser + */ + default ResponseEntity logoutUser() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * @see UserApi#updateUser + */ + default ResponseEntity updateUser(String username, + User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiDelegateImpl.java new file mode 100644 index 000000000..f533ac10f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserApiDelegateImpl.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.user; + +import org.springframework.stereotype.Service; + +@Service +public class UserApiDelegateImpl implements UserApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserClient.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserClient.java new file mode 100644 index 000000000..5c644c4ed --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/api/user/UserClient.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.api.user; + +import test.org.springdoc.api.v31.app68.model.User; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +@RequestMapping(value = "/users", consumes = "application/json") +@Controller +public class UserClient { + + @GetMapping("/{id}") + public User findById(@PathVariable Integer id) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Body.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Body.java new file mode 100644 index 000000000..dc3c20294 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Body.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Body { + + @Schema(description = "Updated name of the pet") + /** + * Updated name of the pet + **/ + private String name = null; + + @Schema(description = "Updated status of the pet") + /** + * Updated status of the pet + **/ + private String status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Updated name of the pet + * + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Body name(String name) { + this.name = name; + return this; + } + + /** + * Updated status of the pet + * + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Body status(String status) { + this.status = status; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Body {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Body1.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Body1.java new file mode 100644 index 000000000..93e2f621b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Body1.java @@ -0,0 +1,107 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.model; + +import java.io.File; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Body1 { + + @Schema(description = "Additional data to pass to server") + /** + * Additional data to pass to server + **/ + private String additionalMetadata = null; + + @Schema(description = "file to upload") + /** + * file to upload + **/ + private File file = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Additional data to pass to server + * + * @return additionalMetadata + **/ + @JsonProperty("additionalMetadata") + public String getAdditionalMetadata() { + return additionalMetadata; + } + + public void setAdditionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + } + + public Body1 additionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + return this; + } + + /** + * file to upload + * + * @return file + **/ + @JsonProperty("file") + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } + + public Body1 file(File file) { + this.file = file; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Body1 {\n"); + + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Category.java new file mode 100644 index 000000000..e22f47224 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Category.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Category { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/ModelApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/ModelApiResponse.java new file mode 100644 index 000000000..09dbc8b62 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/ModelApiResponse.java @@ -0,0 +1,122 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class ModelApiResponse { + + @Schema(description = "") + private Integer code = null; + + @Schema(description = "") + private String type = null; + + @Schema(description = "") + private String message = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get code + * + * @return code + **/ + @JsonProperty("code") + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * + * @return type + **/ + @JsonProperty("type") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * + * @return message + **/ + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Order.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Order.java new file mode 100644 index 000000000..9fc6753f5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Order.java @@ -0,0 +1,234 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.model; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Order { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private Long petId = null; + + @Schema(description = "") + private Integer quantity = null; + + @Schema(description = "") + private Date shipDate = null; + + @Schema(description = "Order Status") + /** + * Order Status + **/ + private StatusEnum status = null; + + @Schema(description = "") + private Boolean complete = false; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * + * @return petId + **/ + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * + * @return quantity + **/ + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * + * @return shipDate + **/ + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + if (status == null) { + return null; + } + return status.getValue(); + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * + * @return complete + **/ + @JsonProperty("complete") + public Boolean isisComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public enum StatusEnum { + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Pet.java new file mode 100644 index 000000000..d6bb64560 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Pet.java @@ -0,0 +1,248 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.model; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +public class Pet { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private Category category = null; + + @Schema(example = "doggie", required = true, description = "") + private String name = null; + + @Schema(required = true, description = "") + private List photoUrls = new ArrayList(); + + @Schema(description = "") + private List tags = null; + + @Schema(description = "pet status in the store") + /** + * pet status in the store + **/ + private StatusEnum status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * + * @return category + **/ + @JsonProperty("category") + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * + * @return name + **/ + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * + * @return photoUrls + **/ + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * + * @return tags + **/ + @JsonProperty("tags") + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * + * @return status + **/ + @JsonProperty("status") + public StatusEnum getStatus() { + if (status == null) { + return null; + } + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public enum StatusEnum { + AVAILABLE("available"), PENDING("pending"), SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Tag.java new file mode 100644 index 000000000..01a25f667 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/Tag.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class Tag { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/User.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/User.java new file mode 100644 index 000000000..878ce721a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app68/model/User.java @@ -0,0 +1,240 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app68.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class User { + + @Schema(description = "") + private Long id = null; + + @Schema(description = "") + private String username = null; + + @Schema(description = "") + private String firstName = null; + + @Schema(description = "") + private String lastName = null; + + @Schema(description = "") + private String email = null; + + @Schema(description = "") + private String password = null; + + @Schema(description = "") + private String phone = null; + + @Schema(description = "User Status") + /** + * User Status + **/ + private Integer userStatus = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * + * @return username + **/ + @JsonProperty("username") + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * + * @return firstName + **/ + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * + * @return lastName + **/ + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * + * @return email + **/ + @JsonProperty("email") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * + * @return password + **/ + @JsonProperty("password") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * + * @return phone + **/ + @JsonProperty("phone") + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * + * @return userStatus + **/ + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java new file mode 100644 index 000000000..891be31f3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.FilteredClassLoader; +import org.springframework.boot.test.context.runner.ApplicationContextRunner; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +class BlockingAutoConfigurationTest { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void configurations_successfully_loaded() { + contextRunner + .withPropertyValues("springdoc.show-actuator=true") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("actuatorProvider") + .hasBean("multipleOpenApiResource") + ); + } + + @Test + void configurations_not_loaded_when_application_is_not_web() { + new ApplicationContextRunner() + .withUserConfiguration(TestApp.class) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void actuator_configuration_not_loaded_when_not_enabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("actuatorPprrovider") + .hasBean("multipleOpenApiResource") + ); + } + + @Test + void configurations_not_loaded_when_disabled() { + contextRunner + .withPropertyValues("springdoc.api-docs.enabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void configurations_not_loaded_when_mvc_is_not_on_class_path() { + contextRunner + .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + + } + + @SpringBootApplication + static class TestApp { + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java new file mode 100644 index 000000000..488aa20aa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java @@ -0,0 +1,93 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import org.junit.jupiter.api.Test; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +public class CacheAutoConfigurationTest1 { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void cache_configuration_loaded_when_not_disabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void cache_configuration_loaded_when_disabled_explicitly() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void cache_configurations_successfully_disabled() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=true") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + @Test + void group_configuration_loaded() { + contextRunner + .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("multipleOpenApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + ); + } + + + @EnableAutoConfiguration + static class TestApp { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java new file mode 100644 index 000000000..c425f0be6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +public class GroupAutoConfigurationTest { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void group_configuration_loaded() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .hasBean("multipleOpenApiResource") + ); + } + + @EnableAutoConfiguration + static class TestApp { + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app128.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app128.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app128.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app128.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app144.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app144.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app144.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app144.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app145.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app145.json new file mode 100644 index 000000000..c88631044 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app145.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:53556", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app146-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app146-1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app146-1.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app146-1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app146-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app146-2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app146-2.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app146-2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app147-1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-1.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app147-1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app147-2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app147-2.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app147-2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app148-1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-1.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app148-1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app148-2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app148-2.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app148-2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app186.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app186.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app186.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-1.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-2.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-3.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-3.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-3.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-3.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-4.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-4.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app68-4.json rename to springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-4.json diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app128.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app128.json new file mode 100644 index 000000000..c21957aa0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app128.json @@ -0,0 +1,98 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/actuator/tenant/customer/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "test.org.springdoc.api.app128.HelloController#getTenantById(String)", + "operationId": "getTenantById_0", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/actuator": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app144.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app144.json new file mode 100644 index 000000000..bd7dd826b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app144.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:53554", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app145.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app145.json new file mode 100644 index 000000000..0ca407319 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app145.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:52556", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app146-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app146-1.json new file mode 100644 index 000000000..05b8c14a2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app146-1.json @@ -0,0 +1,797 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:9299/test", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggers-name", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggers-name_2", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threaddump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledtasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "metrics", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metrics-requiredMetricName", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapdump", + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "env", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "env-toMatch", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configprops", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configprops-prefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches_2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "caches-cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "caches-cache_2", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app146-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app146-2.json new file mode 100644 index 000000000..b6c792e3a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app146-2.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app147-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app147-1.json new file mode 100644 index 000000000..7ecc6396b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app147-1.json @@ -0,0 +1,891 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:9387/test", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app147-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app147-2.json new file mode 100644 index 000000000..b6c792e3a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app147-2.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app148-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app148-1.json new file mode 100644 index 000000000..d8887780c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app148-1.json @@ -0,0 +1,36 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:6376/toto/titi", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app148-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app148-2.json new file mode 100644 index 000000000..8681210a7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app148-2.json @@ -0,0 +1,891 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:9398/test", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/application/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/application": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + }, + "/application/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/application/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/application/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/application/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app186.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app186.json new file mode 100644 index 000000000..18314bb45 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app186.json @@ -0,0 +1,891 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/actuator/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/actuator": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + }, + "/actuator/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/actuator/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-1.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-1.json new file mode 100644 index 000000000..32ec4b6aa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-1.json @@ -0,0 +1,273 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "store", + "description": "the store API" + } + ], + "paths": { + "/store/order/{orderId}": { + "get": { + "tags": [ + "store" + ], + "summary": "Find purchase order by ID", + "operationId": "getOrderById", + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of pet that needs to be fetched", + "required": true, + "schema": { + "maximum": 5, + "minimum": 1, + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Order not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + } + } + }, + "delete": { + "tags": [ + "store" + ], + "summary": "Delete purchase order by ID", + "operationId": "deleteOrder", + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of the order that needs to be deleted", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Order not found" + } + } + } + }, + "/store/inventory": { + "get": { + "tags": [ + "store" + ], + "summary": "Returns pet inventories by status", + "description": "Returns a map of status codes to quantities", + "operationId": "getInventory", + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "security": [ + { + "api_key": [] + } + ] + } + }, + "/store/order": { + "post": { + "tags": [ + "store" + ], + "summary": "Place an order for a pet", + "operationId": "placeOrder", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid Order", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Order": { + "type": "object", + "properties": { + "complete": { + "type": "boolean" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "petId": { + "type": "integer", + "format": "int64" + }, + "quantity": { + "type": "integer", + "format": "int32" + }, + "shipDate": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order Status" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-2.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-2.json new file mode 100644 index 000000000..572726ca3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-2.json @@ -0,0 +1,434 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://toto.v1.com", + "description": "myserver1" + } + ], + "tags": [ + { + "name": "user", + "description": "the user API" + } + ], + "paths": { + "/user/{username}": { + "get": { + "tags": [ + "user" + ], + "summary": "Get user by user name", + "operationId": "getUserByName", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "The name that needs to be fetched. Use user1 for testing.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid username supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "404": { + "description": "User not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + }, + "put": { + "tags": [ + "user" + ], + "summary": "Updated user", + "operationId": "updateUser", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "name that need to be deleted", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Updated user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid user supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "User not found" + } + } + }, + "delete": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "operationId": "deleteUser", + "parameters": [ + { + "name": "username", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/login": { + "get": { + "tags": [ + "user" + ], + "summary": "Logs user into the system", + "operationId": "loginUser", + "parameters": [ + { + "name": "username", + "in": "query", + "description": "The user name for login", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "password", + "in": "query", + "description": "The password for login in clear text", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid username/password supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/user": { + "post": { + "tags": [ + "user" + ], + "summary": "Create user", + "operationId": "createUser", + "requestBody": { + "description": "Created user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/logout": { + "get": { + "tags": [ + "user" + ], + "summary": "Logs out current logged in user session", + "operationId": "logoutUser", + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/createWithList": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "operationId": "createUsersWithListInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/createWithArray": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "operationId": "createUsersWithArrayInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "username": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + }, + "password": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "userStatus": { + "type": "integer", + "description": "User Status", + "format": "int32" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-3.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-3.json new file mode 100644 index 000000000..a99ca2d3f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-3.json @@ -0,0 +1,639 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://toto.v2.com", + "description": "myserver2" + } + ], + "tags": [ + { + "name": "pet", + "description": "the pet API" + } + ], + "paths": { + "/pet": { + "put": { + "tags": [ + "pet" + ], + "summary": "Update an existing pet", + "operationId": "updatePet", + "requestBody": { + "description": "Pet object that needs to be added to the store", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Pet not found" + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + }, + "post": { + "tags": [ + "pet" + ], + "summary": "Add a new pet to the store", + "operationId": "addPet", + "requestBody": { + "description": "Pet object that needs to be added to the store", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/{petId}": { + "get": { + "tags": [ + "pet" + ], + "summary": "Find pet by ID", + "description": "Returns a single pet", + "operationId": "getPetById", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to return", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Pet not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "post": { + "tags": [ + "pet" + ], + "summary": "Updates a pet in the store with form data", + "operationId": "updatePetWithForm", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet that needs to be updated", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + }, + "delete": { + "tags": [ + "pet" + ], + "summary": "Deletes a pet", + "operationId": "deletePet", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "Pet id to delete", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "api_key", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Pet not found" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/{petId}/uploadImage": { + "post": { + "tags": [ + "pet" + ], + "summary": "uploads an image", + "operationId": "uploadFile", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to update", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "additionalMetadata", + "in": "query", + "description": "Additional data to pass to server", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "file" + ], + "type": "object", + "properties": { + "file": { + "type": "string", + "description": "file detail", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModelApiResponse" + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByTags": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by tags", + "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId": "findPetsByTags", + "parameters": [ + { + "name": "tags", + "in": "query", + "description": "Tags to filter by", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "400": { + "description": "Invalid tag value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByStatus": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by status", + "description": "Multiple status values can be provided with comma separated strings", + "operationId": "findPetsByStatus", + "parameters": [ + { + "name": "status", + "in": "query", + "description": "Status values that need to be considered for filter", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "400": { + "description": "Invalid status value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Pet": { + "required": [ + "name", + "photoUrls" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "name": { + "type": "string", + "example": "doggie" + }, + "photoUrls": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tag" + } + }, + "status": { + "type": "string", + "description": "pet status in the store", + "enum": [ + "available", + "pending", + "sold" + ] + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "ModelApiResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-4.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-4.json new file mode 100644 index 000000000..f393a5154 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-4.json @@ -0,0 +1,83 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "store", + "description": "the store API" + } + ], + "paths": { + "/v1/stores": { + "get": { + "tags": [ + "store" + ], + "operationId": "stores", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app145.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app145.json deleted file mode 100644 index 8f45f3ad4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/app145.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "OpenAPI definition", - "version": "v0" - }, - "servers": [ - { - "url": "http://localhost:52556", - "description": "Generated server url" - } - ], - "paths": { - "/persons": { - "get": { - "tags": [ - "hello-controller" - ], - "operationId": "persons", - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - } - } - } - } - } - }, - "components": {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index ae5f08e1b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@ActiveProfiles("test") -@SpringBootTest -@AutoConfigureMockMvc -@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) -public abstract class AbstractSpringDocTest { - - public static String className; - - @Autowired - protected MockMvc mockMvc; - - public static String getContent(String fileName) { - try { - Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } - - @Test - void testApp() throws Exception { - className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - Path path = Paths.get(getClass().getClassLoader().getResource("results/app" + testNumber + ".json").toURI()); - byte[] fileBytes = Files.readAllBytes(path); - String expected = new String(fileBytes); - assertEquals(expected, result, true); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/Account.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/Account.java deleted file mode 100644 index d6d67d96d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/Account.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app10; - -import java.util.Date; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.Temporal; -import jakarta.persistence.TemporalType; - -@Entity -public class Account { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - @ManyToOne - private Customer customer; - - @Temporal(TemporalType.DATE) - private Date expiryDate; - - public Long getId() { - return id; - } - - public Customer getCustomer() { - return customer; - } - - public Date getExpiryDate() { - return expiryDate; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/AccountRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/AccountRepository.java deleted file mode 100644 index 68c733f3e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/AccountRepository.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app10; - - -import java.util.List; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -/** - * Repository to manage {@link Account} instances. - * - */ -@RepositoryRestResource -public interface AccountRepository extends CrudRepository { - - /** - * Returns all accounts belonging to the given {@link Customer}. - * - * @param customer - * @return - */ - List findByCustomer(@Param("customer") Customer customer); -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/Customer.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/Customer.java deleted file mode 100644 index 7efc70c7e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/Customer.java +++ /dev/null @@ -1,34 +0,0 @@ -package test.org.springdoc.api.app10; - - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; - -/** - * @author Oliver Gierke - */ -@Entity -public class Customer { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - private String firstname; - - private String lastname; - - public Long getId() { - return id; - } - - public String getFirstname() { - return firstname; - } - - public String getLastname() { - return lastname; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/CustomerRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/CustomerRepository.java deleted file mode 100644 index da7c7609b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/CustomerRepository.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app10; - -import java.util.List; -import java.util.Optional; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.data.rest.core.annotation.RestResource; - -/** - * Repository to manage {@link Customer} instances. - * - * @author Oliver Gierke - */ -@RepositoryRestResource -public interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor { - - /** - * Returns a page of {@link Customer}s with the given lastname. - * - * @param lastname - * @param pageable - * @return - */ - Page findByLastname(@Param("lastname") String lastname, Pageable pageable); - - @Override - @RestResource(exported = false) - void deleteById(Long id); - - @Override - @RestResource(exported = false) - void delete(Customer entity); - - @Override - @RestResource - List findAll(); - - @Override - @RestResource(exported = false) - Optional findById(Long aLong); - - @Override - @RestResource(exported = false) - S save(S entity); -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java deleted file mode 100644 index 2e2a805f8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app10; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp10Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/Person.java deleted file mode 100644 index 08dcf2865..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/Person.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app11; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; - -@Entity -public class Person { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String firstName; - - private String lastName; - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/PersonRepository.java deleted file mode 100644 index 87029cbdf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/PersonRepository.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app11; - -import java.util.List; - -import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -@RepositoryRestResource(collectionResourceRel = "people", path = "peopleme") -public interface PersonRepository extends PagingAndSortingRepository { - - List findByLastName(@Param("name") String name); - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java deleted file mode 100644 index 83d58a1aa..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app11; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp11Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java deleted file mode 100644 index b17b8a771..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app12; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.MediaTypes; -import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@RequestMapping("/demo") -@RestController -public class HelloController { - - @Operation(summary = "GetMyData", operationId = "gettt", - responses = @ApiResponse(responseCode = "204", - content = @Content(mediaType = "application/vnd.something"))) - @GetMapping(produces = "application/vnd.something") - public ResponseEntity getSomethingElse() { - return ResponseEntity.noContent().build(); - } - - @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE) - public String get() { - return "some text"; - } - - @GetMapping(produces = MediaTypes.HAL_JSON_VALUE) - public EntityModel getHal() { - return EntityModel.of(new JsonResponse(), - WebMvcLinkBuilder.linkTo(HelloController.class).slash("somelink").withSelfRel() - ); - } - - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public JsonResponse getJson() { - return new JsonResponse(); - } - - @GetMapping(produces = MediaType.APPLICATION_XML_VALUE) - @ApiResponse(responseCode = "202", - content = @Content(mediaType = MediaType.APPLICATION_XML_VALUE, schema = @Schema(implementation = JsonResponse.class))) - public JsonResponse getXML() { - return new JsonResponse(); - } - - public class JsonResponse { - @JsonProperty - private String field; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java deleted file mode 100644 index 386ae591a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app12; - -import io.swagger.v3.oas.models.Operation; -import org.springdoc.core.customizers.OperationCustomizer; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.web.method.HandlerMethod; - -public class SpringDocApp12Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - @Bean - OperationCustomizer operationCustomizer() { - return (Operation operation, HandlerMethod handlerMethod) -> { - if (operation.getOperationId().startsWith("gettt")) - operation.setOperationId("gettt"); - return operation; - }; - } - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java deleted file mode 100644 index 98c914111..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app13; - -import java.util.List; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort.Direction; -import org.springframework.data.web.PageableDefault; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@PageableDefault(size = 5, sort = "name") @ParameterObject Pageable pageable) { - return null; - } - - - @GetMapping("/test1") - public String getPatientList1(@PageableDefault(size = 100, sort = { "someField", "someoTHER" }, - direction = Direction.DESC) - @ParameterObject Pageable pageable) { - return "bla"; - } - - @GetMapping("/test2") - public String getPatientList2(@PageableDefault(size = 100, sort = "someField", - direction = Direction.DESC) - @ParameterObject Pageable pageable) { - return "bla"; - } - - @GetMapping("/test3") - public String getPatientList3(@PageableDefault(size = 100) - @ParameterObject Pageable pageable) { - return "bla"; - } - - @GetMapping("/test4") - public String getPatientList4(@PageableDefault(100) - @ParameterObject Pageable pageable) { - return "bla"; - } - - @GetMapping("/test5") - public void read( - @PageableDefault(sort = { - "some,desc", - "other,asc", - "another.that,desc" - }) - @ParameterObject final Pageable pageable) { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java deleted file mode 100644 index b71b02438..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app13; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java deleted file mode 100644 index 0a0f2efaa..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app13; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp13Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java deleted file mode 100644 index 2a8021b9b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app14; - -import java.util.List; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@ParameterObject Pageable pageable) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/PersonDTO.java deleted file mode 100644 index 6cd5f2bde..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/PersonDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app14; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java deleted file mode 100644 index 39c01662a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app14; - -import java.util.Optional; - -import org.springdoc.core.configuration.SpringDocDataRestConfiguration; -import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; -import org.springdoc.core.providers.RepositoryRestConfigurationProvider; -import org.springdoc.core.providers.SpringDataWebPropertiesProvider; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Lazy; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = { "spring.data.web.pageable.default-page-size=25", - "spring.data.web.pageable.page-parameter=pages", - "spring.data.web.pageable.size-parameter=sizes", - "spring.data.web.pageable.one-indexed-parameters=true", - "spring.data.web.pageable.prefix=prefix_", - "spring.data.web.sort.sort-parameter=sorts" }) -@EnableAutoConfiguration(exclude = { - RepositoryRestMvcAutoConfiguration.class, SpringDocDataRestConfiguration.class -}) -public class SpringDocApp14Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - // We only need to test spring-web with Pageable, without the use of spring-data-rest-starter - @Bean - @ConditionalOnMissingBean - @Lazy(false) - DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { - return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); - } - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java deleted file mode 100644 index 0f44ebe1f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app15; - -import java.util.List; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@ParameterObject Pageable pageable) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/PersonDTO.java deleted file mode 100644 index 31ed71d36..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/PersonDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app15; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java deleted file mode 100644 index 4f01a58c9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app15; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "spring.data.rest.default-page-size=50") -public class SpringDocApp15Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/Account.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/Account.java deleted file mode 100644 index 0dccfe830..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/Account.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app16; - -import java.util.Date; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.Temporal; -import jakarta.persistence.TemporalType; - -@Entity -public class Account { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - @ManyToOne - private Customer customer; - - @Temporal(TemporalType.DATE) - private Date expiryDate; - - public Long getId() { - return id; - } - - public Customer getCustomer() { - return customer; - } - - public Date getExpiryDate() { - return expiryDate; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/AccountRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/AccountRepository.java deleted file mode 100644 index 11f20a658..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/AccountRepository.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app16; - - -import java.util.List; - -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -/** - * Repository to manage {@link Account} instances. - * - */ -@RepositoryRestResource -@Tag(name = "The account Repository") -@SecurityRequirement(name = "bearer") -public interface AccountRepository extends CrudRepository { - - /** - * Returns all accounts belonging to the given {@link Customer}. - * - * @param customer - * @return - */ - List findByCustomer(@Param("customer") Customer customer); -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/Customer.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/Customer.java deleted file mode 100644 index 864a6d91a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/Customer.java +++ /dev/null @@ -1,34 +0,0 @@ -package test.org.springdoc.api.app16; - - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; - -/** - * @author Oliver Gierke - */ -@Entity -public class Customer { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - private String firstname; - - private String lastname; - - public Long getId() { - return id; - } - - public String getFirstname() { - return firstname; - } - - public String getLastname() { - return lastname; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/CustomerRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/CustomerRepository.java deleted file mode 100644 index f61137c1e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/CustomerRepository.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app16; - -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.data.rest.core.annotation.RestResource; - -/** - * Repository to manage {@link Customer} instances. - * - * @author Oliver Gierke - */ -@RepositoryRestResource -@Tag(name = "The customer Repository") -public interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor { - - /** - * Returns a page of {@link Customer}s with the given lastname. - * - * @param lastname - * @param pageable - * @return - */ - @SecurityRequirement(name = "bearer") - Page findByLastname(@Param("lastname") String lastname, Pageable pageable); - - @Override - @RestResource(exported = false) - void deleteById(Long id); - - @Override - @RestResource(exported = false) - void delete(Customer entity); -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/OpenApiConfig.java deleted file mode 100644 index f7939932e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/OpenApiConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app16; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.info.Info; -import io.swagger.v3.oas.annotations.info.License; -import io.swagger.v3.oas.annotations.security.SecurityScheme; - -@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) -@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") -public class OpenApiConfig { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java deleted file mode 100644 index 56d2a5c06..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app16; - -import io.swagger.v3.oas.models.Operation; -import org.springdoc.core.customizers.DataRestRouterOperationCustomizer; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -public class SpringDocApp16Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - @Bean - public DataRestRouterOperationCustomizer addRouterOperationCustomizer() { - return (routerOperation) -> { - Operation operation = routerOperation.getOperationModel(); - operation.setSummary(operation.getOperationId()); - return routerOperation; - }; - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/ChildProperty.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/ChildProperty.java deleted file mode 100644 index 077a1798b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/ChildProperty.java +++ /dev/null @@ -1,34 +0,0 @@ -package test.org.springdoc.api.app17; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import lombok.Data; - -@Entity -public @Data -class ChildProperty { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String name; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/ChildPropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/ChildPropertyRepository.java deleted file mode 100644 index f9572893c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/ChildPropertyRepository.java +++ /dev/null @@ -1,6 +0,0 @@ -package test.org.springdoc.api.app17; - -import org.springframework.data.repository.PagingAndSortingRepository; - -public interface ChildPropertyRepository extends PagingAndSortingRepository { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/Property.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/Property.java deleted file mode 100644 index 1e969ded9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/Property.java +++ /dev/null @@ -1,48 +0,0 @@ -package test.org.springdoc.api.app17; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToOne; -import lombok.Data; - -@Entity -public @Data -class Property { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String name; - - @ManyToOne - @JoinColumn(name = "child_property_id") - private ChildProperty myChildPropertyName; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ChildProperty getMyChildPropertyName() { - return myChildPropertyName; - } - - public void setMyChildPropertyName(ChildProperty myChildPropertyName) { - this.myChildPropertyName = myChildPropertyName; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/PropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/PropertyRepository.java deleted file mode 100644 index 51da75c24..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/PropertyRepository.java +++ /dev/null @@ -1,6 +0,0 @@ -package test.org.springdoc.api.app17; - -import org.springframework.data.repository.PagingAndSortingRepository; - -public interface PropertyRepository extends PagingAndSortingRepository { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java deleted file mode 100644 index 91f369ed2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app17; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp17Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java deleted file mode 100644 index df702f150..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java +++ /dev/null @@ -1,27 +0,0 @@ -package test.org.springdoc.api.app18; - -import io.swagger.v3.oas.annotations.Operation; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.validation.Valid; -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.http.MediaType; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@Validated -@RestController -@RequestMapping(value = { HelloController.VERSION + "/helloWorld", "latest/helloWorld" }, produces = MediaType.APPLICATION_JSON_VALUE) -public class HelloController { - - public static final String VERSION = "v1"; - - @Operation(summary = "Example endpoint") - @GetMapping("/helloWorld") - public HelloWorldModel helloWorld(@Valid @ParameterObject HelloWorldModel helloWorldModel, HttpServletRequest request) { - return new HelloWorldModel(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/HelloWorldModel.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/HelloWorldModel.java deleted file mode 100644 index 3afc09d10..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/HelloWorldModel.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api.app18; - -import java.time.LocalDate; - -import io.swagger.v3.oas.annotations.Parameter; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; - -import org.springframework.format.annotation.DateTimeFormat; - -public class HelloWorldModel { - - @Parameter(description = "Description for abc", example = "def") - @NotBlank - private String abc; - - @Parameter(description = "Description of this date", example = "2020-10-25") - @NotNull - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate thisDate; - - public String getAbc() { - return abc; - } - - public void setAbc(String abc) { - this.abc = abc; - } - - public LocalDate getThisDate() { - return thisDate; - } - - public void setThisDate(LocalDate thisDate) { - this.thisDate = thisDate; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java deleted file mode 100644 index 2c235e339..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app18; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp18Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/Application.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/Application.java deleted file mode 100644 index eff19d5c6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/Application.java +++ /dev/null @@ -1,80 +0,0 @@ -package test.org.springdoc.api.app19; - -import java.io.Serializable; -import java.time.LocalDateTime; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.EntityListeners; -import jakarta.persistence.EnumType; -import jakarta.persistence.Enumerated; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import jakarta.persistence.Table; -import lombok.Data; - -import org.springframework.data.annotation.CreatedDate; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -@Data -@Entity -@Table(schema = "application", name = "application") -@Schema(description = "app") -@EntityListeners(AuditingEntityListener.class) -public class Application implements Serializable { - private static final long serialVersionUID = 6582562282311194139L; - - @Id - @Column(length = 64) - @GeneratedValue - @Schema(description = "id") - private String id; - - @Column(nullable = false, length = 64) - @Schema(description = "name") - private String name; - - @Column(length = 1024) - @Schema(description = "description") - private String description; - - @Column(length = 32) - @Schema(description = "app type") - @Enumerated(EnumType.STRING) - private AppType type = AppType.EXTERNAL; - - @Column - @Schema(description = "icon") - private String icon; - - @Column(nullable = false) - @CreatedDate - @Schema(description = "createTime") - private LocalDateTime createTime; - - @Column(length = 1024) - @Schema(description = "rsa-publicKey") - private String publicKey; - - @Column(length = 16, nullable = false) - @Enumerated(EnumType.STRING) - @Schema(description = "status") - private AuditStatus auditStatus = AuditStatus.UN_SUBMITTED; - - @Column - @Schema(description = "auditTime") - private LocalDateTime auditTime; - - public enum AuditStatus { - UN_SUBMITTED, - PENDING, - APPROVED, - FAILED - } - - public enum AppType { - INNER, - EXTERNAL - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/ApplicationPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/ApplicationPredicate.java deleted file mode 100644 index 87eb55761..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/ApplicationPredicate.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app19; - -import com.querydsl.core.types.dsl.StringExpression; - -import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; -import org.springframework.data.querydsl.binding.QuerydslBindings; - -public class ApplicationPredicate implements QuerydslBinderCustomizer { - - @Override - public void customize(QuerydslBindings bindings, QApplication root) { - bindings.excludeUnlistedProperties(true); - bindings.bind(root.name).first(StringExpression::containsIgnoreCase); - bindings.including(root.icon); - bindings.including(root.name); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/GreetingController.java deleted file mode 100644 index 4d29e645f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/GreetingController.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app19; - -import com.querydsl.core.types.Predicate; - -import org.springframework.data.querydsl.binding.QuerydslPredicate; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class GreetingController { - - @GetMapping("/test2") - public ResponseEntity sayHello2(@QuerydslPredicate(root = Application.class, bindings = ApplicationPredicate.class) Predicate predicate, - @RequestParam String test) { - return ResponseEntity.ok().build(); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/QApplication.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/QApplication.java deleted file mode 100644 index fac3afc5f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/QApplication.java +++ /dev/null @@ -1,55 +0,0 @@ -package test.org.springdoc.api.app19; - -import com.querydsl.core.types.Path; -import com.querydsl.core.types.PathMetadata; -import com.querydsl.core.types.dsl.DateTimePath; -import com.querydsl.core.types.dsl.EntityPathBase; -import com.querydsl.core.types.dsl.EnumPath; -import com.querydsl.core.types.dsl.StringPath; -import jakarta.annotation.Generated; - -import static com.querydsl.core.types.PathMetadataFactory.forVariable; - - -/** - * QApplication is a Querydsl query type for Application - */ -@Generated("com.querydsl.codegen.EntitySerializer") -public class QApplication extends EntityPathBase { - - public static final QApplication application = new QApplication("application"); - - private static final long serialVersionUID = 2120388982L; - - public final EnumPath auditStatus = createEnum("auditStatus", Application.AuditStatus.class); - - public final DateTimePath auditTime = createDateTime("auditTime", java.time.LocalDateTime.class); - - public final DateTimePath createTime = createDateTime("createTime", java.time.LocalDateTime.class); - - public final StringPath description = createString("description"); - - public final StringPath icon = createString("icon"); - - public final StringPath id = createString("id"); - - public final StringPath name = createString("name"); - - public final StringPath publicKey = createString("publicKey"); - - public final EnumPath type = createEnum("type", Application.AppType.class); - - public QApplication(String variable) { - super(Application.class, forVariable(variable)); - } - - public QApplication(Path path) { - super(path.getType(), path.getMetadata()); - } - - public QApplication(PathMetadata metadata) { - super(Application.class, metadata); - } - -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java deleted file mode 100644 index 06e1e6da7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app19; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp19Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/HelloController.java deleted file mode 100644 index 58bc9420b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/HelloController.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2; - -import java.util.List; - -import jakarta.validation.constraints.NotNull; - -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@NotNull Pageable pageable) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/PersonDTO.java deleted file mode 100644 index 28c4282bf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/PersonDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java deleted file mode 100644 index bd1d90c53..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp2Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/Bank.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/Bank.java deleted file mode 100644 index 7683e9d52..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/Bank.java +++ /dev/null @@ -1,81 +0,0 @@ -package test.org.springdoc.api.app20; - -import java.util.Objects; - -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.SequenceGenerator; -import jakarta.persistence.Table; -import org.hibernate.annotations.NaturalId; - -@Entity -@Table(name = "bank") -public class Bank implements EntityDefinition { - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "bnk_seq") - @SequenceGenerator(name = "bnk_seq", sequenceName = "bnk_seq", allocationSize = 1) - private Long id; - - @Column(unique = true) - @NaturalId - private String code; - - @Column(unique = true, nullable = false) - private String name; - - public Long getId() { - return this.id; - } - - public String getCode() { - return this.code; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public int hashCode() { - return Objects.hash(getCode()); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Bank)) { - return false; - } - Bank bank = (Bank) o; - return Objects.equals(getCode(), bank.getCode()); - } - - @Override - public String toString() { - return "Bank{" + - "id=" + id + - ", code='" + code + '\'' + - ", name='" + name + '\'' + - '}'; - } - - @Override - public String getKey() { - return code; - } - - @Override - public String getDescription() { - return name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/BankRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/BankRepository.java deleted file mode 100644 index 81d8e8db3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/BankRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package test.org.springdoc.api.app20; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.stereotype.Repository; - -@Repository -@RepositoryRestResource(path = "banks") -public interface BankRepository extends JpaRepository, CodeLookupRepository { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/CodeLookupRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/CodeLookupRepository.java deleted file mode 100644 index 01e6e8792..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/CodeLookupRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -package test.org.springdoc.api.app20; - -import org.springframework.data.repository.NoRepositoryBean; -import org.springframework.data.repository.query.Param; - -@NoRepositoryBean -public interface CodeLookupRepository { - EntityT findOneByCode(@Param("code") KeyT code); - - Long countByCode(KeyT code); -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/DemoApplication.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/DemoApplication.java deleted file mode 100644 index 811426b39..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/DemoApplication.java +++ /dev/null @@ -1,21 +0,0 @@ -package test.org.springdoc.api.app20; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.info.Info; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -@OpenAPIDefinition( - info = @Info( - title = "Core API" - ) -) -public class DemoApplication { - - public static void main(String[] args) { - SpringApplication.run(DemoApplication.class, args); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/EntityDefinition.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/EntityDefinition.java deleted file mode 100644 index 98c9f2aae..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/EntityDefinition.java +++ /dev/null @@ -1,12 +0,0 @@ -package test.org.springdoc.api.app20; - -import com.fasterxml.jackson.annotation.JsonIgnore; - -public interface EntityDefinition { - - @JsonIgnore - String getKey(); - - @JsonIgnore - String getDescription(); -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java deleted file mode 100644 index efe2a13b4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app20; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp20Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/Person.java deleted file mode 100644 index f26012737..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/Person.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app21; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; - -@Entity -public class Person { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String firstName; - - private String lastName; - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/PersonRepository.java deleted file mode 100644 index 309112fd0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/PersonRepository.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app21; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -@RepositoryRestResource(collectionResourceRel = "people", path = "peopleme") -public interface PersonRepository extends PagingAndSortingRepository { - - @Operation(description = "this is my test") - @ApiResponses( - value = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Contact not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") } - ) - List findByLastName(@Param("lastName") String name); - - @Operation(description = "this is another test", responses = { - @ApiResponse(responseCode = "200", description = "another successful operation"), - @ApiResponse(responseCode = "404", description = "another Contact not found") } - ) - List findByFirstName(@Param("firstName") @Parameter(description = "this is for first Name") String name); - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java deleted file mode 100644 index 2c502c7bb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app21; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp21Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/Person.java deleted file mode 100644 index e5b2f8094..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/Person.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app22; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; - -@Entity -public class Person { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String firstName; - - private String lastName; - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/PersonApi.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/PersonApi.java deleted file mode 100644 index e81a6633b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/PersonApi.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app22; - -import org.springframework.data.rest.webmvc.RepositoryRestController; -import org.springframework.web.bind.annotation.GetMapping; - -@RepositoryRestController -public class PersonApi { - - @GetMapping("/people/test") - public Person test() { - return new Person(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/PersonRepository.java deleted file mode 100644 index 352bc248a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/PersonRepository.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app22; - -import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -@RepositoryRestResource(path = "people", collectionResourceRel = "people") -public interface PersonRepository extends PagingAndSortingRepository { - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java deleted file mode 100644 index 6e2605c35..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app22; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp22Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/Clinic.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/Clinic.java deleted file mode 100644 index 255be21d4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/Clinic.java +++ /dev/null @@ -1,31 +0,0 @@ -package test.org.springdoc.api.app23; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -@Data -@Entity -@NoArgsConstructor -@AllArgsConstructor -@EqualsAndHashCode(callSuper = false) -@Builder -public class Clinic { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - @NotNull - @NotBlank - private String name; - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/ClinicRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/ClinicRepo.java deleted file mode 100644 index 42be7d85a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/ClinicRepo.java +++ /dev/null @@ -1,8 +0,0 @@ -package test.org.springdoc.api.app23; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.web.bind.annotation.CrossOrigin; - -@CrossOrigin -public interface ClinicRepo extends CrudRepository { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/Doctor.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/Doctor.java deleted file mode 100644 index bccdd6c9a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/Doctor.java +++ /dev/null @@ -1,40 +0,0 @@ -package test.org.springdoc.api.app23; - -import java.util.Set; - -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema.AccessMode; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.ManyToMany; -import jakarta.validation.constraints.Size; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -@Data -@Entity -@NoArgsConstructor -@AllArgsConstructor -@EqualsAndHashCode(callSuper = false) -@Builder -public class Doctor { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - @ManyToMany - @Size(min = 1) - @ArraySchema( - schema = @Schema( - implementation = String.class, - accessMode = AccessMode.WRITE_ONLY - )) - private Set clinics; -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/DoctorRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/DoctorRepo.java deleted file mode 100644 index e83ecea3b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/DoctorRepo.java +++ /dev/null @@ -1,8 +0,0 @@ -package test.org.springdoc.api.app23; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.web.bind.annotation.CrossOrigin; - -@CrossOrigin -public interface DoctorRepo extends CrudRepository { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java deleted file mode 100644 index 2a5d19e48..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app23; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp23Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/QUser.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/QUser.java deleted file mode 100644 index 32327b42b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/QUser.java +++ /dev/null @@ -1,44 +0,0 @@ -package test.org.springdoc.api.app24; - -import com.querydsl.core.types.Path; -import com.querydsl.core.types.PathMetadata; -import com.querydsl.core.types.dsl.EntityPathBase; -import com.querydsl.core.types.dsl.NumberPath; -import com.querydsl.core.types.dsl.StringPath; -import jakarta.annotation.Generated; - -import static com.querydsl.core.types.PathMetadataFactory.forVariable; - - -/** - * QUser is a Querydsl query type for User - */ -@Generated("com.querydsl.codegen.EntitySerializer") -public class QUser extends EntityPathBase { - - public static final QUser user = new QUser("user"); - - private static final long serialVersionUID = 222331676L; - - public final StringPath email = createString("email"); - - public final StringPath firstName = createString("firstName"); - - public final NumberPath id = createNumber("id", Long.class); - - public final StringPath lastName = createString("lastName"); - - public QUser(String variable) { - super(User.class, forVariable(variable)); - } - - public QUser(Path path) { - super(path.getType(), path.getMetadata()); - } - - public QUser(PathMetadata metadata) { - super(User.class, metadata); - } - -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java deleted file mode 100644 index b05806fbd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app24; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp24Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/TesteResource.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/TesteResource.java deleted file mode 100644 index 6f8b8f80c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/TesteResource.java +++ /dev/null @@ -1,21 +0,0 @@ -package test.org.springdoc.api.app24; - -import com.querydsl.core.types.Predicate; -import lombok.AllArgsConstructor; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.querydsl.binding.QuerydslPredicate; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -@AllArgsConstructor -public class TesteResource { - - @GetMapping("/") - public Page testeQueryDslAndSpringDoc(@QuerydslPredicate(root = User.class, bindings = UserPredicate.class) Predicate predicate, Pageable pageable) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/User.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/User.java deleted file mode 100644 index cbf085035..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/User.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app24; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import lombok.Getter; -import lombok.Setter; - -@Entity -@Getter -@Setter -public class User { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - private String firstName; - - private String lastName; - - private String email; -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/UserPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/UserPredicate.java deleted file mode 100644 index 41a36132f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app24/UserPredicate.java +++ /dev/null @@ -1,15 +0,0 @@ -package test.org.springdoc.api.app24; - -import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; -import org.springframework.data.querydsl.binding.QuerydslBindings; - -public class UserPredicate implements QuerydslBinderCustomizer { - - - @Override - public void customize(QuerydslBindings bindings, QUser user) { - bindings.excludeUnlistedProperties(true); - bindings.including(user.email); - bindings.bind(user.firstName).as("name").withDefaultBinding(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java deleted file mode 100644 index f748d7787..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app25; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp25Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Address.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Address.java deleted file mode 100644 index 28db53d32..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Address.java +++ /dev/null @@ -1,28 +0,0 @@ -package test.org.springdoc.api.app25.model; - -import jakarta.persistence.Embeddable; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Embeddable -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class Address { - - private String name; - - private String street; - - private String number; - - private String zipcode; - - private String city; - - private String country; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/BaseEntity.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/BaseEntity.java deleted file mode 100644 index 07c2a5118..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/BaseEntity.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app25.model; - -import java.util.UUID; - -import jakarta.persistence.Id; -import jakarta.persistence.MappedSuperclass; -import jakarta.persistence.PrePersist; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.hibernate.annotations.JdbcTypeCode; -import org.hibernate.type.SqlTypes; - -@Getter -@Setter -@NoArgsConstructor -@MappedSuperclass -public abstract class BaseEntity { - - @Id - @JdbcTypeCode(SqlTypes.CHAR) - private UUID id; - - @PrePersist - private void generateId() { - if (id == null) - id = UUID.randomUUID(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Cat.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Cat.java deleted file mode 100644 index 2c2fed252..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Cat.java +++ /dev/null @@ -1,33 +0,0 @@ -package test.org.springdoc.api.app25.model; - -import jakarta.persistence.Entity; -import jakarta.persistence.EnumType; -import jakarta.persistence.Enumerated; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -@Entity -@Data -@EqualsAndHashCode(callSuper = false) -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class Cat extends Pet { - - @Enumerated(EnumType.STRING) - private CoatType coat; - - @Builder - public Cat(String name, Owner owner, CoatType coat) { - super(name, owner); - this.coat = coat; - } - - public static enum CoatType { - TABBY, TOROISE, COLORPOINT, BICOLOR, TRICOLOR, SOLID - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Clinic.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Clinic.java deleted file mode 100644 index 7e4345cd5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Clinic.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app25.model; - -import java.util.Set; - -import jakarta.persistence.ElementCollection; -import jakarta.persistence.Entity; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -@Entity -@Data -@EqualsAndHashCode(callSuper = false) -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class Clinic extends BaseEntity { - - @NotNull - private String name; - - @Size(min = 1) - @ElementCollection - private Set
addresses; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Doctor.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Doctor.java deleted file mode 100644 index 353c8323b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Doctor.java +++ /dev/null @@ -1,38 +0,0 @@ -package test.org.springdoc.api.app25.model; - -import java.util.Set; - -import jakarta.persistence.Entity; -import jakarta.persistence.EnumType; -import jakarta.persistence.Enumerated; -import jakarta.persistence.ManyToMany; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -@Entity -@Data -@EqualsAndHashCode(callSuper = false) -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class Doctor extends BaseEntity { - - @NotNull - private String firstname; - - @NotNull - private String lastname; - - @Enumerated(EnumType.STRING) - private Specialty specialty; - - @Size(min = 1) - @ManyToMany - private Set clinics; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Dog.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Dog.java deleted file mode 100644 index 02f907a23..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Dog.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app25.model; - -import jakarta.persistence.Entity; -import jakarta.persistence.EnumType; -import jakarta.persistence.Enumerated; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -@Entity -@Data -@EqualsAndHashCode(callSuper = false) -@AllArgsConstructor -@NoArgsConstructor -public class Dog extends Pet { - - @Enumerated(EnumType.STRING) - private CoatType coat; - - @Builder - public Dog(String name, Owner owner, CoatType coat) { - super(name, owner); - this.coat = coat; - } - - public static enum CoatType { - SMOOTH, SHORT, COMBINATION, DOUBLE, HEAVY, SILKY, LONG, CURLY, WIRE, HAIRLESS - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Owner.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Owner.java deleted file mode 100644 index efb94f4fc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Owner.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api.app25.model; - -import java.util.Set; - -import jakarta.persistence.CascadeType; -import jakarta.persistence.Embedded; -import jakarta.persistence.Entity; -import jakarta.persistence.OneToMany; -import jakarta.validation.constraints.NotNull; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -@Entity -@Data -@EqualsAndHashCode(callSuper = false) -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class Owner extends BaseEntity { - - private String firstname; - - @NotNull - private String lastname; - - @NotNull - @Embedded - private Address addresses; - - @EqualsAndHashCode.Exclude - @OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL }) - private Set pets; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Pet.java deleted file mode 100644 index d6502e69b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Pet.java +++ /dev/null @@ -1,44 +0,0 @@ -package test.org.springdoc.api.app25.model; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonSubTypes.Type; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; -import jakarta.persistence.ManyToOne; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.NonNull; -import lombok.RequiredArgsConstructor; - -@Entity - -@EqualsAndHashCode(callSuper = false) -@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) - -@Data -@NoArgsConstructor -@RequiredArgsConstructor - -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "_type") -@JsonSubTypes({ - @Type(value = Dog.class, name = "dog"), - @Type(value = Cat.class, name = "cat") -}) -public class Pet extends BaseEntity { - - @NonNull - @NotNull - private String name; - - @NonNull - @ManyToOne - private Owner owner; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Specialty.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Specialty.java deleted file mode 100644 index b1a3874ef..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/model/Specialty.java +++ /dev/null @@ -1,79 +0,0 @@ -package test.org.springdoc.api.app25.model; - -public enum Specialty { - - ALLERGY_AND_IMMUNOLOGY, - ADOLESCENT_MEDICINE, - ANESTHESIOLOGY, - AEROSPACE_MEDICINE, - BARIATRICS, - CARDIOLOGY, - CARDIOTHORACIC_SURGERY, - CHILD_AND_ADOLESCENT_PSYCHIATRY, - CLINICAL_NEUROPHYSIOLOGY, - COLORECTAL_SURGERY, - DERMATOLOGY, - DEVELOPMENTAL_PEDIATRICS, - EMERGENCY_MEDICINE, - ENDOCRINOLOGY, - FAMILY_MEDICINE, - FORENSIC_PATHOLOGY, - FORENSIC_PSYCHIATRY, - GASTROENTEROLOGY, - GENERAL_SURGERY, - GENERAL_SURGICAL_ONCOLOGY, - GERIATRICS, - GERIATRIC_PSYCHIATRY, - GYNECOLOGIC_ONCOLOGY, - HEMATOLOGY, - HEMATOLOGIC_PATHOLOGY, - INFECTIOUS_DISEASE, - INTERNAL_MEDICINE, - INTERVENTIONAL_RADIOLOGY, - INTENSIVE_CARE_MEDICINE, - MATERNAL_FETAL_MEDICINE, - MEDICAL_BIOCHEMISTRY, - MEDICAL_GENETICS, - MEDICAL_ONCOLOGY, - NEONATOLOGY, - NEPHROLOGY, - NEUROLOGY, - NEUROPATHOLOGY, - NEUROSURGERY, - NUCLEAR_MEDICINE, - OBSTETRICS_AND_GYNECOLOGY, - OCCUPATIONAL_MEDICINE, - OPHTHALMOLOGY, - ORTHOPEDIC_SURGERY, - ORAL_AND_MAXILLOFACIAL_SURGERY, - OTORHINOLARYNGOLOGY, - PALLIATIVE_CARE, - PATHOLOGY, - PEDIATRICS, - PEDIATRIC_ALLERGY_AND_IMMUNOLOGY, - PEDIATRIC_CARDIOLOGY, - PEDIATRIC_EMERGENCY_MEDICINE, - PEDIATRIC_ENDOCRINOLOGY, - PEDIATRIC_GASTROENTEROLOGY, - PEDIATRIC_HEMATOLOGY_AND_ONCOLOGY, - PEDIATRIC_INFECTIOUS_DISEASE, - PEDIATRIC_NEPHROLOGY, - PEDIATRIC_RESPIRATORY_MEDICINE, - PEDIATRIC_RHEUMATOLOGY, - PEDIATRIC_SURGERY, - PHYSICAL_MEDICINE_AND_REHABILITATION, - PLASTIC_RECONSTRUCTIVE_AND_AESTHETIC_SURGERY, - PSYCHIATRY, - PUBLIC_HEALTH, - RADIATION_ONCOLOGY, - RADIOLOGY, - REPRODUCTIVE_ENDOCRINOLOGY_AND_INFERTILITY, - RESPIRATORY_MEDICINE, - RHEUMATOLOGY, - SPORTS_MEDICINE, - THORACIC_SURGERY, - NEURORADIOLOGY, - UROLOGY, - VASCULAR_SURGERY; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/ClinicRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/ClinicRepo.java deleted file mode 100644 index 65c5a1585..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/ClinicRepo.java +++ /dev/null @@ -1,13 +0,0 @@ -package test.org.springdoc.api.app25.repo; - -import java.util.UUID; - -import test.org.springdoc.api.app25.model.Clinic; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.web.bind.annotation.CrossOrigin; - -@CrossOrigin -public interface ClinicRepo extends CrudRepository { - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/DoctorRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/DoctorRepo.java deleted file mode 100644 index 3c939ec3d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/DoctorRepo.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app25.repo; - -import java.util.UUID; - -import test.org.springdoc.api.app25.model.Clinic; -import test.org.springdoc.api.app25.model.Doctor; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.web.bind.annotation.CrossOrigin; - -@CrossOrigin -public interface DoctorRepo extends CrudRepository { - - Iterable findByClinicsContains(Clinic clinic); - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/OwnerRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/OwnerRepo.java deleted file mode 100644 index 6b9a2737a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/OwnerRepo.java +++ /dev/null @@ -1,13 +0,0 @@ -package test.org.springdoc.api.app25.repo; - -import java.util.UUID; - -import test.org.springdoc.api.app25.model.Owner; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.web.bind.annotation.CrossOrigin; - -@CrossOrigin -public interface OwnerRepo extends JpaRepository { - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/PetRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/PetRepo.java deleted file mode 100644 index d65663a94..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app25/repo/PetRepo.java +++ /dev/null @@ -1,13 +0,0 @@ -package test.org.springdoc.api.app25.repo; - -import java.util.UUID; - -import test.org.springdoc.api.app25.model.Pet; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.web.bind.annotation.CrossOrigin; - -@CrossOrigin -public interface PetRepo extends JpaRepository { - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/Person.java deleted file mode 100644 index c33e239c8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/Person.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app26; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; - -@Entity -public class Person { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String firstName; - - private String lastName; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/PersonRepository.java deleted file mode 100644 index 050f10d34..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/PersonRepository.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app26; - -import java.util.List; - -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -@RepositoryRestResource(collectionResourceRel = "people", path = "peopleme") -public interface PersonRepository extends PagingAndSortingRepository { - - List findByLastName(@Param("name") String name); - - @Query(value = "select 1 from dual", nativeQuery = true) - void testQuery(); - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java deleted file mode 100644 index f78005bf4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app26; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp26Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/SpringRestConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/SpringRestConfiguration.java deleted file mode 100644 index da217f749..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app26/SpringRestConfiguration.java +++ /dev/null @@ -1,14 +0,0 @@ -package test.org.springdoc.api.app26; - -import org.springframework.context.annotation.Configuration; -import org.springframework.data.rest.core.config.RepositoryRestConfiguration; -import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; -import org.springframework.web.servlet.config.annotation.CorsRegistry; - -@Configuration -public class SpringRestConfiguration implements RepositoryRestConfigurer { - @Override - public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { - config.exposeIdsFor(Person.class); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java deleted file mode 100644 index 818dfacfa..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app27; - -import java.util.List; - -import jakarta.validation.constraints.NotNull; - -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@NotNull Pageable pageable) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/PersonDTO.java deleted file mode 100644 index 53863d19c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/PersonDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app27; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java deleted file mode 100644 index cfed1c2ef..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app27; - -import java.util.Optional; - -import io.swagger.v3.core.converter.ModelConverter; -import io.swagger.v3.core.converter.ModelConverters; -import org.springdoc.core.converters.PageableOpenAPIConverter; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.model-converters.pageable-converter.enabled=false") -public class SpringDocApp27Test extends AbstractSpringDocTest { - - static { - Optional pageabeConverter = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof PageableOpenAPIConverter).findAny(); - pageabeConverter.ifPresent(ModelConverters.getInstance()::removeConverter); - } - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/ExamplePageable.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/ExamplePageable.java deleted file mode 100644 index 1dd15c8b1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/ExamplePageable.java +++ /dev/null @@ -1,59 +0,0 @@ -package test.org.springdoc.api.app28; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; - -public class ExamplePageable implements Pageable { - - @Parameter(description = "Anything") - @JsonProperty - private int something; - - @Override - public int getPageNumber() { - return 0; - } - - @Override - public int getPageSize() { - return 0; - } - - @Override - public long getOffset() { - return 0; - } - - @Override - public Sort getSort() { - return null; - } - - @Override - public Pageable next() { - return null; - } - - @Override - public Pageable previousOrFirst() { - return null; - } - - @Override - public Pageable first() { - return null; - } - - @Override - public Pageable withPage(int pageNumber) { - return null; - } - - @Override - public boolean hasPrevious() { - return false; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/ExamplePageableReplacement.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/ExamplePageableReplacement.java deleted file mode 100644 index cb7412c4c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/ExamplePageableReplacement.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app28; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Parameter; -import org.springdoc.core.converters.models.Pageable; - -public class ExamplePageableReplacement extends Pageable { - - @Parameter(description = "Anything") - private int something; - - /** - * Instantiates a new Pageable. - * @param page the page - * @param size the size - * @param sort the sort - */ - public ExamplePageableReplacement(int page, int size, List sort) { - super(page, size, sort); - } - - public int getSomething() { - return something; - } - - public void setSomething(int something) { - this.something = something; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java deleted file mode 100644 index 65cc30014..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java +++ /dev/null @@ -1,21 +0,0 @@ -package test.org.springdoc.api.app28; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author bnasslahsen - */ -@RestController -@RequestMapping("/api") -public class HelloController { - - - @GetMapping("/items/nested") - public void showNestedItem(@ParameterObject ExamplePageable examplePageable) { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java deleted file mode 100644 index 02445483a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app28; - -import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp28Test extends AbstractSpringDocTest { - - static { - SpringDocUtils.getConfig().replaceParameterObjectWithClass(ExamplePageable.class, ExamplePageableReplacement.class); - } - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/Person.java deleted file mode 100644 index 1cd2d4f92..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/Person.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app29; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; - -@Entity -public class Person { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String firstName; - - private String lastName; - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/PersonApi.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/PersonApi.java deleted file mode 100644 index 45fcc70be..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/PersonApi.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app29; - -import org.springframework.data.rest.webmvc.BasePathAwareController; -import org.springframework.web.bind.annotation.GetMapping; - -@BasePathAwareController -public class PersonApi { - - @GetMapping("/people/test") - public Person test() { - return new Person(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/PersonRepository.java deleted file mode 100644 index e13df1b0c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/PersonRepository.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app29; - -import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -@RepositoryRestResource(path = "people", collectionResourceRel = "people") -public interface PersonRepository extends PagingAndSortingRepository { - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java deleted file mode 100644 index ed6a0bc0b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app29; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp29Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java deleted file mode 100644 index d49db78f1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3; - -import org.springdoc.core.converters.models.PageableAsQueryParam; -import org.springdoc.core.converters.models.SortAsQueryParam; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping(path = "/demo", - produces = MediaType.TEXT_PLAIN_VALUE) -public class HelloController { - - @GetMapping("operation4") - @PageableAsQueryParam - public String operation4() { - return "operation4"; - } - - @GetMapping("operation5") - @SortAsQueryParam - public String operation5() { - return "operation5"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java deleted file mode 100644 index b5399787c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp3Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java deleted file mode 100644 index 191d63c96..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app30; - -import com.querydsl.core.types.Predicate; - -import org.springframework.data.querydsl.binding.QuerydslPredicate; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -public class HelloController { - - @GetMapping("/") - public User testQueryDslAndSpringDoc(@QuerydslPredicate(root = User.class, bindings = UserPredicate.class) Predicate predicate) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/QUser.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/QUser.java deleted file mode 100644 index 999ab5a4b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/QUser.java +++ /dev/null @@ -1,42 +0,0 @@ -package test.org.springdoc.api.app30; - - -import com.querydsl.core.types.Path; -import com.querydsl.core.types.PathMetadata; -import com.querydsl.core.types.dsl.EntityPathBase; -import com.querydsl.core.types.dsl.NumberPath; -import com.querydsl.core.types.dsl.StringPath; - -import static com.querydsl.core.types.PathMetadataFactory.forVariable; - - -/** - * QUser is a Querydsl query type for User - */ -public class QUser extends EntityPathBase { - - public static final QUser user = new QUser("user"); - - private static final long serialVersionUID = 222331676L; - - public final StringPath email = createString("email"); - - public final StringPath firstName = createString("firstName"); - - public final NumberPath id = createNumber("id", Long.class); - - public final StringPath lastName = createString("lastName"); - - public QUser(String variable) { - super(User.class, forVariable(variable)); - } - - public QUser(Path path) { - super(path.getType(), path.getMetadata()); - } - - public QUser(PathMetadata metadata) { - super(User.class, metadata); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java deleted file mode 100644 index ae34d87df..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app30; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp30Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/User.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/User.java deleted file mode 100644 index ac8446a3d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/User.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app30; - - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import lombok.Getter; -import lombok.Setter; - -@Entity -@Getter -@Setter -public class User { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - private String firstName; - - private String lastName; - - private String email; -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/UserPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/UserPredicate.java deleted file mode 100644 index f30e85663..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app30/UserPredicate.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app30; - - -import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; -import org.springframework.data.querydsl.binding.QuerydslBindings; - -public class UserPredicate implements QuerydslBinderCustomizer { - - - @Override - public void customize(QuerydslBindings bindings, QUser user) { - bindings.excludeUnlistedProperties(true); - bindings.including(user.email); - bindings.bind(user.firstName).as("name").withDefaultBinding(); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/Person.java deleted file mode 100644 index 483d7998f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/Person.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app301; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; - -@Entity -public class Person { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String firstName; - - private String lastName; - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/PersonApi.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/PersonApi.java deleted file mode 100644 index 2ee3695df..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/PersonApi.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app301; - -import org.springframework.data.rest.webmvc.BasePathAwareController; -import org.springframework.web.bind.annotation.GetMapping; - -@BasePathAwareController -public class PersonApi { - - @GetMapping("/people/test") - public Person test() { - return new Person(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/PersonRepository.java deleted file mode 100644 index cbc4365bd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/PersonRepository.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app301; - -import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -@RepositoryRestResource(path = "people", collectionResourceRel = "people") -public interface PersonRepository extends PagingAndSortingRepository { - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/SpringDocApp301Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/SpringDocApp301Test.java deleted file mode 100644 index 2dbbb1436..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app301/SpringDocApp301Test.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app301; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; - -import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; -import com.fasterxml.jackson.databind.type.ClassKey; -import org.apache.commons.lang3.reflect.FieldUtils; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.springdoc.core.providers.ObjectMapperProvider; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.enable-data-rest=false") -public class SpringDocApp301Test extends AbstractSpringDocTest { - - private final Map> springMixins = new HashMap<>(); - - @Autowired - ObjectMapperProvider objectMapperProvider; - - @BeforeEach - void init() throws IllegalAccessException { - SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); - Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); - Iterator>> it = _localMixIns.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry> entry = it.next(); - if (entry.getKey().toString().startsWith("org.springframework")) { - springMixins.put(entry.getKey(), entry.getValue()); - it.remove(); - } - } - - } - - @AfterEach - void clean() throws IllegalAccessException { - SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); - Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); - _localMixIns.putAll(springMixins); - } - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java deleted file mode 100644 index 19bf81cb2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app31; - -import java.util.List; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; -import org.springframework.data.domain.Sort.Direction; -import org.springframework.data.web.SortDefault; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@SortDefault("name") @ParameterObject Sort sort) { - return null; - } - - - @GetMapping("/test1") - public String getPatientList1(@SortDefault(sort = { "someField", "someoTHER" }, - direction = Direction.DESC) - @ParameterObject Sort sort) { - return "bla"; - } - - @GetMapping("/test2") - public String getPatientList2(@SortDefault(sort = "someField", - direction = Direction.DESC) - @ParameterObject Sort sort) { - return "bla"; - } - - @GetMapping("/test3") - public String getPatientList3(@SortDefault(sort = { "someField", "someoTHER" }, - direction = Direction.DESC) - @ParameterObject Pageable pageable) { - return "bla"; - } - - @GetMapping("/test4") - public String getPatientList4(@SortDefault(sort = "someField", - direction = Direction.DESC) - @ParameterObject Pageable pageable) { - return "bla"; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/PersonDTO.java deleted file mode 100644 index 203895d69..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/PersonDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app31; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java deleted file mode 100644 index 353d61813..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app31; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp31Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java deleted file mode 100644 index bb2c6d8b9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app32; - -import java.util.List; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.data.domain.Sort; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@ParameterObject Sort sort) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/PersonDTO.java deleted file mode 100644 index 519f89a37..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/PersonDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app32; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java deleted file mode 100644 index 5c8ef96af..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app32; - -import java.util.Optional; - -import org.springdoc.core.configuration.SpringDocDataRestConfiguration; -import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; -import org.springdoc.core.providers.RepositoryRestConfigurationProvider; -import org.springdoc.core.providers.SpringDataWebPropertiesProvider; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Lazy; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "spring.data.web.sort.sort-parameter=sorts") -@EnableAutoConfiguration(exclude = { - RepositoryRestMvcAutoConfiguration.class, SpringDocDataRestConfiguration.class -}) -public class SpringDocApp32Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - // We only need to test spring-web with Sort, without the use of spring-data-rest-starter - @Bean - @ConditionalOnMissingBean - @Lazy(false) - DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { - return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); - } - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/ExampleSort.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/ExampleSort.java deleted file mode 100644 index e1252c277..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/ExampleSort.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app33; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.data.domain.Sort; - -public class ExampleSort extends Sort { - - @Parameter(description = "Anything") - @JsonProperty - private int something; - - protected ExampleSort(List orders) { - super(orders); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/ExampleSortReplacement.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/ExampleSortReplacement.java deleted file mode 100644 index 88f1771e1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/ExampleSortReplacement.java +++ /dev/null @@ -1,28 +0,0 @@ -package test.org.springdoc.api.app33; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Parameter; -import org.springdoc.core.converters.models.Sort; - -public class ExampleSortReplacement extends Sort { - - @Parameter(description = "Anything") - private int something; - - /** - * Instantiates a new Sort. - * @param sort the sort - */ - public ExampleSortReplacement(List sort) { - super(sort); - } - - public int getSomething() { - return something; - } - - public void setSomething(int something) { - this.something = something; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java deleted file mode 100644 index 797917d34..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app33; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/api") -public class HelloController { - - - @GetMapping("/items/nested") - public void showNestedItem(@ParameterObject ExampleSort exampleSort) { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java deleted file mode 100644 index b5dd2ea81..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app33; - -import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp33Test extends AbstractSpringDocTest { - - static { - SpringDocUtils.getConfig().replaceParameterObjectWithClass(ExampleSort.class, ExampleSortReplacement.class); - } - - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/Account.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/Account.java deleted file mode 100644 index 354d5c94b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/Account.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app34; - -import java.util.Date; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.Temporal; -import jakarta.persistence.TemporalType; - - -@Entity -public class Account { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - @ManyToOne - private Customer customer; - - @Temporal(TemporalType.DATE) - private Date expiryDate; - - public Long getId() { - return id; - } - - public Customer getCustomer() { - return customer; - } - - public Date getExpiryDate() { - return expiryDate; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/AccountRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/AccountRepository.java deleted file mode 100644 index 29103f58b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/AccountRepository.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app34; - - -import java.util.List; - -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -/** - * Repository to manage {@link Account} instances. - * - */ -@RepositoryRestResource -@Tag(name = "The account Repository") -@SecurityRequirement(name = "bearer") -public interface AccountRepository extends CrudRepository { - - /** - * Returns all accounts belonging to the given {@link Customer}. - * - * @param customer - * @return - */ - List findByCustomer(@Param("customer") Customer customer); -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/Customer.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/Customer.java deleted file mode 100644 index 2c3cf609b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/Customer.java +++ /dev/null @@ -1,49 +0,0 @@ -package test.org.springdoc.api.app34; - - -import java.util.Collection; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.OneToMany; - - -/** - * @author Oliver Gierke - */ -@Entity -public class Customer { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - private String firstname; - - private String lastname; - - @OneToMany(mappedBy = "customer") - private Collection accounts; - - public Long getId() { - return id; - } - - public String getFirstname() { - return firstname; - } - - public String getLastname() { - return lastname; - } - - public Collection getAccounts() { - return accounts; - } - - public void setAccounts(Collection accounts) { - this.accounts = accounts; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/CustomerRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/CustomerRepository.java deleted file mode 100644 index b476408f5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/CustomerRepository.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app34; - -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.data.rest.core.annotation.RestResource; - -/** - * Repository to manage {@link Customer} instances. - * - * @author Oliver Gierke - */ -@RepositoryRestResource -@Tag(name = "The customer Repository") -public interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor { - - /** - * Returns a page of {@link Customer}s with the given lastname. - * - * @param lastname - * @param pageable - * @return - */ - @SecurityRequirement(name = "bearer") - Page findByLastname(@Param("lastname") String lastname, Pageable pageable); - - @Override - @RestResource(exported = false) - void deleteById(Long id); - - @Override - @RestResource(exported = false) - void delete(Customer entity); -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/OpenApiConfig.java deleted file mode 100644 index 8002eed57..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/OpenApiConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app34; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.info.Info; -import io.swagger.v3.oas.annotations.info.License; -import io.swagger.v3.oas.annotations.security.SecurityScheme; - -@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) -@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") -public class OpenApiConfig { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java deleted file mode 100644 index fe1cf4e07..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app34; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp34Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/SpringRestConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/SpringRestConfiguration.java deleted file mode 100644 index 70808c53f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app34/SpringRestConfiguration.java +++ /dev/null @@ -1,15 +0,0 @@ -package test.org.springdoc.api.app34; - - -import org.springframework.context.annotation.Configuration; -import org.springframework.data.rest.core.config.RepositoryRestConfiguration; -import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; -import org.springframework.web.servlet.config.annotation.CorsRegistry; - -@Configuration -public class SpringRestConfiguration implements RepositoryRestConfigurer { - @Override - public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { - config.exposeIdsFor(Account.class, Customer.class); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/ChildProperty.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/ChildProperty.java deleted file mode 100644 index 74b313bc8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/ChildProperty.java +++ /dev/null @@ -1,35 +0,0 @@ -package test.org.springdoc.api.app35; - - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import lombok.Data; - -@Entity -public @Data -class ChildProperty { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String name; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/ChildPropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/ChildPropertyRepository.java deleted file mode 100644 index 8a1f3e0f7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/ChildPropertyRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package test.org.springdoc.api.app35; - -import io.swagger.v3.oas.annotations.Hidden; - -import org.springframework.data.repository.PagingAndSortingRepository; - -@Hidden -public interface ChildPropertyRepository extends PagingAndSortingRepository { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/Property.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/Property.java deleted file mode 100644 index 7afeb9cfb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/Property.java +++ /dev/null @@ -1,49 +0,0 @@ -package test.org.springdoc.api.app35; - - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToOne; -import lombok.Data; - -@Entity -public @Data -class Property { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - private String name; - - @ManyToOne - @JoinColumn(name = "child_property_id") - private ChildProperty myChildPropertyName; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ChildProperty getMyChildPropertyName() { - return myChildPropertyName; - } - - public void setMyChildPropertyName(ChildProperty myChildPropertyName) { - this.myChildPropertyName = myChildPropertyName; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/PropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/PropertyRepository.java deleted file mode 100644 index 39d5e3017..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/PropertyRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package test.org.springdoc.api.app35; - -import io.swagger.v3.oas.annotations.Hidden; - -import org.springframework.data.repository.PagingAndSortingRepository; - -@Hidden -public interface PropertyRepository extends PagingAndSortingRepository { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java deleted file mode 100644 index 00723376b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app35; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp35Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolder.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolder.java deleted file mode 100644 index bd506b1f5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolder.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app36; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; - -@Entity -public class EnumFieldHolder { - - public enum EnumField { - - FOO, BAR; - - } - - @Id - @GeneratedValue - private Long id; - - private EnumField enumField; - - public Long getId() { - return id; - } - - public EnumField getEnumField() { - return enumField; - } - - public void setEnumField(EnumField enumField) { - this.enumField = enumField; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolderRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolderRepository.java deleted file mode 100644 index 2bde495dd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/EnumFieldHolderRepository.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app36; - -import java.util.List; - -import org.springframework.data.repository.Repository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.data.util.Streamable; - -@RepositoryRestResource -public interface EnumFieldHolderRepository extends Repository { - - Streamable findAllByEnumField(@Param("enumField") EnumFieldHolder.EnumField enumField); - - Streamable findAllByEnumFieldIn(@Param("enumFields") List enumFields); - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java deleted file mode 100644 index 74850c071..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app36/SpringDocApp36Test.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app36; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp36Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/BaseEntity.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/BaseEntity.java deleted file mode 100644 index 514bc4292..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/BaseEntity.java +++ /dev/null @@ -1,44 +0,0 @@ -package test.org.springdoc.api.app37; - -import java.io.Serializable; - -import jakarta.persistence.Column; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.MappedSuperclass; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.SuperBuilder; -import org.hibernate.annotations.DynamicInsert; -import org.hibernate.annotations.DynamicUpdate; - -/** - * @author bnasslahsen - */ - -@Data -@MappedSuperclass -@DynamicInsert(true) -@DynamicUpdate(true) -@SuperBuilder(toBuilder = true) -@NoArgsConstructor -public abstract class BaseEntity implements Serializable { - - /** SVUDI */ - private static final long serialVersionUID = 1L; - - /** 数据库中的ID */ - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "ID", unique = true, nullable = false, insertable = false, updatable = false) - private Long id; - - - /** - * 数据是否合法 - * - * @return 是否合法 - */ - public abstract boolean isValid(); -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/ProductEntity.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/ProductEntity.java deleted file mode 100644 index 8d39d89b7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/ProductEntity.java +++ /dev/null @@ -1,60 +0,0 @@ -package test.org.springdoc.api.app37; - -import java.math.BigDecimal; -import java.time.LocalDate; - -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.Table; -import jakarta.validation.constraints.NotNull; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -import lombok.experimental.SuperBuilder; - -/** - * @author bnasslahsen - */ - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -@Entity -@Table(name = "PRODUCT_ENTITY") -@SuperBuilder(toBuilder = true) -@NoArgsConstructor -public class ProductEntity extends BaseEntity implements Comparable { - - /** SVUDI */ - private static final long serialVersionUID = 1L; - - /** 名字. */ - @NotNull - @Column(nullable = false) - private String name; - - /** 单价. */ - @NotNull - @Column(nullable = false) - private BigDecimal price; - - /** 日期. */ - @NotNull - @Column(nullable = false) - private LocalDate date; - - @Override - public boolean isValid() { - return name != null && price != null && date != null; - } - - /** 根据日期排序 */ - @Override - public int compareTo(ProductEntity oProduct) { - return this.getDate().compareTo(oProduct.getDate()); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/ProductRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/ProductRepository.java deleted file mode 100644 index 99f7cc57e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/ProductRepository.java +++ /dev/null @@ -1,89 +0,0 @@ -package test.org.springdoc.api.app37; - -/** - * @author bnasslahsen - */ - -import java.math.BigDecimal; -import java.time.LocalDate; -import java.util.List; - -import ch.qos.logback.core.rolling.helper.DateTokenConverter; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.format.annotation.DateTimeFormat; - -/** - * 商品信息 - * - * @author zctmdc - */ -@RepositoryRestResource(path = "product") -public interface ProductRepository extends JpaRepository { - - List findByPrice( @Parameter( - name = "price", - description = "test desc", - in = ParameterIn.QUERY, - required = true - ) - @Param("price") BigDecimal price); - /** - * 根据商品名称查询商品信息 - * - * @param name 商品名称 - * @return 商品信息列表 - */ - List findByName(@Parameter(name = "name2", required = true) String name); - - /** - * 根据商品名称查询最新的商品信息 - * - * @param name 商品名称 - * @return 商品信息 - */ - ProductEntity findTopByNameOrderByDateDesc(@Parameter(name = "name2", required = true) String name); - - /** - * 根据商品名称模糊查询商品信息并按时间降序排序 - * - * @param name 商品名称 - * @return 商品信息列表 - */ - List findByNameContainingIgnoreCaseOrderByDateDesc( - @Parameter(name = "name2", required = true) String name); - - /** - * 根据商品名称模糊查询商品信息并按时间降序排序 - * - * @param name 商品名称 - * @return 商品信息列表 - */ - List findByNameContainingIgnoreCase( - @Parameter(name = "name2", required = true) String name); - - /** - * 根据商品名称模糊查询指定日期前的商品信息 - * - * @param end 指定日期结束 - * @return 商品信息列表 - */ - List findByDateBefore( - @Parameter(name = "end2", required = true) @DateTimeFormat(pattern = DateTokenConverter.DEFAULT_DATE_PATTERN) @Param("end") LocalDate end); - - /** - * 根据商品名称模糊查询指定日期前的商品信息 - * - * @param name 商品名称 - * @param end 指定日期结束 - * @return 商品信息列表 - */ - List findByNameContainingIgnoreCaseAndDateBefore( - @Parameter(name = "name2", required = true) String name, - @Parameter(name = "end2", required = true) @DateTimeFormat(pattern = DateTokenConverter.DEFAULT_DATE_PATTERN) @Param("end") LocalDate end); - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java deleted file mode 100644 index 705fb5984..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app37; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp37Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app38/DefaultFlatParamObjectController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app38/DefaultFlatParamObjectController.java deleted file mode 100644 index 7823db61c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app38/DefaultFlatParamObjectController.java +++ /dev/null @@ -1,14 +0,0 @@ -package test.org.springdoc.api.app38; - -import org.springframework.data.domain.Sort; -import org.springframework.data.web.SortDefault; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class DefaultFlatParamObjectController { - @GetMapping("/test1") - public String test1(@SortDefault("name") Sort sort) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java deleted file mode 100644 index bb67e61fb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app38; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = { "springdoc.default-flat-param-object=true" }) -public class SpringDocApp38Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/DatabaseLoader.java deleted file mode 100644 index 2c15ce5b5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/DatabaseLoader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app4; - -import org.springframework.boot.CommandLineRunner; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Component; - -/** - * Pre-load some data using a Spring Boot {@link CommandLineRunner}. - * - * @author Greg Turnquist - */ -@Component -class DatabaseLoader { - - /** - * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app - * is operational, the database will be up. - * - * @param repository - */ - @Bean - CommandLineRunner init(EmployeeRepository repository) { - - return args -> { - repository.save(new Employee("Frodo", "Baggins", "ring bearer")); - repository.save(new Employee("Bilbo", "Baggins", "burglar")); - }; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/Employee.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/Employee.java deleted file mode 100644 index ba2ba9e72..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/Employee.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app4; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - - * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class - * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA - * {@code @AllArgsConstructor} - Create a constructor with all args to support testing - * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. - * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows - * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without - * adjustment. - * - * @author Greg Turnquist - */ -@Data -@Entity -@NoArgsConstructor(access = AccessLevel.PRIVATE) -@AllArgsConstructor -class Employee { - - @Id - @GeneratedValue - private Long id; - - private String firstName; - - private String lastName; - - private String role; - - /** - * Useful constructor when id is not yet known. - * - * @param firstName - * @param lastName - * @param role - */ - Employee(String firstName, String lastName, String role) { - - this.firstName = firstName; - this.lastName = lastName; - this.role = role; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/EmployeeController.java deleted file mode 100644 index 98d115732..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/EmployeeController.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app4; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.List; -import java.util.stream.StreamSupport; - -import org.springframework.hateoas.CollectionModel; -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.IanaLinkRelations; -import org.springframework.hateoas.Link; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; - -/** - * Spring Web {@link RestController} used to generate a REST API. - * - * @author Greg Turnquist - */ -@RestController -class EmployeeController { - - private final EmployeeRepository repository; - - EmployeeController(EmployeeRepository repository) { - this.repository = repository; - } - - /** - * Look up all employees, and transform them into a REST collection resource. Then return them through Spring Web's - * {@link ResponseEntity} fluent API. - */ - @GetMapping("/employees") - ResponseEntity>> findAll() { - - List> employees = StreamSupport.stream(repository.findAll().spliterator(), false) - .map(employee -> EntityModel.of(employee, // - linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // - linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // - .toList(); - - return ResponseEntity.ok( // - CollectionModel.of(employees, // - linkTo(methodOn(EmployeeController.class).findAll()).withSelfRel())); - } - - @PostMapping("/employees") - ResponseEntity> newEmployee(@RequestBody Employee employee) { - - try { - Employee savedEmployee = repository.save(employee); - - EntityModel employeeResource = EntityModel.of(savedEmployee, // - linkTo(methodOn(EmployeeController.class).findOne(savedEmployee.getId())).withSelfRel()); - - return ResponseEntity // - .created(new URI(employeeResource.getRequiredLink(IanaLinkRelations.SELF).getHref())) // - .body(employeeResource); - } - catch (URISyntaxException e) { - return ResponseEntity.badRequest().body(null); - } - } - - /** - * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's - * {@link ResponseEntity} fluent API. - * - * @param id - */ - @GetMapping("/employees/{id}") - ResponseEntity> findOne(@PathVariable long id) { - - return repository.findById(id) // - .map(employee -> EntityModel.of(employee, // - linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // - linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // - .map(ResponseEntity::ok) // - .orElse(ResponseEntity.notFound().build()); - } - - /** - * Update existing employee then return a Location header. - * - * @param employee - * @param id - * @return - */ - @PutMapping("/employees/{id}") - ResponseEntity updateEmployee(@RequestBody Employee employee, @PathVariable long id) throws URISyntaxException { - - Employee employeeToUpdate = employee; - employeeToUpdate.setId(id); - repository.save(employeeToUpdate); - - Link newlyCreatedLink = linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); - - return ResponseEntity.noContent().location(new URI(newlyCreatedLink.getHref())).build(); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/EmployeeRepository.java deleted file mode 100644 index a13dbc3c5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/EmployeeRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app4; - -import org.springframework.data.repository.CrudRepository; - -/** - * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. - * - * @author Greg Turnquist - */ -interface EmployeeRepository extends CrudRepository { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java deleted file mode 100644 index faa270b76..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4; - -import test.org.springdoc.api.AbstractSpringDocTest; - -public class SpringDocApp4Test extends AbstractSpringDocTest { - - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/SpringDocTestApp.java deleted file mode 100644 index a833bd8d8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app4/SpringDocTestApp.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider; - -@SpringBootApplication -public class SpringDocTestApp { - - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - @Bean - EvoInflectorLinkRelationProvider relProvider() { - return new EvoInflectorLinkRelationProvider(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/Country.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/Country.java deleted file mode 100644 index 784b38324..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/Country.java +++ /dev/null @@ -1,94 +0,0 @@ -package test.org.springdoc.api.app5; - -import jakarta.persistence.Basic; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.EnumType; -import jakarta.persistence.Enumerated; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; - -/** - * @author gibah - */ - -@Entity -public class Country { - - @Id - @GeneratedValue - private Long id; - - @Basic - @Column(nullable = false) - private String name; - - @Basic - private String shortName; - - @Basic - private String dialingCode; - - @Basic - @Column(unique = true, nullable = false) - private String codeISO3166; - - @Basic - @Column(nullable = false) - @Enumerated(EnumType.STRING) - private Status status; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getDialingCode() { - return dialingCode; - } - - public void setDialingCode(String dialingCode) { - this.dialingCode = dialingCode; - } - - public String getCodeISO3166() { - return codeISO3166; - } - - public void setCodeISO3166(String codeISO3166) { - this.codeISO3166 = codeISO3166; - } - - public Status getStatus() { - return status; - } - - public Country setStatus(Status status) { - this.status = status; - return this; - } - - public enum Status { - ACTIVE, INACTIVE - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/CountryPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/CountryPredicate.java deleted file mode 100644 index 4730ed454..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/CountryPredicate.java +++ /dev/null @@ -1,13 +0,0 @@ -package test.org.springdoc.api.app5; - -import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; -import org.springframework.data.querydsl.binding.QuerydslBindings; - -public class CountryPredicate implements QuerydslBinderCustomizer { - - @Override - public void customize(QuerydslBindings querydslBindings, QCountry qCountry) { - querydslBindings.bind(qCountry.codeISO3166).as("code").first((path, value) -> path.containsIgnoreCase(value)); - querydslBindings.bind(qCountry.dialingCode).as("postCode").first((path, value) -> path.containsIgnoreCase(value)); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/GreetingController.java deleted file mode 100644 index 2c7cacdcc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/GreetingController.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app5; - -import java.util.List; - -import com.querydsl.core.types.Predicate; -import test.org.springdoc.api.app5.Country.Status; - -import org.springframework.data.querydsl.binding.QuerydslPredicate; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class GreetingController { - - @GetMapping("/test") - public ResponseEntity sayHello2(@QuerydslPredicate(bindings = CountryPredicate.class, root = Country.class) Predicate predicate, - @RequestParam List statuses) { - return ResponseEntity.ok().build(); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/QCountry.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/QCountry.java deleted file mode 100644 index 201667040..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/QCountry.java +++ /dev/null @@ -1,50 +0,0 @@ -package test.org.springdoc.api.app5; - -import com.querydsl.core.types.Path; -import com.querydsl.core.types.PathMetadata; -import com.querydsl.core.types.dsl.EntityPathBase; -import com.querydsl.core.types.dsl.EnumPath; -import com.querydsl.core.types.dsl.NumberPath; -import com.querydsl.core.types.dsl.StringPath; -import jakarta.annotation.Generated; -import test.org.springdoc.api.app5.Country.Status; - -import static com.querydsl.core.types.PathMetadataFactory.forVariable; - - -/** - * QCountry is a Querydsl query type for Country - */ -@Generated("com.querydsl.codegen.EntitySerializer") -public class QCountry extends EntityPathBase { - - public static final QCountry country = new QCountry("country"); - - private static final long serialVersionUID = -1184258693L; - - public final StringPath codeISO3166 = createString("codeISO3166"); - - public final StringPath dialingCode = createString("dialingCode"); - - public final NumberPath id = createNumber("id", Long.class); - - public final StringPath name = createString("name"); - - public final StringPath shortName = createString("shortName"); - - public final EnumPath status = createEnum("status", Status.class); - - public QCountry(String variable) { - super(Country.class, forVariable(variable)); - } - - public QCountry(Path path) { - super(path.getType(), path.getMetadata()); - } - - public QCountry(PathMetadata metadata) { - super(Country.class, metadata); - } - -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java deleted file mode 100644 index e5ff03a64..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app5; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * @author Gibah Joseph - * Email: gibahjoe@gmail.com - * Mar, 2020 - **/ - -public class SpringDocApp5Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/DatabaseLoader.java deleted file mode 100644 index 3058d3a0c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/DatabaseLoader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app6; - -import org.springframework.boot.CommandLineRunner; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Component; - -/** - * Pre-load some data using a Spring Boot {@link CommandLineRunner}. - * - * @author Greg Turnquist - */ -@Component -class DatabaseLoader { - - /** - * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app - * is operational, the database will be up. - * - * @param repository - */ - @Bean - CommandLineRunner init(EmployeeRepository repository) { - - return args -> { - repository.save(new Employee("Frodo", "Baggins", "ring bearer")); - repository.save(new Employee("Bilbo", "Baggins", "burglar")); - }; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/Employee.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/Employee.java deleted file mode 100644 index 81762d147..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/Employee.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app6; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - - * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class - * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA - * {@code @AllArgsConstructor} - Create a constructor with all args to support testing - * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. - * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows - * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without - * adjustment. - * - * @author Greg Turnquist - */ -@Data -@Entity -@NoArgsConstructor(access = AccessLevel.PRIVATE) -@AllArgsConstructor -class Employee { - - @Id - @GeneratedValue - private Long id; - - private String firstName; - - private String lastName; - - private String role; - - /** - * Useful constructor when id is not yet known. - * - * @param firstName - * @param lastName - * @param role - */ - Employee(String firstName, String lastName, String role) { - - this.firstName = firstName; - this.lastName = lastName; - this.role = role; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeController.java deleted file mode 100644 index 0cefc1580..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeController.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app6; - -import org.springframework.hateoas.EntityModel; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -/** - * Spring Web {@link RestController} used to generate a REST API. - * - * @author Greg Turnquist - */ -@RestController -class EmployeeController { - - /** - * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's - * {@link ResponseEntity} fluent API. - * - * @param id - */ - @GetMapping("/employees/{id}") - EntityModel findOne(@PathVariable long id) { - - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeRepository.java deleted file mode 100644 index dd5dafaae..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/EmployeeRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app6; - -import org.springframework.data.repository.CrudRepository; - -/** - * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. - * - * @author Greg Turnquist - */ -interface EmployeeRepository extends CrudRepository { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java deleted file mode 100644 index d2db28e94..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app6; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.remove-broken-reference-definitions=false") -public class SpringDocApp6Test extends AbstractSpringDocTest { - - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/SpringDocTestApp.java deleted file mode 100644 index bb74043f5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app6/SpringDocTestApp.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app6; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider; - -@SpringBootApplication -public class SpringDocTestApp { - - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - @Bean - EvoInflectorLinkRelationProvider relProvider() { - return new EvoInflectorLinkRelationProvider(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java deleted file mode 100644 index 6c99e3a02..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -import java.util.List; - -import jakarta.validation.constraints.NotNull; -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.data.domain.Pageable; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@NotNull @ParameterObject Pageable pageable) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/PersonDTO.java deleted file mode 100644 index e7d21b4de..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/PersonDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java deleted file mode 100644 index 5f180a504..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp7Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/Album.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/Album.java deleted file mode 100644 index de60a7a48..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/Album.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app8; - -public class Album { - - private String title; - - private String description; - - private String releaseDate; - - public Album(String title, String description, String releaseDate) { - this.title = title; - this.description = description; - this.releaseDate = releaseDate; - } - - public String getTitle() { - return title; - } - - public String getDescription() { - return description; - } - - public String getReleaseDate() { - return releaseDate; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/AlbumController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/AlbumController.java deleted file mode 100644 index 537fa646f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/AlbumController.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app8; - -import java.util.Arrays; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.web.PagedResourcesAssembler; -import org.springframework.hateoas.PagedModel; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@SuppressWarnings("unchecked") -public class AlbumController { - - @Autowired - private AlbumModelAssembler albumModelAssembler; - - @Autowired - private PagedResourcesAssembler pagedResourcesAssembler; - - @GetMapping("/api/albums") - public PagedModel getAllAlbums() { - Album album1 = new Album("album-title-1", "album-description-1", "album-release-date-1"); - Album album2 = new Album("album-title-2", "album-description-2", "album-release-date-2"); - Page albumPage = new PageImpl<>(Arrays.asList(album1, album2)); - - return pagedResourcesAssembler.toModel(albumPage, albumModelAssembler); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/AlbumModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/AlbumModelAssembler.java deleted file mode 100644 index a8e68dda3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/AlbumModelAssembler.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app8; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.Link; -import org.springframework.hateoas.server.RepresentationModelAssembler; -import org.springframework.stereotype.Component; - -@Component -public class AlbumModelAssembler implements RepresentationModelAssembler> { - - @Override - public EntityModel toModel(Album entity) { - List links = new ArrayList<>(); - return EntityModel.of(entity, links); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java deleted file mode 100644 index 89f5cfdc4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app8; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp8Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java deleted file mode 100644 index f17f38fe2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app9; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; -import com.fasterxml.jackson.databind.type.ClassKey; -import org.apache.commons.lang3.reflect.FieldUtils; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.springdoc.core.providers.ObjectMapperProvider; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "spring.hateoas.use-hal-as-default-json-media-type= false") -@SuppressWarnings({ "deprecation", "unchecked" }) -public class SpringDocApp9Test extends AbstractSpringDocTest { - - private final Map> springMixins = new HashMap<>(); - - @Autowired - ObjectMapperProvider objectMapperProvider; - - @BeforeEach - void init() throws IllegalAccessException { - SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); - Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); - Iterator>> it = _localMixIns.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry> entry = it.next(); - if (entry.getKey().toString().startsWith("org.springframework")) { - springMixins.put(entry.getKey(), entry.getValue()); - it.remove(); - } - } - - } - - @AfterEach - void clean() throws IllegalAccessException { - SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); - Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); - _localMixIns.putAll(springMixins); - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/ComponentsController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/ComponentsController.java deleted file mode 100644 index 0011c0bb6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/ComponentsController.java +++ /dev/null @@ -1,78 +0,0 @@ -package test.org.springdoc.api.app9.component.controller; - - -import java.util.Optional; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springdoc.core.converters.models.PageableAsQueryParam; -import test.org.springdoc.api.app9.component.controller.hateoas.ComponentDtoModelAssembler; -import test.org.springdoc.api.app9.component.dto.DemoComponentDto; -import test.org.springdoc.api.app9.component.dto.converter.DemoComponentConverter; -import test.org.springdoc.api.app9.component.model.DemoComponent; -import test.org.springdoc.api.app9.component.service.ComponentsService; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.web.PagedResourcesAssembler; -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.PagedModel; -import org.springframework.hateoas.RepresentationModel; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; - -@RestController -@RequestMapping(path = "/components", produces = "application/json") -@Tag(name = "components", description = "Everything about components") -public class ComponentsController { - - @Autowired - private ComponentsService componentsService; - - @Autowired - private DemoComponentConverter toDtoConverter; - - @Autowired - private ComponentDtoModelAssembler componentDtoModelAssembler; - - @Autowired - private PagedResourcesAssembler pagedResourcesAssembler; - - @Operation(summary = "List the components") - @PageableAsQueryParam - @GetMapping - public ResponseEntity>>> findAll(@Parameter(hidden = true) Pageable pageable) { - Page results = componentsService.findAll(pageable); - - return ResponseEntity.ok(pagedResourcesAssembler.toModel(results, componentDtoModelAssembler)); - } - - @Operation(summary = "Get one component by its ID", description = "Returns a single component", // - responses = { // - @ApiResponse(responseCode = "200", description = "Component found"), // - @ApiResponse(responseCode = "404", description = "Component not found", content = { @Content(schema = @Schema(implementation = Void.class)) }) // - }) - @GetMapping("/{componentId}") - public ResponseEntity> findById(@PathVariable String componentId) { - Optional foundComponent = componentsService.findById(componentId); - - if (foundComponent.isPresent()) { - return ResponseEntity.ok(EntityModel.of(toDtoConverter.convert(foundComponent.get()), // - linkTo(methodOn(ComponentsController.class).findAll(null)).withRel("components"))); - } - - return ResponseEntity.notFound().location(linkTo(methodOn(ComponentsController.class).findAll(null)).toUri()).build(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/hateoas/ComponentDtoModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/hateoas/ComponentDtoModelAssembler.java deleted file mode 100644 index 761628f0c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/hateoas/ComponentDtoModelAssembler.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app9.component.controller.hateoas; - - -import test.org.springdoc.api.app9.component.dto.DemoComponentDto; -import test.org.springdoc.api.app9.component.dto.converter.DemoComponentConverter; -import test.org.springdoc.api.app9.component.model.DemoComponent; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.RepresentationModel; -import org.springframework.hateoas.server.RepresentationModelAssembler; -import org.springframework.stereotype.Component; - -@Component -@SuppressWarnings({ "deprecation", "unchecked" }) -public class ComponentDtoModelAssembler implements RepresentationModelAssembler>> { - - @Autowired - private DemoComponentConverter toDtoConverter; - - @Override - public RepresentationModel> toModel(DemoComponent entity) { - return EntityModel.of(toDtoConverter.convert(entity)); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java deleted file mode 100644 index b3b35ba8d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app9.component.controller.hateoas; - - -import test.org.springdoc.api.app9.component.controller.ComponentsController; -import test.org.springdoc.api.app9.component.dto.DemoComponentDto; - -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.server.RepresentationModelProcessor; -import org.springframework.stereotype.Component; - -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; - -@Component -public class DemoComponentDtoModelProcessor implements RepresentationModelProcessor> { - - @Override - public EntityModel process(EntityModel model) { - final String id = model.getContent().getId(); - - model.add(linkTo(methodOn(ComponentsController.class).findById(id)).withSelfRel()); - - return model; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/dto/DemoComponentDto.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/dto/DemoComponentDto.java deleted file mode 100644 index 270d7c919..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/dto/DemoComponentDto.java +++ /dev/null @@ -1,25 +0,0 @@ -package test.org.springdoc.api.app9.component.dto; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import org.springframework.hateoas.server.core.Relation; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Relation(collectionRelation = "components") -@Schema(description = "A demo component to illustrate Springdoc Issue #401") -public final class DemoComponentDto { - - @Schema(description = "Some ID", example = "1") - private String id; - - @Schema(description = "Some dummy payload", example = "Hello World") - private String payload; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/dto/converter/DemoComponentConverter.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/dto/converter/DemoComponentConverter.java deleted file mode 100644 index aef3520ce..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/dto/converter/DemoComponentConverter.java +++ /dev/null @@ -1,25 +0,0 @@ -package test.org.springdoc.api.app9.component.dto.converter; - - -import test.org.springdoc.api.app9.component.dto.DemoComponentDto; -import test.org.springdoc.api.app9.component.model.DemoComponent; -import test.org.springdoc.api.app9.utils.Converter; - -import org.springframework.stereotype.Component; - -@Component -public class DemoComponentConverter implements Converter { - - @Override - public DemoComponentDto convert(DemoComponent source) { - if (source == null) { - return null; - } - - return DemoComponentDto.builder() // - .id(source.getId()) // - .payload(source.getPayload()) // - .build(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/model/DemoComponent.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/model/DemoComponent.java deleted file mode 100644 index 679d8eadf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/model/DemoComponent.java +++ /dev/null @@ -1,21 +0,0 @@ -package test.org.springdoc.api.app9.component.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import org.springframework.data.annotation.Id; - -@Data -@Builder -@AllArgsConstructor -@EqualsAndHashCode -public class DemoComponent { - - @Id - private String id; - - private String payload; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/service/ComponentsService.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/service/ComponentsService.java deleted file mode 100644 index eab7b3f2a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/component/service/ComponentsService.java +++ /dev/null @@ -1,28 +0,0 @@ -package test.org.springdoc.api.app9.component.service; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Map; -import java.util.Optional; - -import test.org.springdoc.api.app9.component.model.DemoComponent; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -@Service -public class ComponentsService { - - private static final Map repo = Collections.singletonMap("1", DemoComponent.builder().id("1").payload("Hello World !").build()); - - public Optional findById(String componentId) { - return Optional.ofNullable(repo.get(componentId)); - } - - public Page findAll(Pageable pageable) { - return new PageImpl(new ArrayList<>(repo.values()), pageable, repo.size()); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/OpenAPIConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/OpenAPIConfiguration.java deleted file mode 100644 index d927be634..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/OpenAPIConfiguration.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app9.core.config; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.info.Info; - -import org.springframework.stereotype.Component; - -@Component -@OpenAPIDefinition( // - info = @Info( // - title = "Demo Springdoc Issue #401", // - version = "0.0.1-SNAPSHOT", // - description = "A demo API to illustrate Springdoc Issue #401." // - ) // -) -public class OpenAPIConfiguration { - // NO-OP -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/SpringRestConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/SpringRestConfiguration.java deleted file mode 100644 index 3ed047190..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/SpringRestConfiguration.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app9.core.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.data.rest.core.config.RepositoryRestConfiguration; -import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; -import org.springframework.http.MediaType; -import org.springframework.web.servlet.config.annotation.CorsRegistry; - -@Configuration -public class SpringRestConfiguration implements RepositoryRestConfigurer { - @Override - public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { - config.setDefaultMediaType(MediaType.APPLICATION_JSON); - config.useHalAsDefaultJsonMediaType(false); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/WebMvcConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/WebMvcConfiguration.java deleted file mode 100644 index 497a9eb71..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/config/WebMvcConfiguration.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app9.core.config; - -import org.springframework.boot.convert.ApplicationConversionService; -import org.springframework.context.annotation.Configuration; -import org.springframework.format.FormatterRegistry; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -import static org.springdoc.core.utils.Constants.ALL_PATTERN; - -@Configuration -public class WebMvcConfiguration implements WebMvcConfigurer { - - private final long MAX_AGE_SECS = 3600; - - @Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping(ALL_PATTERN) // - .allowedOrigins("http://localhost") // - .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS") // - .allowedHeaders("*") // - .allowCredentials(true) // - .maxAge(MAX_AGE_SECS); - } - - @Override - public void addFormatters(FormatterRegistry registry) { - ApplicationConversionService.configure(registry); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/exception/BadArgumentException.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/exception/BadArgumentException.java deleted file mode 100644 index 1f4623a2f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/exception/BadArgumentException.java +++ /dev/null @@ -1,15 +0,0 @@ -package test.org.springdoc.api.app9.core.exception; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ResponseStatus; - -@ResponseStatus(value = HttpStatus.BAD_REQUEST) -public class BadArgumentException extends Exception { - - private static final long serialVersionUID = -4975801683971908022L; - - public BadArgumentException(String message) { - super(message); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/exception/BusinessException.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/exception/BusinessException.java deleted file mode 100644 index 589b543b8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/exception/BusinessException.java +++ /dev/null @@ -1,11 +0,0 @@ -package test.org.springdoc.api.app9.core.exception; - -public class BusinessException extends Exception { - - private static final long serialVersionUID = -5454643285401132760L; - - public BusinessException(String message) { - super(message); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/model/ExceptionDto.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/model/ExceptionDto.java deleted file mode 100644 index 42b56200f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/core/model/ExceptionDto.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app9.core.model; - -import java.time.Instant; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.NonNull; - -@Data -public class ExceptionDto { - - @NonNull - @NotNull - @NotEmpty - @Schema(description = "The date and time the problem occured", example = "2020-02-04T13:21:08.098+0000", type = "string", format = "date-time") - private Instant timestamp; - - @Schema(description = "The exception class", example = "com.it4it.it4data.newdata.dataplatform.portal.api.core.exception.BadArgumentException") - private String exception; - - @Schema(description = "The exception message", example = "Trying to update a non existing component !") - private String message; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/utils/Converter.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/utils/Converter.java deleted file mode 100644 index f1ad8f278..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/app9/utils/Converter.java +++ /dev/null @@ -1,7 +0,0 @@ -package test.org.springdoc.api.app9.utils; - -public interface Converter { - - T convert(S source); - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..53b6057d9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) +public abstract class AbstractSpringDocTest { + + public static String className; + + @Autowired + protected MockMvc mockMvc; + + public static String getContent(String fileName) { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.0.1/app" + testNumber + ".json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/Account.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/Account.java new file mode 100644 index 000000000..c45a4ac37 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/Account.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import java.util.Date; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; + +@Entity +public class Account { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @ManyToOne + private Customer customer; + + @Temporal(TemporalType.DATE) + private Date expiryDate; + + public Long getId() { + return id; + } + + public Customer getCustomer() { + return customer; + } + + public Date getExpiryDate() { + return expiryDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/AccountRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/AccountRepository.java new file mode 100644 index 000000000..62c75c379 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/AccountRepository.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + + +import java.util.List; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +/** + * Repository to manage {@link Account} instances. + * + */ +@RepositoryRestResource +public interface AccountRepository extends CrudRepository { + + /** + * Returns all accounts belonging to the given {@link Customer}. + * + * @param customer + * @return + */ + List findByCustomer(@Param("customer") Customer customer); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/Customer.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/Customer.java new file mode 100644 index 000000000..df93bf4f9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/Customer.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +/** + * @author Oliver Gierke + */ +@Entity +public class Customer { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private String firstname; + + private String lastname; + + public Long getId() { + return id; + } + + public String getFirstname() { + return firstname; + } + + public String getLastname() { + return lastname; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/CustomerRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/CustomerRepository.java new file mode 100644 index 000000000..fb0da38ec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/CustomerRepository.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import java.util.List; +import java.util.Optional; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.data.rest.core.annotation.RestResource; + +/** + * Repository to manage {@link Customer} instances. + * + * @author Oliver Gierke + */ +@RepositoryRestResource +public interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor { + + /** + * Returns a page of {@link Customer}s with the given lastname. + * + * @param lastname + * @param pageable + * @return + */ + Page findByLastname(@Param("lastname") String lastname, Pageable pageable); + + @Override + @RestResource(exported = false) + void deleteById(Long id); + + @Override + @RestResource(exported = false) + void delete(Customer entity); + + @Override + @RestResource + List findAll(); + + @Override + @RestResource(exported = false) + Optional findById(Long aLong); + + @Override + @RestResource(exported = false) + S save(S entity); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java new file mode 100644 index 000000000..8c5fcfe37 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp10Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/Person.java new file mode 100644 index 000000000..b57168bb8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/PersonRepository.java new file mode 100644 index 000000000..78c0abc04 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/PersonRepository.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import java.util.List; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(collectionResourceRel = "people", path = "peopleme") +public interface PersonRepository extends PagingAndSortingRepository { + + List findByLastName(@Param("name") String name); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..65bb4c97c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp11Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java new file mode 100644 index 000000000..87be5b190 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.MediaTypes; +import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RequestMapping("/demo") +@RestController +public class HelloController { + + @Operation(summary = "GetMyData", operationId = "gettt", + responses = @ApiResponse(responseCode = "204", + content = @Content(mediaType = "application/vnd.something"))) + @GetMapping(produces = "application/vnd.something") + public ResponseEntity getSomethingElse() { + return ResponseEntity.noContent().build(); + } + + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE) + public String get() { + return "some text"; + } + + @GetMapping(produces = MediaTypes.HAL_JSON_VALUE) + public EntityModel getHal() { + return EntityModel.of(new JsonResponse(), + WebMvcLinkBuilder.linkTo(HelloController.class).slash("somelink").withSelfRel() + ); + } + + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public JsonResponse getJson() { + return new JsonResponse(); + } + + @GetMapping(produces = MediaType.APPLICATION_XML_VALUE) + @ApiResponse(responseCode = "202", + content = @Content(mediaType = MediaType.APPLICATION_XML_VALUE, schema = @Schema(implementation = JsonResponse.class))) + public JsonResponse getXML() { + return new JsonResponse(); + } + + public class JsonResponse { + @JsonProperty + private String field; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java new file mode 100644 index 000000000..5132651a4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app12; + +import io.swagger.v3.oas.models.Operation; +import org.springdoc.core.customizers.OperationCustomizer; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.web.method.HandlerMethod; + +public class SpringDocApp12Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + OperationCustomizer operationCustomizer() { + return (Operation operation, HandlerMethod handlerMethod) -> { + if (operation.getOperationId().startsWith("gettt")) + operation.setOperationId("gettt"); + return operation; + }; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java new file mode 100644 index 000000000..c094b330d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app13; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.PageableDefault; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@PageableDefault(size = 5, sort = "name") @ParameterObject Pageable pageable) { + return null; + } + + + @GetMapping("/test1") + public String getPatientList1(@PageableDefault(size = 100, sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test2") + public String getPatientList2(@PageableDefault(size = 100, sort = "someField", + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test3") + public String getPatientList3(@PageableDefault(size = 100) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test4") + public String getPatientList4(@PageableDefault(100) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test5") + public void read( + @PageableDefault(sort = { + "some,desc", + "other,asc", + "another.that,desc" + }) + @ParameterObject final Pageable pageable) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java new file mode 100644 index 000000000..5a417e784 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app13; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java new file mode 100644 index 000000000..31e790770 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app13; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp13Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java new file mode 100644 index 000000000..6252302f6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app14; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@ParameterObject Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/PersonDTO.java new file mode 100644 index 000000000..e7633340a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app14; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java new file mode 100644 index 000000000..d3fa04045 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app14; + +import java.util.Optional; + +import org.springdoc.core.configuration.SpringDocDataRestConfiguration; +import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; +import org.springdoc.core.providers.RepositoryRestConfigurationProvider; +import org.springdoc.core.providers.SpringDataWebPropertiesProvider; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Lazy; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "spring.data.web.pageable.default-page-size=25", + "spring.data.web.pageable.page-parameter=pages", + "spring.data.web.pageable.size-parameter=sizes", + "spring.data.web.pageable.one-indexed-parameters=true", + "spring.data.web.pageable.prefix=prefix_", + "spring.data.web.sort.sort-parameter=sorts" }) +@EnableAutoConfiguration(exclude = { + RepositoryRestMvcAutoConfiguration.class, SpringDocDataRestConfiguration.class +}) +public class SpringDocApp14Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + // We only need to test spring-web with Pageable, without the use of spring-data-rest-starter + @Bean + @ConditionalOnMissingBean + @Lazy(false) + DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { + return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java new file mode 100644 index 000000000..f487167be --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app15; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@ParameterObject Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/PersonDTO.java new file mode 100644 index 000000000..3b80ef331 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app15; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java new file mode 100644 index 000000000..5d267a330 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app15; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "spring.data.rest.default-page-size=50") +public class SpringDocApp15Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/Account.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/Account.java new file mode 100644 index 000000000..201cc5439 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/Account.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app16; + +import java.util.Date; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; + +@Entity +public class Account { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @ManyToOne + private Customer customer; + + @Temporal(TemporalType.DATE) + private Date expiryDate; + + public Long getId() { + return id; + } + + public Customer getCustomer() { + return customer; + } + + public Date getExpiryDate() { + return expiryDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/AccountRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/AccountRepository.java new file mode 100644 index 000000000..1d5397ed1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/AccountRepository.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app16; + + +import java.util.List; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +/** + * Repository to manage {@link Account} instances. + * + */ +@RepositoryRestResource +@Tag(name = "The account Repository") +@SecurityRequirement(name = "bearer") +public interface AccountRepository extends CrudRepository { + + /** + * Returns all accounts belonging to the given {@link Customer}. + * + * @param customer + * @return + */ + List findByCustomer(@Param("customer") Customer customer); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/Customer.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/Customer.java new file mode 100644 index 000000000..434784ed8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/Customer.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app16; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +/** + * @author Oliver Gierke + */ +@Entity +public class Customer { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private String firstname; + + private String lastname; + + public Long getId() { + return id; + } + + public String getFirstname() { + return firstname; + } + + public String getLastname() { + return lastname; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/CustomerRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/CustomerRepository.java new file mode 100644 index 000000000..17fcc6020 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/CustomerRepository.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app16; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.data.rest.core.annotation.RestResource; + +/** + * Repository to manage {@link Customer} instances. + * + * @author Oliver Gierke + */ +@RepositoryRestResource +@Tag(name = "The customer Repository") +public interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor { + + /** + * Returns a page of {@link Customer}s with the given lastname. + * + * @param lastname + * @param pageable + * @return + */ + @SecurityRequirement(name = "bearer") + Page findByLastname(@Param("lastname") String lastname, Pageable pageable); + + @Override + @RestResource(exported = false) + void deleteById(Long id); + + @Override + @RestResource(exported = false) + void delete(Customer entity); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/OpenApiConfig.java new file mode 100644 index 000000000..d17b975a4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/OpenApiConfig.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app16; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.security.SecurityScheme; + +@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) +@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") +public class OpenApiConfig { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java new file mode 100644 index 000000000..17526d688 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app16; + +import io.swagger.v3.oas.models.Operation; +import org.springdoc.core.customizers.DataRestRouterOperationCustomizer; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp16Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public DataRestRouterOperationCustomizer addRouterOperationCustomizer() { + return (routerOperation) -> { + Operation operation = routerOperation.getOperationModel(); + operation.setSummary(operation.getOperationId()); + return routerOperation; + }; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/ChildProperty.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/ChildProperty.java new file mode 100644 index 000000000..0a2e9911a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/ChildProperty.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app17; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import lombok.Data; + +@Entity +public @Data +class ChildProperty { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String name; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/ChildPropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/ChildPropertyRepository.java new file mode 100644 index 000000000..fdcfb3183 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/ChildPropertyRepository.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app17; + +import org.springframework.data.repository.PagingAndSortingRepository; + +public interface ChildPropertyRepository extends PagingAndSortingRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/Property.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/Property.java new file mode 100644 index 000000000..af3c3d6d1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/Property.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app17; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import lombok.Data; + +@Entity +public @Data +class Property { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String name; + + @ManyToOne + @JoinColumn(name = "child_property_id") + private ChildProperty myChildPropertyName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ChildProperty getMyChildPropertyName() { + return myChildPropertyName; + } + + public void setMyChildPropertyName(ChildProperty myChildPropertyName) { + this.myChildPropertyName = myChildPropertyName; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/PropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/PropertyRepository.java new file mode 100644 index 000000000..cc44d08a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/PropertyRepository.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app17; + +import org.springframework.data.repository.PagingAndSortingRepository; + +public interface PropertyRepository extends PagingAndSortingRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java new file mode 100644 index 000000000..a59e54168 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app17; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp17Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java new file mode 100644 index 000000000..9b02113f5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app18; + +import io.swagger.v3.oas.annotations.Operation; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.validation.Valid; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Validated +@RestController +@RequestMapping(value = { HelloController.VERSION + "/helloWorld", "latest/helloWorld" }, produces = MediaType.APPLICATION_JSON_VALUE) +public class HelloController { + + public static final String VERSION = "v1"; + + @Operation(summary = "Example endpoint") + @GetMapping("/helloWorld") + public HelloWorldModel helloWorld(@Valid @ParameterObject HelloWorldModel helloWorldModel, HttpServletRequest request) { + return new HelloWorldModel(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloWorldModel.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloWorldModel.java new file mode 100644 index 000000000..c1071d5e9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloWorldModel.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app18; + +import java.time.LocalDate; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +import org.springframework.format.annotation.DateTimeFormat; + +public class HelloWorldModel { + + @Parameter(description = "Description for abc", example = "def") + @NotBlank + private String abc; + + @Parameter(description = "Description of this date", example = "2020-10-25") + @NotNull + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate thisDate; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public LocalDate getThisDate() { + return thisDate; + } + + public void setThisDate(LocalDate thisDate) { + this.thisDate = thisDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java new file mode 100644 index 000000000..e1145bc6a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app18; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp18Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/Application.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/Application.java new file mode 100644 index 000000000..a353b9266 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/Application.java @@ -0,0 +1,106 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app19; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Data; + +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +@Data +@Entity +@Table(schema = "application", name = "application") +@Schema(description = "app") +@EntityListeners(AuditingEntityListener.class) +public class Application implements Serializable { + private static final long serialVersionUID = 6582562282311194139L; + + @Id + @Column(length = 64) + @GeneratedValue + @Schema(description = "id") + private String id; + + @Column(nullable = false, length = 64) + @Schema(description = "name") + private String name; + + @Column(length = 1024) + @Schema(description = "description") + private String description; + + @Column(length = 32) + @Schema(description = "app type") + @Enumerated(EnumType.STRING) + private AppType type = AppType.EXTERNAL; + + @Column + @Schema(description = "icon") + private String icon; + + @Column(nullable = false) + @CreatedDate + @Schema(description = "createTime") + private LocalDateTime createTime; + + @Column(length = 1024) + @Schema(description = "rsa-publicKey") + private String publicKey; + + @Column(length = 16, nullable = false) + @Enumerated(EnumType.STRING) + @Schema(description = "status") + private AuditStatus auditStatus = AuditStatus.UN_SUBMITTED; + + @Column + @Schema(description = "auditTime") + private LocalDateTime auditTime; + + public enum AuditStatus { + UN_SUBMITTED, + PENDING, + APPROVED, + FAILED + } + + public enum AppType { + INNER, + EXTERNAL + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/ApplicationPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/ApplicationPredicate.java new file mode 100644 index 000000000..a8b5332ff --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/ApplicationPredicate.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app19; + +import com.querydsl.core.types.dsl.StringExpression; + +import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; +import org.springframework.data.querydsl.binding.QuerydslBindings; + +public class ApplicationPredicate implements QuerydslBinderCustomizer { + + @Override + public void customize(QuerydslBindings bindings, QApplication root) { + bindings.excludeUnlistedProperties(true); + bindings.bind(root.name).first(StringExpression::containsIgnoreCase); + bindings.including(root.icon); + bindings.including(root.name); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/GreetingController.java new file mode 100644 index 000000000..63e3a4d20 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/GreetingController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app19; + +import com.querydsl.core.types.Predicate; + +import org.springframework.data.querydsl.binding.QuerydslPredicate; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class GreetingController { + + @GetMapping("/test2") + public ResponseEntity sayHello2(@QuerydslPredicate(root = Application.class, bindings = ApplicationPredicate.class) Predicate predicate, + @RequestParam String test) { + return ResponseEntity.ok().build(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/QApplication.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/QApplication.java new file mode 100644 index 000000000..627cbf229 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/QApplication.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app19; + +import com.querydsl.core.types.Path; +import com.querydsl.core.types.PathMetadata; +import com.querydsl.core.types.dsl.DateTimePath; +import com.querydsl.core.types.dsl.EntityPathBase; +import com.querydsl.core.types.dsl.EnumPath; +import com.querydsl.core.types.dsl.StringPath; +import jakarta.annotation.Generated; + +import static com.querydsl.core.types.PathMetadataFactory.forVariable; + + +/** + * QApplication is a Querydsl query type for Application + */ +@Generated("com.querydsl.codegen.EntitySerializer") +public class QApplication extends EntityPathBase { + + public static final QApplication application = new QApplication("application"); + + private static final long serialVersionUID = 2120388982L; + + public final EnumPath auditStatus = createEnum("auditStatus", Application.AuditStatus.class); + + public final DateTimePath auditTime = createDateTime("auditTime", java.time.LocalDateTime.class); + + public final DateTimePath createTime = createDateTime("createTime", java.time.LocalDateTime.class); + + public final StringPath description = createString("description"); + + public final StringPath icon = createString("icon"); + + public final StringPath id = createString("id"); + + public final StringPath name = createString("name"); + + public final StringPath publicKey = createString("publicKey"); + + public final EnumPath type = createEnum("type", Application.AppType.class); + + public QApplication(String variable) { + super(Application.class, forVariable(variable)); + } + + public QApplication(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QApplication(PathMetadata metadata) { + super(Application.class, metadata); + } + +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java new file mode 100644 index 000000000..5e64cbbe3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app19; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp19Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/HelloController.java new file mode 100644 index 000000000..d44c34b07 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2; + +import java.util.List; + +import jakarta.validation.constraints.NotNull; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@NotNull Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/PersonDTO.java new file mode 100644 index 000000000..407f38b21 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..e6eeb44a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp2Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/Bank.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/Bank.java new file mode 100644 index 000000000..9a7ad78b7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/Bank.java @@ -0,0 +1,107 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app20; + +import java.util.Objects; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Table; +import org.hibernate.annotations.NaturalId; + +@Entity +@Table(name = "bank") +public class Bank implements EntityDefinition { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "bnk_seq") + @SequenceGenerator(name = "bnk_seq", sequenceName = "bnk_seq", allocationSize = 1) + private Long id; + + @Column(unique = true) + @NaturalId + private String code; + + @Column(unique = true, nullable = false) + private String name; + + public Long getId() { + return this.id; + } + + public String getCode() { + return this.code; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public int hashCode() { + return Objects.hash(getCode()); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Bank)) { + return false; + } + Bank bank = (Bank) o; + return Objects.equals(getCode(), bank.getCode()); + } + + @Override + public String toString() { + return "Bank{" + + "id=" + id + + ", code='" + code + '\'' + + ", name='" + name + '\'' + + '}'; + } + + @Override + public String getKey() { + return code; + } + + @Override + public String getDescription() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/BankRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/BankRepository.java new file mode 100644 index 000000000..223623480 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/BankRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app20; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.stereotype.Repository; + +@Repository +@RepositoryRestResource(path = "banks") +public interface BankRepository extends JpaRepository, CodeLookupRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/CodeLookupRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/CodeLookupRepository.java new file mode 100644 index 000000000..d25471fca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/CodeLookupRepository.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app20; + +import org.springframework.data.repository.NoRepositoryBean; +import org.springframework.data.repository.query.Param; + +@NoRepositoryBean +public interface CodeLookupRepository { + EntityT findOneByCode(@Param("code") KeyT code); + + Long countByCode(KeyT code); +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/DemoApplication.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/DemoApplication.java new file mode 100644 index 000000000..2cc632c6c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/DemoApplication.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app20; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@OpenAPIDefinition( + info = @Info( + title = "Core API" + ) +) +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/EntityDefinition.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/EntityDefinition.java new file mode 100644 index 000000000..458a0813a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/EntityDefinition.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app20; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +public interface EntityDefinition { + + @JsonIgnore + String getKey(); + + @JsonIgnore + String getDescription(); +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java new file mode 100644 index 000000000..de6c59de5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app20; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp20Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/Person.java new file mode 100644 index 000000000..d1312f8db --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app21; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/PersonRepository.java new file mode 100644 index 000000000..95d1dc9c9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/PersonRepository.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app21; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(collectionResourceRel = "people", path = "peopleme") +public interface PersonRepository extends PagingAndSortingRepository { + + @Operation(description = "this is my test") + @ApiResponses( + value = { + @ApiResponse(responseCode = "200", description = "successful operation"), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Contact not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") } + ) + List findByLastName(@Param("lastName") String name); + + @Operation(description = "this is another test", responses = { + @ApiResponse(responseCode = "200", description = "another successful operation"), + @ApiResponse(responseCode = "404", description = "another Contact not found") } + ) + List findByFirstName(@Param("firstName") @Parameter(description = "this is for first Name") String name); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java new file mode 100644 index 000000000..090988903 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app21; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp21Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/Person.java new file mode 100644 index 000000000..952b6b375 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app22; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonApi.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonApi.java new file mode 100644 index 000000000..949483d9f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonApi.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app22; + +import org.springframework.data.rest.webmvc.RepositoryRestController; +import org.springframework.web.bind.annotation.GetMapping; + +@RepositoryRestController +public class PersonApi { + + @GetMapping("/people/test") + public Person test() { + return new Person(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonRepository.java new file mode 100644 index 000000000..aea57b358 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app22; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(path = "people", collectionResourceRel = "people") +public interface PersonRepository extends PagingAndSortingRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java new file mode 100644 index 000000000..40b3741e9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app22; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp22Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/Clinic.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/Clinic.java new file mode 100644 index 000000000..b9879fe5c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/Clinic.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app23; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@Entity +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = false) +@Builder +public class Clinic { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @NotNull + @NotBlank + private String name; + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/ClinicRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/ClinicRepo.java new file mode 100644 index 000000000..84e92aa31 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/ClinicRepo.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app23; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface ClinicRepo extends CrudRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/Doctor.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/Doctor.java new file mode 100644 index 000000000..ec3465d9f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/Doctor.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app23; + +import java.util.Set; + +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.AccessMode; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToMany; +import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@Entity +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = false) +@Builder +public class Doctor { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @ManyToMany + @Size(min = 1) + @ArraySchema( + schema = @Schema( + implementation = String.class, + accessMode = AccessMode.WRITE_ONLY + )) + private Set clinics; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/DoctorRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/DoctorRepo.java new file mode 100644 index 000000000..b041e5894 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/DoctorRepo.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app23; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface DoctorRepo extends CrudRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java new file mode 100644 index 000000000..7a17c9f5b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app23; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp23Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/QUser.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/QUser.java new file mode 100644 index 000000000..0af0989e2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/QUser.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app24; + +import com.querydsl.core.types.Path; +import com.querydsl.core.types.PathMetadata; +import com.querydsl.core.types.dsl.EntityPathBase; +import com.querydsl.core.types.dsl.NumberPath; +import com.querydsl.core.types.dsl.StringPath; +import jakarta.annotation.Generated; + +import static com.querydsl.core.types.PathMetadataFactory.forVariable; + + +/** + * QUser is a Querydsl query type for User + */ +@Generated("com.querydsl.codegen.EntitySerializer") +public class QUser extends EntityPathBase { + + public static final QUser user = new QUser("user"); + + private static final long serialVersionUID = 222331676L; + + public final StringPath email = createString("email"); + + public final StringPath firstName = createString("firstName"); + + public final NumberPath id = createNumber("id", Long.class); + + public final StringPath lastName = createString("lastName"); + + public QUser(String variable) { + super(User.class, forVariable(variable)); + } + + public QUser(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QUser(PathMetadata metadata) { + super(User.class, metadata); + } + +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java new file mode 100644 index 000000000..c9db43749 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app24; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp24Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/TesteResource.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/TesteResource.java new file mode 100644 index 000000000..34417ce12 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/TesteResource.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app24; + +import com.querydsl.core.types.Predicate; +import lombok.AllArgsConstructor; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.querydsl.binding.QuerydslPredicate; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@AllArgsConstructor +public class TesteResource { + + @GetMapping("/") + public Page testeQueryDslAndSpringDoc(@QuerydslPredicate(root = User.class, bindings = UserPredicate.class) Predicate predicate, Pageable pageable) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/User.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/User.java new file mode 100644 index 000000000..f0402de53 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/User.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app24; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import lombok.Getter; +import lombok.Setter; + +@Entity +@Getter +@Setter +public class User { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String firstName; + + private String lastName; + + private String email; +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/UserPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/UserPredicate.java new file mode 100644 index 000000000..bfca2ed00 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app24/UserPredicate.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app24; + +import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; +import org.springframework.data.querydsl.binding.QuerydslBindings; + +public class UserPredicate implements QuerydslBinderCustomizer { + + + @Override + public void customize(QuerydslBindings bindings, QUser user) { + bindings.excludeUnlistedProperties(true); + bindings.including(user.email); + bindings.bind(user.firstName).as("name").withDefaultBinding(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java new file mode 100644 index 000000000..7cbac719a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp25Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Address.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Address.java new file mode 100644 index 000000000..1edaa1bbb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Address.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.model; + +import jakarta.persistence.Embeddable; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Embeddable +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Address { + + private String name; + + private String street; + + private String number; + + private String zipcode; + + private String city; + + private String country; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/BaseEntity.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/BaseEntity.java new file mode 100644 index 000000000..e9ab93ee2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/BaseEntity.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.model; + +import java.util.UUID; + +import jakarta.persistence.Id; +import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.PrePersist; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.annotations.JdbcTypeCode; +import org.hibernate.type.SqlTypes; + +@Getter +@Setter +@NoArgsConstructor +@MappedSuperclass +public abstract class BaseEntity { + + @Id + @JdbcTypeCode(SqlTypes.CHAR) + private UUID id; + + @PrePersist + private void generateId() { + if (id == null) + id = UUID.randomUUID(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Cat.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Cat.java new file mode 100644 index 000000000..a863cdb3c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Cat.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.model; + +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Cat extends Pet { + + @Enumerated(EnumType.STRING) + private CoatType coat; + + @Builder + public Cat(String name, Owner owner, CoatType coat) { + super(name, owner); + this.coat = coat; + } + + public static enum CoatType { + TABBY, TOROISE, COLORPOINT, BICOLOR, TRICOLOR, SOLID + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Clinic.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Clinic.java new file mode 100644 index 000000000..4bd47fdbf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Clinic.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.model; + +import java.util.Set; + +import jakarta.persistence.ElementCollection; +import jakarta.persistence.Entity; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Clinic extends BaseEntity { + + @NotNull + private String name; + + @Size(min = 1) + @ElementCollection + private Set
addresses; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Doctor.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Doctor.java new file mode 100644 index 000000000..406528d9a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Doctor.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.model; + +import java.util.Set; + +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.ManyToMany; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Doctor extends BaseEntity { + + @NotNull + private String firstname; + + @NotNull + private String lastname; + + @Enumerated(EnumType.STRING) + private Specialty specialty; + + @Size(min = 1) + @ManyToMany + private Set clinics; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Dog.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Dog.java new file mode 100644 index 000000000..337537a75 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Dog.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.model; + +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@AllArgsConstructor +@NoArgsConstructor +public class Dog extends Pet { + + @Enumerated(EnumType.STRING) + private CoatType coat; + + @Builder + public Dog(String name, Owner owner, CoatType coat) { + super(name, owner); + this.coat = coat; + } + + public static enum CoatType { + SMOOTH, SHORT, COMBINATION, DOUBLE, HEAVY, SILKY, LONG, CURLY, WIRE, HAIRLESS + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Owner.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Owner.java new file mode 100644 index 000000000..a8d12436f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Owner.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.model; + +import java.util.Set; + +import jakarta.persistence.CascadeType; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Owner extends BaseEntity { + + private String firstname; + + @NotNull + private String lastname; + + @NotNull + @Embedded + private Address addresses; + + @EqualsAndHashCode.Exclude + @OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL }) + private Set pets; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Pet.java new file mode 100644 index 000000000..77a59719c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Pet.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import jakarta.persistence.Entity; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.ManyToOne; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; + +@Entity + +@EqualsAndHashCode(callSuper = false) +@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) + +@Data +@NoArgsConstructor +@RequiredArgsConstructor + +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "_type") +@JsonSubTypes({ + @Type(value = Dog.class, name = "dog"), + @Type(value = Cat.class, name = "cat") +}) +public class Pet extends BaseEntity { + + @NonNull + @NotNull + private String name; + + @NonNull + @ManyToOne + private Owner owner; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Specialty.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Specialty.java new file mode 100644 index 000000000..56428ba4a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/model/Specialty.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.model; + +public enum Specialty { + + ALLERGY_AND_IMMUNOLOGY, + ADOLESCENT_MEDICINE, + ANESTHESIOLOGY, + AEROSPACE_MEDICINE, + BARIATRICS, + CARDIOLOGY, + CARDIOTHORACIC_SURGERY, + CHILD_AND_ADOLESCENT_PSYCHIATRY, + CLINICAL_NEUROPHYSIOLOGY, + COLORECTAL_SURGERY, + DERMATOLOGY, + DEVELOPMENTAL_PEDIATRICS, + EMERGENCY_MEDICINE, + ENDOCRINOLOGY, + FAMILY_MEDICINE, + FORENSIC_PATHOLOGY, + FORENSIC_PSYCHIATRY, + GASTROENTEROLOGY, + GENERAL_SURGERY, + GENERAL_SURGICAL_ONCOLOGY, + GERIATRICS, + GERIATRIC_PSYCHIATRY, + GYNECOLOGIC_ONCOLOGY, + HEMATOLOGY, + HEMATOLOGIC_PATHOLOGY, + INFECTIOUS_DISEASE, + INTERNAL_MEDICINE, + INTERVENTIONAL_RADIOLOGY, + INTENSIVE_CARE_MEDICINE, + MATERNAL_FETAL_MEDICINE, + MEDICAL_BIOCHEMISTRY, + MEDICAL_GENETICS, + MEDICAL_ONCOLOGY, + NEONATOLOGY, + NEPHROLOGY, + NEUROLOGY, + NEUROPATHOLOGY, + NEUROSURGERY, + NUCLEAR_MEDICINE, + OBSTETRICS_AND_GYNECOLOGY, + OCCUPATIONAL_MEDICINE, + OPHTHALMOLOGY, + ORTHOPEDIC_SURGERY, + ORAL_AND_MAXILLOFACIAL_SURGERY, + OTORHINOLARYNGOLOGY, + PALLIATIVE_CARE, + PATHOLOGY, + PEDIATRICS, + PEDIATRIC_ALLERGY_AND_IMMUNOLOGY, + PEDIATRIC_CARDIOLOGY, + PEDIATRIC_EMERGENCY_MEDICINE, + PEDIATRIC_ENDOCRINOLOGY, + PEDIATRIC_GASTROENTEROLOGY, + PEDIATRIC_HEMATOLOGY_AND_ONCOLOGY, + PEDIATRIC_INFECTIOUS_DISEASE, + PEDIATRIC_NEPHROLOGY, + PEDIATRIC_RESPIRATORY_MEDICINE, + PEDIATRIC_RHEUMATOLOGY, + PEDIATRIC_SURGERY, + PHYSICAL_MEDICINE_AND_REHABILITATION, + PLASTIC_RECONSTRUCTIVE_AND_AESTHETIC_SURGERY, + PSYCHIATRY, + PUBLIC_HEALTH, + RADIATION_ONCOLOGY, + RADIOLOGY, + REPRODUCTIVE_ENDOCRINOLOGY_AND_INFERTILITY, + RESPIRATORY_MEDICINE, + RHEUMATOLOGY, + SPORTS_MEDICINE, + THORACIC_SURGERY, + NEURORADIOLOGY, + UROLOGY, + VASCULAR_SURGERY; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/ClinicRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/ClinicRepo.java new file mode 100644 index 000000000..b7a65d114 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/ClinicRepo.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.repo; + +import java.util.UUID; + +import test.org.springdoc.api.v30.app25.model.Clinic; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface ClinicRepo extends CrudRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/DoctorRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/DoctorRepo.java new file mode 100644 index 000000000..f4155fb8c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/DoctorRepo.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.repo; + +import java.util.UUID; + +import test.org.springdoc.api.v30.app25.model.Clinic; +import test.org.springdoc.api.v30.app25.model.Doctor; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface DoctorRepo extends CrudRepository { + + Iterable findByClinicsContains(Clinic clinic); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/OwnerRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/OwnerRepo.java new file mode 100644 index 000000000..5c864c484 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/OwnerRepo.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.repo; + +import java.util.UUID; + +import test.org.springdoc.api.v30.app25.model.Owner; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface OwnerRepo extends JpaRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/PetRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/PetRepo.java new file mode 100644 index 000000000..0a924fae1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app25/repo/PetRepo.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25.repo; + +import java.util.UUID; + +import test.org.springdoc.api.v30.app25.model.Pet; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface PetRepo extends JpaRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/Person.java new file mode 100644 index 000000000..617ceabd2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/Person.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app26; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/PersonRepository.java new file mode 100644 index 000000000..8e5c48f15 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/PersonRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app26; + +import java.util.List; + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(collectionResourceRel = "people", path = "peopleme") +public interface PersonRepository extends PagingAndSortingRepository { + + List findByLastName(@Param("name") String name); + + @Query(value = "select 1 from dual", nativeQuery = true) + void testQuery(); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java new file mode 100644 index 000000000..f0381cb6c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app26; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp26Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringRestConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringRestConfiguration.java new file mode 100644 index 000000000..a4a40475f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringRestConfiguration.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app26; + +import org.springframework.context.annotation.Configuration; +import org.springframework.data.rest.core.config.RepositoryRestConfiguration; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; +import org.springframework.web.servlet.config.annotation.CorsRegistry; + +@Configuration +public class SpringRestConfiguration implements RepositoryRestConfigurer { + @Override + public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { + config.exposeIdsFor(Person.class); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java new file mode 100644 index 000000000..58f687835 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app27; + +import java.util.List; + +import jakarta.validation.constraints.NotNull; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@NotNull Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/PersonDTO.java new file mode 100644 index 000000000..9cc882f67 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app27; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java new file mode 100644 index 000000000..3278e2960 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app27; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.springdoc.core.converters.PageableOpenAPIConverter; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.model-converters.pageable-converter.enabled=false") +public class SpringDocApp27Test extends AbstractSpringDocTest { + + static { + Optional pageabeConverter = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof PageableOpenAPIConverter).findAny(); + pageabeConverter.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/ExamplePageable.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/ExamplePageable.java new file mode 100644 index 000000000..2de642529 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/ExamplePageable.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app28; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; + +public class ExamplePageable implements Pageable { + + @Parameter(description = "Anything") + @JsonProperty + private int something; + + @Override + public int getPageNumber() { + return 0; + } + + @Override + public int getPageSize() { + return 0; + } + + @Override + public long getOffset() { + return 0; + } + + @Override + public Sort getSort() { + return null; + } + + @Override + public Pageable next() { + return null; + } + + @Override + public Pageable previousOrFirst() { + return null; + } + + @Override + public Pageable first() { + return null; + } + + @Override + public Pageable withPage(int pageNumber) { + return null; + } + + @Override + public boolean hasPrevious() { + return false; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/ExamplePageableReplacement.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/ExamplePageableReplacement.java new file mode 100644 index 000000000..9e8b38341 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/ExamplePageableReplacement.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app28; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Parameter; +import org.springdoc.core.converters.models.Pageable; + +public class ExamplePageableReplacement extends Pageable { + + @Parameter(description = "Anything") + private int something; + + /** + * Instantiates a new Pageable. + * @param page the page + * @param size the size + * @param sort the sort + */ + public ExamplePageableReplacement(int page, int size, List sort) { + super(page, size, sort); + } + + public int getSomething() { + return something; + } + + public void setSomething(int something) { + this.something = something; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java new file mode 100644 index 000000000..93e341856 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app28; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/api") +public class HelloController { + + + @GetMapping("/items/nested") + public void showNestedItem(@ParameterObject ExamplePageable examplePageable) { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java new file mode 100644 index 000000000..72b8d027f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app28; + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp28Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().replaceParameterObjectWithClass(ExamplePageable.class, ExamplePageableReplacement.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/Person.java new file mode 100644 index 000000000..c824d6dc1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app29; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/PersonApi.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/PersonApi.java new file mode 100644 index 000000000..04f46a79a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/PersonApi.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app29; + +import org.springframework.data.rest.webmvc.BasePathAwareController; +import org.springframework.web.bind.annotation.GetMapping; + +@BasePathAwareController +public class PersonApi { + + @GetMapping("/people/test") + public Person test() { + return new Person(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/PersonRepository.java new file mode 100644 index 000000000..b1dbd3b8f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/PersonRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app29; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(path = "people", collectionResourceRel = "people") +public interface PersonRepository extends PagingAndSortingRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java new file mode 100644 index 000000000..77f9d091b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app29; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp29Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app3/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app3/HelloController.java new file mode 100644 index 000000000..106024df3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app3/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import org.springdoc.core.converters.models.PageableAsQueryParam; +import org.springdoc.core.converters.models.SortAsQueryParam; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(path = "/demo", + produces = MediaType.TEXT_PLAIN_VALUE) +public class HelloController { + + @GetMapping("operation4") + @PageableAsQueryParam + public String operation4() { + return "operation4"; + } + + @GetMapping("operation5") + @SortAsQueryParam + public String operation5() { + return "operation5"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java new file mode 100644 index 000000000..a2df76273 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp3Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java new file mode 100644 index 000000000..b729ce0b6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app30; + +import com.querydsl.core.types.Predicate; + +import org.springframework.data.querydsl.binding.QuerydslPredicate; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + @GetMapping("/") + public User testQueryDslAndSpringDoc(@QuerydslPredicate(root = User.class, bindings = UserPredicate.class) Predicate predicate) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/QUser.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/QUser.java new file mode 100644 index 000000000..f80b57bc5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/QUser.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app30; + + +import com.querydsl.core.types.Path; +import com.querydsl.core.types.PathMetadata; +import com.querydsl.core.types.dsl.EntityPathBase; +import com.querydsl.core.types.dsl.NumberPath; +import com.querydsl.core.types.dsl.StringPath; + +import static com.querydsl.core.types.PathMetadataFactory.forVariable; + + +/** + * QUser is a Querydsl query type for User + */ +public class QUser extends EntityPathBase { + + public static final QUser user = new QUser("user"); + + private static final long serialVersionUID = 222331676L; + + public final StringPath email = createString("email"); + + public final StringPath firstName = createString("firstName"); + + public final NumberPath id = createNumber("id", Long.class); + + public final StringPath lastName = createString("lastName"); + + public QUser(String variable) { + super(User.class, forVariable(variable)); + } + + public QUser(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QUser(PathMetadata metadata) { + super(User.class, metadata); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java new file mode 100644 index 000000000..1620b2c1b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app30; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp30Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/User.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/User.java new file mode 100644 index 000000000..a6f2f5f10 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/User.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app30; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import lombok.Getter; +import lombok.Setter; + +@Entity +@Getter +@Setter +public class User { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String firstName; + + private String lastName; + + private String email; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/UserPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/UserPredicate.java new file mode 100644 index 000000000..6b5531387 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app30/UserPredicate.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app30; + + +import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; +import org.springframework.data.querydsl.binding.QuerydslBindings; + +public class UserPredicate implements QuerydslBinderCustomizer { + + + @Override + public void customize(QuerydslBindings bindings, QUser user) { + bindings.excludeUnlistedProperties(true); + bindings.including(user.email); + bindings.bind(user.firstName).as("name").withDefaultBinding(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/Person.java new file mode 100644 index 000000000..c41696aae --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app301; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/PersonApi.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/PersonApi.java new file mode 100644 index 000000000..42ea14b32 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/PersonApi.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app301; + +import org.springframework.data.rest.webmvc.BasePathAwareController; +import org.springframework.web.bind.annotation.GetMapping; + +@BasePathAwareController +public class PersonApi { + + @GetMapping("/people/test") + public Person test() { + return new Person(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/PersonRepository.java new file mode 100644 index 000000000..e1ceb492f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/PersonRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app301; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(path = "people", collectionResourceRel = "people") +public interface PersonRepository extends PagingAndSortingRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/SpringDocApp301Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/SpringDocApp301Test.java new file mode 100644 index 000000000..183533b06 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app301/SpringDocApp301Test.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app301; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.springdoc.core.providers.ObjectMapperProvider; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.enable-data-rest=false") +public class SpringDocApp301Test extends AbstractSpringDocTest { + + private final Map> springMixins = new HashMap<>(); + + @Autowired + ObjectMapperProvider objectMapperProvider; + + @BeforeEach + void init() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + Iterator>> it = _localMixIns.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry> entry = it.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + it.remove(); + } + } + + } + + @AfterEach + void clean() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + _localMixIns.putAll(springMixins); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java new file mode 100644 index 000000000..dc7df05e6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app31; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.SortDefault; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@SortDefault("name") @ParameterObject Sort sort) { + return null; + } + + + @GetMapping("/test1") + public String getPatientList1(@SortDefault(sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Sort sort) { + return "bla"; + } + + @GetMapping("/test2") + public String getPatientList2(@SortDefault(sort = "someField", + direction = Direction.DESC) + @ParameterObject Sort sort) { + return "bla"; + } + + @GetMapping("/test3") + public String getPatientList3(@SortDefault(sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test4") + public String getPatientList4(@SortDefault(sort = "someField", + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/PersonDTO.java new file mode 100644 index 000000000..a995fd804 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app31; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java new file mode 100644 index 000000000..10b68f470 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app31; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp31Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java new file mode 100644 index 000000000..c3f80c35b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app32; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Sort; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@ParameterObject Sort sort) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/PersonDTO.java new file mode 100644 index 000000000..0919022b3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app32; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java new file mode 100644 index 000000000..6b4113423 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app32; + +import java.util.Optional; + +import org.springdoc.core.configuration.SpringDocDataRestConfiguration; +import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; +import org.springdoc.core.providers.RepositoryRestConfigurationProvider; +import org.springdoc.core.providers.SpringDataWebPropertiesProvider; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Lazy; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "spring.data.web.sort.sort-parameter=sorts") +@EnableAutoConfiguration(exclude = { + RepositoryRestMvcAutoConfiguration.class, SpringDocDataRestConfiguration.class +}) +public class SpringDocApp32Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + // We only need to test spring-web with Sort, without the use of spring-data-rest-starter + @Bean + @ConditionalOnMissingBean + @Lazy(false) + DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { + return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/ExampleSort.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/ExampleSort.java new file mode 100644 index 000000000..59e928a3e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/ExampleSort.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app33; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.data.domain.Sort; + +public class ExampleSort extends Sort { + + @Parameter(description = "Anything") + @JsonProperty + private int something; + + protected ExampleSort(List orders) { + super(orders); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/ExampleSortReplacement.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/ExampleSortReplacement.java new file mode 100644 index 000000000..6c48b9b2b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/ExampleSortReplacement.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app33; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Parameter; +import org.springdoc.core.converters.models.Sort; + +public class ExampleSortReplacement extends Sort { + + @Parameter(description = "Anything") + private int something; + + /** + * Instantiates a new Sort. + * @param sort the sort + */ + public ExampleSortReplacement(List sort) { + super(sort); + } + + public int getSomething() { + return something; + } + + public void setSomething(int something) { + this.something = something; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java new file mode 100644 index 000000000..1b495fe92 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app33; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class HelloController { + + + @GetMapping("/items/nested") + public void showNestedItem(@ParameterObject ExampleSort exampleSort) { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java new file mode 100644 index 000000000..4eddf485d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app33; + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp33Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().replaceParameterObjectWithClass(ExampleSort.class, ExampleSortReplacement.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/Account.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/Account.java new file mode 100644 index 000000000..79ed96068 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/Account.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + +import java.util.Date; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; + + +@Entity +public class Account { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @ManyToOne + private Customer customer; + + @Temporal(TemporalType.DATE) + private Date expiryDate; + + public Long getId() { + return id; + } + + public Customer getCustomer() { + return customer; + } + + public Date getExpiryDate() { + return expiryDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/AccountRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/AccountRepository.java new file mode 100644 index 000000000..320f1a7fa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/AccountRepository.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + + +import java.util.List; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +/** + * Repository to manage {@link Account} instances. + * + */ +@RepositoryRestResource +@Tag(name = "The account Repository") +@SecurityRequirement(name = "bearer") +public interface AccountRepository extends CrudRepository { + + /** + * Returns all accounts belonging to the given {@link Customer}. + * + * @param customer + * @return + */ + List findByCustomer(@Param("customer") Customer customer); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/Customer.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/Customer.java new file mode 100644 index 000000000..e11557c67 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/Customer.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + + +import java.util.Collection; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; + + +/** + * @author Oliver Gierke + */ +@Entity +public class Customer { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private String firstname; + + private String lastname; + + @OneToMany(mappedBy = "customer") + private Collection accounts; + + public Long getId() { + return id; + } + + public String getFirstname() { + return firstname; + } + + public String getLastname() { + return lastname; + } + + public Collection getAccounts() { + return accounts; + } + + public void setAccounts(Collection accounts) { + this.accounts = accounts; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/CustomerRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/CustomerRepository.java new file mode 100644 index 000000000..1c09702dd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/CustomerRepository.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.data.rest.core.annotation.RestResource; + +/** + * Repository to manage {@link Customer} instances. + * + * @author Oliver Gierke + */ +@RepositoryRestResource +@Tag(name = "The customer Repository") +public interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor { + + /** + * Returns a page of {@link Customer}s with the given lastname. + * + * @param lastname + * @param pageable + * @return + */ + @SecurityRequirement(name = "bearer") + Page findByLastname(@Param("lastname") String lastname, Pageable pageable); + + @Override + @RestResource(exported = false) + void deleteById(Long id); + + @Override + @RestResource(exported = false) + void delete(Customer entity); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/OpenApiConfig.java new file mode 100644 index 000000000..e1b2b1b10 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/OpenApiConfig.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.security.SecurityScheme; + +@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) +@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") +public class OpenApiConfig { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java new file mode 100644 index 000000000..a853bd3d4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp34Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringRestConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringRestConfiguration.java new file mode 100644 index 000000000..4fcc3a20d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringRestConfiguration.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + + +import org.springframework.context.annotation.Configuration; +import org.springframework.data.rest.core.config.RepositoryRestConfiguration; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; +import org.springframework.web.servlet.config.annotation.CorsRegistry; + +@Configuration +public class SpringRestConfiguration implements RepositoryRestConfigurer { + @Override + public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { + config.exposeIdsFor(Account.class, Customer.class); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/ChildProperty.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/ChildProperty.java new file mode 100644 index 000000000..4e1f5f2c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/ChildProperty.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app35; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import lombok.Data; + +@Entity +public @Data +class ChildProperty { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String name; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/ChildPropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/ChildPropertyRepository.java new file mode 100644 index 000000000..81bbfebe1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/ChildPropertyRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app35; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.data.repository.PagingAndSortingRepository; + +@Hidden +public interface ChildPropertyRepository extends PagingAndSortingRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/Property.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/Property.java new file mode 100644 index 000000000..4eeb7aae3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/Property.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app35; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import lombok.Data; + +@Entity +public @Data +class Property { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String name; + + @ManyToOne + @JoinColumn(name = "child_property_id") + private ChildProperty myChildPropertyName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ChildProperty getMyChildPropertyName() { + return myChildPropertyName; + } + + public void setMyChildPropertyName(ChildProperty myChildPropertyName) { + this.myChildPropertyName = myChildPropertyName; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/PropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/PropertyRepository.java new file mode 100644 index 000000000..ab06524bd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/PropertyRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app35; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.data.repository.PagingAndSortingRepository; + +@Hidden +public interface PropertyRepository extends PagingAndSortingRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java new file mode 100644 index 000000000..8c045f8b8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app35; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp35Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/EnumFieldHolder.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/EnumFieldHolder.java new file mode 100644 index 000000000..13d50ffde --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/EnumFieldHolder.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app36; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +@Entity +public class EnumFieldHolder { + + public enum EnumField { + + FOO, BAR; + + } + + @Id + @GeneratedValue + private Long id; + + private EnumField enumField; + + public Long getId() { + return id; + } + + public EnumField getEnumField() { + return enumField; + } + + public void setEnumField(EnumField enumField) { + this.enumField = enumField; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/EnumFieldHolderRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/EnumFieldHolderRepository.java new file mode 100644 index 000000000..9de06794b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/EnumFieldHolderRepository.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app36; + +import java.util.List; + +import org.springframework.data.repository.Repository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.data.util.Streamable; + +@RepositoryRestResource +public interface EnumFieldHolderRepository extends Repository { + + Streamable findAllByEnumField(@Param("enumField") EnumFieldHolder.EnumField enumField); + + Streamable findAllByEnumFieldIn(@Param("enumFields") List enumFields); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/SpringDocApp36Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/SpringDocApp36Test.java new file mode 100644 index 000000000..c112fed6d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app36/SpringDocApp36Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app36; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp36Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/BaseEntity.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/BaseEntity.java new file mode 100644 index 000000000..29236f1b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/BaseEntity.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +import java.io.Serializable; + +import jakarta.persistence.Column; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.MappedSuperclass; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +/** + * @author bnasslahsen + */ + +@Data +@MappedSuperclass +@DynamicInsert(true) +@DynamicUpdate(true) +@SuperBuilder(toBuilder = true) +@NoArgsConstructor +public abstract class BaseEntity implements Serializable { + + /** SVUDI */ + private static final long serialVersionUID = 1L; + + /** 数据库中的ID */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID", unique = true, nullable = false, insertable = false, updatable = false) + private Long id; + + + /** + * 数据是否合法 + * + * @return 是否合法 + */ + public abstract boolean isValid(); +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/ProductEntity.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/ProductEntity.java new file mode 100644 index 000000000..c95da374c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/ProductEntity.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +import java.math.BigDecimal; +import java.time.LocalDate; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; + +/** + * @author bnasslahsen + */ + +@Getter +@Setter +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Entity +@Table(name = "PRODUCT_ENTITY") +@SuperBuilder(toBuilder = true) +@NoArgsConstructor +public class ProductEntity extends BaseEntity implements Comparable { + + /** SVUDI */ + private static final long serialVersionUID = 1L; + + /** 名字. */ + @NotNull + @Column(nullable = false) + private String name; + + /** 单价. */ + @NotNull + @Column(nullable = false) + private BigDecimal price; + + /** 日期. */ + @NotNull + @Column(nullable = false) + private LocalDate date; + + @Override + public boolean isValid() { + return name != null && price != null && date != null; + } + + /** 根据日期排序 */ + @Override + public int compareTo(ProductEntity oProduct) { + return this.getDate().compareTo(oProduct.getDate()); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/ProductRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/ProductRepository.java new file mode 100644 index 000000000..93dd0ecb3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/ProductRepository.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +/** + * @author bnasslahsen + */ + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.List; + +import ch.qos.logback.core.rolling.helper.DateTokenConverter; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 商品信息 + * + * @author zctmdc + */ +@RepositoryRestResource(path = "product") +public interface ProductRepository extends JpaRepository { + + List findByPrice( @Parameter( + name = "price", + description = "test desc", + in = ParameterIn.QUERY, + required = true + ) + @Param("price") BigDecimal price); + /** + * 根据商品名称查询商品信息 + * + * @param name 商品名称 + * @return 商品信息列表 + */ + List findByName(@Parameter(name = "name2", required = true) String name); + + /** + * 根据商品名称查询最新的商品信息 + * + * @param name 商品名称 + * @return 商品信息 + */ + ProductEntity findTopByNameOrderByDateDesc(@Parameter(name = "name2", required = true) String name); + + /** + * 根据商品名称模糊查询商品信息并按时间降序排序 + * + * @param name 商品名称 + * @return 商品信息列表 + */ + List findByNameContainingIgnoreCaseOrderByDateDesc( + @Parameter(name = "name2", required = true) String name); + + /** + * 根据商品名称模糊查询商品信息并按时间降序排序 + * + * @param name 商品名称 + * @return 商品信息列表 + */ + List findByNameContainingIgnoreCase( + @Parameter(name = "name2", required = true) String name); + + /** + * 根据商品名称模糊查询指定日期前的商品信息 + * + * @param end 指定日期结束 + * @return 商品信息列表 + */ + List findByDateBefore( + @Parameter(name = "end2", required = true) @DateTimeFormat(pattern = DateTokenConverter.DEFAULT_DATE_PATTERN) @Param("end") LocalDate end); + + /** + * 根据商品名称模糊查询指定日期前的商品信息 + * + * @param name 商品名称 + * @param end 指定日期结束 + * @return 商品信息列表 + */ + List findByNameContainingIgnoreCaseAndDateBefore( + @Parameter(name = "name2", required = true) String name, + @Parameter(name = "end2", required = true) @DateTimeFormat(pattern = DateTokenConverter.DEFAULT_DATE_PATTERN) @Param("end") LocalDate end); + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java new file mode 100644 index 000000000..f7cc2471a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp37Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app38/DefaultFlatParamObjectController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app38/DefaultFlatParamObjectController.java new file mode 100644 index 000000000..f96bff150 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app38/DefaultFlatParamObjectController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app38; + +import org.springframework.data.domain.Sort; +import org.springframework.data.web.SortDefault; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class DefaultFlatParamObjectController { + @GetMapping("/test1") + public String test1(@SortDefault("name") Sort sort) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java new file mode 100644 index 000000000..6c3cff547 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app38; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.default-flat-param-object=true" }) +public class SpringDocApp38Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/DatabaseLoader.java new file mode 100644 index 000000000..a0bfd766e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app4; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/Employee.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/Employee.java new file mode 100644 index 000000000..41a7bbb80 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app4; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/EmployeeController.java new file mode 100644 index 000000000..09f44adb8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/EmployeeController.java @@ -0,0 +1,135 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app4; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.stream.StreamSupport; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.IanaLinkRelations; +import org.springframework.hateoas.Link; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + private final EmployeeRepository repository; + + EmployeeController(EmployeeRepository repository) { + this.repository = repository; + } + + /** + * Look up all employees, and transform them into a REST collection resource. Then return them through Spring Web's + * {@link ResponseEntity} fluent API. + */ + @GetMapping("/employees") + ResponseEntity>> findAll() { + + List> employees = StreamSupport.stream(repository.findAll().spliterator(), false) + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .toList(); + + return ResponseEntity.ok( // + CollectionModel.of(employees, // + linkTo(methodOn(EmployeeController.class).findAll()).withSelfRel())); + } + + @PostMapping("/employees") + ResponseEntity> newEmployee(@RequestBody Employee employee) { + + try { + Employee savedEmployee = repository.save(employee); + + EntityModel employeeResource = EntityModel.of(savedEmployee, // + linkTo(methodOn(EmployeeController.class).findOne(savedEmployee.getId())).withSelfRel()); + + return ResponseEntity // + .created(new URI(employeeResource.getRequiredLink(IanaLinkRelations.SELF).getHref())) // + .body(employeeResource); + } + catch (URISyntaxException e) { + return ResponseEntity.badRequest().body(null); + } + } + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + ResponseEntity> findOne(@PathVariable long id) { + + return repository.findById(id) // + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .map(ResponseEntity::ok) // + .orElse(ResponseEntity.notFound().build()); + } + + /** + * Update existing employee then return a Location header. + * + * @param employee + * @param id + * @return + */ + @PutMapping("/employees/{id}") + ResponseEntity updateEmployee(@RequestBody Employee employee, @PathVariable long id) throws URISyntaxException { + + Employee employeeToUpdate = employee; + employeeToUpdate.setId(id); + repository.save(employeeToUpdate); + + Link newlyCreatedLink = linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); + + return ResponseEntity.noContent().location(new URI(newlyCreatedLink.getHref())).build(); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/EmployeeRepository.java new file mode 100644 index 000000000..78295fc7a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app4; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java new file mode 100644 index 000000000..b21bbadc1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +public class SpringDocApp4Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocTestApp.java new file mode 100644 index 000000000..c62943422 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocTestApp.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + EvoInflectorLinkRelationProvider relProvider() { + return new EvoInflectorLinkRelationProvider(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/Country.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/Country.java new file mode 100644 index 000000000..3bc1533a3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/Country.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import jakarta.persistence.Basic; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +/** + * @author gibah + */ + +@Entity +public class Country { + + @Id + @GeneratedValue + private Long id; + + @Basic + @Column(nullable = false) + private String name; + + @Basic + private String shortName; + + @Basic + private String dialingCode; + + @Basic + @Column(unique = true, nullable = false) + private String codeISO3166; + + @Basic + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private Status status; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getShortName() { + return shortName; + } + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + public String getDialingCode() { + return dialingCode; + } + + public void setDialingCode(String dialingCode) { + this.dialingCode = dialingCode; + } + + public String getCodeISO3166() { + return codeISO3166; + } + + public void setCodeISO3166(String codeISO3166) { + this.codeISO3166 = codeISO3166; + } + + public Status getStatus() { + return status; + } + + public Country setStatus(Status status) { + this.status = status; + return this; + } + + public enum Status { + ACTIVE, INACTIVE + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/CountryPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/CountryPredicate.java new file mode 100644 index 000000000..0a934a1b1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/CountryPredicate.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; +import org.springframework.data.querydsl.binding.QuerydslBindings; + +public class CountryPredicate implements QuerydslBinderCustomizer { + + @Override + public void customize(QuerydslBindings querydslBindings, QCountry qCountry) { + querydslBindings.bind(qCountry.codeISO3166).as("code").first((path, value) -> path.containsIgnoreCase(value)); + querydslBindings.bind(qCountry.dialingCode).as("postCode").first((path, value) -> path.containsIgnoreCase(value)); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/GreetingController.java new file mode 100644 index 000000000..2739a4143 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/GreetingController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import java.util.List; + +import com.querydsl.core.types.Predicate; +import test.org.springdoc.api.v30.app5.Country.Status; + +import org.springframework.data.querydsl.binding.QuerydslPredicate; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class GreetingController { + + @GetMapping("/test") + public ResponseEntity sayHello2(@QuerydslPredicate(bindings = CountryPredicate.class, root = Country.class) Predicate predicate, + @RequestParam List statuses) { + return ResponseEntity.ok().build(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/QCountry.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/QCountry.java new file mode 100644 index 000000000..d6294b7b2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/QCountry.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import com.querydsl.core.types.Path; +import com.querydsl.core.types.PathMetadata; +import com.querydsl.core.types.dsl.EntityPathBase; +import com.querydsl.core.types.dsl.EnumPath; +import com.querydsl.core.types.dsl.NumberPath; +import com.querydsl.core.types.dsl.StringPath; +import jakarta.annotation.Generated; +import test.org.springdoc.api.v30.app5.Country.Status; + +import static com.querydsl.core.types.PathMetadataFactory.forVariable; + + +/** + * QCountry is a Querydsl query type for Country + */ +@Generated("com.querydsl.codegen.EntitySerializer") +public class QCountry extends EntityPathBase { + + public static final QCountry country = new QCountry("country"); + + private static final long serialVersionUID = -1184258693L; + + public final StringPath codeISO3166 = createString("codeISO3166"); + + public final StringPath dialingCode = createString("dialingCode"); + + public final NumberPath id = createNumber("id", Long.class); + + public final StringPath name = createString("name"); + + public final StringPath shortName = createString("shortName"); + + public final EnumPath status = createEnum("status", Status.class); + + public QCountry(String variable) { + super(Country.class, forVariable(variable)); + } + + public QCountry(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QCountry(PathMetadata metadata) { + super(Country.class, metadata); + } + +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java new file mode 100644 index 000000000..efa971f2c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author Gibah Joseph + * Email: gibahjoe@gmail.com + * Mar, 2020 + **/ + +public class SpringDocApp5Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/DatabaseLoader.java new file mode 100644 index 000000000..94c9b630c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app6; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/Employee.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/Employee.java new file mode 100644 index 000000000..f3e76b2bd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app6; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/EmployeeController.java new file mode 100644 index 000000000..1be9db363 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/EmployeeController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app6; + +import org.springframework.hateoas.EntityModel; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + EntityModel findOne(@PathVariable long id) { + + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/EmployeeRepository.java new file mode 100644 index 000000000..d850232ef --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app6; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java new file mode 100644 index 000000000..886f9105d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.remove-broken-reference-definitions=false") +public class SpringDocApp6Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocTestApp.java new file mode 100644 index 000000000..1ec73e3c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocTestApp.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + EvoInflectorLinkRelationProvider relProvider() { + return new EvoInflectorLinkRelationProvider(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java new file mode 100644 index 000000000..cae453e79 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import java.util.List; + +import jakarta.validation.constraints.NotNull; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@NotNull @ParameterObject Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/PersonDTO.java new file mode 100644 index 000000000..7e66b26a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java new file mode 100644 index 000000000..06ee8c982 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp7Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/Album.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/Album.java new file mode 100644 index 000000000..3a3bea5e2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/Album.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app8; + +public class Album { + + private String title; + + private String description; + + private String releaseDate; + + public Album(String title, String description, String releaseDate) { + this.title = title; + this.description = description; + this.releaseDate = releaseDate; + } + + public String getTitle() { + return title; + } + + public String getDescription() { + return description; + } + + public String getReleaseDate() { + return releaseDate; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/AlbumController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/AlbumController.java new file mode 100644 index 000000000..21a5f0cd1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/AlbumController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app8; + +import java.util.Arrays; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.web.PagedResourcesAssembler; +import org.springframework.hateoas.PagedModel; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SuppressWarnings("unchecked") +public class AlbumController { + + @Autowired + private AlbumModelAssembler albumModelAssembler; + + @Autowired + private PagedResourcesAssembler pagedResourcesAssembler; + + @GetMapping("/api/albums") + public PagedModel getAllAlbums() { + Album album1 = new Album("album-title-1", "album-description-1", "album-release-date-1"); + Album album2 = new Album("album-title-2", "album-description-2", "album-release-date-2"); + Page albumPage = new PageImpl<>(Arrays.asList(album1, album2)); + + return pagedResourcesAssembler.toModel(albumPage, albumModelAssembler); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/AlbumModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/AlbumModelAssembler.java new file mode 100644 index 000000000..a68002442 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/AlbumModelAssembler.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app8; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.Link; +import org.springframework.hateoas.server.RepresentationModelAssembler; +import org.springframework.stereotype.Component; + +@Component +public class AlbumModelAssembler implements RepresentationModelAssembler> { + + @Override + public EntityModel toModel(Album entity) { + List links = new ArrayList<>(); + return EntityModel.of(entity, links); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java new file mode 100644 index 000000000..1b6a8682e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app8; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp8Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..96b79a9a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.springdoc.core.providers.ObjectMapperProvider; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "spring.hateoas.use-hal-as-default-json-media-type= false") +@SuppressWarnings({ "deprecation", "unchecked" }) +public class SpringDocApp9Test extends AbstractSpringDocTest { + + private final Map> springMixins = new HashMap<>(); + + @Autowired + ObjectMapperProvider objectMapperProvider; + + @BeforeEach + void init() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + Iterator>> it = _localMixIns.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry> entry = it.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + it.remove(); + } + } + + } + + @AfterEach + void clean() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + _localMixIns.putAll(springMixins); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/ComponentsController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/ComponentsController.java new file mode 100644 index 000000000..878c31b11 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/ComponentsController.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.component.controller; + + +import java.util.Optional; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springdoc.core.converters.models.PageableAsQueryParam; +import test.org.springdoc.api.v30.app9.component.controller.hateoas.ComponentDtoModelAssembler; +import test.org.springdoc.api.v30.app9.component.dto.DemoComponentDto; +import test.org.springdoc.api.v30.app9.component.dto.converter.DemoComponentConverter; +import test.org.springdoc.api.v30.app9.component.model.DemoComponent; +import test.org.springdoc.api.v30.app9.component.service.ComponentsService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PagedResourcesAssembler; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.PagedModel; +import org.springframework.hateoas.RepresentationModel; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@RestController +@RequestMapping(path = "/components", produces = "application/json") +@Tag(name = "components", description = "Everything about components") +public class ComponentsController { + + @Autowired + private ComponentsService componentsService; + + @Autowired + private DemoComponentConverter toDtoConverter; + + @Autowired + private ComponentDtoModelAssembler componentDtoModelAssembler; + + @Autowired + private PagedResourcesAssembler pagedResourcesAssembler; + + @Operation(summary = "List the components") + @PageableAsQueryParam + @GetMapping + public ResponseEntity>>> findAll(@Parameter(hidden = true) Pageable pageable) { + Page results = componentsService.findAll(pageable); + + return ResponseEntity.ok(pagedResourcesAssembler.toModel(results, componentDtoModelAssembler)); + } + + @Operation(summary = "Get one component by its ID", description = "Returns a single component", // + responses = { // + @ApiResponse(responseCode = "200", description = "Component found"), // + @ApiResponse(responseCode = "404", description = "Component not found", content = { @Content(schema = @Schema(implementation = Void.class)) }) // + }) + @GetMapping("/{componentId}") + public ResponseEntity> findById(@PathVariable String componentId) { + Optional foundComponent = componentsService.findById(componentId); + + if (foundComponent.isPresent()) { + return ResponseEntity.ok(EntityModel.of(toDtoConverter.convert(foundComponent.get()), // + linkTo(methodOn(ComponentsController.class).findAll(null)).withRel("components"))); + } + + return ResponseEntity.notFound().location(linkTo(methodOn(ComponentsController.class).findAll(null)).toUri()).build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/hateoas/ComponentDtoModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/hateoas/ComponentDtoModelAssembler.java new file mode 100644 index 000000000..f9b2b5497 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/hateoas/ComponentDtoModelAssembler.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.component.controller.hateoas; + + +import test.org.springdoc.api.v30.app9.component.dto.DemoComponentDto; +import test.org.springdoc.api.v30.app9.component.dto.converter.DemoComponentConverter; +import test.org.springdoc.api.v30.app9.component.model.DemoComponent; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.RepresentationModel; +import org.springframework.hateoas.server.RepresentationModelAssembler; +import org.springframework.stereotype.Component; + +@Component +@SuppressWarnings({ "deprecation", "unchecked" }) +public class ComponentDtoModelAssembler implements RepresentationModelAssembler>> { + + @Autowired + private DemoComponentConverter toDtoConverter; + + @Override + public RepresentationModel> toModel(DemoComponent entity) { + return EntityModel.of(toDtoConverter.convert(entity)); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java new file mode 100644 index 000000000..b555eb898 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.component.controller.hateoas; + + +import test.org.springdoc.api.v30.app9.component.controller.ComponentsController; +import test.org.springdoc.api.v30.app9.component.dto.DemoComponentDto; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.server.RepresentationModelProcessor; +import org.springframework.stereotype.Component; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@Component +public class DemoComponentDtoModelProcessor implements RepresentationModelProcessor> { + + @Override + public EntityModel process(EntityModel model) { + final String id = model.getContent().getId(); + + model.add(linkTo(methodOn(ComponentsController.class).findById(id)).withSelfRel()); + + return model; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/dto/DemoComponentDto.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/dto/DemoComponentDto.java new file mode 100644 index 000000000..a4ba03883 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/dto/DemoComponentDto.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.component.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import org.springframework.hateoas.server.core.Relation; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Relation(collectionRelation = "components") +@Schema(description = "A demo component to illustrate Springdoc Issue #401") +public final class DemoComponentDto { + + @Schema(description = "Some ID", example = "1") + private String id; + + @Schema(description = "Some dummy payload", example = "Hello World") + private String payload; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/dto/converter/DemoComponentConverter.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/dto/converter/DemoComponentConverter.java new file mode 100644 index 000000000..046747a19 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/dto/converter/DemoComponentConverter.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.component.dto.converter; + + +import test.org.springdoc.api.v30.app9.component.dto.DemoComponentDto; +import test.org.springdoc.api.v30.app9.component.model.DemoComponent; +import test.org.springdoc.api.v30.app9.utils.Converter; + +import org.springframework.stereotype.Component; + +@Component +public class DemoComponentConverter implements Converter { + + @Override + public DemoComponentDto convert(DemoComponent source) { + if (source == null) { + return null; + } + + return DemoComponentDto.builder() // + .id(source.getId()) // + .payload(source.getPayload()) // + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/model/DemoComponent.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/model/DemoComponent.java new file mode 100644 index 000000000..900153f3c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/model/DemoComponent.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.component.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import org.springframework.data.annotation.Id; + +@Data +@Builder +@AllArgsConstructor +@EqualsAndHashCode +public class DemoComponent { + + @Id + private String id; + + private String payload; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/service/ComponentsService.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/service/ComponentsService.java new file mode 100644 index 000000000..b162699d0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/component/service/ComponentsService.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.component.service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Map; +import java.util.Optional; + +import test.org.springdoc.api.v30.app9.component.model.DemoComponent; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; + +@Service +public class ComponentsService { + + private static final Map repo = Collections.singletonMap("1", DemoComponent.builder().id("1").payload("Hello World !").build()); + + public Optional findById(String componentId) { + return Optional.ofNullable(repo.get(componentId)); + } + + public Page findAll(Pageable pageable) { + return new PageImpl(new ArrayList<>(repo.values()), pageable, repo.size()); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/OpenAPIConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/OpenAPIConfiguration.java new file mode 100644 index 000000000..946a7e170 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/OpenAPIConfiguration.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.core.config; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; + +import org.springframework.stereotype.Component; + +@Component +@OpenAPIDefinition( // + info = @Info( // + title = "Demo Springdoc Issue #401", // + version = "0.0.1-SNAPSHOT", // + description = "A demo API to illustrate Springdoc Issue #401." // + ) // +) +public class OpenAPIConfiguration { + // NO-OP +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/SpringRestConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/SpringRestConfiguration.java new file mode 100644 index 000000000..d0a1f9751 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/SpringRestConfiguration.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.core.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.data.rest.core.config.RepositoryRestConfiguration; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; +import org.springframework.http.MediaType; +import org.springframework.web.servlet.config.annotation.CorsRegistry; + +@Configuration +public class SpringRestConfiguration implements RepositoryRestConfigurer { + @Override + public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { + config.setDefaultMediaType(MediaType.APPLICATION_JSON); + config.useHalAsDefaultJsonMediaType(false); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/WebMvcConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/WebMvcConfiguration.java new file mode 100644 index 000000000..d04900fec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/config/WebMvcConfiguration.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.core.config; + +import org.springframework.boot.convert.ApplicationConversionService; +import org.springframework.context.annotation.Configuration; +import org.springframework.format.FormatterRegistry; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import static org.springdoc.core.utils.Constants.ALL_PATTERN; + +@Configuration +public class WebMvcConfiguration implements WebMvcConfigurer { + + private final long MAX_AGE_SECS = 3600; + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping(ALL_PATTERN) // + .allowedOrigins("http://localhost") // + .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS") // + .allowedHeaders("*") // + .allowCredentials(true) // + .maxAge(MAX_AGE_SECS); + } + + @Override + public void addFormatters(FormatterRegistry registry) { + ApplicationConversionService.configure(registry); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/exception/BadArgumentException.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/exception/BadArgumentException.java new file mode 100644 index 000000000..16e450418 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/exception/BadArgumentException.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.core.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ResponseStatus(value = HttpStatus.BAD_REQUEST) +public class BadArgumentException extends Exception { + + private static final long serialVersionUID = -4975801683971908022L; + + public BadArgumentException(String message) { + super(message); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/exception/BusinessException.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/exception/BusinessException.java new file mode 100644 index 000000000..b71019f31 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/exception/BusinessException.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.core.exception; + +public class BusinessException extends Exception { + + private static final long serialVersionUID = -5454643285401132760L; + + public BusinessException(String message) { + super(message); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/model/ExceptionDto.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/model/ExceptionDto.java new file mode 100644 index 000000000..1b66c28ba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/core/model/ExceptionDto.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.core.model; + +import java.time.Instant; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.NonNull; + +@Data +public class ExceptionDto { + + @NonNull + @NotNull + @NotEmpty + @Schema(description = "The date and time the problem occured", example = "2020-02-04T13:21:08.098+0000", type = "string", format = "date-time") + private Instant timestamp; + + @Schema(description = "The exception class", example = "com.it4it.it4data.newdata.dataplatform.portal.api.core.exception.BadArgumentException") + private String exception; + + @Schema(description = "The exception message", example = "Trying to update a non existing component !") + private String message; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/utils/Converter.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/utils/Converter.java new file mode 100644 index 000000000..9ab47120c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v30/app9/utils/Converter.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.utils; + +public interface Converter { + + T convert(S source); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..a88d3265e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +public abstract class AbstractSpringDocTest { + + public static String className; + + @Autowired + protected MockMvc mockMvc; + + public static String getContent(String fileName) { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.1.0/app" + testNumber + ".json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/Account.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/Account.java new file mode 100644 index 000000000..fe913cdcc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/Account.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import java.util.Date; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; + +@Entity +public class Account { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @ManyToOne + private Customer customer; + + @Temporal(TemporalType.DATE) + private Date expiryDate; + + public Long getId() { + return id; + } + + public Customer getCustomer() { + return customer; + } + + public Date getExpiryDate() { + return expiryDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/AccountRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/AccountRepository.java new file mode 100644 index 000000000..2ad726fb0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/AccountRepository.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + + +import java.util.List; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +/** + * Repository to manage {@link Account} instances. + * + */ +@RepositoryRestResource +public interface AccountRepository extends CrudRepository { + + /** + * Returns all accounts belonging to the given {@link Customer}. + * + * @param customer + * @return + */ + List findByCustomer(@Param("customer") Customer customer); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/Customer.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/Customer.java new file mode 100644 index 000000000..f0263d37d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/Customer.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +/** + * @author Oliver Gierke + */ +@Entity +public class Customer { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private String firstname; + + private String lastname; + + public Long getId() { + return id; + } + + public String getFirstname() { + return firstname; + } + + public String getLastname() { + return lastname; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/CustomerRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/CustomerRepository.java new file mode 100644 index 000000000..9b6f89670 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/CustomerRepository.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import java.util.List; +import java.util.Optional; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.data.rest.core.annotation.RestResource; + +/** + * Repository to manage {@link Customer} instances. + * + * @author Oliver Gierke + */ +@RepositoryRestResource +public interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor { + + /** + * Returns a page of {@link Customer}s with the given lastname. + * + * @param lastname + * @param pageable + * @return + */ + Page findByLastname(@Param("lastname") String lastname, Pageable pageable); + + @Override + @RestResource(exported = false) + void deleteById(Long id); + + @Override + @RestResource(exported = false) + void delete(Customer entity); + + @Override + @RestResource + List findAll(); + + @Override + @RestResource(exported = false) + Optional findById(Long aLong); + + @Override + @RestResource(exported = false) + S save(S entity); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java new file mode 100644 index 000000000..f2b91c7a5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp10Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/Person.java new file mode 100644 index 000000000..92905ae73 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/PersonRepository.java new file mode 100644 index 000000000..f1aed0151 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/PersonRepository.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import java.util.List; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(collectionResourceRel = "people", path = "peopleme") +public interface PersonRepository extends PagingAndSortingRepository { + + List findByLastName(@Param("name") String name); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..4411b7abd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp11Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java new file mode 100644 index 000000000..f8169da98 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.MediaTypes; +import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RequestMapping("/demo") +@RestController +public class HelloController { + + @Operation(summary = "GetMyData", operationId = "gettt", + responses = @ApiResponse(responseCode = "204", + content = @Content(mediaType = "application/vnd.something"))) + @GetMapping(produces = "application/vnd.something") + public ResponseEntity getSomethingElse() { + return ResponseEntity.noContent().build(); + } + + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE) + public String get() { + return "some text"; + } + + @GetMapping(produces = MediaTypes.HAL_JSON_VALUE) + public EntityModel getHal() { + return EntityModel.of(new JsonResponse(), + WebMvcLinkBuilder.linkTo(HelloController.class).slash("somelink").withSelfRel() + ); + } + + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public JsonResponse getJson() { + return new JsonResponse(); + } + + @GetMapping(produces = MediaType.APPLICATION_XML_VALUE) + @ApiResponse(responseCode = "202", + content = @Content(mediaType = MediaType.APPLICATION_XML_VALUE, schema = @Schema(implementation = JsonResponse.class))) + public JsonResponse getXML() { + return new JsonResponse(); + } + + public class JsonResponse { + @JsonProperty + private String field; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java new file mode 100644 index 000000000..0cd6ffdb2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import io.swagger.v3.oas.models.Operation; +import org.springdoc.core.customizers.OperationCustomizer; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.web.method.HandlerMethod; + +public class SpringDocApp12Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + OperationCustomizer operationCustomizer() { + return (Operation operation, HandlerMethod handlerMethod) -> { + if (operation.getOperationId().startsWith("gettt")) + operation.setOperationId("gettt"); + return operation; + }; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java new file mode 100644 index 000000000..fe7d3a85b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app13; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.PageableDefault; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@PageableDefault(size = 5, sort = "name") @ParameterObject Pageable pageable) { + return null; + } + + + @GetMapping("/test1") + public String getPatientList1(@PageableDefault(size = 100, sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test2") + public String getPatientList2(@PageableDefault(size = 100, sort = "someField", + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test3") + public String getPatientList3(@PageableDefault(size = 100) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test4") + public String getPatientList4(@PageableDefault(100) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test5") + public void read( + @PageableDefault(sort = { + "some,desc", + "other,asc", + "another.that,desc" + }) + @ParameterObject final Pageable pageable) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java new file mode 100644 index 000000000..6ec5d1458 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app13; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java new file mode 100644 index 000000000..9b149c949 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app13; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp13Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java new file mode 100644 index 000000000..743ad62f6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app14; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@ParameterObject Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/PersonDTO.java new file mode 100644 index 000000000..2cbe843e9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app14; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java new file mode 100644 index 000000000..8a0f23df3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app14; + +import java.util.Optional; + +import org.springdoc.core.configuration.SpringDocDataRestConfiguration; +import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; +import org.springdoc.core.providers.RepositoryRestConfigurationProvider; +import org.springdoc.core.providers.SpringDataWebPropertiesProvider; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Lazy; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "spring.data.web.pageable.default-page-size=25", + "spring.data.web.pageable.page-parameter=pages", + "spring.data.web.pageable.size-parameter=sizes", + "spring.data.web.pageable.one-indexed-parameters=true", + "spring.data.web.pageable.prefix=prefix_", + "spring.data.web.sort.sort-parameter=sorts" }) +@EnableAutoConfiguration(exclude = { + RepositoryRestMvcAutoConfiguration.class, SpringDocDataRestConfiguration.class +}) +public class SpringDocApp14Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + // We only need to test spring-web with Pageable, without the use of spring-data-rest-starter + @Bean + @ConditionalOnMissingBean + @Lazy(false) + DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { + return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java new file mode 100644 index 000000000..4a877d43c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app15; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@ParameterObject Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/PersonDTO.java new file mode 100644 index 000000000..076f6332d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app15; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java new file mode 100644 index 000000000..38df23261 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app15; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "spring.data.rest.default-page-size=50") +public class SpringDocApp15Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/Account.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/Account.java new file mode 100644 index 000000000..1eaf072a7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/Account.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + +import java.util.Date; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; + +@Entity +public class Account { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @ManyToOne + private Customer customer; + + @Temporal(TemporalType.DATE) + private Date expiryDate; + + public Long getId() { + return id; + } + + public Customer getCustomer() { + return customer; + } + + public Date getExpiryDate() { + return expiryDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/AccountRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/AccountRepository.java new file mode 100644 index 000000000..84d138196 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/AccountRepository.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + + +import java.util.List; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +/** + * Repository to manage {@link Account} instances. + * + */ +@RepositoryRestResource +@Tag(name = "The account Repository") +@SecurityRequirement(name = "bearer") +public interface AccountRepository extends CrudRepository { + + /** + * Returns all accounts belonging to the given {@link Customer}. + * + * @param customer + * @return + */ + List findByCustomer(@Param("customer") Customer customer); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/Customer.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/Customer.java new file mode 100644 index 000000000..2c674c95a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/Customer.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +/** + * @author Oliver Gierke + */ +@Entity +public class Customer { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private String firstname; + + private String lastname; + + public Long getId() { + return id; + } + + public String getFirstname() { + return firstname; + } + + public String getLastname() { + return lastname; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/CustomerRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/CustomerRepository.java new file mode 100644 index 000000000..5ce219160 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/CustomerRepository.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.data.rest.core.annotation.RestResource; + +/** + * Repository to manage {@link Customer} instances. + * + * @author Oliver Gierke + */ +@RepositoryRestResource +@Tag(name = "The customer Repository") +public interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor { + + /** + * Returns a page of {@link Customer}s with the given lastname. + * + * @param lastname + * @param pageable + * @return + */ + @SecurityRequirement(name = "bearer") + Page findByLastname(@Param("lastname") String lastname, Pageable pageable); + + @Override + @RestResource(exported = false) + void deleteById(Long id); + + @Override + @RestResource(exported = false) + void delete(Customer entity); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/OpenApiConfig.java new file mode 100644 index 000000000..2b8d31e10 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/OpenApiConfig.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.security.SecurityScheme; + +@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) +@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") +public class OpenApiConfig { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java new file mode 100644 index 000000000..ac798f879 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + +import io.swagger.v3.oas.models.Operation; +import org.springdoc.core.customizers.DataRestRouterOperationCustomizer; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp16Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public DataRestRouterOperationCustomizer addRouterOperationCustomizer() { + return (routerOperation) -> { + Operation operation = routerOperation.getOperationModel(); + operation.setSummary(operation.getOperationId()); + return routerOperation; + }; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/ChildProperty.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/ChildProperty.java new file mode 100644 index 000000000..6863c34a4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/ChildProperty.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app17; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import lombok.Data; + +@Entity +public @Data +class ChildProperty { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String name; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/ChildPropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/ChildPropertyRepository.java new file mode 100644 index 000000000..7c5918285 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/ChildPropertyRepository.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app17; + +import org.springframework.data.repository.PagingAndSortingRepository; + +public interface ChildPropertyRepository extends PagingAndSortingRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/Property.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/Property.java new file mode 100644 index 000000000..d45816636 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/Property.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app17; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import lombok.Data; + +@Entity +public @Data +class Property { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String name; + + @ManyToOne + @JoinColumn(name = "child_property_id") + private ChildProperty myChildPropertyName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ChildProperty getMyChildPropertyName() { + return myChildPropertyName; + } + + public void setMyChildPropertyName(ChildProperty myChildPropertyName) { + this.myChildPropertyName = myChildPropertyName; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/PropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/PropertyRepository.java new file mode 100644 index 000000000..a7311f867 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/PropertyRepository.java @@ -0,0 +1,32 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app17; + +import org.springframework.data.repository.PagingAndSortingRepository; + +public interface PropertyRepository extends PagingAndSortingRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java new file mode 100644 index 000000000..3af44ad26 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app17; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp17Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java new file mode 100644 index 000000000..e002a40ae --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app18; + +import io.swagger.v3.oas.annotations.Operation; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.validation.Valid; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Validated +@RestController +@RequestMapping(value = { HelloController.VERSION + "/helloWorld", "latest/helloWorld" }, produces = MediaType.APPLICATION_JSON_VALUE) +public class HelloController { + + public static final String VERSION = "v1"; + + @Operation(summary = "Example endpoint") + @GetMapping("/helloWorld") + public HelloWorldModel helloWorld(@Valid @ParameterObject HelloWorldModel helloWorldModel, HttpServletRequest request) { + return new HelloWorldModel(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloWorldModel.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloWorldModel.java new file mode 100644 index 000000000..05f3826f2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloWorldModel.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app18; + +import java.time.LocalDate; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +import org.springframework.format.annotation.DateTimeFormat; + +public class HelloWorldModel { + + @Parameter(description = "Description for abc", example = "def") + @NotBlank + private String abc; + + @Parameter(description = "Description of this date", example = "2020-10-25") + @NotNull + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate thisDate; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public LocalDate getThisDate() { + return thisDate; + } + + public void setThisDate(LocalDate thisDate) { + this.thisDate = thisDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java new file mode 100644 index 000000000..650852c30 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app18; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp18Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/Application.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/Application.java new file mode 100644 index 000000000..001818afe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/Application.java @@ -0,0 +1,106 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app19; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Data; + +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +@Data +@Entity +@Table(schema = "application", name = "application") +@Schema(description = "app") +@EntityListeners(AuditingEntityListener.class) +public class Application implements Serializable { + private static final long serialVersionUID = 6582562282311194139L; + + @Id + @Column(length = 64) + @GeneratedValue + @Schema(description = "id") + private String id; + + @Column(nullable = false, length = 64) + @Schema(description = "name") + private String name; + + @Column(length = 1024) + @Schema(description = "description") + private String description; + + @Column(length = 32) + @Schema(description = "app type") + @Enumerated(EnumType.STRING) + private AppType type = AppType.EXTERNAL; + + @Column + @Schema(description = "icon") + private String icon; + + @Column(nullable = false) + @CreatedDate + @Schema(description = "createTime") + private LocalDateTime createTime; + + @Column(length = 1024) + @Schema(description = "rsa-publicKey") + private String publicKey; + + @Column(length = 16, nullable = false) + @Enumerated(EnumType.STRING) + @Schema(description = "status") + private AuditStatus auditStatus = AuditStatus.UN_SUBMITTED; + + @Column + @Schema(description = "auditTime") + private LocalDateTime auditTime; + + public enum AuditStatus { + UN_SUBMITTED, + PENDING, + APPROVED, + FAILED + } + + public enum AppType { + INNER, + EXTERNAL + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/ApplicationPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/ApplicationPredicate.java new file mode 100644 index 000000000..4ddae77e0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/ApplicationPredicate.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app19; + +import com.querydsl.core.types.dsl.StringExpression; + +import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; +import org.springframework.data.querydsl.binding.QuerydslBindings; + +public class ApplicationPredicate implements QuerydslBinderCustomizer { + + @Override + public void customize(QuerydslBindings bindings, QApplication root) { + bindings.excludeUnlistedProperties(true); + bindings.bind(root.name).first(StringExpression::containsIgnoreCase); + bindings.including(root.icon); + bindings.including(root.name); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/GreetingController.java new file mode 100644 index 000000000..df13412e1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/GreetingController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app19; + +import com.querydsl.core.types.Predicate; + +import org.springframework.data.querydsl.binding.QuerydslPredicate; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class GreetingController { + + @GetMapping("/test2") + public ResponseEntity sayHello2(@QuerydslPredicate(root = Application.class, bindings = ApplicationPredicate.class) Predicate predicate, + @RequestParam String test) { + return ResponseEntity.ok().build(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/QApplication.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/QApplication.java new file mode 100644 index 000000000..b4894fa2b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/QApplication.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app19; + +import com.querydsl.core.types.Path; +import com.querydsl.core.types.PathMetadata; +import com.querydsl.core.types.dsl.DateTimePath; +import com.querydsl.core.types.dsl.EntityPathBase; +import com.querydsl.core.types.dsl.EnumPath; +import com.querydsl.core.types.dsl.StringPath; +import jakarta.annotation.Generated; + +import static com.querydsl.core.types.PathMetadataFactory.forVariable; + + +/** + * QApplication is a Querydsl query type for Application + */ +@Generated("com.querydsl.codegen.EntitySerializer") +public class QApplication extends EntityPathBase { + + public static final QApplication application = new QApplication("application"); + + private static final long serialVersionUID = 2120388982L; + + public final EnumPath auditStatus = createEnum("auditStatus", Application.AuditStatus.class); + + public final DateTimePath auditTime = createDateTime("auditTime", java.time.LocalDateTime.class); + + public final DateTimePath createTime = createDateTime("createTime", java.time.LocalDateTime.class); + + public final StringPath description = createString("description"); + + public final StringPath icon = createString("icon"); + + public final StringPath id = createString("id"); + + public final StringPath name = createString("name"); + + public final StringPath publicKey = createString("publicKey"); + + public final EnumPath type = createEnum("type", Application.AppType.class); + + public QApplication(String variable) { + super(Application.class, forVariable(variable)); + } + + public QApplication(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QApplication(PathMetadata metadata) { + super(Application.class, metadata); + } + +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java new file mode 100644 index 000000000..1885539f0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app19; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp19Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/HelloController.java new file mode 100644 index 000000000..ef37cd93b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2; + +import java.util.List; + +import jakarta.validation.constraints.NotNull; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@NotNull Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/PersonDTO.java new file mode 100644 index 000000000..ba048cb66 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..3fef40c5a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp2Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/Bank.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/Bank.java new file mode 100644 index 000000000..f802ce0f3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/Bank.java @@ -0,0 +1,107 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import java.util.Objects; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Table; +import org.hibernate.annotations.NaturalId; + +@Entity +@Table(name = "bank") +public class Bank implements EntityDefinition { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "bnk_seq") + @SequenceGenerator(name = "bnk_seq", sequenceName = "bnk_seq", allocationSize = 1) + private Long id; + + @Column(unique = true) + @NaturalId + private String code; + + @Column(unique = true, nullable = false) + private String name; + + public Long getId() { + return this.id; + } + + public String getCode() { + return this.code; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public int hashCode() { + return Objects.hash(getCode()); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Bank)) { + return false; + } + Bank bank = (Bank) o; + return Objects.equals(getCode(), bank.getCode()); + } + + @Override + public String toString() { + return "Bank{" + + "id=" + id + + ", code='" + code + '\'' + + ", name='" + name + '\'' + + '}'; + } + + @Override + public String getKey() { + return code; + } + + @Override + public String getDescription() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/BankRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/BankRepository.java new file mode 100644 index 000000000..48ab7f656 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/BankRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.stereotype.Repository; + +@Repository +@RepositoryRestResource(path = "banks") +public interface BankRepository extends JpaRepository, CodeLookupRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/CodeLookupRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/CodeLookupRepository.java new file mode 100644 index 000000000..f484ab661 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/CodeLookupRepository.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import org.springframework.data.repository.NoRepositoryBean; +import org.springframework.data.repository.query.Param; + +@NoRepositoryBean +public interface CodeLookupRepository { + EntityT findOneByCode(@Param("code") KeyT code); + + Long countByCode(KeyT code); +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/DemoApplication.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/DemoApplication.java new file mode 100644 index 000000000..fa34360f1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/DemoApplication.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@OpenAPIDefinition( + info = @Info( + title = "Core API" + ) +) +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/EntityDefinition.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/EntityDefinition.java new file mode 100644 index 000000000..9e6a71094 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/EntityDefinition.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +public interface EntityDefinition { + + @JsonIgnore + String getKey(); + + @JsonIgnore + String getDescription(); +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java new file mode 100644 index 000000000..33e4c1026 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp20Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/Person.java new file mode 100644 index 000000000..caec567a4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app21; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/PersonRepository.java new file mode 100644 index 000000000..b3c492389 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/PersonRepository.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app21; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(collectionResourceRel = "people", path = "peopleme") +public interface PersonRepository extends PagingAndSortingRepository { + + @Operation(description = "this is my test") + @ApiResponses( + value = { + @ApiResponse(responseCode = "200", description = "successful operation"), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Contact not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") } + ) + List findByLastName(@Param("lastName") String name); + + @Operation(description = "this is another test", responses = { + @ApiResponse(responseCode = "200", description = "another successful operation"), + @ApiResponse(responseCode = "404", description = "another Contact not found") } + ) + List findByFirstName(@Param("firstName") @Parameter(description = "this is for first Name") String name); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java new file mode 100644 index 000000000..e57bb1ed1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app21; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp21Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/Person.java new file mode 100644 index 000000000..47458862f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonApi.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonApi.java new file mode 100644 index 000000000..e5417c885 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonApi.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +import org.springframework.data.rest.webmvc.RepositoryRestController; +import org.springframework.web.bind.annotation.GetMapping; + +@RepositoryRestController +public class PersonApi { + + @GetMapping("/people/test") + public Person test() { + return new Person(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonRepository.java new file mode 100644 index 000000000..77d72c0c0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(path = "people", collectionResourceRel = "people") +public interface PersonRepository extends PagingAndSortingRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java new file mode 100644 index 000000000..80861859d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp22Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/Clinic.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/Clinic.java new file mode 100644 index 000000000..e2156d75a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/Clinic.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app23; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@Entity +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = false) +@Builder +public class Clinic { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @NotNull + @NotBlank + private String name; + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/ClinicRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/ClinicRepo.java new file mode 100644 index 000000000..6dfd42399 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/ClinicRepo.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app23; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface ClinicRepo extends CrudRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/Doctor.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/Doctor.java new file mode 100644 index 000000000..5a6902465 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/Doctor.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app23; + +import java.util.Set; + +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.AccessMode; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToMany; +import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@Entity +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = false) +@Builder +public class Doctor { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @ManyToMany + @Size(min = 1) + @ArraySchema( + schema = @Schema( + implementation = String.class, + accessMode = AccessMode.WRITE_ONLY + )) + private Set clinics; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/DoctorRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/DoctorRepo.java new file mode 100644 index 000000000..308b73cfa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/DoctorRepo.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app23; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface DoctorRepo extends CrudRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java new file mode 100644 index 000000000..4c33f4ac2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app23; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp23Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/QUser.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/QUser.java new file mode 100644 index 000000000..1db52884e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/QUser.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import com.querydsl.core.types.Path; +import com.querydsl.core.types.PathMetadata; +import com.querydsl.core.types.dsl.EntityPathBase; +import com.querydsl.core.types.dsl.NumberPath; +import com.querydsl.core.types.dsl.StringPath; +import jakarta.annotation.Generated; + +import static com.querydsl.core.types.PathMetadataFactory.forVariable; + + +/** + * QUser is a Querydsl query type for User + */ +@Generated("com.querydsl.codegen.EntitySerializer") +public class QUser extends EntityPathBase { + + public static final QUser user = new QUser("user"); + + private static final long serialVersionUID = 222331676L; + + public final StringPath email = createString("email"); + + public final StringPath firstName = createString("firstName"); + + public final NumberPath id = createNumber("id", Long.class); + + public final StringPath lastName = createString("lastName"); + + public QUser(String variable) { + super(User.class, forVariable(variable)); + } + + public QUser(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QUser(PathMetadata metadata) { + super(User.class, metadata); + } + +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java new file mode 100644 index 000000000..6fdbbc1de --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp24Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/TesteResource.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/TesteResource.java new file mode 100644 index 000000000..c63417b7c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/TesteResource.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import com.querydsl.core.types.Predicate; +import lombok.AllArgsConstructor; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.querydsl.binding.QuerydslPredicate; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@AllArgsConstructor +public class TesteResource { + + @GetMapping("/") + public Page testeQueryDslAndSpringDoc(@QuerydslPredicate(root = User.class, bindings = UserPredicate.class) Predicate predicate, Pageable pageable) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/User.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/User.java new file mode 100644 index 000000000..79741b964 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/User.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import lombok.Getter; +import lombok.Setter; + +@Entity +@Getter +@Setter +public class User { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String firstName; + + private String lastName; + + private String email; +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/UserPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/UserPredicate.java new file mode 100644 index 000000000..2a76b9557 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app24/UserPredicate.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; +import org.springframework.data.querydsl.binding.QuerydslBindings; + +public class UserPredicate implements QuerydslBinderCustomizer { + + + @Override + public void customize(QuerydslBindings bindings, QUser user) { + bindings.excludeUnlistedProperties(true); + bindings.including(user.email); + bindings.bind(user.firstName).as("name").withDefaultBinding(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java new file mode 100644 index 000000000..be50c24c0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp25Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Address.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Address.java new file mode 100644 index 000000000..bf41b6c05 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Address.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.model; + +import jakarta.persistence.Embeddable; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Embeddable +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Address { + + private String name; + + private String street; + + private String number; + + private String zipcode; + + private String city; + + private String country; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/BaseEntity.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/BaseEntity.java new file mode 100644 index 000000000..a7f6d757a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/BaseEntity.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.model; + +import java.util.UUID; + +import jakarta.persistence.Id; +import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.PrePersist; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.annotations.JdbcTypeCode; +import org.hibernate.type.SqlTypes; + +@Getter +@Setter +@NoArgsConstructor +@MappedSuperclass +public abstract class BaseEntity { + + @Id + @JdbcTypeCode(SqlTypes.CHAR) + private UUID id; + + @PrePersist + private void generateId() { + if (id == null) + id = UUID.randomUUID(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Cat.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Cat.java new file mode 100644 index 000000000..0e6c58840 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Cat.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.model; + +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Cat extends Pet { + + @Enumerated(EnumType.STRING) + private CoatType coat; + + @Builder + public Cat(String name, Owner owner, CoatType coat) { + super(name, owner); + this.coat = coat; + } + + public static enum CoatType { + TABBY, TOROISE, COLORPOINT, BICOLOR, TRICOLOR, SOLID + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Clinic.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Clinic.java new file mode 100644 index 000000000..7e7cb72e3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Clinic.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.model; + +import java.util.Set; + +import jakarta.persistence.ElementCollection; +import jakarta.persistence.Entity; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Clinic extends BaseEntity { + + @NotNull + private String name; + + @Size(min = 1) + @ElementCollection + private Set
addresses; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Doctor.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Doctor.java new file mode 100644 index 000000000..aa6935387 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Doctor.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.model; + +import java.util.Set; + +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.ManyToMany; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Doctor extends BaseEntity { + + @NotNull + private String firstname; + + @NotNull + private String lastname; + + @Enumerated(EnumType.STRING) + private Specialty specialty; + + @Size(min = 1) + @ManyToMany + private Set clinics; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Dog.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Dog.java new file mode 100644 index 000000000..d3a2bfdc8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Dog.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.model; + +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@AllArgsConstructor +@NoArgsConstructor +public class Dog extends Pet { + + @Enumerated(EnumType.STRING) + private CoatType coat; + + @Builder + public Dog(String name, Owner owner, CoatType coat) { + super(name, owner); + this.coat = coat; + } + + public static enum CoatType { + SMOOTH, SHORT, COMBINATION, DOUBLE, HEAVY, SILKY, LONG, CURLY, WIRE, HAIRLESS + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Owner.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Owner.java new file mode 100644 index 000000000..970a27b3d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Owner.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.model; + +import java.util.Set; + +import jakarta.persistence.CascadeType; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Entity +@Data +@EqualsAndHashCode(callSuper = false) +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Owner extends BaseEntity { + + private String firstname; + + @NotNull + private String lastname; + + @NotNull + @Embedded + private Address addresses; + + @EqualsAndHashCode.Exclude + @OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL }) + private Set pets; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Pet.java new file mode 100644 index 000000000..95f2c2817 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Pet.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import jakarta.persistence.Entity; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.ManyToOne; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; + +@Entity + +@EqualsAndHashCode(callSuper = false) +@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) + +@Data +@NoArgsConstructor +@RequiredArgsConstructor + +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "_type") +@JsonSubTypes({ + @Type(value = Dog.class, name = "dog"), + @Type(value = Cat.class, name = "cat") +}) +public class Pet extends BaseEntity { + + @NonNull + @NotNull + private String name; + + @NonNull + @ManyToOne + private Owner owner; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Specialty.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Specialty.java new file mode 100644 index 000000000..01b2e195f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/model/Specialty.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.model; + +public enum Specialty { + + ALLERGY_AND_IMMUNOLOGY, + ADOLESCENT_MEDICINE, + ANESTHESIOLOGY, + AEROSPACE_MEDICINE, + BARIATRICS, + CARDIOLOGY, + CARDIOTHORACIC_SURGERY, + CHILD_AND_ADOLESCENT_PSYCHIATRY, + CLINICAL_NEUROPHYSIOLOGY, + COLORECTAL_SURGERY, + DERMATOLOGY, + DEVELOPMENTAL_PEDIATRICS, + EMERGENCY_MEDICINE, + ENDOCRINOLOGY, + FAMILY_MEDICINE, + FORENSIC_PATHOLOGY, + FORENSIC_PSYCHIATRY, + GASTROENTEROLOGY, + GENERAL_SURGERY, + GENERAL_SURGICAL_ONCOLOGY, + GERIATRICS, + GERIATRIC_PSYCHIATRY, + GYNECOLOGIC_ONCOLOGY, + HEMATOLOGY, + HEMATOLOGIC_PATHOLOGY, + INFECTIOUS_DISEASE, + INTERNAL_MEDICINE, + INTERVENTIONAL_RADIOLOGY, + INTENSIVE_CARE_MEDICINE, + MATERNAL_FETAL_MEDICINE, + MEDICAL_BIOCHEMISTRY, + MEDICAL_GENETICS, + MEDICAL_ONCOLOGY, + NEONATOLOGY, + NEPHROLOGY, + NEUROLOGY, + NEUROPATHOLOGY, + NEUROSURGERY, + NUCLEAR_MEDICINE, + OBSTETRICS_AND_GYNECOLOGY, + OCCUPATIONAL_MEDICINE, + OPHTHALMOLOGY, + ORTHOPEDIC_SURGERY, + ORAL_AND_MAXILLOFACIAL_SURGERY, + OTORHINOLARYNGOLOGY, + PALLIATIVE_CARE, + PATHOLOGY, + PEDIATRICS, + PEDIATRIC_ALLERGY_AND_IMMUNOLOGY, + PEDIATRIC_CARDIOLOGY, + PEDIATRIC_EMERGENCY_MEDICINE, + PEDIATRIC_ENDOCRINOLOGY, + PEDIATRIC_GASTROENTEROLOGY, + PEDIATRIC_HEMATOLOGY_AND_ONCOLOGY, + PEDIATRIC_INFECTIOUS_DISEASE, + PEDIATRIC_NEPHROLOGY, + PEDIATRIC_RESPIRATORY_MEDICINE, + PEDIATRIC_RHEUMATOLOGY, + PEDIATRIC_SURGERY, + PHYSICAL_MEDICINE_AND_REHABILITATION, + PLASTIC_RECONSTRUCTIVE_AND_AESTHETIC_SURGERY, + PSYCHIATRY, + PUBLIC_HEALTH, + RADIATION_ONCOLOGY, + RADIOLOGY, + REPRODUCTIVE_ENDOCRINOLOGY_AND_INFERTILITY, + RESPIRATORY_MEDICINE, + RHEUMATOLOGY, + SPORTS_MEDICINE, + THORACIC_SURGERY, + NEURORADIOLOGY, + UROLOGY, + VASCULAR_SURGERY; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/ClinicRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/ClinicRepo.java new file mode 100644 index 000000000..4e2afd69d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/ClinicRepo.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.repo; + +import java.util.UUID; + +import test.org.springdoc.api.v31.app25.model.Clinic; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface ClinicRepo extends CrudRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/DoctorRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/DoctorRepo.java new file mode 100644 index 000000000..3b7b90aca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/DoctorRepo.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.repo; + +import java.util.UUID; + +import test.org.springdoc.api.v31.app25.model.Clinic; +import test.org.springdoc.api.v31.app25.model.Doctor; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface DoctorRepo extends CrudRepository { + + Iterable findByClinicsContains(Clinic clinic); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/OwnerRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/OwnerRepo.java new file mode 100644 index 000000000..eaa5a18b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/OwnerRepo.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.repo; + +import java.util.UUID; + +import test.org.springdoc.api.v31.app25.model.Owner; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface OwnerRepo extends JpaRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/PetRepo.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/PetRepo.java new file mode 100644 index 000000000..a4223bd3f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app25/repo/PetRepo.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25.repo; + +import java.util.UUID; + +import test.org.springdoc.api.v31.app25.model.Pet; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@CrossOrigin +public interface PetRepo extends JpaRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/Person.java new file mode 100644 index 000000000..7876d4520 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/Person.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/PersonRepository.java new file mode 100644 index 000000000..1813497d6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/PersonRepository.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import java.util.List; + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(collectionResourceRel = "people", path = "peopleme") +public interface PersonRepository extends PagingAndSortingRepository { + + List findByLastName(@Param("name") String name); + + @Query(value = "select 1 from dual", nativeQuery = true) + void testQuery(); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java new file mode 100644 index 000000000..04ae935b7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp26Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringRestConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringRestConfiguration.java new file mode 100644 index 000000000..1006d3d04 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringRestConfiguration.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import org.springframework.context.annotation.Configuration; +import org.springframework.data.rest.core.config.RepositoryRestConfiguration; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; +import org.springframework.web.servlet.config.annotation.CorsRegistry; + +@Configuration +public class SpringRestConfiguration implements RepositoryRestConfigurer { + @Override + public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { + config.exposeIdsFor(Person.class); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java new file mode 100644 index 000000000..0fdf5865c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +import java.util.List; + +import jakarta.validation.constraints.NotNull; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@NotNull Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/PersonDTO.java new file mode 100644 index 000000000..1b2b72898 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java new file mode 100644 index 000000000..5306c9e4b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.springdoc.core.converters.PageableOpenAPIConverter; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.model-converters.pageable-converter.enabled=false") +public class SpringDocApp27Test extends AbstractSpringDocTest { + + static { + Optional pageabeConverter = + ModelConverters.getInstance(true).getConverters() + .stream().filter(modelConverter -> modelConverter instanceof PageableOpenAPIConverter).findAny(); + pageabeConverter.ifPresent(ModelConverters.getInstance(true)::removeConverter); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/ExamplePageable.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/ExamplePageable.java new file mode 100644 index 000000000..aa22fd81e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/ExamplePageable.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app28; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; + +public class ExamplePageable implements Pageable { + + @Parameter(description = "Anything") + @JsonProperty + private int something; + + @Override + public int getPageNumber() { + return 0; + } + + @Override + public int getPageSize() { + return 0; + } + + @Override + public long getOffset() { + return 0; + } + + @Override + public Sort getSort() { + return null; + } + + @Override + public Pageable next() { + return null; + } + + @Override + public Pageable previousOrFirst() { + return null; + } + + @Override + public Pageable first() { + return null; + } + + @Override + public Pageable withPage(int pageNumber) { + return null; + } + + @Override + public boolean hasPrevious() { + return false; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/ExamplePageableReplacement.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/ExamplePageableReplacement.java new file mode 100644 index 000000000..cfe5fa80e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/ExamplePageableReplacement.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app28; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Parameter; +import org.springdoc.core.converters.models.Pageable; + +public class ExamplePageableReplacement extends Pageable { + + @Parameter(description = "Anything") + private int something; + + /** + * Instantiates a new Pageable. + * @param page the page + * @param size the size + * @param sort the sort + */ + public ExamplePageableReplacement(int page, int size, List sort) { + super(page, size, sort); + } + + public int getSomething() { + return something; + } + + public void setSomething(int something) { + this.something = something; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java new file mode 100644 index 000000000..f841501f5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app28; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +@RequestMapping("/api") +public class HelloController { + + + @GetMapping("/items/nested") + public void showNestedItem(@ParameterObject ExamplePageable examplePageable) { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java new file mode 100644 index 000000000..49a4a0ead --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app28; + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp28Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().replaceParameterObjectWithClass(ExamplePageable.class, ExamplePageableReplacement.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/Person.java new file mode 100644 index 000000000..589b0fb3e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/PersonApi.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/PersonApi.java new file mode 100644 index 000000000..bbf716e56 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/PersonApi.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import org.springframework.data.rest.webmvc.BasePathAwareController; +import org.springframework.web.bind.annotation.GetMapping; + +@BasePathAwareController +public class PersonApi { + + @GetMapping("/people/test") + public Person test() { + return new Person(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/PersonRepository.java new file mode 100644 index 000000000..0dd92e452 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/PersonRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(path = "people", collectionResourceRel = "people") +public interface PersonRepository extends PagingAndSortingRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java new file mode 100644 index 000000000..136f530be --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp29Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app3/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app3/HelloController.java new file mode 100644 index 000000000..b8386c2ee --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app3/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import org.springdoc.core.converters.models.PageableAsQueryParam; +import org.springdoc.core.converters.models.SortAsQueryParam; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(path = "/demo", + produces = MediaType.TEXT_PLAIN_VALUE) +public class HelloController { + + @GetMapping("operation4") + @PageableAsQueryParam + public String operation4() { + return "operation4"; + } + + @GetMapping("operation5") + @SortAsQueryParam + public String operation5() { + return "operation5"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java new file mode 100644 index 000000000..a5377b94f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp3Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java new file mode 100644 index 000000000..e68880518 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app30; + +import com.querydsl.core.types.Predicate; + +import org.springframework.data.querydsl.binding.QuerydslPredicate; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +public class HelloController { + + @GetMapping("/") + public User testQueryDslAndSpringDoc(@QuerydslPredicate(root = User.class, bindings = UserPredicate.class) Predicate predicate) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/QUser.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/QUser.java new file mode 100644 index 000000000..aaa8eb9de --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/QUser.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app30; + + +import com.querydsl.core.types.Path; +import com.querydsl.core.types.PathMetadata; +import com.querydsl.core.types.dsl.EntityPathBase; +import com.querydsl.core.types.dsl.NumberPath; +import com.querydsl.core.types.dsl.StringPath; + +import static com.querydsl.core.types.PathMetadataFactory.forVariable; + + +/** + * QUser is a Querydsl query type for User + */ +public class QUser extends EntityPathBase { + + public static final QUser user = new QUser("user"); + + private static final long serialVersionUID = 222331676L; + + public final StringPath email = createString("email"); + + public final StringPath firstName = createString("firstName"); + + public final NumberPath id = createNumber("id", Long.class); + + public final StringPath lastName = createString("lastName"); + + public QUser(String variable) { + super(User.class, forVariable(variable)); + } + + public QUser(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QUser(PathMetadata metadata) { + super(User.class, metadata); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java new file mode 100644 index 000000000..c9e0bb870 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app30; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp30Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/User.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/User.java new file mode 100644 index 000000000..d13a9f693 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/User.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app30; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import lombok.Getter; +import lombok.Setter; + +@Entity +@Getter +@Setter +public class User { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String firstName; + + private String lastName; + + private String email; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/UserPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/UserPredicate.java new file mode 100644 index 000000000..f11de7712 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app30/UserPredicate.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app30; + + +import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; +import org.springframework.data.querydsl.binding.QuerydslBindings; + +public class UserPredicate implements QuerydslBinderCustomizer { + + + @Override + public void customize(QuerydslBindings bindings, QUser user) { + bindings.excludeUnlistedProperties(true); + bindings.including(user.email); + bindings.bind(user.firstName).as("name").withDefaultBinding(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/Person.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/Person.java new file mode 100644 index 000000000..eb78bf1f8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/Person.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app301; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Person { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String firstName; + + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/PersonApi.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/PersonApi.java new file mode 100644 index 000000000..d4527fc25 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/PersonApi.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app301; + +import org.springframework.data.rest.webmvc.BasePathAwareController; +import org.springframework.web.bind.annotation.GetMapping; + +@BasePathAwareController +public class PersonApi { + + @GetMapping("/people/test") + public Person test() { + return new Person(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/PersonRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/PersonRepository.java new file mode 100644 index 000000000..3f360b1f6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/PersonRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app301; + +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(path = "people", collectionResourceRel = "people") +public interface PersonRepository extends PagingAndSortingRepository { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/SpringDocApp301Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/SpringDocApp301Test.java new file mode 100644 index 000000000..2f7366421 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app301/SpringDocApp301Test.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app301; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.springdoc.core.providers.ObjectMapperProvider; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.enable-data-rest=false") +public class SpringDocApp301Test extends AbstractSpringDocTest { + + private final Map> springMixins = new HashMap<>(); + + @Autowired + ObjectMapperProvider objectMapperProvider; + + @BeforeEach + void init() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + Iterator>> it = _localMixIns.entrySet().iterator(); + while (it.hasNext()) { + Entry> entry = it.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + it.remove(); + } + } + + } + + @AfterEach + void clean() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + _localMixIns.putAll(springMixins); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java new file mode 100644 index 000000000..fa4b30b91 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app31; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.SortDefault; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@SortDefault("name") @ParameterObject Sort sort) { + return null; + } + + + @GetMapping("/test1") + public String getPatientList1(@SortDefault(sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Sort sort) { + return "bla"; + } + + @GetMapping("/test2") + public String getPatientList2(@SortDefault(sort = "someField", + direction = Direction.DESC) + @ParameterObject Sort sort) { + return "bla"; + } + + @GetMapping("/test3") + public String getPatientList3(@SortDefault(sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test4") + public String getPatientList4(@SortDefault(sort = "someField", + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/PersonDTO.java new file mode 100644 index 000000000..69a162dc7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app31; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java new file mode 100644 index 000000000..b92ad6523 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app31; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp31Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java new file mode 100644 index 000000000..4a2a6f369 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app32; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Sort; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@ParameterObject Sort sort) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/PersonDTO.java new file mode 100644 index 000000000..f7b4e19a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app32; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java new file mode 100644 index 000000000..6c8aa36dd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app32; + +import java.util.Optional; + +import org.springdoc.core.configuration.SpringDocDataRestConfiguration; +import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer; +import org.springdoc.core.providers.RepositoryRestConfigurationProvider; +import org.springdoc.core.providers.SpringDataWebPropertiesProvider; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Lazy; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "spring.data.web.sort.sort-parameter=sorts") +@EnableAutoConfiguration(exclude = { + RepositoryRestMvcAutoConfiguration.class, SpringDocDataRestConfiguration.class +}) +public class SpringDocApp32Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + // We only need to test spring-web with Sort, without the use of spring-data-rest-starter + @Bean + @ConditionalOnMissingBean + @Lazy(false) + DataRestDelegatingMethodParameterCustomizer dataRestDelegatingMethodParameterCustomizer(Optional optionalSpringDataWebPropertiesProvider, Optional optionalRepositoryRestConfiguration) { + return new DataRestDelegatingMethodParameterCustomizer(optionalSpringDataWebPropertiesProvider, optionalRepositoryRestConfiguration); + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/ExampleSort.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/ExampleSort.java new file mode 100644 index 000000000..23bf9ecf0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/ExampleSort.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app33; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.data.domain.Sort; + +public class ExampleSort extends Sort { + + @Parameter(description = "Anything") + @JsonProperty + private int something; + + protected ExampleSort(List orders) { + super(orders); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/ExampleSortReplacement.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/ExampleSortReplacement.java new file mode 100644 index 000000000..65e3f8765 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/ExampleSortReplacement.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app33; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Parameter; +import org.springdoc.core.converters.models.Sort; + +public class ExampleSortReplacement extends Sort { + + @Parameter(description = "Anything") + private int something; + + /** + * Instantiates a new Sort. + * @param sort the sort + */ + public ExampleSortReplacement(List sort) { + super(sort); + } + + public int getSomething() { + return something; + } + + public void setSomething(int something) { + this.something = something; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java new file mode 100644 index 000000000..1a9a293e1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app33; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class HelloController { + + + @GetMapping("/items/nested") + public void showNestedItem(@ParameterObject ExampleSort exampleSort) { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java new file mode 100644 index 000000000..5273fbf0d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app33; + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp33Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().replaceParameterObjectWithClass(ExampleSort.class, ExampleSortReplacement.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/Account.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/Account.java new file mode 100644 index 000000000..2795be4dc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/Account.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import java.util.Date; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; + + +@Entity +public class Account { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @ManyToOne + private Customer customer; + + @Temporal(TemporalType.DATE) + private Date expiryDate; + + public Long getId() { + return id; + } + + public Customer getCustomer() { + return customer; + } + + public Date getExpiryDate() { + return expiryDate; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/AccountRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/AccountRepository.java new file mode 100644 index 000000000..b6a80d186 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/AccountRepository.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + + +import java.util.List; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +/** + * Repository to manage {@link Account} instances. + * + */ +@RepositoryRestResource +@Tag(name = "The account Repository") +@SecurityRequirement(name = "bearer") +public interface AccountRepository extends CrudRepository { + + /** + * Returns all accounts belonging to the given {@link Customer}. + * + * @param customer + * @return + */ + List findByCustomer(@Param("customer") Customer customer); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/Customer.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/Customer.java new file mode 100644 index 000000000..0d803fd6a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/Customer.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + + +import java.util.Collection; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; + + +/** + * @author Oliver Gierke + */ +@Entity +public class Customer { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private String firstname; + + private String lastname; + + @OneToMany(mappedBy = "customer") + private Collection accounts; + + public Long getId() { + return id; + } + + public String getFirstname() { + return firstname; + } + + public String getLastname() { + return lastname; + } + + public Collection getAccounts() { + return accounts; + } + + public void setAccounts(Collection accounts) { + this.accounts = accounts; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/CustomerRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/CustomerRepository.java new file mode 100644 index 000000000..ee799f9f4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/CustomerRepository.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.data.rest.core.annotation.RestResource; + +/** + * Repository to manage {@link Customer} instances. + * + * @author Oliver Gierke + */ +@RepositoryRestResource +@Tag(name = "The customer Repository") +public interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor { + + /** + * Returns a page of {@link Customer}s with the given lastname. + * + * @param lastname + * @param pageable + * @return + */ + @SecurityRequirement(name = "bearer") + Page findByLastname(@Param("lastname") String lastname, Pageable pageable); + + @Override + @RestResource(exported = false) + void deleteById(Long id); + + @Override + @RestResource(exported = false) + void delete(Customer entity); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/OpenApiConfig.java new file mode 100644 index 000000000..f456244de --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/OpenApiConfig.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.security.SecurityScheme; + +@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) +@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") +public class OpenApiConfig { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java new file mode 100644 index 000000000..1063a917e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp34Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringRestConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringRestConfiguration.java new file mode 100644 index 000000000..c25b9a964 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringRestConfiguration.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + + +import org.springframework.context.annotation.Configuration; +import org.springframework.data.rest.core.config.RepositoryRestConfiguration; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; +import org.springframework.web.servlet.config.annotation.CorsRegistry; + +@Configuration +public class SpringRestConfiguration implements RepositoryRestConfigurer { + @Override + public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { + config.exposeIdsFor(Account.class, Customer.class); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/ChildProperty.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/ChildProperty.java new file mode 100644 index 000000000..24e096224 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/ChildProperty.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app35; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import lombok.Data; + +@Entity +public @Data +class ChildProperty { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String name; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/ChildPropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/ChildPropertyRepository.java new file mode 100644 index 000000000..1bc444c51 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/ChildPropertyRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app35; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.data.repository.PagingAndSortingRepository; + +@Hidden +public interface ChildPropertyRepository extends PagingAndSortingRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/Property.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/Property.java new file mode 100644 index 000000000..c3d33f0de --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/Property.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app35; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import lombok.Data; + +@Entity +public @Data +class Property { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + private String name; + + @ManyToOne + @JoinColumn(name = "child_property_id") + private ChildProperty myChildPropertyName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ChildProperty getMyChildPropertyName() { + return myChildPropertyName; + } + + public void setMyChildPropertyName(ChildProperty myChildPropertyName) { + this.myChildPropertyName = myChildPropertyName; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/PropertyRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/PropertyRepository.java new file mode 100644 index 000000000..14eff26bf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/PropertyRepository.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app35; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.data.repository.PagingAndSortingRepository; + +@Hidden +public interface PropertyRepository extends PagingAndSortingRepository { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java new file mode 100644 index 000000000..8078d891d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app35; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp35Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/EnumFieldHolder.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/EnumFieldHolder.java new file mode 100644 index 000000000..87fd8389f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/EnumFieldHolder.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app36; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +@Entity +public class EnumFieldHolder { + + public enum EnumField { + + FOO, BAR; + + } + + @Id + @GeneratedValue + private Long id; + + private EnumField enumField; + + public Long getId() { + return id; + } + + public EnumField getEnumField() { + return enumField; + } + + public void setEnumField(EnumField enumField) { + this.enumField = enumField; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/EnumFieldHolderRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/EnumFieldHolderRepository.java new file mode 100644 index 000000000..13996b095 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/EnumFieldHolderRepository.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app36; + +import java.util.List; + +import org.springframework.data.repository.Repository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.data.util.Streamable; + +@RepositoryRestResource +public interface EnumFieldHolderRepository extends Repository { + + Streamable findAllByEnumField(@Param("enumField") EnumFieldHolder.EnumField enumField); + + Streamable findAllByEnumFieldIn(@Param("enumFields") List enumFields); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/SpringDocApp36Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/SpringDocApp36Test.java new file mode 100644 index 000000000..d633ac324 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app36/SpringDocApp36Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app36; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp36Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/BaseEntity.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/BaseEntity.java new file mode 100644 index 000000000..63a93d153 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/BaseEntity.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +import java.io.Serializable; + +import jakarta.persistence.Column; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.MappedSuperclass; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +/** + * @author bnasslahsen + */ + +@Data +@MappedSuperclass +@DynamicInsert(true) +@DynamicUpdate(true) +@SuperBuilder(toBuilder = true) +@NoArgsConstructor +public abstract class BaseEntity implements Serializable { + + /** SVUDI */ + private static final long serialVersionUID = 1L; + + /** 数据库中的ID */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID", unique = true, nullable = false, insertable = false, updatable = false) + private Long id; + + + /** + * 数据是否合法 + * + * @return 是否合法 + */ + public abstract boolean isValid(); +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/ProductEntity.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/ProductEntity.java new file mode 100644 index 000000000..afaf6b513 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/ProductEntity.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +import java.math.BigDecimal; +import java.time.LocalDate; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; + +/** + * @author bnasslahsen + */ + +@Getter +@Setter +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = false) +@Entity +@Table(name = "PRODUCT_ENTITY") +@SuperBuilder(toBuilder = true) +@NoArgsConstructor +public class ProductEntity extends BaseEntity implements Comparable { + + /** SVUDI */ + private static final long serialVersionUID = 1L; + + /** 名字. */ + @NotNull + @Column(nullable = false) + private String name; + + /** 单价. */ + @NotNull + @Column(nullable = false) + private BigDecimal price; + + /** 日期. */ + @NotNull + @Column(nullable = false) + private LocalDate date; + + @Override + public boolean isValid() { + return name != null && price != null && date != null; + } + + /** 根据日期排序 */ + @Override + public int compareTo(ProductEntity oProduct) { + return this.getDate().compareTo(oProduct.getDate()); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/ProductRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/ProductRepository.java new file mode 100644 index 000000000..999fdf505 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/ProductRepository.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +/** + * @author bnasslahsen + */ + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.List; + +import ch.qos.logback.core.rolling.helper.DateTokenConverter; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 商品信息 + * + * @author zctmdc + */ +@RepositoryRestResource(path = "product") +public interface ProductRepository extends JpaRepository { + + List findByPrice( @Parameter( + name = "price", + description = "test desc", + in = ParameterIn.QUERY, + required = true + ) + @Param("price") BigDecimal price); + /** + * 根据商品名称查询商品信息 + * + * @param name 商品名称 + * @return 商品信息列表 + */ + List findByName(@Parameter(name = "name2", required = true) String name); + + /** + * 根据商品名称查询最新的商品信息 + * + * @param name 商品名称 + * @return 商品信息 + */ + ProductEntity findTopByNameOrderByDateDesc(@Parameter(name = "name2", required = true) String name); + + /** + * 根据商品名称模糊查询商品信息并按时间降序排序 + * + * @param name 商品名称 + * @return 商品信息列表 + */ + List findByNameContainingIgnoreCaseOrderByDateDesc( + @Parameter(name = "name2", required = true) String name); + + /** + * 根据商品名称模糊查询商品信息并按时间降序排序 + * + * @param name 商品名称 + * @return 商品信息列表 + */ + List findByNameContainingIgnoreCase( + @Parameter(name = "name2", required = true) String name); + + /** + * 根据商品名称模糊查询指定日期前的商品信息 + * + * @param end 指定日期结束 + * @return 商品信息列表 + */ + List findByDateBefore( + @Parameter(name = "end2", required = true) @DateTimeFormat(pattern = DateTokenConverter.DEFAULT_DATE_PATTERN) @Param("end") LocalDate end); + + /** + * 根据商品名称模糊查询指定日期前的商品信息 + * + * @param name 商品名称 + * @param end 指定日期结束 + * @return 商品信息列表 + */ + List findByNameContainingIgnoreCaseAndDateBefore( + @Parameter(name = "name2", required = true) String name, + @Parameter(name = "end2", required = true) @DateTimeFormat(pattern = DateTokenConverter.DEFAULT_DATE_PATTERN) @Param("end") LocalDate end); + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java new file mode 100644 index 000000000..35e25b485 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp37Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app38/DefaultFlatParamObjectController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app38/DefaultFlatParamObjectController.java new file mode 100644 index 000000000..a38090ad9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app38/DefaultFlatParamObjectController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app38; + +import org.springframework.data.domain.Sort; +import org.springframework.data.web.SortDefault; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class DefaultFlatParamObjectController { + @GetMapping("/test1") + public String test1(@SortDefault("name") Sort sort) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java new file mode 100644 index 000000000..53cb5da8f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app38; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.default-flat-param-object=true" }) +public class SpringDocApp38Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/DatabaseLoader.java new file mode 100644 index 000000000..30dde550b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app4; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/Employee.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/Employee.java new file mode 100644 index 000000000..bad2b6f36 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app4; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/EmployeeController.java new file mode 100644 index 000000000..f09b013d3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/EmployeeController.java @@ -0,0 +1,135 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app4; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.stream.StreamSupport; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.IanaLinkRelations; +import org.springframework.hateoas.Link; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + private final EmployeeRepository repository; + + EmployeeController(EmployeeRepository repository) { + this.repository = repository; + } + + /** + * Look up all employees, and transform them into a REST collection resource. Then return them through Spring Web's + * {@link ResponseEntity} fluent API. + */ + @GetMapping("/employees") + ResponseEntity>> findAll() { + + List> employees = StreamSupport.stream(repository.findAll().spliterator(), false) + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .toList(); + + return ResponseEntity.ok( // + CollectionModel.of(employees, // + linkTo(methodOn(EmployeeController.class).findAll()).withSelfRel())); + } + + @PostMapping("/employees") + ResponseEntity> newEmployee(@RequestBody Employee employee) { + + try { + Employee savedEmployee = repository.save(employee); + + EntityModel employeeResource = EntityModel.of(savedEmployee, // + linkTo(methodOn(EmployeeController.class).findOne(savedEmployee.getId())).withSelfRel()); + + return ResponseEntity // + .created(new URI(employeeResource.getRequiredLink(IanaLinkRelations.SELF).getHref())) // + .body(employeeResource); + } + catch (URISyntaxException e) { + return ResponseEntity.badRequest().body(null); + } + } + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + ResponseEntity> findOne(@PathVariable long id) { + + return repository.findById(id) // + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .map(ResponseEntity::ok) // + .orElse(ResponseEntity.notFound().build()); + } + + /** + * Update existing employee then return a Location header. + * + * @param employee + * @param id + * @return + */ + @PutMapping("/employees/{id}") + ResponseEntity updateEmployee(@RequestBody Employee employee, @PathVariable long id) throws URISyntaxException { + + Employee employeeToUpdate = employee; + employeeToUpdate.setId(id); + repository.save(employeeToUpdate); + + Link newlyCreatedLink = linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); + + return ResponseEntity.noContent().location(new URI(newlyCreatedLink.getHref())).build(); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/EmployeeRepository.java new file mode 100644 index 000000000..14a5d162d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app4; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java new file mode 100644 index 000000000..5d60fc494 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +public class SpringDocApp4Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocTestApp.java new file mode 100644 index 000000000..7da86449d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocTestApp.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + EvoInflectorLinkRelationProvider relProvider() { + return new EvoInflectorLinkRelationProvider(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/Country.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/Country.java new file mode 100644 index 000000000..becea25bf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/Country.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import jakarta.persistence.Basic; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +/** + * @author gibah + */ + +@Entity +public class Country { + + @Id + @GeneratedValue + private Long id; + + @Basic + @Column(nullable = false) + private String name; + + @Basic + private String shortName; + + @Basic + private String dialingCode; + + @Basic + @Column(unique = true, nullable = false) + private String codeISO3166; + + @Basic + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private Status status; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getShortName() { + return shortName; + } + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + public String getDialingCode() { + return dialingCode; + } + + public void setDialingCode(String dialingCode) { + this.dialingCode = dialingCode; + } + + public String getCodeISO3166() { + return codeISO3166; + } + + public void setCodeISO3166(String codeISO3166) { + this.codeISO3166 = codeISO3166; + } + + public Status getStatus() { + return status; + } + + public Country setStatus(Status status) { + this.status = status; + return this; + } + + public enum Status { + ACTIVE, INACTIVE + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/CountryPredicate.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/CountryPredicate.java new file mode 100644 index 000000000..fef275fc0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/CountryPredicate.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer; +import org.springframework.data.querydsl.binding.QuerydslBindings; + +public class CountryPredicate implements QuerydslBinderCustomizer { + + @Override + public void customize(QuerydslBindings querydslBindings, QCountry qCountry) { + querydslBindings.bind(qCountry.codeISO3166).as("code").first((path, value) -> path.containsIgnoreCase(value)); + querydslBindings.bind(qCountry.dialingCode).as("postCode").first((path, value) -> path.containsIgnoreCase(value)); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/GreetingController.java new file mode 100644 index 000000000..3efbb32af --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/GreetingController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import java.util.List; + +import com.querydsl.core.types.Predicate; +import test.org.springdoc.api.v30.app5.Country.Status; + +import org.springframework.data.querydsl.binding.QuerydslPredicate; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class GreetingController { + + @GetMapping("/test") + public ResponseEntity sayHello2(@QuerydslPredicate(bindings = CountryPredicate.class, root = Country.class) Predicate predicate, + @RequestParam List statuses) { + return ResponseEntity.ok().build(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/QCountry.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/QCountry.java new file mode 100644 index 000000000..00c9aa679 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/QCountry.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import com.querydsl.core.types.Path; +import com.querydsl.core.types.PathMetadata; +import com.querydsl.core.types.dsl.EntityPathBase; +import com.querydsl.core.types.dsl.EnumPath; +import com.querydsl.core.types.dsl.NumberPath; +import com.querydsl.core.types.dsl.StringPath; +import jakarta.annotation.Generated; +import test.org.springdoc.api.v30.app5.Country.Status; + +import static com.querydsl.core.types.PathMetadataFactory.forVariable; + + +/** + * QCountry is a Querydsl query type for Country + */ +@Generated("com.querydsl.codegen.EntitySerializer") +public class QCountry extends EntityPathBase { + + public static final QCountry country = new QCountry("country"); + + private static final long serialVersionUID = -1184258693L; + + public final StringPath codeISO3166 = createString("codeISO3166"); + + public final StringPath dialingCode = createString("dialingCode"); + + public final NumberPath id = createNumber("id", Long.class); + + public final StringPath name = createString("name"); + + public final StringPath shortName = createString("shortName"); + + public final EnumPath status = createEnum("status", Status.class); + + public QCountry(String variable) { + super(Country.class, forVariable(variable)); + } + + public QCountry(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QCountry(PathMetadata metadata) { + super(Country.class, metadata); + } + +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java new file mode 100644 index 000000000..c4f996968 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author Gibah Joseph + * Email: gibahjoe@gmail.com + * Mar, 2020 + **/ + +public class SpringDocApp5Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/DatabaseLoader.java new file mode 100644 index 000000000..5001a631e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app6; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/Employee.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/Employee.java new file mode 100644 index 000000000..50b2fbee8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app6; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/EmployeeController.java new file mode 100644 index 000000000..ec36b2a11 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/EmployeeController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app6; + +import org.springframework.hateoas.EntityModel; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + EntityModel findOne(@PathVariable long id) { + + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/EmployeeRepository.java new file mode 100644 index 000000000..61c4aa887 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app6; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java new file mode 100644 index 000000000..1933073e2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.remove-broken-reference-definitions=false") +public class SpringDocApp6Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocTestApp.java new file mode 100644 index 000000000..053730202 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocTestApp.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + EvoInflectorLinkRelationProvider relProvider() { + return new EvoInflectorLinkRelationProvider(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java new file mode 100644 index 000000000..528071409 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import java.util.List; + +import jakarta.validation.constraints.NotNull; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@NotNull @ParameterObject Pageable pageable) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/PersonDTO.java new file mode 100644 index 000000000..d601029e2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java new file mode 100644 index 000000000..f18601f70 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp7Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/Album.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/Album.java new file mode 100644 index 000000000..8f024d3cd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/Album.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app8; + +public class Album { + + private String title; + + private String description; + + private String releaseDate; + + public Album(String title, String description, String releaseDate) { + this.title = title; + this.description = description; + this.releaseDate = releaseDate; + } + + public String getTitle() { + return title; + } + + public String getDescription() { + return description; + } + + public String getReleaseDate() { + return releaseDate; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/AlbumController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/AlbumController.java new file mode 100644 index 000000000..8412ab28b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/AlbumController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app8; + +import java.util.Arrays; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.web.PagedResourcesAssembler; +import org.springframework.hateoas.PagedModel; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SuppressWarnings("unchecked") +public class AlbumController { + + @Autowired + private AlbumModelAssembler albumModelAssembler; + + @Autowired + private PagedResourcesAssembler pagedResourcesAssembler; + + @GetMapping("/api/albums") + public PagedModel getAllAlbums() { + Album album1 = new Album("album-title-1", "album-description-1", "album-release-date-1"); + Album album2 = new Album("album-title-2", "album-description-2", "album-release-date-2"); + Page albumPage = new PageImpl<>(Arrays.asList(album1, album2)); + + return pagedResourcesAssembler.toModel(albumPage, albumModelAssembler); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/AlbumModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/AlbumModelAssembler.java new file mode 100644 index 000000000..4ac085987 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/AlbumModelAssembler.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app8; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.Link; +import org.springframework.hateoas.server.RepresentationModelAssembler; +import org.springframework.stereotype.Component; + +@Component +public class AlbumModelAssembler implements RepresentationModelAssembler> { + + @Override + public EntityModel toModel(Album entity) { + List links = new ArrayList<>(); + return EntityModel.of(entity, links); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java new file mode 100644 index 000000000..7954f61e9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app8; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp8Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..0f813a91a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.springdoc.core.providers.ObjectMapperProvider; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "spring.hateoas.use-hal-as-default-json-media-type= false") +@SuppressWarnings({ "deprecation", "unchecked" }) +public class SpringDocApp9Test extends AbstractSpringDocTest { + + private final Map> springMixins = new HashMap<>(); + + @Autowired + ObjectMapperProvider objectMapperProvider; + + @BeforeEach + void init() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + Iterator>> it = _localMixIns.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry> entry = it.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + it.remove(); + } + } + + } + + @AfterEach + void clean() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + _localMixIns.putAll(springMixins); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/ComponentsController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/ComponentsController.java new file mode 100644 index 000000000..c49d0d590 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/ComponentsController.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.component.controller; + + +import java.util.Optional; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springdoc.core.converters.models.PageableAsQueryParam; +import test.org.springdoc.api.v31.app9.component.controller.hateoas.ComponentDtoModelAssembler; +import test.org.springdoc.api.v31.app9.component.dto.DemoComponentDto; +import test.org.springdoc.api.v31.app9.component.dto.converter.DemoComponentConverter; +import test.org.springdoc.api.v31.app9.component.model.DemoComponent; +import test.org.springdoc.api.v31.app9.component.service.ComponentsService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PagedResourcesAssembler; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.PagedModel; +import org.springframework.hateoas.RepresentationModel; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@RestController +@RequestMapping(path = "/components", produces = "application/json") +@Tag(name = "components", description = "Everything about components") +public class ComponentsController { + + @Autowired + private ComponentsService componentsService; + + @Autowired + private DemoComponentConverter toDtoConverter; + + @Autowired + private ComponentDtoModelAssembler componentDtoModelAssembler; + + @Autowired + private PagedResourcesAssembler pagedResourcesAssembler; + + @Operation(summary = "List the components") + @PageableAsQueryParam + @GetMapping + public ResponseEntity>>> findAll(@Parameter(hidden = true) Pageable pageable) { + Page results = componentsService.findAll(pageable); + + return ResponseEntity.ok(pagedResourcesAssembler.toModel(results, componentDtoModelAssembler)); + } + + @Operation(summary = "Get one component by its ID", description = "Returns a single component", // + responses = { // + @ApiResponse(responseCode = "200", description = "Component found"), // + @ApiResponse(responseCode = "404", description = "Component not found", content = { @Content(schema = @Schema(implementation = Void.class)) }) // + }) + @GetMapping("/{componentId}") + public ResponseEntity> findById(@PathVariable String componentId) { + Optional foundComponent = componentsService.findById(componentId); + + if (foundComponent.isPresent()) { + return ResponseEntity.ok(EntityModel.of(toDtoConverter.convert(foundComponent.get()), // + linkTo(methodOn(ComponentsController.class).findAll(null)).withRel("components"))); + } + + return ResponseEntity.notFound().location(linkTo(methodOn(ComponentsController.class).findAll(null)).toUri()).build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/hateoas/ComponentDtoModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/hateoas/ComponentDtoModelAssembler.java new file mode 100644 index 000000000..087885889 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/hateoas/ComponentDtoModelAssembler.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.component.controller.hateoas; + + +import test.org.springdoc.api.v31.app9.component.dto.DemoComponentDto; +import test.org.springdoc.api.v31.app9.component.dto.converter.DemoComponentConverter; +import test.org.springdoc.api.v31.app9.component.model.DemoComponent; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.RepresentationModel; +import org.springframework.hateoas.server.RepresentationModelAssembler; +import org.springframework.stereotype.Component; + +@Component +@SuppressWarnings({ "deprecation", "unchecked" }) +public class ComponentDtoModelAssembler implements RepresentationModelAssembler>> { + + @Autowired + private DemoComponentConverter toDtoConverter; + + @Override + public RepresentationModel> toModel(DemoComponent entity) { + return EntityModel.of(toDtoConverter.convert(entity)); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java new file mode 100644 index 000000000..5fa37eca4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/controller/hateoas/DemoComponentDtoModelProcessor.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.component.controller.hateoas; + + +import test.org.springdoc.api.v31.app9.component.controller.ComponentsController; +import test.org.springdoc.api.v31.app9.component.dto.DemoComponentDto; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.server.RepresentationModelProcessor; +import org.springframework.stereotype.Component; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@Component +public class DemoComponentDtoModelProcessor implements RepresentationModelProcessor> { + + @Override + public EntityModel process(EntityModel model) { + final String id = model.getContent().getId(); + + model.add(linkTo(methodOn(ComponentsController.class).findById(id)).withSelfRel()); + + return model; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/dto/DemoComponentDto.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/dto/DemoComponentDto.java new file mode 100644 index 000000000..a38ac49da --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/dto/DemoComponentDto.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.component.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import org.springframework.hateoas.server.core.Relation; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Relation(collectionRelation = "components") +@Schema(description = "A demo component to illustrate Springdoc Issue #401") +public final class DemoComponentDto { + + @Schema(description = "Some ID", example = "1") + private String id; + + @Schema(description = "Some dummy payload", example = "Hello World") + private String payload; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/dto/converter/DemoComponentConverter.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/dto/converter/DemoComponentConverter.java new file mode 100644 index 000000000..cd42b81f6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/dto/converter/DemoComponentConverter.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.component.dto.converter; + + +import test.org.springdoc.api.v31.app9.component.dto.DemoComponentDto; +import test.org.springdoc.api.v31.app9.component.model.DemoComponent; +import test.org.springdoc.api.v31.app9.utils.Converter; + +import org.springframework.stereotype.Component; + +@Component +public class DemoComponentConverter implements Converter { + + @Override + public DemoComponentDto convert(DemoComponent source) { + if (source == null) { + return null; + } + + return DemoComponentDto.builder() // + .id(source.getId()) // + .payload(source.getPayload()) // + .build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/model/DemoComponent.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/model/DemoComponent.java new file mode 100644 index 000000000..75a9ea4e6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/model/DemoComponent.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.component.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import org.springframework.data.annotation.Id; + +@Data +@Builder +@AllArgsConstructor +@EqualsAndHashCode +public class DemoComponent { + + @Id + private String id; + + private String payload; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/service/ComponentsService.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/service/ComponentsService.java new file mode 100644 index 000000000..8429cf32a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/component/service/ComponentsService.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.component.service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Map; +import java.util.Optional; + +import test.org.springdoc.api.v31.app9.component.model.DemoComponent; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; + +@Service +public class ComponentsService { + + private static final Map repo = Collections.singletonMap("1", DemoComponent.builder().id("1").payload("Hello World !").build()); + + public Optional findById(String componentId) { + return Optional.ofNullable(repo.get(componentId)); + } + + public Page findAll(Pageable pageable) { + return new PageImpl(new ArrayList<>(repo.values()), pageable, repo.size()); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/OpenAPIConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/OpenAPIConfiguration.java new file mode 100644 index 000000000..34cc20b32 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/OpenAPIConfiguration.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.core.config; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; + +import org.springframework.stereotype.Component; + +@Component +@OpenAPIDefinition( // + info = @Info( // + title = "Demo Springdoc Issue #401", // + version = "0.0.1-SNAPSHOT", // + description = "A demo API to illustrate Springdoc Issue #401." // + ) // +) +public class OpenAPIConfiguration { + // NO-OP +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/SpringRestConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/SpringRestConfiguration.java new file mode 100644 index 000000000..d831a89b1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/SpringRestConfiguration.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.core.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.data.rest.core.config.RepositoryRestConfiguration; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer; +import org.springframework.http.MediaType; +import org.springframework.web.servlet.config.annotation.CorsRegistry; + +@Configuration +public class SpringRestConfiguration implements RepositoryRestConfigurer { + @Override + public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) { + config.setDefaultMediaType(MediaType.APPLICATION_JSON); + config.useHalAsDefaultJsonMediaType(false); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/WebMvcConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/WebMvcConfiguration.java new file mode 100644 index 000000000..787ea1200 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/config/WebMvcConfiguration.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.core.config; + +import org.springframework.boot.convert.ApplicationConversionService; +import org.springframework.context.annotation.Configuration; +import org.springframework.format.FormatterRegistry; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import static org.springdoc.core.utils.Constants.ALL_PATTERN; + +@Configuration +public class WebMvcConfiguration implements WebMvcConfigurer { + + private final long MAX_AGE_SECS = 3600; + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping(ALL_PATTERN) // + .allowedOrigins("http://localhost") // + .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS") // + .allowedHeaders("*") // + .allowCredentials(true) // + .maxAge(MAX_AGE_SECS); + } + + @Override + public void addFormatters(FormatterRegistry registry) { + ApplicationConversionService.configure(registry); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/exception/BadArgumentException.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/exception/BadArgumentException.java new file mode 100644 index 000000000..22f91c4a5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/exception/BadArgumentException.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.core.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ResponseStatus(value = HttpStatus.BAD_REQUEST) +public class BadArgumentException extends Exception { + + private static final long serialVersionUID = -4975801683971908022L; + + public BadArgumentException(String message) { + super(message); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/exception/BusinessException.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/exception/BusinessException.java new file mode 100644 index 000000000..c5861511a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/exception/BusinessException.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.core.exception; + +public class BusinessException extends Exception { + + private static final long serialVersionUID = -5454643285401132760L; + + public BusinessException(String message) { + super(message); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/model/ExceptionDto.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/model/ExceptionDto.java new file mode 100644 index 000000000..7b188439c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/core/model/ExceptionDto.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.core.model; + +import java.time.Instant; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.NonNull; + +@Data +public class ExceptionDto { + + @NonNull + @NotNull + @NotEmpty + @Schema(description = "The date and time the problem occured", example = "2020-02-04T13:21:08.098+0000", type = "string", format = "date-time") + private Instant timestamp; + + @Schema(description = "The exception class", example = "com.it4it.it4data.newdata.dataplatform.portal.api.core.exception.BadArgumentException") + private String exception; + + @Schema(description = "The exception message", example = "Trying to update a non existing component !") + private String message; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/utils/Converter.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/utils/Converter.java new file mode 100644 index 000000000..5e5ee17ba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app9/utils/Converter.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.utils; + +public interface Converter { + + T convert(S source); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app10.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app10.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app10.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app10.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app11.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app11.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app11.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app12.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app12.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app12.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app12.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app13.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app13.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app13.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app13.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app14.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app14.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app14.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app14.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app15.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app15.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app15.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app15.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app16.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app16.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app16.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app16.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app17.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app17.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app17.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app17.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app18.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app18.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app18.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app18.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app19.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app19.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app19.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app19.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app2.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app20.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app20.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app20.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app20.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app21.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app21.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app21.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app21.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app22.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app22.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app22.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app22.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app23.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app23.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app23.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app23.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app24.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app24.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app24.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app24.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app25.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app25.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app25.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app25.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app26.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app26.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app26.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app26.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app27.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app27.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app27.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app27.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app28.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app28.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app28.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app28.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app29.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app29.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app29.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app29.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app3.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app3.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app3.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app3.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app30.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app30.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app30.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app30.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app301.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app301.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app301.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app301.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app31.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app31.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app31.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app31.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app32.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app32.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app32.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app32.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app33.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app33.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app33.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app33.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app34.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app34.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app34.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app34.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app35.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app35.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app35.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app35.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app36.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app36.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app36.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app36.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app37.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app37.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app37.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app37.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app38.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app38.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app38.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app38.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app4.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app4.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app4.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app4.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app5.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app5.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app5.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app5.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app6.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app6.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app6.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app6.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app7.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app7.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app7.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app7.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app8.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app8.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app8.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app8.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app9.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app9.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/app9.json rename to springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app9.json diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app10.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app10.json new file mode 100644 index 000000000..dacf06142 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app10.json @@ -0,0 +1,960 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/accounts": { + "get": { + "tags": [ + "account-entity-controller" + ], + "description": "get-account", + "operationId": "getCollectionResource-account-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelAccount" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelAccount" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "account-entity-controller" + ], + "description": "create-account", + "operationId": "postCollectionResource-account-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + } + } + } + }, + "/accounts/search/findByCustomer": { + "get": { + "tags": [ + "account-search-controller" + ], + "operationId": "executeSearch-account-get", + "parameters": [ + { + "name": "customer", + "in": "query", + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelAccount" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/accounts/{id}": { + "get": { + "tags": [ + "account-entity-controller" + ], + "description": "get-account", + "operationId": "getItemResource-account-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "account-entity-controller" + ], + "description": "update-account", + "operationId": "putItemResource-account-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "account-entity-controller" + ], + "description": "delete-account", + "operationId": "deleteItemResource-account-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "account-entity-controller" + ], + "description": "patch-account", + "operationId": "patchItemResource-account-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/accounts/{id}/customer": { + "get": { + "tags": [ + "account-property-reference-controller" + ], + "description": "get-customer-by-account-Id", + "operationId": "followPropertyReference-account-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "account-property-reference-controller" + ], + "description": "update-customer-by-account-Id", + "operationId": "createPropertyReference-account-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "account-property-reference-controller" + ], + "description": "delete-customer-by-account-Id", + "operationId": "deletePropertyReference-account-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "account-property-reference-controller" + ], + "description": "patch-customer-by-account-Id", + "operationId": "createPropertyReference-account-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/accounts/{id}/customer/{propertyId}": { + "get": { + "tags": [ + "account-property-reference-controller" + ], + "description": "get-customer-by-account-Id", + "operationId": "followPropertyReference-account-get_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "account-property-reference-controller" + ], + "description": "delete-customer-by-account-Id", + "operationId": "deletePropertyReferenceId-account-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/customers": { + "get": { + "tags": [ + "customer-entity-controller" + ], + "description": "get-customer", + "operationId": "getCollectionResource-customer-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelCustomer" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelCustomer" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/customers/search/findByLastname": { + "get": { + "tags": [ + "customer-search-controller" + ], + "operationId": "executeSearch-customer-get", + "parameters": [ + { + "name": "lastname", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelCustomer" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/accounts": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/profile/customers": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelCustomer": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Customer": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + } + } + }, + "EntityModelCustomer": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelCustomer": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "EntityModelAccount": { + "type": "object", + "properties": { + "expiryDate": { + "type": "string", + "format": "date-time" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelAccount": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelObject": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "AccountRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "customer": { + "type": "string" + }, + "expiryDate": { + "type": "string", + "format": "date-time" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app11.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app11.json new file mode 100644 index 000000000..3e9d8a418 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app11.json @@ -0,0 +1,353 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/peopleme": { + "get": { + "tags": [ + "person-entity-controller" + ], + "description": "get-person", + "operationId": "getCollectionResource-person-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/peopleme/search/findByLastName": { + "get": { + "tags": [ + "person-search-controller" + ], + "operationId": "executeSearch-person-get", + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelPerson" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/peopleme": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelPerson": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelPerson": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "people": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPerson" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "CollectionModelEntityModelPerson": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "people": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPerson" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app12.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app12.json new file mode 100644 index 000000000..b5d3256c8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app12.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/demo": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GetMyData", + "operationId": "gettt", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonResponse" + } + }, + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelJsonResponse" + } + } + } + }, + "204": { + "description": "No Content", + "content": { + "application/vnd.something": {} + } + }, + "202": { + "description": "Accepted", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/JsonResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "JsonResponse": { + "type": "object", + "properties": { + "field": { + "type": "string" + } + } + }, + "EntityModelJsonResponse": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app13.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app13.json new file mode 100644 index 000000000..7d6b13b15 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app13.json @@ -0,0 +1,388 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test5": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "read", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 10 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "some,desc", + "other,asc", + "another.that,desc" + ] + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/test4": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList4", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 100 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList3", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 100 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList2", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 100 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "someField,DESC" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList1", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 100 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "someField,DESC", + "someoTHER,DESC" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 5 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "name,ASC" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app14.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app14.json new file mode 100644 index 000000000..a2e119230 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app14.json @@ -0,0 +1,100 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "prefix_pages", + "in": "query", + "description": "One-based page index (1..N)", + "required": false, + "schema": { + "type": "integer", + "default": 1, + "minimum": 0 + } + }, + { + "name": "prefix_sizes", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "type": "integer", + "default": 25, + "minimum": 1 + } + }, + { + "name": "sorts", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app15.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app15.json new file mode 100644 index 000000000..afaff436f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app15.json @@ -0,0 +1,100 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "minimum": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "minimum": 1 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app16.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app16.json new file mode 100644 index 000000000..d7ab06682 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app16.json @@ -0,0 +1,1236 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "My App", + "description": "Some long and useful description", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/accounts": { + "get": { + "tags": [ + "The account Repository" + ], + "summary": "getCollectionResource-account-get", + "description": "get-account", + "operationId": "getCollectionResource-account-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelAccount" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelAccount" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "post": { + "tags": [ + "The account Repository" + ], + "summary": "postCollectionResource-account-post", + "description": "create-account", + "operationId": "postCollectionResource-account-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/accounts/search/findByCustomer": { + "get": { + "tags": [ + "The account Repository" + ], + "summary": "executeSearch-account-get", + "operationId": "executeSearch-account-get", + "parameters": [ + { + "name": "customer", + "in": "query", + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelAccount" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/accounts/{id}": { + "get": { + "tags": [ + "The account Repository" + ], + "summary": "getItemResource-account-get", + "description": "get-account", + "operationId": "getItemResource-account-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "put": { + "tags": [ + "The account Repository" + ], + "summary": "putItemResource-account-put", + "description": "update-account", + "operationId": "putItemResource-account-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "tags": [ + "The account Repository" + ], + "summary": "deleteItemResource-account-delete", + "description": "delete-account", + "operationId": "deleteItemResource-account-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "patch": { + "tags": [ + "The account Repository" + ], + "summary": "patchItemResource-account-patch", + "description": "patch-account", + "operationId": "patchItemResource-account-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/accounts/{id}/customer": { + "get": { + "tags": [ + "The account Repository" + ], + "summary": "followPropertyReference-account-get", + "description": "get-customer-by-account-Id", + "operationId": "followPropertyReference-account-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "put": { + "tags": [ + "The account Repository" + ], + "summary": "createPropertyReference-account-put", + "description": "update-customer-by-account-Id", + "operationId": "createPropertyReference-account-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "tags": [ + "The account Repository" + ], + "summary": "deletePropertyReference-account-delete", + "description": "delete-customer-by-account-Id", + "operationId": "deletePropertyReference-account-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "patch": { + "tags": [ + "The account Repository" + ], + "summary": "createPropertyReference-account-patch", + "description": "patch-customer-by-account-Id", + "operationId": "createPropertyReference-account-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/accounts/{id}/customer/{propertyId}": { + "get": { + "tags": [ + "The account Repository" + ], + "summary": "followPropertyReference-account-get", + "description": "get-customer-by-account-Id", + "operationId": "followPropertyReference-account-get_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "tags": [ + "The account Repository" + ], + "summary": "deletePropertyReferenceId-account-delete", + "description": "delete-customer-by-account-Id", + "operationId": "deletePropertyReferenceId-account-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/customers": { + "get": { + "tags": [ + "The customer Repository" + ], + "summary": "getCollectionResource-customer-get", + "description": "get-customer", + "operationId": "getCollectionResource-customer-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelCustomer" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelCustomer" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "The customer Repository" + ], + "summary": "postCollectionResource-customer-post", + "description": "create-customer", + "operationId": "postCollectionResource-customer-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomerRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + } + } + } + }, + "/customers/search/findByLastname": { + "get": { + "tags": [ + "The customer Repository" + ], + "summary": "executeSearch-customer-get", + "operationId": "executeSearch-customer-get", + "parameters": [ + { + "name": "lastname", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelCustomer" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/customers/{id}": { + "get": { + "tags": [ + "The customer Repository" + ], + "summary": "getItemResource-customer-get", + "description": "get-customer", + "operationId": "getItemResource-customer-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "The customer Repository" + ], + "summary": "putItemResource-customer-put", + "description": "update-customer", + "operationId": "putItemResource-customer-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomerRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "patch": { + "tags": [ + "The customer Repository" + ], + "summary": "patchItemResource-customer-patch", + "description": "patch-customer", + "operationId": "patchItemResource-customer-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomerRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "summary": "listAllFormsOfMetadata", + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/accounts": { + "get": { + "tags": [ + "profile-controller" + ], + "summary": "descriptor", + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/profile/customers": { + "get": { + "tags": [ + "profile-controller" + ], + "summary": "descriptor", + "operationId": "descriptor_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Customer": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + } + } + }, + "EntityModelAccount": { + "type": "object", + "properties": { + "expiryDate": { + "type": "string", + "format": "date-time" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelAccount": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelCustomer": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelObject": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelCustomer": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelCustomer": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "AccountRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "customer": { + "type": "string" + }, + "expiryDate": { + "type": "string", + "format": "date-time" + } + } + }, + "CustomerRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + }, + "securitySchemes": { + "bearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app17.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app17.json new file mode 100644 index 000000000..f62a6e888 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app17.json @@ -0,0 +1,452 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/childProperties": { + "get": { + "tags": [ + "child-property-entity-controller" + ], + "description": "get-childproperty", + "operationId": "getCollectionResource-childproperty-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelChildProperty" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelChildProperty" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/childProperties": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/profile/properties": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/properties": { + "get": { + "tags": [ + "property-entity-controller" + ], + "description": "get-property", + "operationId": "getCollectionResource-property-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelProperty" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelProperty" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "ChildProperty": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "EntityModelChildProperty": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelChildProperty": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "childProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelChildProperty" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "EntityModelProperty": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "myChildPropertyName": { + "$ref": "#/components/schemas/ChildProperty" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PagedModelEntityModelProperty": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "properties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelProperty" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app18.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app18.json new file mode 100644 index 000000000..fa8936163 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app18.json @@ -0,0 +1,123 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/latest/helloWorld/helloWorld": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Example endpoint", + "operationId": "helloWorld", + "parameters": [ + { + "name": "abc", + "in": "query", + "description": "Description for abc", + "required": true, + "schema": { + "type": "string" + }, + "example": "def" + }, + { + "name": "thisDate", + "in": "query", + "description": "Description of this date", + "required": true, + "schema": { + "type": "string", + "format": "date" + }, + "example": "2020-10-25" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloWorldModel" + } + } + } + } + } + } + }, + "/v1/helloWorld/helloWorld": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Example endpoint", + "operationId": "helloWorld_1", + "parameters": [ + { + "name": "abc", + "in": "query", + "description": "Description for abc", + "required": true, + "schema": { + "type": "string" + }, + "example": "def" + }, + { + "name": "thisDate", + "in": "query", + "description": "Description of this date", + "required": true, + "schema": { + "type": "string", + "format": "date" + }, + "example": "2020-10-25" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloWorldModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloWorldModel": { + "required": [ + "abc", + "thisDate" + ], + "type": "object", + "properties": { + "abc": { + "type": "string" + }, + "thisDate": { + "type": "string", + "format": "date" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app19.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app19.json new file mode 100644 index 000000000..0013f04e1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app19.json @@ -0,0 +1,62 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test2": { + "get": { + "tags": [ + "greeting-controller" + ], + "operationId": "sayHello2", + "parameters": [ + { + "name": "test", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "icon", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": {} + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app2.json new file mode 100644 index 000000000..b745cc8fe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app2.json @@ -0,0 +1,95 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Pageable" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Pageable": { + "type": "object", + "properties": { + "page": { + "minimum": 0, + "type": "integer", + "format": "int32" + }, + "size": { + "minimum": 1, + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app20.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app20.json new file mode 100644 index 000000000..21565f6af --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app20.json @@ -0,0 +1,563 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Core API" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/banks": { + "get": { + "tags": [ + "bank-entity-controller" + ], + "description": "get-bank", + "operationId": "getCollectionResource-bank-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelBank" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelBank" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "bank-entity-controller" + ], + "description": "create-bank", + "operationId": "postCollectionResource-bank-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelBank" + } + } + } + } + } + } + }, + "/banks/search/countByCode": { + "get": { + "tags": [ + "bank-search-controller" + ], + "operationId": "executeSearch-bank-get", + "parameters": [ + { + "name": "code", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/banks/search/findOneByCode": { + "get": { + "tags": [ + "bank-search-controller" + ], + "operationId": "executeSearch-bank-get_1", + "parameters": [ + { + "name": "code", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelBank" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/banks/{id}": { + "get": { + "tags": [ + "bank-entity-controller" + ], + "description": "get-bank", + "operationId": "getItemResource-bank-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelBank" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "bank-entity-controller" + ], + "description": "update-bank", + "operationId": "putItemResource-bank-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelBank" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelBank" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "bank-entity-controller" + ], + "description": "delete-bank", + "operationId": "deleteItemResource-bank-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "bank-entity-controller" + ], + "description": "patch-bank", + "operationId": "patchItemResource-bank-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelBank" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/banks": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelBank": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "name": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelBank": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "banks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelBank" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "BankRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "code": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app21.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app21.json new file mode 100644 index 000000000..adc13ea4a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app21.json @@ -0,0 +1,432 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/peopleme": { + "get": { + "tags": [ + "person-entity-controller" + ], + "description": "get-person", + "operationId": "getCollectionResource-person-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/peopleme/search/findByFirstName": { + "get": { + "tags": [ + "person-search-controller" + ], + "description": "this is another test", + "operationId": "executeSearch-person-get", + "parameters": [ + { + "name": "firstName", + "in": "query", + "description": "this is for first Name", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "another successful operation", + "content": { + "application/hal+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + }, + "404": { + "description": "another Contact not found", + "content": { + "application/hal+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/peopleme/search/findByLastName": { + "get": { + "tags": [ + "person-search-controller" + ], + "description": "this is my test", + "operationId": "executeSearch-person-get_1", + "parameters": [ + { + "name": "lastName", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "application/hal+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/hal+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + }, + "404": { + "description": "Contact not found", + "content": { + "application/hal+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + }, + "405": { + "description": "Validation exception", + "content": { + "application/hal+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/peopleme": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelPerson": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelPerson": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "people": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPerson" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "Person": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app22.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app22.json new file mode 100644 index 000000000..d24d579c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app22.json @@ -0,0 +1,343 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/people": { + "get": { + "tags": [ + "person-entity-controller" + ], + "description": "get-person", + "operationId": "getCollectionResource-person-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/people": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/people/test": { + "get": { + "tags": [ + "person-api" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + }, + "application/prs.hal-forms+json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelPerson": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelPerson": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "people": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPerson" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "Person": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app23.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app23.json new file mode 100644 index 000000000..232b86a03 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app23.json @@ -0,0 +1,1026 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/clinics": { + "get": { + "tags": [ + "clinic-entity-controller" + ], + "description": "get-clinic", + "operationId": "getCollectionResource-clinic-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelClinic" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelClinic" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "clinic-entity-controller" + ], + "description": "create-clinic", + "operationId": "postCollectionResource-clinic-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClinicRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + } + } + } + }, + "/clinics/{id}": { + "get": { + "tags": [ + "clinic-entity-controller" + ], + "description": "get-clinic", + "operationId": "getItemResource-clinic-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "clinic-entity-controller" + ], + "description": "update-clinic", + "operationId": "putItemResource-clinic-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClinicRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "clinic-entity-controller" + ], + "description": "delete-clinic", + "operationId": "deleteItemResource-clinic-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "clinic-entity-controller" + ], + "description": "patch-clinic", + "operationId": "patchItemResource-clinic-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClinicRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/doctors": { + "get": { + "tags": [ + "doctor-entity-controller" + ], + "description": "get-doctor", + "operationId": "getCollectionResource-doctor-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelDoctor" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelDoctor" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "doctor-entity-controller" + ], + "description": "create-doctor", + "operationId": "postCollectionResource-doctor-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DoctorRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + } + } + } + }, + "/doctors/{id}": { + "get": { + "tags": [ + "doctor-entity-controller" + ], + "description": "get-doctor", + "operationId": "getItemResource-doctor-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "doctor-entity-controller" + ], + "description": "update-doctor", + "operationId": "putItemResource-doctor-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DoctorRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "doctor-entity-controller" + ], + "description": "delete-doctor", + "operationId": "deleteItemResource-doctor-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "doctor-entity-controller" + ], + "description": "patch-doctor", + "operationId": "patchItemResource-doctor-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DoctorRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/doctors/{id}/clinics": { + "get": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "get-clinic-by-doctor-Id", + "operationId": "followPropertyReference-doctor-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "update-clinic-by-doctor-Id", + "operationId": "createPropertyReference-doctor-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "delete-clinic-by-doctor-Id", + "operationId": "deletePropertyReference-doctor-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "patch-clinic-by-doctor-Id", + "operationId": "createPropertyReference-doctor-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/doctors/{id}/clinics/{propertyId}": { + "get": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "get-clinic-by-doctor-Id", + "operationId": "followPropertyReference-doctor-get_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "delete-clinic-by-doctor-Id", + "operationId": "deletePropertyReferenceId-doctor-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/clinics": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/profile/doctors": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelDoctor": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelDoctor": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "doctors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelClinic": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "clinics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClinicResponse" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelObject": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelClinic": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelClinic": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "clinics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "ClinicRequestBody": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "DoctorRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "clinics": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ClinicResponse": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app24.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app24.json new file mode 100644 index 000000000..76b3a324f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app24.json @@ -0,0 +1,188 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "teste-resource" + ], + "operationId": "testeQueryDslAndSpringDoc", + "parameters": [ + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Pageable" + } + }, + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "email", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PageUser" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Pageable": { + "type": "object", + "properties": { + "page": { + "minimum": 0, + "type": "integer", + "format": "int32" + }, + "size": { + "minimum": 1, + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PageUser": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "last": { + "type": "boolean" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + }, + "PageableObject": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" + } + } + }, + "SortObject": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app25.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app25.json new file mode 100644 index 000000000..52c638696 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app25.json @@ -0,0 +1,2718 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/clinics": { + "get": { + "tags": [ + "clinic-entity-controller" + ], + "description": "get-clinic", + "operationId": "getCollectionResource-clinic-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelClinic" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelClinic" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "clinic-entity-controller" + ], + "description": "create-clinic", + "operationId": "postCollectionResource-clinic-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClinicRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + } + } + } + }, + "/clinics/{id}": { + "get": { + "tags": [ + "clinic-entity-controller" + ], + "description": "get-clinic", + "operationId": "getItemResource-clinic-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "clinic-entity-controller" + ], + "description": "update-clinic", + "operationId": "putItemResource-clinic-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClinicRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "clinic-entity-controller" + ], + "description": "delete-clinic", + "operationId": "deleteItemResource-clinic-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "clinic-entity-controller" + ], + "description": "patch-clinic", + "operationId": "patchItemResource-clinic-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClinicRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/doctors": { + "get": { + "tags": [ + "doctor-entity-controller" + ], + "description": "get-doctor", + "operationId": "getCollectionResource-doctor-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelDoctor" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelDoctor" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "doctor-entity-controller" + ], + "description": "create-doctor", + "operationId": "postCollectionResource-doctor-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DoctorRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + } + } + } + }, + "/doctors/search/findByClinicsContains": { + "get": { + "tags": [ + "doctor-search-controller" + ], + "operationId": "executeSearch-doctor-get", + "parameters": [ + { + "name": "clinic", + "in": "query", + "schema": { + "$ref": "#/components/schemas/Clinic" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelDoctor" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/doctors/{id}": { + "get": { + "tags": [ + "doctor-entity-controller" + ], + "description": "get-doctor", + "operationId": "getItemResource-doctor-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "doctor-entity-controller" + ], + "description": "update-doctor", + "operationId": "putItemResource-doctor-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DoctorRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "doctor-entity-controller" + ], + "description": "delete-doctor", + "operationId": "deleteItemResource-doctor-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "doctor-entity-controller" + ], + "description": "patch-doctor", + "operationId": "patchItemResource-doctor-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DoctorRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/doctors/{id}/clinics": { + "get": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "get-clinic-by-doctor-Id", + "operationId": "followPropertyReference-doctor-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "update-clinic-by-doctor-Id", + "operationId": "createPropertyReference-doctor-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "delete-clinic-by-doctor-Id", + "operationId": "deletePropertyReference-doctor-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "patch-clinic-by-doctor-Id", + "operationId": "createPropertyReference-doctor-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/doctors/{id}/clinics/{propertyId}": { + "get": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "get-clinic-by-doctor-Id", + "operationId": "followPropertyReference-doctor-get_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelClinic" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "doctor-property-reference-controller" + ], + "description": "delete-clinic-by-doctor-Id", + "operationId": "deletePropertyReferenceId-doctor-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/owners": { + "get": { + "tags": [ + "owner-entity-controller" + ], + "description": "get-owner", + "operationId": "getCollectionResource-owner-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "minimum": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "minimum": 1 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelOwner" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelOwner" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "owner-entity-controller" + ], + "description": "create-owner", + "operationId": "postCollectionResource-owner-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OwnerRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + } + } + } + }, + "/owners/{id}": { + "get": { + "tags": [ + "owner-entity-controller" + ], + "description": "get-owner", + "operationId": "getItemResource-owner-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "owner-entity-controller" + ], + "description": "update-owner", + "operationId": "putItemResource-owner-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OwnerRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "owner-entity-controller" + ], + "description": "delete-owner", + "operationId": "deleteItemResource-owner-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "owner-entity-controller" + ], + "description": "patch-owner", + "operationId": "patchItemResource-owner-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OwnerRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/owners/{id}/pets": { + "get": { + "tags": [ + "owner-property-reference-controller" + ], + "description": "get-pet-by-owner-Id", + "operationId": "followPropertyReference-owner-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelPet" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "owner-property-reference-controller" + ], + "description": "update-pet-by-owner-Id", + "operationId": "createPropertyReference-owner-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelPet" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelPet" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "owner-property-reference-controller" + ], + "description": "delete-pet-by-owner-Id", + "operationId": "deletePropertyReference-owner-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "owner-property-reference-controller" + ], + "description": "patch-pet-by-owner-Id", + "operationId": "createPropertyReference-owner-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelPet" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/owners/{id}/pets/{propertyId}": { + "get": { + "tags": [ + "owner-property-reference-controller" + ], + "description": "get-pet-by-owner-Id", + "operationId": "followPropertyReference-owner-get_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelPet" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "owner-property-reference-controller" + ], + "description": "delete-pet-by-owner-Id", + "operationId": "deletePropertyReferenceId-owner-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/pets": { + "get": { + "tags": [ + "pet-entity-controller" + ], + "description": "get-pet", + "operationId": "getCollectionResource-pet-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "minimum": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "minimum": 1 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPet" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPet" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "pet-entity-controller" + ], + "description": "create-pet", + "operationId": "postCollectionResource-pet-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/PetRequestBody" + }, + { + "$ref": "#/components/schemas/CatRequestBody" + }, + { + "$ref": "#/components/schemas/DogRequestBody" + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelPet" + } + } + } + } + } + } + }, + "/pets/{id}": { + "get": { + "tags": [ + "pet-entity-controller" + ], + "description": "get-pet", + "operationId": "getItemResource-pet-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelPet" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "pet-entity-controller" + ], + "description": "update-pet", + "operationId": "putItemResource-pet-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/PetRequestBody" + }, + { + "$ref": "#/components/schemas/CatRequestBody" + }, + { + "$ref": "#/components/schemas/DogRequestBody" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelPet" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelPet" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "pet-entity-controller" + ], + "description": "delete-pet", + "operationId": "deleteItemResource-pet-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "pet-entity-controller" + ], + "description": "patch-pet", + "operationId": "patchItemResource-pet-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/PetRequestBody" + }, + { + "$ref": "#/components/schemas/CatRequestBody" + }, + { + "$ref": "#/components/schemas/DogRequestBody" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelPet" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/pets/{id}/owner": { + "get": { + "tags": [ + "pet-property-reference-controller" + ], + "description": "get-owner-by-pet-Id", + "operationId": "followPropertyReference-pet-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "pet-property-reference-controller" + ], + "description": "update-owner-by-pet-Id", + "operationId": "createPropertyReference-pet-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "pet-property-reference-controller" + ], + "description": "delete-owner-by-pet-Id", + "operationId": "deletePropertyReference-pet-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "pet-property-reference-controller" + ], + "description": "patch-owner-by-pet-Id", + "operationId": "createPropertyReference-pet-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/pets/{id}/owner/{propertyId}": { + "get": { + "tags": [ + "pet-property-reference-controller" + ], + "description": "get-owner-by-pet-Id", + "operationId": "followPropertyReference-pet-get_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "pet-property-reference-controller" + ], + "description": "delete-owner-by-pet-Id", + "operationId": "deletePropertyReferenceId-pet-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/clinics": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/profile/doctors": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/profile/owners": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor_2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/profile/pets": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor_3", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Address": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "street": { + "type": "string" + }, + "number": { + "type": "string" + }, + "zipcode": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + } + } + }, + "EntityModelOwner": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "addresses": { + "$ref": "#/components/schemas/Address" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + }, + "required": [ + "addresses", + "lastname" + ] + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelOwner": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "owners": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelOwner" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "CollectionModelPet": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "pets": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PetResponse" + }, + { + "$ref": "#/components/schemas/CatResponse" + }, + { + "$ref": "#/components/schemas/DogResponse" + } + ] + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelObject": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Clinic": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + }, + "maxItems": 2147483647, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "name" + ] + }, + "EntityModelDoctor": { + "type": "object", + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "specialty": { + "type": "string", + "enum": [ + "ALLERGY_AND_IMMUNOLOGY", + "ADOLESCENT_MEDICINE", + "ANESTHESIOLOGY", + "AEROSPACE_MEDICINE", + "BARIATRICS", + "CARDIOLOGY", + "CARDIOTHORACIC_SURGERY", + "CHILD_AND_ADOLESCENT_PSYCHIATRY", + "CLINICAL_NEUROPHYSIOLOGY", + "COLORECTAL_SURGERY", + "DERMATOLOGY", + "DEVELOPMENTAL_PEDIATRICS", + "EMERGENCY_MEDICINE", + "ENDOCRINOLOGY", + "FAMILY_MEDICINE", + "FORENSIC_PATHOLOGY", + "FORENSIC_PSYCHIATRY", + "GASTROENTEROLOGY", + "GENERAL_SURGERY", + "GENERAL_SURGICAL_ONCOLOGY", + "GERIATRICS", + "GERIATRIC_PSYCHIATRY", + "GYNECOLOGIC_ONCOLOGY", + "HEMATOLOGY", + "HEMATOLOGIC_PATHOLOGY", + "INFECTIOUS_DISEASE", + "INTERNAL_MEDICINE", + "INTERVENTIONAL_RADIOLOGY", + "INTENSIVE_CARE_MEDICINE", + "MATERNAL_FETAL_MEDICINE", + "MEDICAL_BIOCHEMISTRY", + "MEDICAL_GENETICS", + "MEDICAL_ONCOLOGY", + "NEONATOLOGY", + "NEPHROLOGY", + "NEUROLOGY", + "NEUROPATHOLOGY", + "NEUROSURGERY", + "NUCLEAR_MEDICINE", + "OBSTETRICS_AND_GYNECOLOGY", + "OCCUPATIONAL_MEDICINE", + "OPHTHALMOLOGY", + "ORTHOPEDIC_SURGERY", + "ORAL_AND_MAXILLOFACIAL_SURGERY", + "OTORHINOLARYNGOLOGY", + "PALLIATIVE_CARE", + "PATHOLOGY", + "PEDIATRICS", + "PEDIATRIC_ALLERGY_AND_IMMUNOLOGY", + "PEDIATRIC_CARDIOLOGY", + "PEDIATRIC_EMERGENCY_MEDICINE", + "PEDIATRIC_ENDOCRINOLOGY", + "PEDIATRIC_GASTROENTEROLOGY", + "PEDIATRIC_HEMATOLOGY_AND_ONCOLOGY", + "PEDIATRIC_INFECTIOUS_DISEASE", + "PEDIATRIC_NEPHROLOGY", + "PEDIATRIC_RESPIRATORY_MEDICINE", + "PEDIATRIC_RHEUMATOLOGY", + "PEDIATRIC_SURGERY", + "PHYSICAL_MEDICINE_AND_REHABILITATION", + "PLASTIC_RECONSTRUCTIVE_AND_AESTHETIC_SURGERY", + "PSYCHIATRY", + "PUBLIC_HEALTH", + "RADIATION_ONCOLOGY", + "RADIOLOGY", + "REPRODUCTIVE_ENDOCRINOLOGY_AND_INFERTILITY", + "RESPIRATORY_MEDICINE", + "RHEUMATOLOGY", + "SPORTS_MEDICINE", + "THORACIC_SURGERY", + "NEURORADIOLOGY", + "UROLOGY", + "VASCULAR_SURGERY" + ] + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + }, + "required": [ + "firstname", + "lastname" + ] + }, + "CollectionModelEntityModelDoctor": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "doctors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelClinic": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "clinics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClinicResponse" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelClinic": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + }, + "maxItems": 2147483647, + "minItems": 1, + "uniqueItems": true + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + }, + "required": [ + "name" + ] + }, + "CollectionModelEntityModelClinic": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "clinics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelClinic" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelPet": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "_type": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + }, + "required": [ + "_type", + "name" + ] + }, + "PagedModelEntityModelPet": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPet" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "ClinicRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + }, + "maxItems": 2147483647, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "name" + ] + }, + "DoctorRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "specialty": { + "type": "string", + "enum": [ + "ALLERGY_AND_IMMUNOLOGY", + "ADOLESCENT_MEDICINE", + "ANESTHESIOLOGY", + "AEROSPACE_MEDICINE", + "BARIATRICS", + "CARDIOLOGY", + "CARDIOTHORACIC_SURGERY", + "CHILD_AND_ADOLESCENT_PSYCHIATRY", + "CLINICAL_NEUROPHYSIOLOGY", + "COLORECTAL_SURGERY", + "DERMATOLOGY", + "DEVELOPMENTAL_PEDIATRICS", + "EMERGENCY_MEDICINE", + "ENDOCRINOLOGY", + "FAMILY_MEDICINE", + "FORENSIC_PATHOLOGY", + "FORENSIC_PSYCHIATRY", + "GASTROENTEROLOGY", + "GENERAL_SURGERY", + "GENERAL_SURGICAL_ONCOLOGY", + "GERIATRICS", + "GERIATRIC_PSYCHIATRY", + "GYNECOLOGIC_ONCOLOGY", + "HEMATOLOGY", + "HEMATOLOGIC_PATHOLOGY", + "INFECTIOUS_DISEASE", + "INTERNAL_MEDICINE", + "INTERVENTIONAL_RADIOLOGY", + "INTENSIVE_CARE_MEDICINE", + "MATERNAL_FETAL_MEDICINE", + "MEDICAL_BIOCHEMISTRY", + "MEDICAL_GENETICS", + "MEDICAL_ONCOLOGY", + "NEONATOLOGY", + "NEPHROLOGY", + "NEUROLOGY", + "NEUROPATHOLOGY", + "NEUROSURGERY", + "NUCLEAR_MEDICINE", + "OBSTETRICS_AND_GYNECOLOGY", + "OCCUPATIONAL_MEDICINE", + "OPHTHALMOLOGY", + "ORTHOPEDIC_SURGERY", + "ORAL_AND_MAXILLOFACIAL_SURGERY", + "OTORHINOLARYNGOLOGY", + "PALLIATIVE_CARE", + "PATHOLOGY", + "PEDIATRICS", + "PEDIATRIC_ALLERGY_AND_IMMUNOLOGY", + "PEDIATRIC_CARDIOLOGY", + "PEDIATRIC_EMERGENCY_MEDICINE", + "PEDIATRIC_ENDOCRINOLOGY", + "PEDIATRIC_GASTROENTEROLOGY", + "PEDIATRIC_HEMATOLOGY_AND_ONCOLOGY", + "PEDIATRIC_INFECTIOUS_DISEASE", + "PEDIATRIC_NEPHROLOGY", + "PEDIATRIC_RESPIRATORY_MEDICINE", + "PEDIATRIC_RHEUMATOLOGY", + "PEDIATRIC_SURGERY", + "PHYSICAL_MEDICINE_AND_REHABILITATION", + "PLASTIC_RECONSTRUCTIVE_AND_AESTHETIC_SURGERY", + "PSYCHIATRY", + "PUBLIC_HEALTH", + "RADIATION_ONCOLOGY", + "RADIOLOGY", + "REPRODUCTIVE_ENDOCRINOLOGY_AND_INFERTILITY", + "RESPIRATORY_MEDICINE", + "RHEUMATOLOGY", + "SPORTS_MEDICINE", + "THORACIC_SURGERY", + "NEURORADIOLOGY", + "UROLOGY", + "VASCULAR_SURGERY" + ] + }, + "clinics": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "firstname", + "lastname" + ] + }, + "ClinicResponse": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + }, + "maxItems": 2147483647, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "name" + ] + }, + "CatRequestBody": { + "allOf": [ + { + "$ref": "#/components/schemas/PetRequestBody" + }, + { + "type": "object", + "properties": { + "coat": { + "type": "string", + "enum": [ + "TABBY", + "TOROISE", + "COLORPOINT", + "BICOLOR", + "TRICOLOR", + "SOLID" + ] + } + } + } + ], + "required": [ + "name" + ] + }, + "DogRequestBody": { + "allOf": [ + { + "$ref": "#/components/schemas/PetRequestBody" + }, + { + "type": "object", + "properties": { + "coat": { + "type": "string", + "enum": [ + "SMOOTH", + "SHORT", + "COMBINATION", + "DOUBLE", + "HEAVY", + "SILKY", + "LONG", + "CURLY", + "WIRE", + "HAIRLESS" + ] + } + } + } + ], + "required": [ + "name" + ] + }, + "OwnerRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "addresses": { + "$ref": "#/components/schemas/Address" + }, + "pets": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "addresses", + "lastname" + ] + }, + "PetRequestBody": { + "type": "object", + "discriminator": { + "propertyName": "_type" + }, + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "_type": { + "type": "string" + } + }, + "required": [ + "_type", + "name" + ] + }, + "CatResponse": { + "allOf": [ + { + "$ref": "#/components/schemas/PetResponse" + }, + { + "type": "object", + "properties": { + "coat": { + "type": "string", + "enum": [ + "TABBY", + "TOROISE", + "COLORPOINT", + "BICOLOR", + "TRICOLOR", + "SOLID" + ] + } + } + } + ], + "required": [ + "name" + ] + }, + "DogResponse": { + "allOf": [ + { + "$ref": "#/components/schemas/PetResponse" + }, + { + "type": "object", + "properties": { + "coat": { + "type": "string", + "enum": [ + "SMOOTH", + "SHORT", + "COMBINATION", + "DOUBLE", + "HEAVY", + "SILKY", + "LONG", + "CURLY", + "WIRE", + "HAIRLESS" + ] + } + } + } + ], + "required": [ + "name" + ] + }, + "PetResponse": { + "type": "object", + "discriminator": { + "propertyName": "_type" + }, + "properties": { + "name": { + "type": "string" + }, + "_type": { + "type": "string" + } + }, + "required": [ + "_type", + "name" + ] + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app26.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app26.json new file mode 100644 index 000000000..06cd6bc64 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app26.json @@ -0,0 +1,373 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/peopleme": { + "get": { + "tags": [ + "person-entity-controller" + ], + "description": "get-person", + "operationId": "getCollectionResource-person-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/peopleme/search/findByLastName": { + "get": { + "tags": [ + "person-search-controller" + ], + "operationId": "executeSearch-person-get", + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelPerson" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/peopleme/search/testQuery": { + "get": { + "tags": [ + "person-search-controller" + ], + "operationId": "executeSearch-person-get_1", + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/peopleme": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelPerson": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelPerson": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "people": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPerson" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "CollectionModelEntityModelPerson": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "people": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPerson" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app27.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app27.json new file mode 100644 index 000000000..36a615f73 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app27.json @@ -0,0 +1,114 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Pageable" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Pageable": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" + } + } + }, + "SortObject": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app28.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app28.json new file mode 100644 index 000000000..2148e0ae7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app28.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/items/nested": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "showNestedItem", + "parameters": [ + { + "name": "something", + "in": "query", + "description": "Anything", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": {} + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app29.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app29.json new file mode 100644 index 000000000..c692e756d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app29.json @@ -0,0 +1,333 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/people": { + "get": { + "tags": [ + "person-entity-controller" + ], + "description": "get-person", + "operationId": "getCollectionResource-person-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPerson" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/people": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/people/test": { + "get": { + "tags": [ + "person-api" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelPerson": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelPerson": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "people": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPerson" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "Person": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app3.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app3.json new file mode 100644 index 000000000..0123f829a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app3.json @@ -0,0 +1,102 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/demo/operation5": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "operation5", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/demo/operation4": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "operation4", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": {} + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app30.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app30.json new file mode 100644 index 000000000..bbb90bbe9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app30.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "testQueryDslAndSpringDoc", + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "email", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app301.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app301.json new file mode 100644 index 000000000..4b199f6cc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app301.json @@ -0,0 +1,17 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": {}, + "components": { + "schemas": {} + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app31.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app31.json new file mode 100644 index 000000000..80178d3af --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app31.json @@ -0,0 +1,275 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test4": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList4", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "minimum": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "minimum": 1 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "default": [ + "someField,DESC" + ], + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList3", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "minimum": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "minimum": 1 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "default": [ + "someField,DESC", + "someoTHER,DESC" + ], + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList2", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "default": [ + "someField,DESC" + ], + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList1", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "default": [ + "someField,DESC", + "someoTHER,DESC" + ], + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "default": [ + "name,ASC" + ], + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app32.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app32.json new file mode 100644 index 000000000..7f4e53f17 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app32.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "sorts", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app33.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app33.json new file mode 100644 index 000000000..6a190f0ee --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app33.json @@ -0,0 +1,55 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/items/nested": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "showNestedItem", + "parameters": [ + { + "name": "something", + "in": "query", + "description": "Anything", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": {} + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app34.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app34.json new file mode 100644 index 000000000..60caa7048 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app34.json @@ -0,0 +1,1477 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "My App", + "description": "Some long and useful description", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/accounts": { + "get": { + "tags": [ + "The account Repository" + ], + "description": "get-account", + "operationId": "getCollectionResource-account-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelAccount" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelAccount" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "post": { + "tags": [ + "The account Repository" + ], + "description": "create-account", + "operationId": "postCollectionResource-account-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/accounts/search/findByCustomer": { + "get": { + "tags": [ + "The account Repository" + ], + "operationId": "executeSearch-account-get", + "parameters": [ + { + "name": "customer", + "in": "query", + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelAccount" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/accounts/{id}": { + "get": { + "tags": [ + "The account Repository" + ], + "description": "get-account", + "operationId": "getItemResource-account-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "put": { + "tags": [ + "The account Repository" + ], + "description": "update-account", + "operationId": "putItemResource-account-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "tags": [ + "The account Repository" + ], + "description": "delete-account", + "operationId": "deleteItemResource-account-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "patch": { + "tags": [ + "The account Repository" + ], + "description": "patch-account", + "operationId": "patchItemResource-account-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/accounts/{id}/customer": { + "get": { + "tags": [ + "The account Repository" + ], + "description": "get-customer-by-account-Id", + "operationId": "followPropertyReference-account-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "put": { + "tags": [ + "The account Repository" + ], + "description": "update-customer-by-account-Id", + "operationId": "createPropertyReference-account-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "tags": [ + "The account Repository" + ], + "description": "delete-customer-by-account-Id", + "operationId": "deletePropertyReference-account-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "patch": { + "tags": [ + "The account Repository" + ], + "description": "patch-customer-by-account-Id", + "operationId": "createPropertyReference-account-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/accounts/{id}/customer/{propertyId}": { + "get": { + "tags": [ + "The account Repository" + ], + "description": "get-customer-by-account-Id", + "operationId": "followPropertyReference-account-get_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "tags": [ + "The account Repository" + ], + "description": "delete-customer-by-account-Id", + "operationId": "deletePropertyReferenceId-account-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/customers": { + "get": { + "tags": [ + "The customer Repository" + ], + "description": "get-customer", + "operationId": "getCollectionResource-customer-get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelCustomer" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelCustomer" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "The customer Repository" + ], + "description": "create-customer", + "operationId": "postCollectionResource-customer-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomerRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + } + } + } + }, + "/customers/search/findByLastname": { + "get": { + "tags": [ + "The customer Repository" + ], + "operationId": "executeSearch-customer-get", + "parameters": [ + { + "name": "lastname", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelCustomer" + } + } + } + }, + "404": { + "description": "Not Found" + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/customers/{id}": { + "get": { + "tags": [ + "The customer Repository" + ], + "description": "get-customer", + "operationId": "getItemResource-customer-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "The customer Repository" + ], + "description": "update-customer", + "operationId": "putItemResource-customer-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomerRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "patch": { + "tags": [ + "The customer Repository" + ], + "description": "patch-customer", + "operationId": "patchItemResource-customer-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomerRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/customers/{id}/accounts": { + "get": { + "tags": [ + "The customer Repository" + ], + "description": "get-account-by-customer-Id", + "operationId": "followPropertyReference-customer-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelAccount" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "The customer Repository" + ], + "description": "update-account-by-customer-Id", + "operationId": "createPropertyReference-customer-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelAccount" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelAccount" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "patch": { + "tags": [ + "The customer Repository" + ], + "description": "patch-account-by-customer-Id", + "operationId": "createPropertyReference-customer-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelObject" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelAccount" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/customers/{id}/accounts/{propertyId}": { + "get": { + "tags": [ + "The customer Repository" + ], + "description": "get-account-by-customer-Id", + "operationId": "followPropertyReference-customer-get_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "propertyId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelAccount" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/accounts": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + }, + "/profile/customers": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Account": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "customer": { + "$ref": "#/components/schemas/Customer" + }, + "expiryDate": { + "type": "string", + "format": "date-time" + } + } + }, + "Customer": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Account" + } + } + } + }, + "EntityModelAccount": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "expiryDate": { + "type": "string", + "format": "date-time" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelAccount": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelAccount" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelCustomer": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelObject": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "objects": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelEntityModelCustomer": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "CollectionModelAccount": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountResponse" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelCustomer": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelCustomer" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "AccountRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "customer": { + "type": "string" + }, + "expiryDate": { + "type": "string", + "format": "date-time" + } + } + }, + "CustomerRequestBody": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "accounts": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AccountResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "expiryDate": { + "type": "string", + "format": "date-time" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + }, + "securitySchemes": { + "bearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app35.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app35.json new file mode 100644 index 000000000..4b199f6cc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app35.json @@ -0,0 +1,17 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": {}, + "components": { + "schemas": {} + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app36.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app36.json new file mode 100644 index 000000000..b148f585a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app36.json @@ -0,0 +1,167 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/enumFieldHolders/search/findAllByEnumField": { + "get": { + "tags": [ + "enum-field-holder-search-controller" + ], + "operationId": "executeSearch-enumfieldholder-get", + "parameters": [ + { + "name": "enumField", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "FOO", + "BAR" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelEnumFieldHolder" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/enumFieldHolders/search/findAllByEnumFieldIn": { + "get": { + "tags": [ + "enum-field-holder-search-controller" + ], + "operationId": "executeSearch-enumfieldholder-get_1", + "parameters": [ + { + "name": "enumFields", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "FOO", + "BAR" + ] + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelEnumFieldHolder" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + } + }, + "components": { + "schemas": { + "CollectionModelEntityModelEnumFieldHolder": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "enumFieldHolders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelEnumFieldHolder" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelEnumFieldHolder": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "enumField": { + "type": "string", + "enum": [ + "FOO", + "BAR" + ] + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Link": { + "type": "object", + "properties": { + "deprecation": { + "type": "string" + }, + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "name": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "templated": { + "type": "boolean" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app37.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app37.json new file mode 100644 index 000000000..7759dead0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app37.json @@ -0,0 +1,835 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/product": { + "get": { + "tags": [ + "product-entity-entity-controller" + ], + "description": "get-productentity", + "operationId": "getCollectionResource-productentity-get", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelProductEntity" + } + }, + "application/x-spring-data-compact+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelProductEntity" + } + }, + "text/uri-list": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "post": { + "tags": [ + "product-entity-entity-controller" + ], + "description": "create-productentity", + "operationId": "postCollectionResource-productentity-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProductEntityRequestBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelProductEntity" + } + } + } + } + } + } + }, + "/product/search/findByDateBefore": { + "get": { + "tags": [ + "product-entity-search-controller" + ], + "operationId": "executeSearch-productentity-get", + "parameters": [ + { + "name": "end2", + "in": "query", + "required": true, + "schema": { + "type": "string", + "format": "date" + } + }, + { + "name": "end", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelProductEntity" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/product/search/findByName": { + "get": { + "tags": [ + "product-entity-search-controller" + ], + "operationId": "executeSearch-productentity-get_1", + "parameters": [ + { + "name": "name2", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelProductEntity" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/product/search/findByNameContainingIgnoreCase": { + "get": { + "tags": [ + "product-entity-search-controller" + ], + "operationId": "executeSearch-productentity-get_2", + "parameters": [ + { + "name": "name2", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelProductEntity" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/product/search/findByNameContainingIgnoreCaseAndDateBefore": { + "get": { + "tags": [ + "product-entity-search-controller" + ], + "operationId": "executeSearch-productentity-get_3", + "parameters": [ + { + "name": "name2", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "end2", + "in": "query", + "required": true, + "schema": { + "type": "string", + "format": "date" + } + }, + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "end", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelProductEntity" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/product/search/findByNameContainingIgnoreCaseOrderByDateDesc": { + "get": { + "tags": [ + "product-entity-search-controller" + ], + "operationId": "executeSearch-productentity-get_4", + "parameters": [ + { + "name": "name2", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelProductEntity" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/product/search/findByPrice": { + "get": { + "tags": [ + "product-entity-search-controller" + ], + "operationId": "executeSearch-productentity-get_5", + "parameters": [ + { + "name": "price", + "in": "query", + "description": "test desc", + "required": true, + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelProductEntity" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/product/search/findTopByNameOrderByDateDesc": { + "get": { + "tags": [ + "product-entity-search-controller" + ], + "operationId": "executeSearch-productentity-get_6", + "parameters": [ + { + "name": "name2", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelProductEntity" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/product/{id}": { + "get": { + "tags": [ + "product-entity-entity-controller" + ], + "description": "get-productentity", + "operationId": "getItemResource-productentity-get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelProductEntity" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "put": { + "tags": [ + "product-entity-entity-controller" + ], + "description": "update-productentity", + "operationId": "putItemResource-productentity-put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProductEntityRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelProductEntity" + } + } + } + }, + "201": { + "description": "Created", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelProductEntity" + } + } + } + }, + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "product-entity-entity-controller" + ], + "description": "delete-productentity", + "operationId": "deleteItemResource-productentity-delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + }, + "patch": { + "tags": [ + "product-entity-entity-controller" + ], + "description": "patch-productentity", + "operationId": "patchItemResource-productentity-patch", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProductEntityRequestBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelProductEntity" + } + } + } + }, + "204": { + "description": "No Content" + } + } + } + }, + "/profile": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "listAllFormsOfMetadata", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/RepresentationModelObject" + } + } + } + } + } + } + }, + "/profile/product": { + "get": { + "tags": [ + "profile-controller" + ], + "operationId": "descriptor", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + }, + "application/alps+json": { + "schema": { + "type": "string" + } + }, + "application/schema+json": { + "schema": { + "$ref": "#/components/schemas/JsonSchema" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AbstractJsonSchemaPropertyObject": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + }, + "Item": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "JsonSchema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AbstractJsonSchemaPropertyObject" + } + }, + "requiredProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Item" + } + }, + "type": { + "type": "string" + }, + "$schema": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "RepresentationModelObject": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "EntityModelProductEntity": { + "required": [ + "date", + "name", + "price" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "price": { + "type": "number" + }, + "date": { + "type": "string", + "format": "date" + }, + "valid": { + "type": "boolean" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelProductEntity": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "productEntities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelProductEntity" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "CollectionModelEntityModelProductEntity": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "productEntities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelProductEntity" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "ProductEntityRequestBody": { + "required": [ + "date", + "name", + "price" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "price": { + "type": "number" + }, + "date": { + "type": "string", + "format": "date" + }, + "valid": { + "type": "boolean" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app38.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app38.json new file mode 100644 index 000000000..44e97f0a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app38.json @@ -0,0 +1,55 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test1": { + "get": { + "tags": [ + "default-flat-param-object-controller" + ], + "operationId": "test1", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "default": [ + "name,ASC" + ], + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": {} + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app4.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app4.json new file mode 100644 index 000000000..09eb17db0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app4.json @@ -0,0 +1,223 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/employees": { + "get": { + "tags": [ + "employee-controller" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelEmployee" + } + } + } + } + } + }, + "post": { + "tags": [ + "employee-controller" + ], + "operationId": "newEmployee", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + } + } + } + }, + "/employees/{id}": { + "get": { + "tags": [ + "employee-controller" + ], + "operationId": "findOne", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + } + } + }, + "put": { + "tags": [ + "employee-controller" + ], + "operationId": "updateEmployee", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "CollectionModelEntityModelEmployee": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "employees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Employee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "EntityModelEmployee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app5.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app5.json new file mode 100644 index 000000000..e46116a9f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app5.json @@ -0,0 +1,102 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "greeting-controller" + ], + "operationId": "sayHello2", + "parameters": [ + { + "name": "statuses", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] + } + } + }, + { + "name": "code", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "postCode", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "query", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "shortName", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "status", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": {} + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app6.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app6.json new file mode 100644 index 000000000..0d368ee00 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app6.json @@ -0,0 +1,124 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/employees/{id}": { + "get": { + "tags": [ + "employee-controller" + ], + "operationId": "findOne", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Employee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "EntityModelEmployee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app7.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app7.json new file mode 100644 index 000000000..8549f6460 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app7.json @@ -0,0 +1,100 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "type": "integer", + "default": 0, + "minimum": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "minimum": 1 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app8.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app8.json new file mode 100644 index 000000000..6fbcf3fd7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app8.json @@ -0,0 +1,131 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/albums": { + "get": { + "tags": [ + "album-controller" + ], + "operationId": "getAllAlbums", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/PagedModelAlbum" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Album": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "releaseDate": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelAlbum": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "albums": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Album" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app9.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app9.json new file mode 100644 index 000000000..f02a7f25b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app9.json @@ -0,0 +1,218 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Demo Springdoc Issue #401", + "description": "A demo API to illustrate Springdoc Issue #401.", + "version": "0.0.1-SNAPSHOT" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "components", + "description": "Everything about components" + } + ], + "paths": { + "/components": { + "get": { + "tags": [ + "components" + ], + "summary": "List the components", + "operationId": "findAll", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedModelRepresentationModelEntityModelDemoComponentDto" + } + } + } + } + } + } + }, + "/components/{componentId}": { + "get": { + "tags": [ + "components" + ], + "summary": "Get one component by its ID", + "description": "Returns a single component", + "operationId": "findById", + "parameters": [ + { + "name": "componentId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Component found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityModelDemoComponentDto" + } + } + } + }, + "404": { + "description": "Component not found" + } + } + } + } + }, + "components": { + "schemas": { + "Link": { + "type": "object", + "properties": { + "rel": { + "type": "string" + }, + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "media": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelRepresentationModelEntityModelDemoComponentDto": { + "type": "object", + "properties": { + "links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Link" + } + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepresentationModelEntityModelDemoComponentDto" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "RepresentationModelEntityModelDemoComponentDto": { + "type": "object", + "properties": { + "links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "EntityModelDemoComponentDto": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Some ID", + "example": 1 + }, + "payload": { + "type": "string", + "description": "Some dummy payload", + "example": "Hello World" + }, + "links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java deleted file mode 100644 index 3f94f121c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.reactive.server.WebTestClient; - -@AutoConfigureWebTestClient(timeout = "3600000") -@ActiveProfiles("test") -@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) -public abstract class AbstractCommonTest { - - protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); - - @Autowired - protected WebTestClient webTestClient; - - protected String getContent(String fileName) { - try { - Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java deleted file mode 100644 index e8332bd55..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocFunctionTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import org.json.JSONException; -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; - -import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; -import org.springframework.cloud.function.context.test.FunctionalSpringBootTest; -import org.springframework.test.web.reactive.server.EntityExchangeResult; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - - -@FunctionalSpringBootTest -@AutoConfigureWebTestClient(timeout = "3600000") -public abstract class AbstractSpringDocFunctionTest extends AbstractCommonTest { - - protected String groupName = ""; - - - @Test - void testApp() { - String result = null; - try { - EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() - .expectStatus().isOk().expectBody().returnResult(); - - result = new String(getResult.getResponseBody()); - String className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } - catch (AssertionError e) { - LOGGER.error(result); - throw e; - } - catch (JSONException e) { - LOGGER.error(result); - throw new RuntimeException(e); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/app154/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/app154/PersonDTO.java deleted file mode 100644 index c435f526e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/app154/PersonDTO.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app154; - -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java deleted file mode 100644 index 9c7f8c66c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app154; - -import java.util.function.Function; -import java.util.function.Supplier; - -import reactor.core.publisher.Flux; -import test.org.springdoc.api.AbstractSpringDocFunctionTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration; -import org.springframework.cloud.function.web.mvc.ReactorAutoConfiguration; -import org.springframework.cloud.function.web.source.FunctionExporterAutoConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.TestPropertySource; - -@Import({ ReactorAutoConfiguration.class, FunctionExporterAutoConfiguration.class, ContextFunctionCatalogAutoConfiguration.class }) -@TestPropertySource(properties = "spring.cloud.function.web.path=/toto") -public class SpringDocApp154Test extends AbstractSpringDocFunctionTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app154" }) - static class SpringDocTestApp { - @Bean - public Function reverseString() { - return value -> new StringBuilder(value).reverse().toString(); - } - - @Bean - public Function uppercase() { - return String::toUpperCase; - } - - @Bean - public Function, Flux> lowercase() { - return flux -> flux.map(String::toLowerCase); - } - - @Bean(name = "titi") - public Supplier hello() { - return PersonDTO::new; - } - - @Bean - public Supplier> words() { - return () -> Flux.fromArray(new String[] { "foo", "bar" }); - } - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java new file mode 100644 index 000000000..a26b7e6f2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.reactive.server.WebTestClient; + +@AutoConfigureWebTestClient(timeout = "3600000") +@ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) +public abstract class AbstractCommonTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); + + @Autowired + protected WebTestClient webTestClient; + + protected String getContent(String fileName) { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocFunctionTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocFunctionTest.java new file mode 100644 index 000000000..3530b3608 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocFunctionTest.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.cloud.function.context.test.FunctionalSpringBootTest; +import org.springframework.test.web.reactive.server.EntityExchangeResult; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + + +@FunctionalSpringBootTest +@AutoConfigureWebTestClient(timeout = "3600000") +public abstract class AbstractSpringDocFunctionTest extends AbstractCommonTest { + + protected String groupName = ""; + + + @Test + void testApp() { + String result = null; + try { + EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() + .expectStatus().isOk().expectBody().returnResult(); + + result = new String(getResult.getResponseBody()); + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + catch (JSONException e) { + LOGGER.error(result); + throw new RuntimeException(e); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/app154/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/app154/PersonDTO.java new file mode 100644 index 000000000..8735e622a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/app154/PersonDTO.java @@ -0,0 +1,60 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app154; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java new file mode 100644 index 000000000..37de65ef3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * Copyright 2019-2020 the original author or authors. + * * * + * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * you may not use this file except in compliance with the License. + * * * You may obtain a copy of the License at + * * * + * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * + * * * Unless required by applicable law or agreed to in writing, software + * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * See the License for the specific language governing permissions and + * * * limitations under the License. + * * + * + */ + +package test.org.springdoc.api.v30.app154; + +import java.util.function.Function; +import java.util.function.Supplier; + +import reactor.core.publisher.Flux; +import test.org.springdoc.api.v30.AbstractSpringDocFunctionTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration; +import org.springframework.cloud.function.web.mvc.ReactorAutoConfiguration; +import org.springframework.cloud.function.web.source.FunctionExporterAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Import; +import org.springframework.test.context.TestPropertySource; + +@Import({ ReactorAutoConfiguration.class, FunctionExporterAutoConfiguration.class, ContextFunctionCatalogAutoConfiguration.class }) +@TestPropertySource(properties = "spring.cloud.function.web.path=/toto") +public class SpringDocApp154Test extends AbstractSpringDocFunctionTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app154" }) + static class SpringDocTestApp { + @Bean + public Function reverseString() { + return value -> new StringBuilder(value).reverse().toString(); + } + + @Bean + public Function uppercase() { + return String::toUpperCase; + } + + @Bean + public Function, Flux> lowercase() { + return flux -> flux.map(String::toLowerCase); + } + + @Bean(name = "titi") + public Supplier hello() { + return PersonDTO::new; + } + + @Bean + public Supplier> words() { + return () -> Flux.fromArray(new String[] { "foo", "bar" }); + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java new file mode 100644 index 000000000..4dedd2868 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.reactive.server.WebTestClient; + +@AutoConfigureWebTestClient(timeout = "3600000") +@ActiveProfiles("test") +public abstract class AbstractCommonTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractCommonTest.class); + + @Autowired + protected WebTestClient webTestClient; + + protected String getContent(String fileName) { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocFunctionTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocFunctionTest.java new file mode 100644 index 000000000..006206529 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocFunctionTest.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; +import org.springframework.cloud.function.context.test.FunctionalSpringBootTest; +import org.springframework.test.web.reactive.server.EntityExchangeResult; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + + +@FunctionalSpringBootTest +@AutoConfigureWebTestClient(timeout = "3600000") +public abstract class AbstractSpringDocFunctionTest extends AbstractCommonTest { + + protected String groupName = ""; + + + @Test + void testApp() { + String result = null; + try { + EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL + groupName).exchange() + .expectStatus().isOk().expectBody().returnResult(); + + result = new String(getResult.getResponseBody()); + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + catch (JSONException e) { + LOGGER.error(result); + throw new RuntimeException(e); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/app154/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/app154/PersonDTO.java new file mode 100644 index 000000000..3a49b397b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/app154/PersonDTO.java @@ -0,0 +1,60 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app154; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java new file mode 100644 index 000000000..5909969b5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * Copyright 2019-2020 the original author or authors. + * * * + * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * you may not use this file except in compliance with the License. + * * * You may obtain a copy of the License at + * * * + * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * + * * * Unless required by applicable law or agreed to in writing, software + * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * See the License for the specific language governing permissions and + * * * limitations under the License. + * * + * + */ + +package test.org.springdoc.api.v31.app154; + +import java.util.function.Function; +import java.util.function.Supplier; + +import reactor.core.publisher.Flux; +import test.org.springdoc.api.v31.AbstractSpringDocFunctionTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration; +import org.springframework.cloud.function.web.mvc.ReactorAutoConfiguration; +import org.springframework.cloud.function.web.source.FunctionExporterAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Import; +import org.springframework.test.context.TestPropertySource; + +@Import({ ReactorAutoConfiguration.class, FunctionExporterAutoConfiguration.class, ContextFunctionCatalogAutoConfiguration.class }) +@TestPropertySource(properties = "spring.cloud.function.web.path=/toto") +public class SpringDocApp154Test extends AbstractSpringDocFunctionTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app154" }) + static class SpringDocTestApp { + @Bean + public Function reverseString() { + return value -> new StringBuilder(value).reverse().toString(); + } + + @Bean + public Function uppercase() { + return String::toUpperCase; + } + + @Bean + public Function, Flux> lowercase() { + return flux -> flux.map(String::toLowerCase); + } + + @Bean(name = "titi") + public Supplier hello() { + return PersonDTO::new; + } + + @Bean + public Supplier> words() { + return () -> Flux.fromArray(new String[] { "foo", "bar" }); + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/results/app154.json b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/results/3.0.1/app154.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/results/app154.json rename to springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/results/3.0.1/app154.json diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/results/3.1.0/app154.json b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/results/3.1.0/app154.json new file mode 100644 index 000000000..4e3b84627 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/src/test/resources/results/3.1.0/app154.json @@ -0,0 +1,303 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/toto/lowercase": { + "post": { + "description": "lowercase function", + "operationId": "lowercase_POST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/toto/lowercase/{lowercase}": { + "get": { + "description": "lowercase function", + "operationId": "lowercase_GET", + "parameters": [ + { + "name": "lowercase", + "in": "path", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/toto/reverseString": { + "post": { + "description": "reverseString function", + "operationId": "reverseString_POST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/toto/reverseString/{reverseString}": { + "get": { + "description": "reverseString function", + "operationId": "reverseString_GET", + "parameters": [ + { + "name": "reverseString", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/toto/titi": { + "get": { + "description": "titi supplier", + "operationId": "titi_GET", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/toto/uppercase": { + "post": { + "description": "uppercase function", + "operationId": "uppercase_POST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/toto/uppercase/{uppercase}": { + "get": { + "description": "uppercase function", + "operationId": "uppercase_GET", + "parameters": [ + { + "name": "uppercase", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/toto/words": { + "get": { + "description": "words supplier", + "operationId": "words_GET", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java deleted file mode 100644 index 7ba22b811..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractCommonTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.servlet.MockMvc; - -@AutoConfigureMockMvc -@ActiveProfiles("test") -@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) -public abstract class AbstractCommonTest { - - @Autowired - protected MockMvc mockMvc; - - protected String getContent(String fileName) throws Exception { - try { - Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index d15f27c5f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; - -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@SpringBootTest -public abstract class AbstractSpringDocTest extends AbstractCommonTest { - - public static String className; - - @Test - void testApp() throws Exception { - className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/HelloController.java deleted file mode 100644 index 55674e934..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/HelloController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app174; - -import reactor.core.publisher.Flux; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("/test") - public void printHello() { - System.out.println("Hello"); - } - - @GetMapping("/toto") - public Flux test() { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/PersonDTO.java deleted file mode 100644 index 2ba7bc4fb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/PersonDTO.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app174; - -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java deleted file mode 100644 index 06352925b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app174; - -import java.util.Arrays; -import java.util.List; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.Supplier; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; -import test.org.springdoc.api.AbstractSpringDocTest; -import test.org.springdoc.api.app175.PersonDTO; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.web.bind.annotation.RequestMethod; - -public class SpringDocApp174Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - @Bean - public Function reverseString() { - return value -> new StringBuilder(value).reverse().toString(); - } - - @Bean - public Function uppercase() { - return String::toUpperCase; - } - - @Bean - @RouterOperations({ - @RouterOperation(method = RequestMethod.GET, operation = @Operation(description = "Say hello GET", operationId = "lowercaseGET", tags = "positions", - responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))), - @RouterOperation(method = RequestMethod.POST, operation = @Operation(description = "Say hello POST", operationId = "lowercasePOST", tags = "positions", - responses = @ApiResponse(responseCode = "200", description = "new desc", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))) - }) - public Function, List> lowercase() { - return list -> list.stream().map(String::toLowerCase).toList(); - } - - @Bean(name = "titi") - @RouterOperation(operation = @Operation(description = "Say hello By Id", operationId = "hellome", tags = "persons", - responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = PersonDTO.class))))) - public Supplier helloSupplier() { - return PersonDTO::new; - } - - @Bean - public Consumer helloConsumer() { - return PersonDTO::getFirstName; - } - - @Bean - public Supplier> words() { - return () -> Arrays.asList("foo", "bar"); - } - - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app175/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app175/PersonDTO.java deleted file mode 100644 index ee4ed2488..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app175/PersonDTO.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app175; - -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app175/SpringDocApp175Test.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app175/SpringDocApp175Test.java deleted file mode 100644 index 0ffbc2bea..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/app175/SpringDocApp175Test.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app175; - -import java.util.Arrays; -import java.util.List; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.Supplier; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; -import org.springframework.web.bind.annotation.RequestMethod; - -@TestPropertySource(properties = "springdoc.show-spring-cloud-functions=false") -public class SpringDocApp175Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - @Bean - public Function reverseString() { - return value -> new StringBuilder(value).reverse().toString(); - } - - @Bean - public Function uppercase() { - return String::toUpperCase; - } - - @Bean - @RouterOperations({ - @RouterOperation(method = RequestMethod.GET, operation = @Operation(description = "Say hello GET", operationId = "lowercaseGET", tags = "positions", - responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))), - @RouterOperation(method = RequestMethod.POST, operation = @Operation(description = "Say hello POST", operationId = "lowercasePOST", tags = "positions", - responses = @ApiResponse(responseCode = "200", description = "new desc", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))) - }) - public Function, List> lowercase() { - return list -> list.stream().map(String::toLowerCase).toList(); - } - - @Bean(name = "titi") - @RouterOperation(operation = @Operation(description = "Say hello By Id", operationId = "hellome", tags = "persons", - responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = PersonDTO.class))))) - public Supplier helloSupplier() { - return PersonDTO::new; - } - - @Bean - public Consumer helloConsumer() { - return PersonDTO::getFirstName; - } - - @Bean - public Supplier> words() { - return () -> Arrays.asList("foo", "bar"); - } - - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java new file mode 100644 index 000000000..853053296 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractCommonTest.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MockMvc; + +@AutoConfigureMockMvc +@ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) +public abstract class AbstractCommonTest { + + @Autowired + protected MockMvc mockMvc; + + protected String getContent(String fileName) throws Exception { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..1f28f3fa6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest +public abstract class AbstractSpringDocTest extends AbstractCommonTest { + + public static String className; + + @Test + void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/HelloController.java new file mode 100644 index 000000000..74a350f4e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app174; + +import reactor.core.publisher.Flux; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test") + public void printHello() { + System.out.println("Hello"); + } + + @GetMapping("/toto") + public Flux test() { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/PersonDTO.java new file mode 100644 index 000000000..e5d6b2f47 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/PersonDTO.java @@ -0,0 +1,60 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app174; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/SpringDocApp174Test.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/SpringDocApp174Test.java new file mode 100644 index 000000000..b9ae68edb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app174/SpringDocApp174Test.java @@ -0,0 +1,85 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app174; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v30.AbstractSpringDocTest; +import test.org.springdoc.api.v30.app175.PersonDTO; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.RequestMethod; + +public class SpringDocApp174Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public Function reverseString() { + return value -> new StringBuilder(value).reverse().toString(); + } + + @Bean + public Function uppercase() { + return String::toUpperCase; + } + + @Bean + @RouterOperations({ + @RouterOperation(method = RequestMethod.GET, operation = @Operation(description = "Say hello GET", operationId = "lowercaseGET", tags = "positions", + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))), + @RouterOperation(method = RequestMethod.POST, operation = @Operation(description = "Say hello POST", operationId = "lowercasePOST", tags = "positions", + responses = @ApiResponse(responseCode = "200", description = "new desc", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))) + }) + public Function, List> lowercase() { + return list -> list.stream().map(String::toLowerCase).toList(); + } + + @Bean(name = "titi") + @RouterOperation(operation = @Operation(description = "Say hello By Id", operationId = "hellome", tags = "persons", + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = PersonDTO.class))))) + public Supplier helloSupplier() { + return PersonDTO::new; + } + + @Bean + public Consumer helloConsumer() { + return PersonDTO::getFirstName; + } + + @Bean + public Supplier> words() { + return () -> Arrays.asList("foo", "bar"); + } + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app175/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app175/PersonDTO.java new file mode 100644 index 000000000..6a026d62d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app175/PersonDTO.java @@ -0,0 +1,60 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app175; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app175/SpringDocApp175Test.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app175/SpringDocApp175Test.java new file mode 100644 index 000000000..01cb2b1a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app175/SpringDocApp175Test.java @@ -0,0 +1,86 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app175; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.bind.annotation.RequestMethod; + +@TestPropertySource(properties = "springdoc.show-spring-cloud-functions=false") +public class SpringDocApp175Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public Function reverseString() { + return value -> new StringBuilder(value).reverse().toString(); + } + + @Bean + public Function uppercase() { + return String::toUpperCase; + } + + @Bean + @RouterOperations({ + @RouterOperation(method = RequestMethod.GET, operation = @Operation(description = "Say hello GET", operationId = "lowercaseGET", tags = "positions", + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))), + @RouterOperation(method = RequestMethod.POST, operation = @Operation(description = "Say hello POST", operationId = "lowercasePOST", tags = "positions", + responses = @ApiResponse(responseCode = "200", description = "new desc", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))) + }) + public Function, List> lowercase() { + return list -> list.stream().map(String::toLowerCase).toList(); + } + + @Bean(name = "titi") + @RouterOperation(operation = @Operation(description = "Say hello By Id", operationId = "hellome", tags = "persons", + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = PersonDTO.class))))) + public Supplier helloSupplier() { + return PersonDTO::new; + } + + @Bean + public Consumer helloConsumer() { + return PersonDTO::getFirstName; + } + + @Bean + public Supplier> words() { + return () -> Arrays.asList("foo", "bar"); + } + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java new file mode 100644 index 000000000..4534f8803 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractCommonTest.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.servlet.MockMvc; + +@AutoConfigureMockMvc +@ActiveProfiles("test") +public abstract class AbstractCommonTest { + + @Autowired + protected MockMvc mockMvc; + + protected String getContent(String fileName) throws Exception { + try { + Path path = Paths.get(AbstractCommonTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..ee9336ca1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@SpringBootTest +public abstract class AbstractSpringDocTest extends AbstractCommonTest { + + public static String className; + + @Test + void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/HelloController.java new file mode 100644 index 000000000..06e5068cd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app174; + +import reactor.core.publisher.Flux; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("/test") + public void printHello() { + System.out.println("Hello"); + } + + @GetMapping("/toto") + public Flux test() { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/PersonDTO.java new file mode 100644 index 000000000..e5ee6ef6d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/PersonDTO.java @@ -0,0 +1,60 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app174; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/SpringDocApp174Test.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/SpringDocApp174Test.java new file mode 100644 index 000000000..5d246066b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app174/SpringDocApp174Test.java @@ -0,0 +1,85 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app174; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v31.AbstractSpringDocTest; +import test.org.springdoc.api.v31.app175.PersonDTO; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.RequestMethod; + +public class SpringDocApp174Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public Function reverseString() { + return value -> new StringBuilder(value).reverse().toString(); + } + + @Bean + public Function uppercase() { + return String::toUpperCase; + } + + @Bean + @RouterOperations({ + @RouterOperation(method = RequestMethod.GET, operation = @Operation(description = "Say hello GET", operationId = "lowercaseGET", tags = "positions", + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))), + @RouterOperation(method = RequestMethod.POST, operation = @Operation(description = "Say hello POST", operationId = "lowercasePOST", tags = "positions", + responses = @ApiResponse(responseCode = "200", description = "new desc", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))) + }) + public Function, List> lowercase() { + return list -> list.stream().map(String::toLowerCase).toList(); + } + + @Bean(name = "titi") + @RouterOperation(operation = @Operation(description = "Say hello By Id", operationId = "hellome", tags = "persons", + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = PersonDTO.class))))) + public Supplier helloSupplier() { + return PersonDTO::new; + } + + @Bean + public Consumer helloConsumer() { + return PersonDTO::getFirstName; + } + + @Bean + public Supplier> words() { + return () -> Arrays.asList("foo", "bar"); + } + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app175/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app175/PersonDTO.java new file mode 100644 index 000000000..23a12e0d4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app175/PersonDTO.java @@ -0,0 +1,60 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app175; + +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app175/SpringDocApp175Test.java b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app175/SpringDocApp175Test.java new file mode 100644 index 000000000..1a20134b7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api/v31/app175/SpringDocApp175Test.java @@ -0,0 +1,86 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app175; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.bind.annotation.RequestMethod; + +@TestPropertySource(properties = "springdoc.show-spring-cloud-functions=false") +public class SpringDocApp175Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public Function reverseString() { + return value -> new StringBuilder(value).reverse().toString(); + } + + @Bean + public Function uppercase() { + return String::toUpperCase; + } + + @Bean + @RouterOperations({ + @RouterOperation(method = RequestMethod.GET, operation = @Operation(description = "Say hello GET", operationId = "lowercaseGET", tags = "positions", + responses = @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))), + @RouterOperation(method = RequestMethod.POST, operation = @Operation(description = "Say hello POST", operationId = "lowercasePOST", tags = "positions", + responses = @ApiResponse(responseCode = "200", description = "new desc", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class)))))) + }) + public Function, List> lowercase() { + return list -> list.stream().map(String::toLowerCase).toList(); + } + + @Bean(name = "titi") + @RouterOperation(operation = @Operation(description = "Say hello By Id", operationId = "hellome", tags = "persons", + responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = PersonDTO.class))))) + public Supplier helloSupplier() { + return PersonDTO::new; + } + + @Bean + public Consumer helloConsumer() { + return PersonDTO::getFirstName; + } + + @Bean + public Supplier> words() { + return () -> Arrays.asList("foo", "bar"); + } + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/app174.json b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.0.1/app174.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/app174.json rename to springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.0.1/app174.json diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/app175.json b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.0.1/app175.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/app175.json rename to springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.0.1/app175.json diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.1.0/app174.json b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.1.0/app174.json new file mode 100644 index 000000000..1b504b480 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.1.0/app174.json @@ -0,0 +1,379 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/toto": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "test", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "printHello", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/helloConsumer": { + "post": { + "description": "helloConsumer consumer", + "operationId": "helloConsumer_POST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + }, + "responses": { + "202": { + "description": "Accepted", + "content": {} + } + } + } + }, + "/lowercase": { + "post": { + "tags": [ + "positions" + ], + "description": "Say hello POST", + "operationId": "lowercasePOST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "responses": { + "200": { + "description": "new desc", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/lowercase/{lowercase}": { + "get": { + "tags": [ + "positions" + ], + "description": "Say hello GET", + "operationId": "lowercaseGET", + "parameters": [ + { + "name": "lowercase", + "in": "path", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/reverseString": { + "post": { + "description": "reverseString function", + "operationId": "reverseString_POST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/reverseString/{reverseString}": { + "get": { + "description": "reverseString function", + "operationId": "reverseString_GET", + "parameters": [ + { + "name": "reverseString", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/titi": { + "get": { + "tags": [ + "persons" + ], + "description": "Say hello By Id", + "operationId": "hellome", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/uppercase": { + "post": { + "description": "uppercase function", + "operationId": "uppercase_POST", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/uppercase/{uppercase}": { + "get": { + "description": "uppercase function", + "operationId": "uppercase_GET", + "parameters": [ + { + "name": "uppercase", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/words": { + "get": { + "description": "words supplier", + "operationId": "words_GET", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.1.0/app175.json b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.1.0/app175.json new file mode 100644 index 000000000..16823bacd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/3.1.0/app175.json @@ -0,0 +1,15 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": {}, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index 3cc8d4828..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springdoc.core.utils.Constants; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@ActiveProfiles("test") -@SpringBootTest -@AutoConfigureMockMvc -@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) -public abstract class AbstractSpringDocTest { - - protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractSpringDocTest.class); - - public static String className; - - @Autowired - protected MockMvc mockMvc; - - public static String getContent(String fileName) throws Exception { - try { - Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } - - @Test - void testApp() throws Exception { - className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/Car.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/Car.groovy deleted file mode 100644 index 14712b71f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/Car.groovy +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app1 - -class Car { - Long id - - String name -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/CarController.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/CarController.groovy deleted file mode 100644 index 3bc1a246e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/CarController.groovy +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app1 - -import org.springdoc.core.annotations.ParameterObject - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RestController - -@RestController -class CarController { - - CarService carService - - CarController(CarService carService) { - this.carService = carService - } - - @GetMapping(path = 'cars/{carId}') - Car getCar(@PathVariable(value = 'carId') Long carId) { - return carService.getCar(carId) - } - - @GetMapping(path = '/cars') - List getCars(@ParameterObject CarsFilter filter) { - return carService.getCars() - } - - static class CarsFilter { - String name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/CarService.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/CarService.groovy deleted file mode 100644 index ad98f3582..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/CarService.groovy +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app1 - - -import org.springframework.stereotype.Service - -@Service -class CarService { - List getCars() { - return [ - new Car(id: 1L, name: 'Car 1'), - new Car(id: 2L, name: 'Car 2'), - new Car(id: 3L, name: 'Car 3'), - new Car(id: 4L, name: 'Car 4'), - new Car(id: 5L, name: 'Car 5'), - ] - } - - Car getCar(Long carId) { - return new Car( - id: carId, - name: "Car $carId" - ) - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/OpenApiConfiguration.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/OpenApiConfiguration.groovy deleted file mode 100644 index 9f3ceee14..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/OpenApiConfiguration.groovy +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app1 - -import io.swagger.v3.oas.annotations.OpenAPIDefinition -import io.swagger.v3.oas.models.Components -import io.swagger.v3.oas.models.OpenAPI -import io.swagger.v3.oas.models.info.Info - -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.Configuration - -@OpenAPIDefinition -@Configuration -class OpenApiConfiguration { - - @Bean - OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components()) - .info( - new Info() - .title('Issue OpenAPI with Groovy') - .description('Special Groovy Metaclass Test Issue') - ) - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/SpringDocApp1Test.java deleted file mode 100644 index c3ec82343..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app1/SpringDocApp1Test.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app1; - -import groovy.lang.MetaClass; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.enable-groovy=false") -public class SpringDocApp1Test extends AbstractSpringDocTest { - @BeforeAll - public static void init() { - SpringDocUtils.getConfig().removeJavaTypeToIgnore(MetaClass.class); - } - - @AfterAll - public static void clean() { - SpringDocUtils.getConfig().addJavaTypeToIgnore(MetaClass.class); - } - - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/HelloController.java deleted file mode 100644 index 0e76f81ef..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/HelloController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app10; - -import java.util.List; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort.Direction; -import org.springframework.data.web.PageableDefault; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@PageableDefault(size = 5, sort = "name") @ParameterObject Pageable pageable) { - return null; - } - - - @GetMapping("/test1") - public String getPatientList1(@PageableDefault(size = 100, sort = { "someField", "someoTHER" }, - direction = Direction.DESC) - @ParameterObject Pageable pageable) { - return "bla"; - } - - @GetMapping("/test2") - public String getPatientList2(@PageableDefault(size = 100, sort = "someField", - direction = Direction.DESC) - @ParameterObject Pageable pageable) { - return "bla"; - } - - @GetMapping("/test3") - public String getPatientList3(@PageableDefault(size = 100) - @ParameterObject Pageable pageable) { - return "bla"; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/PersonDTO.java deleted file mode 100644 index 5d719d0dc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/PersonDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app10; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/SpringDocApp10Test.java deleted file mode 100644 index 2247bcc40..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app10/SpringDocApp10Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app10; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp10Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/SpringDocApp11Test.java deleted file mode 100644 index cca9804c5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/SpringDocApp11Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app11; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp11Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/TestController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/TestController.java deleted file mode 100644 index 78d5fe5e7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/TestController.java +++ /dev/null @@ -1,25 +0,0 @@ -package test.org.springdoc.api.app11; - -/** - * @author bnasslahsen - */ - -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/test") -public class TestController { - @PostMapping - @ApiResponse(responseCode = "200", description = "Random endpoint.") - @ResponseStatus(HttpStatus.OK) - public void testingMethod(@RequestBody TestRequest testRequest) { - System.out.println("Method was run!"); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/TestRequest.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/TestRequest.java deleted file mode 100644 index 2c4df632f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app11/TestRequest.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app11; - -/** - * @author bnasslahsen - */ - -import java.util.Map; - -import io.swagger.v3.oas.annotations.media.Schema; - -public class TestRequest { - @Schema(description = "Joe was here with a tuna melt!") - private String joeWasHere; - - @Schema(description = "This is an example of a map that does not work.!") - private Map testingTheMap; - - public String getJoeWasHere() { return joeWasHere; } - public void setJoeWasHere(String joeWasHere) { this.joeWasHere = joeWasHere; } - public Map getTestingTheMap() { return testingTheMap; } - public void setTestingTheMap(Map testingTheMap) { this.testingTheMap = testingTheMap; } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/GlobalExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/GlobalExceptionHandler.java deleted file mode 100644 index b5b7f838b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/GlobalExceptionHandler.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app191; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; - - -@ControllerAdvice -class GlobalExceptionHandler { - - @ResponseStatus(code = HttpStatus.FORBIDDEN) - @ExceptionHandler(MyException.class) - public ResponseEntity handleException(MyException myException) { - return ResponseEntity.status(HttpStatus.FORBIDDEN) - .body(myException.getMessage()); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/HelloController.java deleted file mode 100644 index 6942db26f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/HelloController.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app191; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; -import org.springframework.data.domain.Sort.Direction; -import org.springframework.data.web.SortDefault; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public ResponseEntity> getAllPets(@SortDefault("name") @ParameterObject Sort sort) { - return null; - } - - - @GetMapping("/test1") - public String getPatientList1(@SortDefault(sort = { "someField", "someoTHER" }, - direction = Direction.DESC) - @ParameterObject Sort sort) { - return "bla"; - } - - @GetMapping("/test2") - public String getPatientList2(@SortDefault(sort = "someField", - direction = Direction.DESC) - @ParameterObject Sort sort) { - return "bla"; - } - - @GetMapping("/test3") - public String getPatientList3(@SortDefault(sort = { "someField", "someoTHER" }, - direction = Direction.DESC) - @ParameterObject Pageable pageable) { - return "bla"; - } - - @GetMapping("/test4") - public String getPatientList4(@SortDefault(sort = "someField", - direction = Direction.DESC) - @ParameterObject Pageable pageable) { - return "bla"; - } - - @GetMapping(value = "/hello", produces = MediaType.TEXT_PLAIN_VALUE) - @Operation(summary = "Says hello") - public ResponseEntity getHello() { - return ResponseEntity - .status(HttpStatus.OK) - .body("Hello!"); - } - - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ExceptionHandler(RuntimeException.class) - public ResponseEntity handleException(RuntimeException runtimeException) { - return ResponseEntity - .status(HttpStatus.INTERNAL_SERVER_ERROR) - .body(runtimeException.getMessage()); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/MyException.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/MyException.java deleted file mode 100644 index 47f68b33a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/MyException.java +++ /dev/null @@ -1,7 +0,0 @@ -package test.org.springdoc.api.app191; - -public class MyException extends RuntimeException { - public MyException(String message) { - super(message); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/PersonDTO.java deleted file mode 100644 index 99568fdf2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/PersonDTO.java +++ /dev/null @@ -1,67 +0,0 @@ -package test.org.springdoc.api.app191; - -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -public class PersonDTO { - private String email; - - private String firstName; - - private String lastName; - - public PersonDTO() { - } - - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/SpringDocApp191Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/SpringDocApp191Test.java deleted file mode 100644 index dec9ecf71..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app191/SpringDocApp191Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app191; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp191Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/Car.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/Car.groovy deleted file mode 100644 index acc95f5a3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/Car.groovy +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app2 - -class Car { - Long id - - String name -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/CarController.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/CarController.groovy deleted file mode 100644 index 0e76487e8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/CarController.groovy +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app2 - -import org.springdoc.core.annotations.ParameterObject - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RestController - -@RestController -class CarController { - - test.org.springdoc.api.app2.CarService carService - - CarController(test.org.springdoc.api.app2.CarService carService) { - this.carService = carService - } - - @GetMapping(path = '/cars') - List getCars(@ParameterObject CarsFilter filter) { - return carService.getCars() - } - - static class CarsFilter { - String name; - } - - @GetMapping(path = 'cars/{carId}') - test.org.springdoc.api.app2.Car getCar(@PathVariable(value = 'carId') Long carId) { - return carService.getCar(carId) - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/CarService.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/CarService.groovy deleted file mode 100644 index df6dcb602..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/CarService.groovy +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app2 - - -import org.springframework.stereotype.Service - -@Service -class CarService { - List getCars() { - return [ - new test.org.springdoc.api.app2.Car(id: 1L, name: 'Car 1'), - new test.org.springdoc.api.app2.Car(id: 2L, name: 'Car 2'), - new test.org.springdoc.api.app2.Car(id: 3L, name: 'Car 3'), - new test.org.springdoc.api.app2.Car(id: 4L, name: 'Car 4'), - new test.org.springdoc.api.app2.Car(id: 5L, name: 'Car 5'), - ] - } - - test.org.springdoc.api.app2.Car getCar(Long carId) { - return new test.org.springdoc.api.app2.Car( - id: carId, - name: "Car $carId" - ) - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/OpenApiConfiguration.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/OpenApiConfiguration.groovy deleted file mode 100644 index f3a1b4506..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/OpenApiConfiguration.groovy +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app2 - -import io.swagger.v3.oas.annotations.OpenAPIDefinition -import io.swagger.v3.oas.models.Components -import io.swagger.v3.oas.models.OpenAPI -import io.swagger.v3.oas.models.info.Info - -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.Configuration - -@OpenAPIDefinition -@Configuration -class OpenApiConfiguration { - - @Bean - OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components()) - .info( - new Info() - .title('Issue OpenAPI with Groovy') - .description('Special Groovy Metaclass Test Issue') - ) - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/SpringDocApp2Test.java deleted file mode 100644 index 7c4cb0620..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app2/SpringDocApp2Test.java +++ /dev/null @@ -1,11 +0,0 @@ -package test.org.springdoc.api.app2; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp2Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/DeprecatedEntity.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/DeprecatedEntity.java deleted file mode 100644 index 7419871f4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/DeprecatedEntity.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app9; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @author bnasslahsen - */ -public class DeprecatedEntity { - @Schema(deprecated = false) - private String myNonDeprecatedField; - - @Schema(deprecated = true) - private String mydeprecatedField; - - public String getMyNonDeprecatedField() { - return myNonDeprecatedField; - } - - @Deprecated - public DeprecatedEntity setMyNonDeprecatedField(String myNonDeprecatedField) { - this.myNonDeprecatedField = myNonDeprecatedField; - return this; - } - - public String getMydeprecatedField() { - return mydeprecatedField; - } - - public void setMydeprecatedField(String mydeprecatedField) { - this.mydeprecatedField = mydeprecatedField; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/HelloController.java deleted file mode 100644 index b95b01100..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/HelloController.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app9; - -import jakarta.validation.constraints.NotNull; -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.data.domain.Pageable; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author bnasslahsen - */ -@RestController -public class HelloController { - - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public DeprecatedEntity getAllPets(@NotNull String toto) { - return null; - } - - @GetMapping(value = "/search2", produces = { "application/xml", "application/json" }) - public void getAllPets2(@ParameterObject Pageable pageable) { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/SpringDocApp9Test.java deleted file mode 100644 index 5c1682776..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/app9/SpringDocApp9Test.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app9; - -import java.util.Optional; - -import io.swagger.v3.core.converter.ModelConverter; -import io.swagger.v3.core.converter.ModelConverters; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - - -/** - * Tests Spring meta-annotations as method parameters - */ -@TestPropertySource(properties = "springdoc.model-converters.deprecating-converter.enabled=false") -public class SpringDocApp9Test extends AbstractSpringDocTest { - - @BeforeAll - public static void init() { - Optional deprecatingConverterOptional = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); - deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); - } - - @AfterAll - public static void clean() { - Optional deprecatingConverterOptional = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); - deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); - } - - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..a904460dc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) +public abstract class AbstractSpringDocTest { + + public static String className; + + @Autowired + protected MockMvc mockMvc; + + public static String getContent(String fileName) { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/Car.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/Car.groovy new file mode 100644 index 000000000..fa7bb4d6d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/Car.groovy @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1 + +class Car { + Long id + + String name +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/CarController.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/CarController.groovy new file mode 100644 index 000000000..2344c2d11 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/CarController.groovy @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1 + +import org.springdoc.core.annotations.ParameterObject + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.RestController + +@RestController +class CarController { + + CarService carService + + CarController(CarService carService) { + this.carService = carService + } + + @GetMapping(path = 'cars/{carId}') + Car getCar(@PathVariable(value = 'carId') Long carId) { + return carService.getCar(carId) + } + + @GetMapping(path = '/cars') + List getCars(@ParameterObject CarsFilter filter) { + return carService.getCars() + } + + static class CarsFilter { + String name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/CarService.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/CarService.groovy new file mode 100644 index 000000000..bd02bbc70 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/CarService.groovy @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1 + + +import org.springframework.stereotype.Service + +@Service +class CarService { + List getCars() { + return [ + new Car(id: 1L, name: 'Car 1'), + new Car(id: 2L, name: 'Car 2'), + new Car(id: 3L, name: 'Car 3'), + new Car(id: 4L, name: 'Car 4'), + new Car(id: 5L, name: 'Car 5'), + ] + } + + Car getCar(Long carId) { + return new Car( + id: carId, + name: "Car $carId" + ) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/OpenApiConfiguration.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/OpenApiConfiguration.groovy new file mode 100644 index 000000000..af3dc8861 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/OpenApiConfiguration.groovy @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1 + +import io.swagger.v3.oas.annotations.OpenAPIDefinition +import io.swagger.v3.oas.models.Components +import io.swagger.v3.oas.models.OpenAPI +import io.swagger.v3.oas.models.info.Info + +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +@OpenAPIDefinition +@Configuration +class OpenApiConfiguration { + + @Bean + OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components()) + .info( + new Info() + .title('Issue OpenAPI with Groovy') + .description('Special Groovy Metaclass Test Issue') + ) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..7c374d615 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import groovy.lang.MetaClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.enable-groovy=false") +public class SpringDocApp1Test extends AbstractSpringDocTest { + @BeforeAll + public static void init() { + SpringDocUtils.getConfig().removeJavaTypeToIgnore(MetaClass.class); + } + + @AfterAll + public static void clean() { + SpringDocUtils.getConfig().addJavaTypeToIgnore(MetaClass.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/HelloController.java new file mode 100644 index 000000000..a518e9705 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/HelloController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.PageableDefault; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@PageableDefault(size = 5, sort = "name") @ParameterObject Pageable pageable) { + return null; + } + + + @GetMapping("/test1") + public String getPatientList1(@PageableDefault(size = 100, sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test2") + public String getPatientList2(@PageableDefault(size = 100, sort = "someField", + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test3") + public String getPatientList3(@PageableDefault(size = 100) + @ParameterObject Pageable pageable) { + return "bla"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/PersonDTO.java new file mode 100644 index 000000000..2486bdc17 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java new file mode 100644 index 000000000..d77535f8c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp10Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..0b9b89f36 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp11Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/TestController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/TestController.java new file mode 100644 index 000000000..67995ec4a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/TestController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +/** + * @author bnasslahsen + */ + +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/test") +public class TestController { + @PostMapping + @ApiResponse(responseCode = "200", description = "Random endpoint.") + @ResponseStatus(HttpStatus.OK) + public void testingMethod(@RequestBody TestRequest testRequest) { + System.out.println("Method was run!"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/TestRequest.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/TestRequest.java new file mode 100644 index 000000000..278cdf504 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app11/TestRequest.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +/** + * @author bnasslahsen + */ + +import java.util.Map; + +import io.swagger.v3.oas.annotations.media.Schema; + +public class TestRequest { + @Schema(description = "Joe was here with a tuna melt!") + private String joeWasHere; + + @Schema(description = "This is an example of a map that does not work.!") + private Map testingTheMap; + + public String getJoeWasHere() { return joeWasHere; } + public void setJoeWasHere(String joeWasHere) { this.joeWasHere = joeWasHere; } + public Map getTestingTheMap() { return testingTheMap; } + public void setTestingTheMap(Map testingTheMap) { this.testingTheMap = testingTheMap; } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/GlobalExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/GlobalExceptionHandler.java new file mode 100644 index 000000000..0d105db0b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/GlobalExceptionHandler.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app191; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +@ControllerAdvice +class GlobalExceptionHandler { + + @ResponseStatus(code = HttpStatus.FORBIDDEN) + @ExceptionHandler(MyException.class) + public ResponseEntity handleException(MyException myException) { + return ResponseEntity.status(HttpStatus.FORBIDDEN) + .body(myException.getMessage()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/HelloController.java new file mode 100644 index 000000000..0e4bae95c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/HelloController.java @@ -0,0 +1,98 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app191; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.SortDefault; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@SortDefault("name") @ParameterObject Sort sort) { + return null; + } + + + @GetMapping("/test1") + public String getPatientList1(@SortDefault(sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Sort sort) { + return "bla"; + } + + @GetMapping("/test2") + public String getPatientList2(@SortDefault(sort = "someField", + direction = Direction.DESC) + @ParameterObject Sort sort) { + return "bla"; + } + + @GetMapping("/test3") + public String getPatientList3(@SortDefault(sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test4") + public String getPatientList4(@SortDefault(sort = "someField", + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping(value = "/hello", produces = MediaType.TEXT_PLAIN_VALUE) + @Operation(summary = "Says hello") + public ResponseEntity getHello() { + return ResponseEntity + .status(HttpStatus.OK) + .body("Hello!"); + } + + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ExceptionHandler(RuntimeException.class) + public ResponseEntity handleException(RuntimeException runtimeException) { + return ResponseEntity + .status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(runtimeException.getMessage()); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/MyException.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/MyException.java new file mode 100644 index 000000000..76741b5ce --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/MyException.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app191; + +public class MyException extends RuntimeException { + public MyException(String message) { + super(message); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/PersonDTO.java new file mode 100644 index 000000000..853cb549e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app191; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/SpringDocApp191Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/SpringDocApp191Test.java new file mode 100644 index 000000000..42114150b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app191/SpringDocApp191Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app191; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp191Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/Car.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/Car.groovy new file mode 100644 index 000000000..5e37361c0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/Car.groovy @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2 + +class Car { + Long id + + String name +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/CarController.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/CarController.groovy new file mode 100644 index 000000000..674a5b478 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/CarController.groovy @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2 + +import org.springdoc.core.annotations.ParameterObject + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.RestController + +@RestController +class CarController { + + CarService carService + + CarController(CarService carService) { + this.carService = carService + } + + @GetMapping(path = '/cars') + List getCars(@ParameterObject CarsFilter filter) { + return carService.getCars() + } + + static class CarsFilter { + String name; + } + + @GetMapping(path = 'cars/{carId}') + Car getCar(@PathVariable(value = 'carId') Long carId) { + return carService.getCar(carId) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/CarService.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/CarService.groovy new file mode 100644 index 000000000..6cbf33b4f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/CarService.groovy @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2 + + +import org.springframework.stereotype.Service + +@Service +class CarService { + List getCars() { + return [ + new test.org.springdoc.api.v30.app2.Car(id: 1L, name: 'Car 1'), + new test.org.springdoc.api.v30.app2.Car(id: 2L, name: 'Car 2'), + new test.org.springdoc.api.v30.app2.Car(id: 3L, name: 'Car 3'), + new test.org.springdoc.api.v30.app2.Car(id: 4L, name: 'Car 4'), + new test.org.springdoc.api.v30.app2.Car(id: 5L, name: 'Car 5'), + ] + } + + test.org.springdoc.api.v30.app2.Car getCar(Long carId) { + return new test.org.springdoc.api.v30.app2.Car( + id: carId, + name: "Car $carId" + ) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/OpenApiConfiguration.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/OpenApiConfiguration.groovy new file mode 100644 index 000000000..12eecb655 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/OpenApiConfiguration.groovy @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2 + +import io.swagger.v3.oas.annotations.OpenAPIDefinition +import io.swagger.v3.oas.models.Components +import io.swagger.v3.oas.models.OpenAPI +import io.swagger.v3.oas.models.info.Info + +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +@OpenAPIDefinition +@Configuration +class OpenApiConfiguration { + + @Bean + OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components()) + .info( + new Info() + .title('Issue OpenAPI with Groovy') + .description('Special Groovy Metaclass Test Issue') + ) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..0b1e69f90 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp2Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/DeprecatedEntity.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/DeprecatedEntity.java new file mode 100644 index 000000000..2bc85606d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/DeprecatedEntity.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * @author bnasslahsen + */ +public class DeprecatedEntity { + @Schema(deprecated = false) + private String myNonDeprecatedField; + + @Schema(deprecated = true) + private String mydeprecatedField; + + public String getMyNonDeprecatedField() { + return myNonDeprecatedField; + } + + @Deprecated + public DeprecatedEntity setMyNonDeprecatedField(String myNonDeprecatedField) { + this.myNonDeprecatedField = myNonDeprecatedField; + return this; + } + + public String getMydeprecatedField() { + return mydeprecatedField; + } + + public void setMydeprecatedField(String mydeprecatedField) { + this.mydeprecatedField = mydeprecatedField; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/HelloController.java new file mode 100644 index 000000000..7ac731d4f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import jakarta.validation.constraints.NotNull; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public DeprecatedEntity getAllPets(@NotNull String toto) { + return null; + } + + @GetMapping(value = "/search2", produces = { "application/xml", "application/json" }) + public void getAllPets2(@ParameterObject Pageable pageable) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..23d86759b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app9; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = "springdoc.model-converters.deprecating-converter.enabled=false") +public class SpringDocApp9Test extends AbstractSpringDocTest { + + @BeforeAll + public static void init() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @AfterAll + public static void clean() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..e2e449a88 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +public abstract class AbstractSpringDocTest { + + public static String className; + + @Autowired + protected MockMvc mockMvc; + + public static String getContent(String fileName){ + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/Car.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/Car.groovy new file mode 100644 index 000000000..ebe64a6b7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/Car.groovy @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1 + +class Car { + Long id + + String name +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/CarController.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/CarController.groovy new file mode 100644 index 000000000..917285c9d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/CarController.groovy @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1 + +import org.springdoc.core.annotations.ParameterObject + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.RestController + +@RestController +class CarController { + + test.org.springdoc.api.v31.app1.CarService carService + + CarController(test.org.springdoc.api.v31.app1.CarService carService) { + this.carService = carService + } + + @GetMapping(path = 'cars/{carId}') + test.org.springdoc.api.v31.app1.Car getCar(@PathVariable(value = 'carId') Long carId) { + return carService.getCar(carId) + } + + @GetMapping(path = '/cars') + List getCars(@ParameterObject CarsFilter filter) { + return carService.getCars() + } + + static class CarsFilter { + String name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/CarService.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/CarService.groovy new file mode 100644 index 000000000..c177621b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/CarService.groovy @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1 + + +import org.springframework.stereotype.Service + +@Service +class CarService { + List getCars() { + return [ + new Car(id: 1L, name: 'Car 1'), + new Car(id: 2L, name: 'Car 2'), + new Car(id: 3L, name: 'Car 3'), + new Car(id: 4L, name: 'Car 4'), + new Car(id: 5L, name: 'Car 5'), + ] + } + + Car getCar(Long carId) { + return new Car( + id: carId, + name: "Car $carId" + ) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/OpenApiConfiguration.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/OpenApiConfiguration.groovy new file mode 100644 index 000000000..95b083178 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/OpenApiConfiguration.groovy @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1 + +import io.swagger.v3.oas.annotations.OpenAPIDefinition +import io.swagger.v3.oas.models.Components +import io.swagger.v3.oas.models.OpenAPI +import io.swagger.v3.oas.models.info.Info + +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +@OpenAPIDefinition +@Configuration +class OpenApiConfiguration { + + @Bean + OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components()) + .info( + new Info() + .title('Issue OpenAPI with Groovy') + .description('Special Groovy Metaclass Test Issue') + ) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..ce8cc1925 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import groovy.lang.MetaClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.enable-groovy=false") +public class SpringDocApp1Test extends AbstractSpringDocTest { + @BeforeAll + public static void init() { + SpringDocUtils.getConfig().removeJavaTypeToIgnore(MetaClass.class); + } + + @AfterAll + public static void clean() { + SpringDocUtils.getConfig().addJavaTypeToIgnore(MetaClass.class); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/HelloController.java new file mode 100644 index 000000000..64f15154d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/HelloController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import java.util.List; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.PageableDefault; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@PageableDefault(size = 5, sort = "name") @ParameterObject Pageable pageable) { + return null; + } + + + @GetMapping("/test1") + public String getPatientList1(@PageableDefault(size = 100, sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test2") + public String getPatientList2(@PageableDefault(size = 100, sort = "someField", + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test3") + public String getPatientList3(@PageableDefault(size = 100) + @ParameterObject Pageable pageable) { + return "bla"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/PersonDTO.java new file mode 100644 index 000000000..c4a62e445 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java new file mode 100644 index 000000000..100636623 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp10Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..71914ef53 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp11Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/TestController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/TestController.java new file mode 100644 index 000000000..28c883d48 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/TestController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +/** + * @author bnasslahsen + */ + +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/test") +public class TestController { + @PostMapping + @ApiResponse(responseCode = "200", description = "Random endpoint.") + @ResponseStatus(HttpStatus.OK) + public void testingMethod(@RequestBody TestRequest testRequest) { + System.out.println("Method was run!"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/TestRequest.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/TestRequest.java new file mode 100644 index 000000000..87325d36a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app11/TestRequest.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +/** + * @author bnasslahsen + */ + +import java.util.Map; + +import io.swagger.v3.oas.annotations.media.Schema; + +public class TestRequest { + @Schema(description = "Joe was here with a tuna melt!") + private String joeWasHere; + + @Schema(description = "This is an example of a map that does not work.!") + private Map testingTheMap; + + public String getJoeWasHere() { return joeWasHere; } + public void setJoeWasHere(String joeWasHere) { this.joeWasHere = joeWasHere; } + public Map getTestingTheMap() { return testingTheMap; } + public void setTestingTheMap(Map testingTheMap) { this.testingTheMap = testingTheMap; } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/GlobalExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/GlobalExceptionHandler.java new file mode 100644 index 000000000..58ad154f0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/GlobalExceptionHandler.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app191; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +@ControllerAdvice +class GlobalExceptionHandler { + + @ResponseStatus(code = HttpStatus.FORBIDDEN) + @ExceptionHandler(MyException.class) + public ResponseEntity handleException(MyException myException) { + return ResponseEntity.status(HttpStatus.FORBIDDEN) + .body(myException.getMessage()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/HelloController.java new file mode 100644 index 000000000..88820dca8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/HelloController.java @@ -0,0 +1,98 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app191; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.SortDefault; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public ResponseEntity> getAllPets(@SortDefault("name") @ParameterObject Sort sort) { + return null; + } + + + @GetMapping("/test1") + public String getPatientList1(@SortDefault(sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Sort sort) { + return "bla"; + } + + @GetMapping("/test2") + public String getPatientList2(@SortDefault(sort = "someField", + direction = Direction.DESC) + @ParameterObject Sort sort) { + return "bla"; + } + + @GetMapping("/test3") + public String getPatientList3(@SortDefault(sort = { "someField", "someoTHER" }, + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping("/test4") + public String getPatientList4(@SortDefault(sort = "someField", + direction = Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + + @GetMapping(value = "/hello", produces = MediaType.TEXT_PLAIN_VALUE) + @Operation(summary = "Says hello") + public ResponseEntity getHello() { + return ResponseEntity + .status(HttpStatus.OK) + .body("Hello!"); + } + + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ExceptionHandler(RuntimeException.class) + public ResponseEntity handleException(RuntimeException runtimeException) { + return ResponseEntity + .status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(runtimeException.getMessage()); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/MyException.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/MyException.java new file mode 100644 index 000000000..7ba1f9beb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/MyException.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app191; + +public class MyException extends RuntimeException { + public MyException(String message) { + super(message); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/PersonDTO.java new file mode 100644 index 000000000..ccfbc95d5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/PersonDTO.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app191; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +public class PersonDTO { + private String email; + + private String firstName; + + private String lastName; + + public PersonDTO() { + } + + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/SpringDocApp191Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/SpringDocApp191Test.java new file mode 100644 index 000000000..af7eafa27 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app191/SpringDocApp191Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app191; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp191Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/Car.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/Car.groovy new file mode 100644 index 000000000..514b56a4e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/Car.groovy @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2 + +class Car { + Long id + + String name +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/CarController.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/CarController.groovy new file mode 100644 index 000000000..846d3a47f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/CarController.groovy @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2 + +import org.springdoc.core.annotations.ParameterObject + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.RestController + +@RestController +class CarController { + + test.org.springdoc.api.v31.app2.CarService carService + + CarController(test.org.springdoc.api.v31.app2.CarService carService) { + this.carService = carService + } + + @GetMapping(path = '/cars') + List getCars(@ParameterObject CarsFilter filter) { + return carService.getCars() + } + + static class CarsFilter { + String name; + } + + @GetMapping(path = 'cars/{carId}') + test.org.springdoc.api.v31.app2.Car getCar(@PathVariable(value = 'carId') Long carId) { + return carService.getCar(carId) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/CarService.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/CarService.groovy new file mode 100644 index 000000000..085039156 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/CarService.groovy @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2 + + +import org.springframework.stereotype.Service + +@Service +class CarService { + List getCars() { + return [ + new Car(id: 1L, name: 'Car 1'), + new Car(id: 2L, name: 'Car 2'), + new Car(id: 3L, name: 'Car 3'), + new Car(id: 4L, name: 'Car 4'), + new Car(id: 5L, name: 'Car 5'), + ] + } + + Car getCar(Long carId) { + return new Car( + id: carId, + name: "Car $carId" + ) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/OpenApiConfiguration.groovy b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/OpenApiConfiguration.groovy new file mode 100644 index 000000000..b1446eef8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/OpenApiConfiguration.groovy @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2 + +import io.swagger.v3.oas.annotations.OpenAPIDefinition +import io.swagger.v3.oas.models.Components +import io.swagger.v3.oas.models.OpenAPI +import io.swagger.v3.oas.models.info.Info + +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +@OpenAPIDefinition +@Configuration +class OpenApiConfiguration { + + @Bean + OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components()) + .info( + new Info() + .title('Issue OpenAPI with Groovy') + .description('Special Groovy Metaclass Test Issue') + ) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..11c23a735 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp2Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/DeprecatedEntity.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/DeprecatedEntity.java new file mode 100644 index 000000000..7c32aebeb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/DeprecatedEntity.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * @author bnasslahsen + */ +public class DeprecatedEntity { + @Schema(deprecated = false) + private String myNonDeprecatedField; + + @Schema(deprecated = true) + private String mydeprecatedField; + + public String getMyNonDeprecatedField() { + return myNonDeprecatedField; + } + + @Deprecated + public DeprecatedEntity setMyNonDeprecatedField(String myNonDeprecatedField) { + this.myNonDeprecatedField = myNonDeprecatedField; + return this; + } + + public String getMydeprecatedField() { + return mydeprecatedField; + } + + public void setMydeprecatedField(String mydeprecatedField) { + this.mydeprecatedField = mydeprecatedField; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/HelloController.java new file mode 100644 index 000000000..c1000c244 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import jakarta.validation.constraints.NotNull; +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.data.domain.Pageable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +public class HelloController { + + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public DeprecatedEntity getAllPets(@NotNull String toto) { + return null; + } + + @GetMapping(value = "/search2", produces = { "application/xml", "application/json" }) + public void getAllPets2(@ParameterObject Pageable pageable) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..0c8486e6f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app9; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = "springdoc.model-converters.deprecating-converter.enabled=false") +public class SpringDocApp9Test extends AbstractSpringDocTest { + + @BeforeAll + public static void init() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance(true).getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance(true)::removeConverter); + } + + @AfterAll + public static void clean() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance(true).getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance(true)::addConverter); + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app1.json rename to springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app10.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app10.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app10.json rename to springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app10.json diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app11.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app11.json rename to springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app11.json diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app191.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app191.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app191.json rename to springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app191.json diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app2.json rename to springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app9.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app9.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/app9.json rename to springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.0.1/app9.json diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app1.json new file mode 100644 index 000000000..abd4acc2a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app1.json @@ -0,0 +1,7275 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Issue OpenAPI with Groovy", + "description": "Special Groovy Metaclass Test Issue" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/cars": { + "get": { + "tags": [ + "car-controller" + ], + "operationId": "getCars", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Car" + } + } + } + } + } + } + } + }, + "/cars/{carId}": { + "get": { + "tags": [ + "car-controller" + ], + "operationId": "getCar", + "parameters": [ + { + "name": "carId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Car" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ASTNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode" + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "AnnotatedNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "AnnotationNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "classNode": { + "$ref": "#/components/schemas/ClassNode" + }, + "members": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Expression" + } + }, + "runtimeRetention": { + "type": "boolean", + "writeOnly": true + }, + "sourceRetention": { + "type": "boolean", + "writeOnly": true + }, + "classRetention": { + "type": "boolean", + "writeOnly": true + }, + "allowedTargets": { + "type": "integer", + "format": "int32", + "writeOnly": true + }, + "text": { + "type": "string" + }, + "builtIn": { + "type": "boolean" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "BlockStatement": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "statementLabels": { + "type": "array", + "items": { + "type": "string" + } + }, + "statements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, + "empty": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "variableScope": { + "$ref": "#/components/schemas/VariableScope" + }, + "statementLabel": { + "type": "string", + "deprecated": true + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "BytecodeProcessor": { + "type": "object" + }, + "CSTNode": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "root": { + "$ref": "#/components/schemas/Token" + }, + "type": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + }, + "startLine": { + "type": "integer", + "format": "int32" + }, + "startColumn": { + "type": "integer", + "format": "int32" + }, + "meaning": { + "type": "integer", + "format": "int32" + }, + "rootText": { + "type": "string" + }, + "anExpression": { + "type": "boolean" + } + } + }, + "CachedClass": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CachedField" + } + }, + "constructors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CachedConstructor" + } + }, + "methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CachedMethod" + } + }, + "cachedSuperClass": { + "$ref": "#/components/schemas/CachedClass" + }, + "hierarchy": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassInfo" + } + }, + "declaredInterfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CachedClass" + }, + "uniqueItems": true + }, + "interfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CachedClass" + }, + "uniqueItems": true + }, + "cachedClass": { + "$ref": "#/components/schemas/CachedClass" + }, + "classInfo": { + "$ref": "#/components/schemas/ClassInfo" + }, + "isArray": { + "type": "boolean" + }, + "isPrimitive": { + "type": "boolean" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "isInterface": { + "type": "boolean" + }, + "isNumber": { + "type": "boolean" + }, + "mopMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CachedMethod" + } + }, + "name": { + "type": "string" + }, + "interface": { + "type": "boolean" + }, + "primitive": { + "type": "boolean" + }, + "void": { + "type": "boolean" + }, + "typeDescription": { + "type": "string" + }, + "superClassDistance": { + "type": "integer", + "format": "int32" + }, + "newMetaMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetaMethod" + } + }, + "callSiteLoader": { + "$ref": "#/components/schemas/CallSiteClassLoader" + } + } + }, + "CachedConstructor": { + "type": "object", + "properties": { + "cachedConstructor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "typeParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "genericDeclaration": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + }, + "varArgs": { + "type": "boolean" + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "synthetic": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "annotatedType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "parameterizedType": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + }, + "varArgs": { + "type": "boolean" + }, + "namePresent": { + "type": "boolean" + }, + "declaringExecutable": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "typeParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "genericDeclaration": { + "type": "object" + }, + "annotatedBounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "typeName": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "varArgs": { + "type": "boolean" + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + } + } + }, + "implicit": { + "type": "boolean" + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "annotatedBounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "typeName": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + }, + "varArgs": { + "type": "boolean" + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "synthetic": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "annotatedType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "parameterizedType": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + }, + "varArgs": { + "type": "boolean" + }, + "namePresent": { + "type": "boolean" + }, + "declaringExecutable": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "typeParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "genericDeclaration": { + "type": "object" + }, + "annotatedBounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "typeName": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "varArgs": { + "type": "boolean" + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + } + } + }, + "implicit": { + "type": "boolean" + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "cachedClass": { + "$ref": "#/components/schemas/CachedClass" + }, + "vargsMethod": { + "type": "boolean" + } + } + }, + "CachedField": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "final": { + "type": "boolean" + }, + "static": { + "type": "boolean" + }, + "cachedField": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + }, + "genericType": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + }, + "enumConstant": { + "type": "boolean" + }, + "annotatedType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + }, + "CachedMethod": { + "type": "object", + "properties": { + "signature": { + "type": "string" + }, + "mopName": { + "type": "string" + }, + "cachedClass": { + "$ref": "#/components/schemas/CachedClass" + }, + "cachedMethod": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "typeParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotatedBounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "typeName": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + }, + "varArgs": { + "type": "boolean" + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "default": { + "type": "boolean" + }, + "genericReturnType": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + }, + "bridge": { + "type": "boolean" + }, + "defaultValue": { + "type": "object" + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "synthetic": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "annotatedType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "parameterizedType": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + }, + "varArgs": { + "type": "boolean" + }, + "namePresent": { + "type": "boolean" + }, + "declaringExecutable": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "typeParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "genericDeclaration": { + "type": "object" + }, + "annotatedBounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "typeName": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "varArgs": { + "type": "boolean" + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + } + } + }, + "implicit": { + "type": "boolean" + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "transformedMethod": { + "$ref": "#/components/schemas/CachedMethod" + }, + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "descriptor": { + "type": "string" + }, + "synthetic": { + "type": "boolean" + }, + "static": { + "type": "boolean" + }, + "declaringClass": { + "$ref": "#/components/schemas/CachedClass" + }, + "paramsCount": { + "type": "integer", + "format": "int32" + }, + "paramTypes": { + "$ref": "#/components/schemas/ParameterTypes" + }, + "public": { + "type": "boolean" + }, + "protected": { + "type": "boolean" + }, + "default": { + "type": "boolean" + }, + "abstract": { + "type": "boolean" + }, + "private": { + "type": "boolean" + }, + "cacheable": { + "type": "boolean" + }, + "vargsMethod": { + "type": "boolean" + } + } + }, + "CallSiteClassLoader": { + "type": "object", + "properties": { + "klazz": { + "type": "object", + "properties": { + "enqueued": { + "type": "boolean", + "deprecated": true + } + } + }, + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "parent": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "unnamedModule": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "classLoader": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "descriptor": { + "type": "object", + "properties": { + "open": { + "type": "boolean" + }, + "automatic": { + "type": "boolean" + } + } + }, + "named": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "nativeAccessEnabled": { + "type": "boolean" + }, + "layer": { + "type": "object" + } + } + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "unnamedModule": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "classLoader": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "descriptor": { + "type": "object", + "properties": { + "open": { + "type": "boolean" + }, + "automatic": { + "type": "boolean" + } + } + }, + "named": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "nativeAccessEnabled": { + "type": "boolean" + }, + "layer": { + "type": "object" + } + } + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "Car": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "metaClass": { + "$ref": "#/components/schemas/MetaClass", + "writeOnly": true + } + } + }, + "ClassInfo": { + "type": "object", + "properties": { + "artifactClassLoader": { + "$ref": "#/components/schemas/ClassLoaderForClassArtifacts" + }, + "hash": { + "type": "integer", + "format": "int32" + }, + "version": { + "type": "integer", + "format": "int32" + }, + "strongMetaClass": { + "$ref": "#/components/schemas/MetaClass" + }, + "weakMetaClass": { + "$ref": "#/components/schemas/MetaClass" + }, + "cachedClass": { + "$ref": "#/components/schemas/CachedClass" + }, + "modifiedExpando": { + "$ref": "#/components/schemas/ExpandoMetaClass" + }, + "metaClassForClass": { + "$ref": "#/components/schemas/MetaClass" + } + } + }, + "ClassLoaderForClassArtifacts": { + "type": "object", + "properties": { + "klazz": { + "type": "object", + "properties": { + "enqueued": { + "type": "boolean", + "deprecated": true + } + } + }, + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "parent": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "unnamedModule": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "classLoader": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "descriptor": { + "type": "object", + "properties": { + "open": { + "type": "boolean" + }, + "automatic": { + "type": "boolean" + } + } + }, + "named": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "nativeAccessEnabled": { + "type": "boolean" + }, + "layer": { + "type": "object" + } + } + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "unnamedModule": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "classLoader": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "descriptor": { + "type": "object", + "properties": { + "open": { + "type": "boolean" + }, + "automatic": { + "type": "boolean" + } + } + }, + "named": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "nativeAccessEnabled": { + "type": "boolean" + }, + "layer": { + "type": "object" + } + } + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "ClassNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "syntheticPublic": { + "type": "boolean" + }, + "interfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "mixins": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MixinNode" + } + }, + "methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FieldNode" + } + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PropertyNode" + } + }, + "fieldIndex": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/FieldNode" + } + }, + "module": { + "$ref": "#/components/schemas/ModuleNode" + }, + "compileUnit": { + "$ref": "#/components/schemas/CompileUnit" + }, + "staticClass": { + "type": "boolean" + }, + "scriptBody": { + "type": "boolean" + }, + "script": { + "type": "boolean" + }, + "superClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "innerClasses": { + "type": "object" + }, + "permittedSubclasses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "typeAnnotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "recordComponents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecordComponentNode" + } + }, + "componentType": { + "$ref": "#/components/schemas/ClassNode" + }, + "redirect": { + "$ref": "#/components/schemas/ClassNode" + }, + "annotated": { + "type": "boolean" + }, + "genericsTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GenericsType" + } + }, + "enclosingMethod": { + "$ref": "#/components/schemas/MethodNode" + }, + "interface": { + "type": "boolean" + }, + "array": { + "type": "boolean" + }, + "enum": { + "type": "boolean" + }, + "record": { + "type": "boolean" + }, + "packageName": { + "type": "string" + }, + "package": { + "$ref": "#/components/schemas/PackageNode" + }, + "declaredConstructors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConstructorNode" + } + }, + "sealed": { + "type": "boolean" + }, + "resolved": { + "type": "boolean" + }, + "abstract": { + "type": "boolean" + }, + "unresolvedName": { + "type": "string" + }, + "text": { + "type": "string" + }, + "objectInitializerStatements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, + "derivedFromGroovyObject": { + "type": "boolean" + }, + "unresolvedSuperClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "unresolvedInterfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "recordComponentNodes": { + "type": "array", + "deprecated": true, + "items": { + "$ref": "#/components/schemas/RecordComponentNode" + } + }, + "outerClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "redirectNode": { + "type": "boolean" + }, + "allDeclaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "allInterfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + }, + "uniqueItems": true + }, + "abstractMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "genericsPlaceHolder": { + "type": "boolean" + }, + "primaryClassNode": { + "type": "boolean" + }, + "usingGenerics": { + "type": "boolean" + }, + "declaredMethodsMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "outerClasses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "nameWithoutPackage": { + "type": "string" + }, + "annotationDefinition": { + "type": "boolean" + }, + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "CompilationCustomizer": { + "type": "object", + "properties": { + "phase": { + "type": "string", + "enum": [ + "INITIALIZATION", + "PARSING", + "CONVERSION", + "SEMANTIC_ANALYSIS", + "CANONICALIZATION", + "INSTRUCTION_SELECTION", + "CLASS_GENERATION", + "OUTPUT", + "FINALIZATION" + ] + } + } + }, + "CompileUnit": { + "type": "object", + "properties": { + "config": { + "$ref": "#/components/schemas/CompilerConfiguration" + }, + "codeSource": { + "type": "object", + "properties": { + "location": { + "type": "string", + "format": "url" + }, + "certificates": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "encoded": { + "type": "string", + "format": "byte" + }, + "publicKey": { + "type": "object", + "properties": { + "encoded": { + "type": "string", + "format": "byte" + }, + "format": { + "type": "string" + }, + "algorithm": { + "type": "string" + } + } + } + } + } + }, + "codeSigners": { + "type": "array", + "items": { + "type": "object", + "properties": { + "signerCertPath": { + "type": "object", + "properties": { + "encodings": { + "type": "object" + }, + "certificates": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "encoded": { + "type": "string", + "format": "byte" + }, + "publicKey": { + "type": "object", + "properties": { + "encoded": { + "type": "string", + "format": "byte" + }, + "format": { + "type": "string" + }, + "algorithm": { + "type": "string" + } + } + } + } + } + }, + "type": { + "type": "string" + }, + "encoded": { + "type": "string", + "format": "byte" + } + } + }, + "timestamp": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time" + }, + "signerCertPath": { + "type": "object", + "properties": { + "encodings": { + "type": "object" + }, + "certificates": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "encoded": { + "type": "string", + "format": "byte" + }, + "publicKey": { + "type": "object", + "properties": { + "encoded": { + "type": "string", + "format": "byte" + }, + "format": { + "type": "string" + }, + "algorithm": { + "type": "string" + } + } + } + } + } + }, + "type": { + "type": "string" + }, + "encoded": { + "type": "string", + "format": "byte" + } + } + } + } + } + } + } + } + } + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "modules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModuleNode" + } + }, + "classes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "classesToCompile": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "generatedInnerClasses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/InnerClassNode" + } + }, + "classLoader": { + "$ref": "#/components/schemas/GroovyClassLoader" + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "CompilerConfiguration": { + "type": "object", + "properties": { + "warningLevel": { + "type": "integer", + "format": "int32" + }, + "sourceEncoding": { + "type": "string" + }, + "output": { + "type": "object", + "deprecated": true + }, + "targetDirectory": { + "type": "string", + "format": "binary" + }, + "classpath": { + "type": "array", + "items": { + "type": "string" + } + }, + "verbose": { + "type": "boolean" + }, + "debug": { + "type": "boolean" + }, + "parameters": { + "type": "boolean" + }, + "tolerance": { + "type": "integer", + "format": "int32" + }, + "scriptBaseClass": { + "type": "string" + }, + "pluginFactory": { + "$ref": "#/components/schemas/ParserPluginFactory" + }, + "defaultScriptExtension": { + "type": "string" + }, + "scriptExtensions": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "recompileGroovySource": { + "type": "boolean" + }, + "minimumRecompilationInterval": { + "type": "integer", + "format": "int32" + }, + "targetBytecode": { + "type": "string" + }, + "previewFeatures": { + "type": "boolean" + }, + "logClassgen": { + "type": "boolean" + }, + "logClassgenStackTraceMaxDepth": { + "type": "integer", + "format": "int32" + }, + "jointCompilationOptions": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "optimizationOptions": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "compilationCustomizers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CompilationCustomizer" + } + }, + "disabledGlobalASTTransformations": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "bytecodePostprocessor": { + "$ref": "#/components/schemas/BytecodeProcessor" + }, + "targetBytecodeIfValid": { + "type": "string", + "writeOnly": true + }, + "runtimeGroovydocEnabled": { + "type": "boolean" + }, + "indyEnabled": { + "type": "boolean" + }, + "targetDirectorySafe": { + "type": "string", + "writeOnly": true + }, + "classpathList": { + "type": "array", + "items": { + "type": "string" + }, + "writeOnly": true + }, + "bytecodeVersion": { + "type": "integer", + "format": "int32" + }, + "groovydocEnabled": { + "type": "boolean" + } + } + }, + "ConstructorNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "syntheticPublic": { + "type": "boolean" + }, + "returnType": { + "$ref": "#/components/schemas/ClassNode" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "code": { + "$ref": "#/components/schemas/Statement" + }, + "dynamicReturnType": { + "type": "boolean" + }, + "variableScope": { + "$ref": "#/components/schemas/VariableScope" + }, + "exceptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "genericsTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GenericsType" + } + }, + "typeDescriptor": { + "type": "string" + }, + "constructor": { + "type": "boolean" + }, + "final": { + "type": "boolean" + }, + "static": { + "type": "boolean" + }, + "public": { + "type": "boolean" + }, + "protected": { + "type": "boolean" + }, + "default": { + "type": "boolean" + }, + "abstract": { + "type": "boolean" + }, + "private": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "voidMethod": { + "type": "boolean" + }, + "packageScope": { + "type": "boolean" + }, + "scriptBody": { + "type": "boolean" + }, + "firstStatement": { + "$ref": "#/components/schemas/Statement" + }, + "staticConstructor": { + "type": "boolean" + }, + "annotationDefault": { + "type": "boolean", + "writeOnly": true + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "ErrorCollector": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Message" + } + }, + "warnings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WarningMessage" + } + }, + "configuration": { + "$ref": "#/components/schemas/CompilerConfiguration" + }, + "errorCount": { + "type": "integer", + "format": "int32" + }, + "lastError": { + "$ref": "#/components/schemas/Message" + }, + "warningCount": { + "type": "integer", + "format": "int32" + } + } + }, + "ExpandoMetaClass": { + "type": "object", + "properties": { + "theCachedClass": { + "$ref": "#/components/schemas/CachedClass" + }, + "additionalMetaMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetaMethod" + } + }, + "registry": { + "$ref": "#/components/schemas/MetaClassRegistry" + }, + "classNode": { + "$ref": "#/components/schemas/ClassNode" + }, + "initialized": { + "type": "boolean", + "writeOnly": true + }, + "permissivePropertyAccess": { + "type": "boolean" + }, + "modified": { + "type": "boolean" + }, + "inRegistry": { + "type": "boolean" + }, + "expandoSubclassMethods": { + "type": "array", + "items": { + "type": "object" + } + }, + "expandoProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetaProperty" + } + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetaProperty" + } + }, + "metaClass": { + "$ref": "#/components/schemas/MetaClass", + "writeOnly": true + }, + "version": { + "type": "integer", + "format": "int32" + }, + "classInfo": { + "$ref": "#/components/schemas/ClassInfo" + }, + "groovyObject": { + "type": "boolean" + }, + "upProperties": { + "type": "array", + "items": { + "type": "object", + "properties": { + "expert": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "preferred": { + "type": "boolean" + }, + "shortDescription": { + "type": "string" + }, + "name": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "bound": { + "type": "boolean" + }, + "constrained": { + "type": "boolean" + }, + "readMethod": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "typeParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotatedBounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "typeName": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + }, + "varArgs": { + "type": "boolean" + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "default": { + "type": "boolean" + }, + "genericReturnType": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + }, + "bridge": { + "type": "boolean" + }, + "defaultValue": { + "type": "object" + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "synthetic": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "annotatedType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "parameterizedType": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + }, + "varArgs": { + "type": "boolean" + }, + "namePresent": { + "type": "boolean" + }, + "declaringExecutable": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "typeParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "genericDeclaration": { + "type": "object" + }, + "annotatedBounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "typeName": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "varArgs": { + "type": "boolean" + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + } + } + }, + "implicit": { + "type": "boolean" + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "writeMethod": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "typeParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotatedBounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "typeName": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + }, + "varArgs": { + "type": "boolean" + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "default": { + "type": "boolean" + }, + "genericReturnType": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + }, + "bridge": { + "type": "boolean" + }, + "defaultValue": { + "type": "object" + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "synthetic": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "annotatedType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "parameterizedType": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + }, + "varArgs": { + "type": "boolean" + }, + "namePresent": { + "type": "boolean" + }, + "declaringExecutable": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "typeParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "genericDeclaration": { + "type": "object" + }, + "annotatedBounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "name": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "typeName": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "synthetic": { + "type": "boolean" + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "varArgs": { + "type": "boolean" + }, + "annotatedParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "parameterCount": { + "type": "integer", + "format": "int32" + }, + "parameterAnnotations": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "genericParameterTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "genericExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + }, + "annotatedReturnType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "accessible": { + "type": "boolean", + "deprecated": true + } + } + }, + "implicit": { + "type": "boolean" + } + } + } + }, + "annotatedReceiverType": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + }, + "annotatedExceptionTypes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "type": { + "type": "object", + "properties": { + "typeName": { + "type": "string" + } + } + } + } + } + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + }, + "writeOnly": true + } + } + }, + "Expression": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "type": { + "$ref": "#/components/schemas/ClassNode" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "FieldNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "type": { + "$ref": "#/components/schemas/ClassNode" + }, + "owner": { + "$ref": "#/components/schemas/ClassNode" + }, + "initialValueExpression": { + "$ref": "#/components/schemas/Expression" + }, + "dynamicTyped": { + "type": "boolean" + }, + "holder": { + "type": "boolean" + }, + "originType": { + "$ref": "#/components/schemas/ClassNode" + }, + "enum": { + "type": "boolean" + }, + "final": { + "type": "boolean" + }, + "static": { + "type": "boolean" + }, + "public": { + "type": "boolean" + }, + "protected": { + "type": "boolean" + }, + "volatile": { + "type": "boolean" + }, + "private": { + "type": "boolean" + }, + "closureSharedVariable": { + "type": "boolean", + "deprecated": true + }, + "initialExpression": { + "$ref": "#/components/schemas/Expression" + }, + "inStaticContext": { + "type": "boolean" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "GenericsType": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "name": { + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ClassNode" + }, + "lowerBound": { + "$ref": "#/components/schemas/ClassNode" + }, + "upperBounds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "placeholder": { + "type": "boolean" + }, + "resolved": { + "type": "boolean" + }, + "wildcard": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "GroovyClassLoader": { + "type": "object", + "properties": { + "resourceLoader": { + "$ref": "#/components/schemas/GroovyResourceLoader" + }, + "shouldRecompile": { + "type": "boolean" + }, + "urls": { + "type": "array", + "items": { + "type": "string", + "format": "url" + } + }, + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "parent": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "unnamedModule": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "classLoader": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "descriptor": { + "type": "object", + "properties": { + "open": { + "type": "boolean" + }, + "automatic": { + "type": "boolean" + } + } + }, + "named": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "nativeAccessEnabled": { + "type": "boolean" + }, + "layer": { + "type": "object" + } + } + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "unnamedModule": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "classLoader": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "registeredAsParallelCapable": { + "type": "boolean" + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "descriptor": { + "type": "object", + "properties": { + "open": { + "type": "boolean" + }, + "automatic": { + "type": "boolean" + } + } + }, + "named": { + "type": "boolean" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "nativeAccessEnabled": { + "type": "boolean" + }, + "layer": { + "type": "object" + } + } + }, + "definedPackages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "declaredAnnotations": { + "type": "array", + "items": { + "type": "object" + } + }, + "sealed": { + "type": "boolean" + }, + "specificationTitle": { + "type": "string" + }, + "specificationVersion": { + "type": "string" + }, + "specificationVendor": { + "type": "string" + }, + "implementationTitle": { + "type": "string" + }, + "implementationVersion": { + "type": "string" + }, + "implementationVendor": { + "type": "string" + } + } + } + }, + "defaultAssertionStatus": { + "type": "boolean", + "writeOnly": true + } + } + }, + "GroovyResourceLoader": { + "type": "object" + }, + "Groovydoc": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "tagList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroovydocTag" + } + }, + "holder": { + "$ref": "#/components/schemas/GroovydocHolder" + }, + "present": { + "type": "boolean" + } + } + }, + "GroovydocHolder": { + "type": "object", + "properties": { + "instance": { + "type": "object" + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + } + } + }, + "GroovydocTag": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "content": { + "type": "string" + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + } + } + }, + "ImportNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "type": { + "$ref": "#/components/schemas/ClassNode" + }, + "alias": { + "type": "string" + }, + "fieldName": { + "type": "string" + }, + "packageName": { + "type": "string" + }, + "static": { + "type": "boolean" + }, + "className": { + "type": "string" + }, + "text": { + "type": "string" + }, + "star": { + "type": "boolean" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "InnerClassNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "syntheticPublic": { + "type": "boolean" + }, + "interfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FieldNode" + } + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PropertyNode" + } + }, + "fieldIndex": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/FieldNode" + } + }, + "module": { + "$ref": "#/components/schemas/ModuleNode" + }, + "compileUnit": { + "$ref": "#/components/schemas/CompileUnit" + }, + "staticClass": { + "type": "boolean" + }, + "scriptBody": { + "type": "boolean" + }, + "script": { + "type": "boolean" + }, + "superClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "innerClasses": { + "type": "object" + }, + "permittedSubclasses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "typeAnnotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "recordComponents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecordComponentNode" + } + }, + "componentType": { + "$ref": "#/components/schemas/ClassNode" + }, + "redirect": { + "$ref": "#/components/schemas/ClassNode" + }, + "annotated": { + "type": "boolean" + }, + "genericsTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GenericsType" + } + }, + "enclosingMethod": { + "$ref": "#/components/schemas/MethodNode" + }, + "outerClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "anonymous": { + "type": "boolean" + }, + "outerMostClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "variableScope": { + "$ref": "#/components/schemas/VariableScope" + }, + "interface": { + "type": "boolean" + }, + "array": { + "type": "boolean" + }, + "enum": { + "type": "boolean" + }, + "record": { + "type": "boolean" + }, + "packageName": { + "type": "string" + }, + "package": { + "$ref": "#/components/schemas/PackageNode" + }, + "declaredConstructors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConstructorNode" + } + }, + "sealed": { + "type": "boolean" + }, + "resolved": { + "type": "boolean" + }, + "abstract": { + "type": "boolean" + }, + "unresolvedName": { + "type": "string" + }, + "text": { + "type": "string" + }, + "objectInitializerStatements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, + "derivedFromGroovyObject": { + "type": "boolean" + }, + "unresolvedSuperClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "unresolvedInterfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "recordComponentNodes": { + "type": "array", + "deprecated": true, + "items": { + "$ref": "#/components/schemas/RecordComponentNode" + } + }, + "redirectNode": { + "type": "boolean" + }, + "allDeclaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "allInterfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + }, + "uniqueItems": true + }, + "abstractMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "genericsPlaceHolder": { + "type": "boolean" + }, + "primaryClassNode": { + "type": "boolean" + }, + "usingGenerics": { + "type": "boolean" + }, + "declaredMethodsMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "outerClasses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "nameWithoutPackage": { + "type": "string" + }, + "annotationDefinition": { + "type": "boolean" + }, + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "Message": { + "type": "object" + }, + "MetaClass": { + "type": "object", + "properties": { + "methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetaMethod" + } + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetaProperty" + } + }, + "classNode": { + "$ref": "#/components/schemas/ClassNode" + }, + "metaMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetaMethod" + } + } + } + }, + "MetaClassCreationHandle": { + "type": "object", + "properties": { + "disableCustomMetaClassLookup": { + "type": "boolean" + } + } + }, + "MetaClassRegistry": { + "type": "object", + "properties": { + "metaClassCreationHandler": { + "$ref": "#/components/schemas/MetaClassCreationHandle" + }, + "metaClassCreationHandle": { + "$ref": "#/components/schemas/MetaClassCreationHandle", + "writeOnly": true + }, + "metaClassRegistryChangeEventListeners": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetaClassRegistryChangeEventListener" + } + } + } + }, + "MetaClassRegistryChangeEventListener": { + "type": "object" + }, + "MetaMethod": { + "type": "object", + "properties": { + "parameterTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CachedClass" + } + }, + "signature": { + "type": "string" + }, + "mopName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "descriptor": { + "type": "string" + }, + "static": { + "type": "boolean" + }, + "declaringClass": { + "$ref": "#/components/schemas/CachedClass" + }, + "public": { + "type": "boolean" + }, + "protected": { + "type": "boolean" + }, + "default": { + "type": "boolean" + }, + "abstract": { + "type": "boolean" + }, + "private": { + "type": "boolean" + }, + "cacheable": { + "type": "boolean" + }, + "vargsMethod": { + "type": "boolean" + }, + "parametersTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CachedClass" + }, + "writeOnly": true + } + } + }, + "MetaProperty": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + } + } + }, + "MethodNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "syntheticPublic": { + "type": "boolean" + }, + "returnType": { + "$ref": "#/components/schemas/ClassNode" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "code": { + "$ref": "#/components/schemas/Statement" + }, + "dynamicReturnType": { + "type": "boolean" + }, + "variableScope": { + "$ref": "#/components/schemas/VariableScope" + }, + "exceptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "genericsTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GenericsType" + } + }, + "typeDescriptor": { + "type": "string" + }, + "constructor": { + "type": "boolean" + }, + "final": { + "type": "boolean" + }, + "static": { + "type": "boolean" + }, + "public": { + "type": "boolean" + }, + "protected": { + "type": "boolean" + }, + "default": { + "type": "boolean" + }, + "abstract": { + "type": "boolean" + }, + "private": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "voidMethod": { + "type": "boolean" + }, + "packageScope": { + "type": "boolean" + }, + "scriptBody": { + "type": "boolean" + }, + "firstStatement": { + "$ref": "#/components/schemas/Statement" + }, + "staticConstructor": { + "type": "boolean" + }, + "annotationDefault": { + "type": "boolean", + "writeOnly": true + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "MixinNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "syntheticPublic": { + "type": "boolean" + }, + "interfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FieldNode" + } + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PropertyNode" + } + }, + "fieldIndex": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/FieldNode" + } + }, + "module": { + "$ref": "#/components/schemas/ModuleNode" + }, + "compileUnit": { + "$ref": "#/components/schemas/CompileUnit" + }, + "staticClass": { + "type": "boolean" + }, + "scriptBody": { + "type": "boolean" + }, + "script": { + "type": "boolean" + }, + "superClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "innerClasses": { + "type": "object" + }, + "permittedSubclasses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "typeAnnotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "recordComponents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecordComponentNode" + } + }, + "componentType": { + "$ref": "#/components/schemas/ClassNode" + }, + "redirect": { + "$ref": "#/components/schemas/ClassNode" + }, + "annotated": { + "type": "boolean" + }, + "genericsTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GenericsType" + } + }, + "enclosingMethod": { + "$ref": "#/components/schemas/MethodNode" + }, + "interface": { + "type": "boolean" + }, + "array": { + "type": "boolean" + }, + "enum": { + "type": "boolean" + }, + "record": { + "type": "boolean" + }, + "packageName": { + "type": "string" + }, + "package": { + "$ref": "#/components/schemas/PackageNode" + }, + "declaredConstructors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConstructorNode" + } + }, + "sealed": { + "type": "boolean" + }, + "resolved": { + "type": "boolean" + }, + "abstract": { + "type": "boolean" + }, + "unresolvedName": { + "type": "string" + }, + "text": { + "type": "string" + }, + "objectInitializerStatements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, + "derivedFromGroovyObject": { + "type": "boolean" + }, + "unresolvedSuperClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "unresolvedInterfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "recordComponentNodes": { + "type": "array", + "deprecated": true, + "items": { + "$ref": "#/components/schemas/RecordComponentNode" + } + }, + "outerClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "redirectNode": { + "type": "boolean" + }, + "allDeclaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "allInterfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + }, + "uniqueItems": true + }, + "abstractMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "genericsPlaceHolder": { + "type": "boolean" + }, + "primaryClassNode": { + "type": "boolean" + }, + "usingGenerics": { + "type": "boolean" + }, + "declaredMethodsMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "outerClasses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "nameWithoutPackage": { + "type": "string" + }, + "annotationDefinition": { + "type": "boolean" + }, + "plainNodeReference": { + "$ref": "#/components/schemas/ClassNode" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "ModuleNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "classes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClassNode" + } + }, + "methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodNode" + } + }, + "imports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImportNode" + } + }, + "starImports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImportNode" + } + }, + "staticImports": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ImportNode" + } + }, + "staticStarImports": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ImportNode" + } + }, + "unit": { + "$ref": "#/components/schemas/CompileUnit" + }, + "description": { + "type": "string" + }, + "importsResolved": { + "type": "boolean", + "writeOnly": true + }, + "mainClassName": { + "type": "string" + }, + "statementBlock": { + "$ref": "#/components/schemas/BlockStatement" + }, + "packageName": { + "type": "string" + }, + "empty": { + "type": "boolean" + }, + "package": { + "$ref": "#/components/schemas/PackageNode" + }, + "context": { + "$ref": "#/components/schemas/SourceUnit" + }, + "scriptBaseClassFromConfig": { + "$ref": "#/components/schemas/ClassNode" + }, + "scriptClassDummy": { + "$ref": "#/components/schemas/ClassNode" + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "PackageNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "text": { + "type": "string" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "Parameter": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "type": { + "$ref": "#/components/schemas/ClassNode" + }, + "name": { + "type": "string" + }, + "originType": { + "$ref": "#/components/schemas/ClassNode" + }, + "dynamicTyped": { + "type": "boolean" + }, + "defaultValue": { + "$ref": "#/components/schemas/Expression" + }, + "inStaticContext": { + "type": "boolean" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "closureSharedVariable": { + "type": "boolean" + }, + "initialExpression": { + "$ref": "#/components/schemas/Expression" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "ParameterTypes": { + "type": "object", + "properties": { + "vargsMethod": { + "type": "boolean" + } + } + }, + "ParserPluginFactory": { + "type": "object" + }, + "PropertyNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "field": { + "$ref": "#/components/schemas/FieldNode" + }, + "getterBlock": { + "$ref": "#/components/schemas/Statement" + }, + "setterBlock": { + "$ref": "#/components/schemas/Statement" + }, + "getterName": { + "type": "string" + }, + "setterName": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "type": { + "$ref": "#/components/schemas/ClassNode" + }, + "name": { + "type": "string" + }, + "static": { + "type": "boolean" + }, + "public": { + "type": "boolean" + }, + "private": { + "type": "boolean" + }, + "closureSharedVariable": { + "type": "boolean", + "deprecated": true + }, + "dynamicTyped": { + "type": "boolean" + }, + "originType": { + "$ref": "#/components/schemas/ClassNode" + }, + "getterNameOrDefault": { + "type": "string" + }, + "setterNameOrDefault": { + "type": "string" + }, + "initialExpression": { + "$ref": "#/components/schemas/Expression" + }, + "inStaticContext": { + "type": "boolean" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "ReaderSource": { + "type": "object", + "properties": { + "uri": { + "type": "string", + "format": "uri" + }, + "reader": { + "type": "object" + } + } + }, + "RecordComponentNode": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnnotationNode" + } + }, + "declaringClass": { + "$ref": "#/components/schemas/ClassNode" + }, + "synthetic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ClassNode" + }, + "instance": { + "$ref": "#/components/schemas/AnnotatedNode" + }, + "hasNoRealSourcePosition": { + "type": "boolean", + "writeOnly": true + }, + "groovydoc": { + "$ref": "#/components/schemas/Groovydoc" + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "Reduction": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "root": { + "$ref": "#/components/schemas/Token" + }, + "anExpression": { + "type": "boolean" + }, + "type": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + }, + "startLine": { + "type": "integer", + "format": "int32" + }, + "startColumn": { + "type": "integer", + "format": "int32" + }, + "meaning": { + "type": "integer", + "format": "int32" + }, + "rootText": { + "type": "string" + } + } + }, + "SourceUnit": { + "type": "object", + "properties": { + "phase": { + "type": "integer", + "format": "int32" + }, + "phaseComplete": { + "type": "boolean" + }, + "configuration": { + "$ref": "#/components/schemas/CompilerConfiguration" + }, + "classLoader": { + "$ref": "#/components/schemas/GroovyClassLoader" + }, + "errorCollector": { + "$ref": "#/components/schemas/ErrorCollector" + }, + "source": { + "$ref": "#/components/schemas/ReaderSource" + }, + "name": { + "type": "string" + }, + "cst": { + "$ref": "#/components/schemas/Reduction" + }, + "ast": { + "$ref": "#/components/schemas/ModuleNode" + }, + "phaseDescription": { + "type": "string" + } + } + }, + "Statement": { + "type": "object", + "properties": { + "lineNumber": { + "type": "integer", + "format": "int32" + }, + "columnNumber": { + "type": "integer", + "format": "int32" + }, + "lastLineNumber": { + "type": "integer", + "format": "int32" + }, + "lastColumnNumber": { + "type": "integer", + "format": "int32" + }, + "metaDataMap": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "statementLabels": { + "type": "array", + "items": { + "type": "string" + } + }, + "empty": { + "type": "boolean" + }, + "statementLabel": { + "type": "string", + "deprecated": true + }, + "text": { + "type": "string" + }, + "sourcePosition": { + "$ref": "#/components/schemas/ASTNode", + "writeOnly": true + }, + "nodeMetaData": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "Token": { + "type": "object", + "properties": { + "type": { + "type": "integer", + "format": "int32" + }, + "meaning": { + "type": "integer", + "format": "int32" + }, + "text": { + "type": "string" + }, + "startLine": { + "type": "integer", + "format": "int32" + }, + "startColumn": { + "type": "integer", + "format": "int32" + }, + "root": { + "$ref": "#/components/schemas/Token" + }, + "rootText": { + "type": "string" + }, + "empty": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "anExpression": { + "type": "boolean" + } + } + }, + "Variable": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "modifiers": { + "type": "integer", + "format": "int32" + }, + "type": { + "$ref": "#/components/schemas/ClassNode" + }, + "closureSharedVariable": { + "type": "boolean" + }, + "dynamicTyped": { + "type": "boolean" + }, + "originType": { + "$ref": "#/components/schemas/ClassNode" + }, + "initialExpression": { + "$ref": "#/components/schemas/Expression" + }, + "inStaticContext": { + "type": "boolean" + } + } + }, + "VariableScope": { + "type": "object", + "properties": { + "parent": { + "$ref": "#/components/schemas/VariableScope" + }, + "classScope": { + "$ref": "#/components/schemas/ClassNode" + }, + "inStaticContext": { + "type": "boolean" + }, + "declaredVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Variable" + } + }, + "referencedClassVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Variable" + } + }, + "root": { + "type": "boolean" + }, + "declaredVariablesIterator": { + "type": "object" + }, + "referencedLocalVariablesCount": { + "type": "integer", + "format": "int32" + }, + "referencedLocalVariablesIterator": { + "type": "object" + }, + "referencedClassVariablesIterator": { + "type": "object" + } + } + }, + "WarningMessage": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "context": { + "$ref": "#/components/schemas/CSTNode" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app10.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app10.json new file mode 100644 index 000000000..7a7ea671d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app10.json @@ -0,0 +1,278 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList3", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 100 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList2", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 100 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "someField,DESC" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList1", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 100 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "someField,DESC", + "someoTHER,DESC" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 5 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "name,ASC" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app11.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app11.json new file mode 100644 index 000000000..5ddab455a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app11.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "test-controller" + ], + "operationId": "testingMethod", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Random endpoint." + } + } + } + } + }, + "components": { + "schemas": { + "TestRequest": { + "type": "object", + "properties": { + "joeWasHere": { + "type": "string", + "description": "Joe was here with a tuna melt!" + }, + "testingTheMap": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "This is an example of a map that does not work.!" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app191.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app191.json new file mode 100644 index 000000000..cd49babb2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app191.json @@ -0,0 +1,416 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test4": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList4", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "someField,DESC" + ] + } + } + ], + "responses": { + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList3", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "someField,DESC", + "someoTHER,DESC" + ] + } + } + ], + "responses": { + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList2", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "someField,DESC" + ] + } + } + ], + "responses": { + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList1", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "someField,DESC", + "someoTHER,DESC" + ] + } + } + ], + "responses": { + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "name,ASC" + ] + } + } + ], + "responses": { + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Says hello", + "operationId": "getHello", + "responses": { + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app2.json new file mode 100644 index 000000000..9a6d39f7c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app2.json @@ -0,0 +1,95 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Issue OpenAPI with Groovy", + "description": "Special Groovy Metaclass Test Issue" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/cars": { + "get": { + "tags": [ + "car-controller" + ], + "operationId": "getCars", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Car" + } + } + } + } + } + } + } + }, + "/cars/{carId}": { + "get": { + "tags": [ + "car-controller" + ], + "operationId": "getCar", + "parameters": [ + { + "name": "carId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Car" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Car": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app9.json b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app9.json new file mode 100644 index 000000000..04ec4dda2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/src/test/resources/results/3.1.0/app9.json @@ -0,0 +1,115 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets", + "parameters": [ + { + "name": "toto", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/DeprecatedEntity" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeprecatedEntity" + } + } + } + } + } + } + }, + "/search2": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getAllPets2", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Zero-based page index (0..N)", + "required": false, + "schema": { + "minimum": 0, + "type": "integer", + "default": 0 + } + }, + { + "name": "size", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "minimum": 1, + "type": "integer", + "default": 20 + } + }, + { + "name": "sort", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "DeprecatedEntity": { + "type": "object", + "properties": { + "myNonDeprecatedField": { + "type": "string" + }, + "mydeprecatedField": { + "type": "string", + "deprecated": true + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index c5a3f253e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@ActiveProfiles("test") -@SpringBootTest -@AutoConfigureMockMvc -@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) -public abstract class AbstractSpringDocTest { - - public static String className; - - @Autowired - protected MockMvc mockMvc; - - public static String getContent(String fileName) { - try { - Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } - - @Test - protected void testApp() throws Exception { - className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - Path path = Paths.get(getClass().getClassLoader().getResource("results/app" + testNumber + ".json").toURI()); - byte[] fileBytes = Files.readAllBytes(path); - String expected = new String(fileBytes); - assertEquals(expected, result, true); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/DatabaseLoader.java deleted file mode 100644 index 019739022..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/DatabaseLoader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app1; - -import org.springframework.boot.CommandLineRunner; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Component; - -/** - * Pre-load some data using a Spring Boot {@link CommandLineRunner}. - * - * @author Greg Turnquist - */ -@Component -class DatabaseLoader { - - /** - * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app - * is operational, the database will be up. - * - * @param repository - */ - @Bean - CommandLineRunner init(EmployeeRepository repository) { - - return args -> { - repository.save(new Employee("Frodo", "Baggins", "ring bearer")); - repository.save(new Employee("Bilbo", "Baggins", "burglar")); - }; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/Employee.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/Employee.java deleted file mode 100644 index 249032474..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/Employee.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app1; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - - * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class - * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA - * {@code @AllArgsConstructor} - Create a constructor with all args to support testing - * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. - * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows - * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without - * adjustment. - * - * @author Greg Turnquist - */ -@Data -@Entity -@NoArgsConstructor(access = AccessLevel.PRIVATE) -@AllArgsConstructor -class Employee { - - @Id - @GeneratedValue - private Long id; - - private String firstName; - - private String lastName; - - private String role; - - /** - * Useful constructor when id is not yet known. - * - * @param firstName - * @param lastName - * @param role - */ - Employee(String firstName, String lastName, String role) { - - this.firstName = firstName; - this.lastName = lastName; - this.role = role; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/EmployeeController.java deleted file mode 100644 index b237cb7be..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/EmployeeController.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app1; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.List; -import java.util.stream.StreamSupport; - -import org.springframework.hateoas.CollectionModel; -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.IanaLinkRelations; -import org.springframework.hateoas.Link; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; - -/** - * Spring Web {@link RestController} used to generate a REST API. - * - * @author Greg Turnquist - */ -@RestController -class EmployeeController { - - private final EmployeeRepository repository; - - EmployeeController(EmployeeRepository repository) { - this.repository = repository; - } - - /** - * Look up all employees, and transform them into a REST collection resource. Then return them through Spring Web's - * {@link ResponseEntity} fluent API. - */ - @GetMapping("/employees") - ResponseEntity>> findAll() { - - List> employees = StreamSupport.stream(repository.findAll().spliterator(), false) - .map(employee -> EntityModel.of(employee, // - linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // - linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // - .toList(); - - return ResponseEntity.ok( // - CollectionModel.of(employees, // - linkTo(methodOn(EmployeeController.class).findAll()).withSelfRel())); - } - - @PostMapping("/employees") - @ResponseStatus(HttpStatus.CREATED) - ResponseEntity> newEmployee(@RequestBody Employee employee) { - - try { - Employee savedEmployee = repository.save(employee); - - EntityModel employeeResource = EntityModel.of(savedEmployee, // - linkTo(methodOn(EmployeeController.class).findOne(savedEmployee.getId())).withSelfRel()); - - return ResponseEntity // - .created(new URI(employeeResource.getRequiredLink(IanaLinkRelations.SELF).getHref())) // - .body(employeeResource); - } - catch (URISyntaxException e) { - return ResponseEntity.badRequest().body(null); - } - } - - /** - * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's - * {@link ResponseEntity} fluent API. - * - * @param id - */ - @GetMapping("/employees/{id}") - ResponseEntity> findOne(@PathVariable long id) { - - return repository.findById(id) // - .map(employee -> EntityModel.of(employee, // - linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // - linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // - .map(ResponseEntity::ok) // - .orElse(ResponseEntity.notFound().build()); - } - - /** - * Update existing employee then return a Location header. - * - * @param employee - * @param id - * @return - */ - @PutMapping("/employees/{id}") - @ResponseStatus(HttpStatus.NO_CONTENT) - ResponseEntity updateEmployee(@RequestBody Employee employee, @PathVariable long id) throws URISyntaxException { - - Employee employeeToUpdate = employee; - employeeToUpdate.setId(id); - repository.save(employeeToUpdate); - - Link newlyCreatedLink = linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); - - return ResponseEntity.noContent().location(new URI(newlyCreatedLink.getHref())).build(); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/EmployeeRepository.java deleted file mode 100644 index 83f117020..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/EmployeeRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app1; - -import org.springframework.data.repository.CrudRepository; - -/** - * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. - * - * @author Greg Turnquist - */ -interface EmployeeRepository extends CrudRepository { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java deleted file mode 100644 index 18f22a25c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp1Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/Dummy.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/Dummy.java deleted file mode 100644 index 761794ae2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/Dummy.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app10; - -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -public class Dummy { - - private T value; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java deleted file mode 100644 index 00d143fbf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app10; - -import java.util.List; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.web.PagedModel; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@SuppressWarnings("rawtypes") -@RestController -public class HelloController { - - @GetMapping("/page-simple") - public Page pageSimple() { - return pageImpl("test"); - } - - @GetMapping("/paged-model-simple") - public PagedModel pagedModelSimple() { - return pagedModel("test"); - } - - @GetMapping("/page-complex") - public Page>> pageComplex() { - return pageImpl(new Dummy<>(List.of("test"))); - } - - @GetMapping("/paged-model-complex") - public PagedModel>> pagedModelComplex() { - return pagedModel(new Dummy<>(List.of("test"))); - } - - @GetMapping("/page-raw") - public Page pageRaw() { - return pageSimple(); - } - - @GetMapping("/paged-model-raw") - public PagedModel pagedModelRaw() { - return pagedModelSimple(); - } - - private PagedModel pagedModel(T value) { - return new PagedModel<>(pageImpl(value)); - } - - private Page pageImpl(T value) { - return new PageImpl<>(List.of(value)); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java deleted file mode 100644 index 3fee1d1e1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10DirectTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app10; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.data.web.config.EnableSpringDataWebSupport; - -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -public class SpringDocApp10DirectTest extends AbstractSpringDocTest { - - @Override - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app10-direct.json"), true)); - } - - @SpringBootApplication - @EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.DIRECT) - public static class SpringDocTestApp { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java deleted file mode 100644 index 6b1b457fb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10NotSpecifiedTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app10; - -import java.util.Optional; - -import io.swagger.v3.core.converter.ModelConverter; -import io.swagger.v3.core.converter.ModelConverters; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.springdoc.core.converters.PageOpenAPIConverter; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -public class SpringDocApp10NotSpecifiedTest extends AbstractSpringDocTest { - - - @BeforeAll - public static void init() { - Optional pageOpenAPIConverter = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof PageOpenAPIConverter).findAny(); - pageOpenAPIConverter.ifPresent(ModelConverters.getInstance()::removeConverter); - } - - @Override - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app10-direct.json"), true)); - } - - @SpringBootApplication - public static class SpringDocTestApp { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java deleted file mode 100644 index ddf6fef87..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10ViaDtoTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app10; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.data.web.config.EnableSpringDataWebSupport; - -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -public class SpringDocApp10ViaDtoTest extends AbstractSpringDocTest { - - @Override - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app10-via_dto.json"), true)); - } - - @SpringBootApplication - @EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO) - public static class SpringDocTestApp { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java deleted file mode 100644 index 1966d9749..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.model-converters.pageable-converter.enabled=true") -public class SpringDocApp2Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/config/DatabaseConfig.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/config/DatabaseConfig.java deleted file mode 100644 index ce3c41005..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/config/DatabaseConfig.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app2.config; - -import java.time.LocalDate; - -import jakarta.annotation.PostConstruct; -import lombok.RequiredArgsConstructor; -import test.org.springdoc.api.app2.entities.Post; -import test.org.springdoc.api.app2.repositories.PostRepository; - -import org.springframework.context.annotation.Configuration; - -/** - * @author Davide Pedone - * 2020 - */ -@Configuration -@RequiredArgsConstructor -public class DatabaseConfig { - - private final PostRepository postRepository; - - @PostConstruct - private void postConstruct() { - for (int i = 0; i < 33; i++) { - Post post = new Post(); - post.setAuthor("name" + i); - post.setContent("content" + i); - post.setCreatedAt(LocalDate.now().toEpochDay()); - postRepository.save(post); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/controller/PostController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/controller/PostController.java deleted file mode 100644 index d413130fa..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/controller/PostController.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app2.controller; - -import lombok.RequiredArgsConstructor; -import test.org.springdoc.api.app2.entities.Post; -import test.org.springdoc.api.app2.service.PostService; - -import org.springframework.data.domain.Pageable; -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.PagedModel; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author Davide Pedone - * 2020 - */ -@RestController -@RequiredArgsConstructor -public class PostController { - - private final PostService postService; - - @GetMapping - public ResponseEntity>> getAll(Pageable pageable) { - return new ResponseEntity<>(postService.getAll(pageable), HttpStatus.OK); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/entities/Post.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/entities/Post.java deleted file mode 100644 index 64fd0db41..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/entities/Post.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app2.entities; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author Davide Pedone - * 2020 - */ -@Data -@Entity -@NoArgsConstructor -@AllArgsConstructor -public class Post { - - @Id - @GeneratedValue - private Long id; - - private String author; - - private String content; - - private Long createdAt; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/hateoas/PostResourceAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/hateoas/PostResourceAssembler.java deleted file mode 100644 index 4ab817898..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/hateoas/PostResourceAssembler.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app2.hateoas; - - -import test.org.springdoc.api.app2.entities.Post; - -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.server.RepresentationModelAssembler; -import org.springframework.stereotype.Component; - -/** - * @author Davide Pedone - * 2020 - */ -@Component -public class PostResourceAssembler implements RepresentationModelAssembler> { - - - @Override - public EntityModel toModel(Post entity) { - return EntityModel.of(entity); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/repositories/PostRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/repositories/PostRepository.java deleted file mode 100644 index e40d48b17..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/repositories/PostRepository.java +++ /dev/null @@ -1,14 +0,0 @@ -package test.org.springdoc.api.app2.repositories; - - -import test.org.springdoc.api.app2.entities.Post; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.PagingAndSortingRepository; - -/** - * @author Davide Pedone - * 2020 - */ -public interface PostRepository extends PagingAndSortingRepository, CrudRepository { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/service/PostService.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/service/PostService.java deleted file mode 100644 index 768b3692e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app2/service/PostService.java +++ /dev/null @@ -1,35 +0,0 @@ -package test.org.springdoc.api.app2.service; - - -import lombok.RequiredArgsConstructor; -import test.org.springdoc.api.app2.entities.Post; -import test.org.springdoc.api.app2.hateoas.PostResourceAssembler; -import test.org.springdoc.api.app2.repositories.PostRepository; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.web.PagedResourcesAssembler; -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.PagedModel; -import org.springframework.stereotype.Service; - -/** - * @author Davide Pedone - * 2020 - */ -@RequiredArgsConstructor -@Service -public class PostService { - - private final PostRepository postRepository; - - private final PagedResourcesAssembler pagedResourcesAssembler; - - private final PostResourceAssembler postResourceAssembler; - - public PagedModel> getAll(Pageable pageable) { - Page postPage = postRepository.findAll(pageable); - return pagedResourcesAssembler.toModel(postPage, postResourceAssembler); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/DatabaseLoader.java deleted file mode 100644 index e3d107802..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/DatabaseLoader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app3; - -import org.springframework.boot.CommandLineRunner; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Component; - -/** - * Pre-load some data using a Spring Boot {@link CommandLineRunner}. - * - * @author Greg Turnquist - */ -@Component -class DatabaseLoader { - - /** - * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app - * is operational, the database will be up. - * - * @param repository - */ - @Bean - CommandLineRunner init(EmployeeRepository repository) { - - return args -> { - repository.save(new Employee("Frodo", "Baggins", "ring bearer")); - repository.save(new Employee("Bilbo", "Baggins", "burglar")); - }; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/Employee.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/Employee.java deleted file mode 100644 index 19ed66469..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/Employee.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app3; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - - * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class - * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA - * {@code @AllArgsConstructor} - Create a constructor with all args to support testing - * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. - * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows - * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without - * adjustment. - * - * @author Greg Turnquist - */ -@Data -@Entity -@NoArgsConstructor(access = AccessLevel.PRIVATE) -@AllArgsConstructor -class Employee { - - @Id - @GeneratedValue - private Long id; - - private String firstName; - - private String lastName; - - private String role; - - /** - * Useful constructor when id is not yet known. - * - * @param firstName - * @param lastName - * @param role - */ - Employee(String firstName, String lastName, String role) { - - this.firstName = firstName; - this.lastName = lastName; - this.role = role; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeController.java deleted file mode 100644 index 209dd8d7c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeController.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app3; - -import org.springframework.hateoas.EntityModel; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -/** - * Spring Web {@link RestController} used to generate a REST API. - * - * @author Greg Turnquist - */ -@RestController -class EmployeeController { - - /** - * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's - * {@link ResponseEntity} fluent API. - * - * @param id - */ - @GetMapping("/employees/{id}") - EntityModel findOne(@PathVariable long id) { - - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeRepository.java deleted file mode 100644 index 1de3d1b4b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/EmployeeRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app3; - -import org.springframework.data.repository.CrudRepository; - -/** - * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. - * - * @author Greg Turnquist - */ -interface EmployeeRepository extends CrudRepository { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java deleted file mode 100644 index ce9055605..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.remove-broken-reference-definitions=false") -public class SpringDocApp3Test extends AbstractSpringDocTest { - - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/SpringDocTestApp.java deleted file mode 100644 index a030eeebb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app3/SpringDocTestApp.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class SpringDocTestApp { - - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/Album.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/Album.java deleted file mode 100644 index ed3eb1a2e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/Album.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app4; - -public class Album { - - private String title; - - private String description; - - private String releaseDate; - - public Album(String title, String description, String releaseDate) { - this.title = title; - this.description = description; - this.releaseDate = releaseDate; - } - - public String getTitle() { - return title; - } - - public String getDescription() { - return description; - } - - public String getReleaseDate() { - return releaseDate; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/AlbumController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/AlbumController.java deleted file mode 100644 index 577864cb8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/AlbumController.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app4; - -import java.util.Arrays; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.web.PagedResourcesAssembler; -import org.springframework.hateoas.PagedModel; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@SuppressWarnings("unchecked") -public class AlbumController { - - @Autowired - private AlbumModelAssembler albumModelAssembler; - - @Autowired - private PagedResourcesAssembler pagedResourcesAssembler; - - @GetMapping("/api/albums") - public PagedModel getAllAlbums() { - Album album1 = new Album("album-title-1", "album-description-1", "album-release-date-1"); - Album album2 = new Album("album-title-2", "album-description-2", "album-release-date-2"); - Page albumPage = new PageImpl<>(Arrays.asList(album1, album2)); - - return pagedResourcesAssembler.toModel(albumPage, albumModelAssembler); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/AlbumModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/AlbumModelAssembler.java deleted file mode 100644 index ddbd8d84e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/AlbumModelAssembler.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app4; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.Link; -import org.springframework.hateoas.server.RepresentationModelAssembler; -import org.springframework.stereotype.Component; - -@Component -public class AlbumModelAssembler implements RepresentationModelAssembler> { - - @Override - public EntityModel toModel(Album entity) { - List links = new ArrayList<>(); - return EntityModel.of(entity, links); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java deleted file mode 100644 index 6fa3df392..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp4Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java deleted file mode 100644 index 1f9ed011d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.ObjectSchema; -import io.swagger.v3.oas.models.media.StringSchema; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -public class SpringDocApp5Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI().components(new Components() - .addSchemas("CompanyDtoNew", new ObjectSchema().addProperties("id", new StringSchema().format("uuid" - )).addProperties("name", new StringSchema()))); - } - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/controller/CompanyController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/controller/CompanyController.java deleted file mode 100644 index 2b63801d5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/controller/CompanyController.java +++ /dev/null @@ -1,31 +0,0 @@ -package test.org.springdoc.api.app5.controller; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; -import lombok.RequiredArgsConstructor; -import test.org.springdoc.api.app5.entities.CompanyDto; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author Davide Pedone - * 2020 - */ -@RestController -@RequiredArgsConstructor -public class CompanyController { - - - @PostMapping - @io.swagger.v3.oas.annotations.parameters.RequestBody( - description = "Details of the Item to be created", - content = @Content(schema = @Schema(ref = "#/components/schemas/CompanyDtoNew"))) - public CompanyDto create(@Valid @RequestBody final CompanyDto companyDto) { - - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/entities/Company.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/entities/Company.java deleted file mode 100644 index a85e15694..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/entities/Company.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app5.entities; - -import java.util.UUID; - -import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.constraints.NotNull; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import org.springframework.hateoas.RepresentationModel; -import org.springframework.hateoas.server.core.Relation; - -/** - * @author bnasslahsen - */ -@AllArgsConstructor -@Data -@Builder -@EqualsAndHashCode(callSuper = false) -@Relation(collectionRelation = "companies", itemRelation = "company") -public class Company extends RepresentationModel { - @JsonProperty(access = JsonProperty.Access.READ_ONLY) - private UUID id; - - @NotNull - private String name; -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/entities/CompanyDto.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/entities/CompanyDto.java deleted file mode 100644 index 5a7558c8e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/entities/CompanyDto.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app5.entities; - -import java.util.UUID; - -import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.constraints.NotNull; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import org.springframework.hateoas.RepresentationModel; -import org.springframework.hateoas.server.core.Relation; - -/** - * @author bnasslahsen - */ -@AllArgsConstructor -@Data -@Builder -@EqualsAndHashCode(callSuper = false) -@Relation(collectionRelation = "companies", itemRelation = "company") -public class CompanyDto extends RepresentationModel { - @JsonProperty(access = JsonProperty.Access.READ_ONLY) - private UUID id; - - @NotNull - private String name; -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/hateoas/CompanyModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/hateoas/CompanyModelAssembler.java deleted file mode 100644 index c893acbf9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app5/hateoas/CompanyModelAssembler.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app5.hateoas; - -import test.org.springdoc.api.app5.controller.CompanyController; -import test.org.springdoc.api.app5.entities.Company; -import test.org.springdoc.api.app5.entities.CompanyDto; - -import org.springframework.hateoas.server.mvc.RepresentationModelAssemblerSupport; -import org.springframework.lang.NonNull; -import org.springframework.stereotype.Component; - -/** - * @author bnasslahsen - */ -@Component -public class CompanyModelAssembler extends RepresentationModelAssemblerSupport { - - public CompanyModelAssembler() { - super(CompanyController.class, CompanyDto.class); - } - - @Override - @NonNull - public CompanyDto toModel(@NonNull final Company company) { - return CompanyDto.builder() - .id(company.getId()) - .name(company.getName()) - .build(); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java deleted file mode 100644 index 92f1dfcdd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app6; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; - -import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; -import com.fasterxml.jackson.databind.type.ClassKey; -import org.apache.commons.lang3.reflect.FieldUtils; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.springdoc.core.providers.ObjectMapperProvider; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "spring.hateoas.use-hal-as-default-json-media-type= false") -public class SpringDocApp6Test extends AbstractSpringDocTest { - - private final Map> springMixins = new HashMap<>(); - - @Autowired - ObjectMapperProvider objectMapperProvider; - - @BeforeEach - void init() throws IllegalAccessException { - SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(),"_mixIns", true); - Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); - Iterator>> iterator = _localMixIns.entrySet().iterator(); - - while (iterator.hasNext()) { - Entry> entry = iterator.next(); - if (entry.getKey().toString().startsWith("org.springframework")) { - springMixins.put(entry.getKey(), entry.getValue()); - iterator.remove(); - } - } - } - - @AfterEach - void clean() throws IllegalAccessException { - SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); - Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); - _localMixIns.putAll(springMixins); - } - - @SpringBootApplication - static class SpringDocTestApp { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/controller/ItemController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/controller/ItemController.java deleted file mode 100644 index 8b814f4fd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/controller/ItemController.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api.app6.controller; - -import java.util.List; -import java.util.stream.Stream; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import test.org.springdoc.api.app6.model.Item; - -import org.springframework.hateoas.CollectionModel; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; - -@RestController -@RequestMapping(value = "/v1/items", produces = MediaType.APPLICATION_JSON_VALUE) -@Tag(name = "Item", description = "The Item API") -public class ItemController { - - List items = Stream.of(new Item("foo"), new Item("bar")).toList(); - - @Operation(summary = "Get all items") - @GetMapping(produces = { MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getAllItems() { - - CollectionModel collection = CollectionModel.of(items); - collection.add(linkTo(methodOn(ItemController.class).getAllItems()).withSelfRel().expand()); - - return new ResponseEntity<>(collection, HttpStatus.OK); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/model/Item.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/model/Item.java deleted file mode 100644 index 9e19f22c1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app6/model/Item.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app6.model; - -import org.springframework.hateoas.Link; -import org.springframework.hateoas.RepresentationModel; - - -public class Item extends RepresentationModel { - - private String description; - - public Item(String description) { - this.description = description; - } - - public Item(Link initialLink, String description) { - super(initialLink); - this.description = description; - } - - public Item(Iterable initialLinks, String description) { - super(initialLinks); - this.description = description; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/FooConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/FooConfiguration.java deleted file mode 100644 index daa030e9b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/FooConfiguration.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app7; - -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class FooConfiguration { - @Bean - public GroupedOpenApi userOpenApi() { - String packagesToscan[] = { "test.org.springdoc.api.app7" }; - return GroupedOpenApi.builder().group("foo-service").packagesToScan(packagesToscan) - .build(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java deleted file mode 100644 index 9166a80a6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp7Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/Foo.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/Foo.java deleted file mode 100644 index 4ef52f3ac..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/Foo.java +++ /dev/null @@ -1,10 +0,0 @@ -package test.org.springdoc.api.app7.application; - -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -public class Foo { - String foo; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooController.java deleted file mode 100644 index 348e1f11e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooController.java +++ /dev/null @@ -1,33 +0,0 @@ -package test.org.springdoc.api.app7.application; - -import java.util.UUID; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.MediaTypes; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class FooController { - - private final FooService fooService; - - private final FooResourceAssembler fooResourceAssembler; - - @Autowired - public FooController( - FooService fooService, - FooResourceAssembler fooResourceAssembler) { - this.fooService = fooService; - this.fooResourceAssembler = fooResourceAssembler; - } - - @GetMapping(value = "foo/{id}", produces = MediaTypes.HAL_JSON_VALUE) - public ResponseEntity> getFoo(@PathVariable("id") UUID id) throws Exception { - Foo foo = fooService.getFoo(id).orElseThrow(Exception::new); - return ResponseEntity.ok(fooResourceAssembler.toModel(foo)); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooResourceAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooResourceAssembler.java deleted file mode 100644 index 6a08e4b23..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooResourceAssembler.java +++ /dev/null @@ -1,35 +0,0 @@ -package test.org.springdoc.api.app7.application; - -import java.util.UUID; - -import org.springframework.hateoas.CollectionModel; -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.server.SimpleRepresentationModelAssembler; -import org.springframework.stereotype.Component; - -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; - -@Component -public class FooResourceAssembler - implements SimpleRepresentationModelAssembler { - - @Override - public void addLinks(EntityModel resource) { - Foo foo = resource.getContent(); - if (foo != null) { - try { - resource.add( - linkTo(methodOn(FooController.class).getFoo(UUID.fromString(foo.getFoo()))).withSelfRel()); - } - catch (Exception e) { - throw new RuntimeException(e); - } - } - } - - @Override - public void addLinks(CollectionModel> resources) { - - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooService.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooService.java deleted file mode 100644 index 6f861e45d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app7/application/FooService.java +++ /dev/null @@ -1,13 +0,0 @@ -package test.org.springdoc.api.app7.application; - -import java.util.Optional; -import java.util.UUID; - -import org.springframework.stereotype.Service; - -@Service -public class FooService { - public Optional getFoo(UUID uuid) { - return Optional.of(new Foo(uuid.toString())); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/DatabaseLoader.java deleted file mode 100644 index 911c519e3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/DatabaseLoader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app8; - -import org.springframework.boot.CommandLineRunner; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Component; - -/** - * Pre-load some data using a Spring Boot {@link CommandLineRunner}. - * - * @author Greg Turnquist - */ -@Component -class DatabaseLoader { - - /** - * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app - * is operational, the database will be up. - * - * @param repository - */ - @Bean - CommandLineRunner init(EmployeeRepository repository) { - - return args -> { - repository.save(new Employee("Frodo", "Baggins", "ring bearer")); - repository.save(new Employee("Bilbo", "Baggins", "burglar")); - }; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/Employee.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/Employee.java deleted file mode 100644 index 2d7ff5616..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/Employee.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app8; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - - * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class - * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA - * {@code @AllArgsConstructor} - Create a constructor with all args to support testing - * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. - * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows - * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without - * adjustment. - * - * @author Greg Turnquist - */ -@Data -@Entity -@NoArgsConstructor(access = AccessLevel.PRIVATE) -@AllArgsConstructor -class Employee { - - @Id - @GeneratedValue - private Long id; - - private String firstName; - - private String lastName; - - private String role; - - /** - * Useful constructor when id is not yet known. - * - * @param firstName - * @param lastName - * @param role - */ - Employee(String firstName, String lastName, String role) { - - this.firstName = firstName; - this.lastName = lastName; - this.role = role; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/EmployeeController.java deleted file mode 100644 index 8afc7bfa6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/EmployeeController.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app8; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.List; -import java.util.stream.StreamSupport; - -import org.springframework.hateoas.CollectionModel; -import org.springframework.hateoas.EntityModel; -import org.springframework.hateoas.IanaLinkRelations; -import org.springframework.hateoas.Link; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; - -/** - * Spring Web {@link RestController} used to generate a REST API. - * - * @author Greg Turnquist - */ -@RestController -class EmployeeController { - - private final EmployeeRepository repository; - - EmployeeController(EmployeeRepository repository) { - this.repository = repository; - } - - /** - * Look up all employees, and transform them into a REST collection resource. Then return them through Spring Web's - * {@link ResponseEntity} fluent API. - */ - @GetMapping("/employees") - ResponseEntity>> findAll() { - - List> employees = StreamSupport.stream(repository.findAll().spliterator(), false) - .map(employee -> EntityModel.of(employee, // - linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // - linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // - .toList(); - - return ResponseEntity.ok( // - CollectionModel.of(employees, // - linkTo(methodOn(EmployeeController.class).findAll()).withSelfRel())); - } - - @PostMapping("/employees") - @ResponseStatus(HttpStatus.CREATED) - ResponseEntity> newEmployee(@RequestBody Employee employee) { - - try { - Employee savedEmployee = repository.save(employee); - - EntityModel employeeResource = EntityModel.of(savedEmployee, // - linkTo(methodOn(EmployeeController.class).findOne(savedEmployee.getId())).withSelfRel()); - - return ResponseEntity // - .created(new URI(employeeResource.getRequiredLink(IanaLinkRelations.SELF).getHref())) // - .body(employeeResource); - } - catch (URISyntaxException e) { - return ResponseEntity.badRequest().body(null); - } - } - - /** - * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's - * {@link ResponseEntity} fluent API. - * - * @param id - */ - @GetMapping("/employees/{id}") - ResponseEntity> findOne(@PathVariable long id) { - - return repository.findById(id) // - .map(employee -> EntityModel.of(employee, // - linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // - linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // - .map(ResponseEntity::ok) // - .orElse(ResponseEntity.notFound().build()); - } - - /** - * Update existing employee then return a Location header. - * - * @param employee - * @param id - * @return - */ - @PutMapping("/employees/{id}") - @ResponseStatus(HttpStatus.NO_CONTENT) - ResponseEntity updateEmployee(@RequestBody Employee employee, @PathVariable long id) throws URISyntaxException { - - Employee employeeToUpdate = employee; - employeeToUpdate.setId(id); - repository.save(employeeToUpdate); - - Link newlyCreatedLink = linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); - - return ResponseEntity.noContent().location(new URI(newlyCreatedLink.getHref())).build(); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/EmployeeRepository.java deleted file mode 100644 index 019db4a69..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/EmployeeRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app8; - -import org.springframework.data.repository.CrudRepository; - -/** - * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. - * - * @author Greg Turnquist - */ -interface EmployeeRepository extends CrudRepository { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java deleted file mode 100644 index 06a8048d8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app8; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; - -import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; -import com.fasterxml.jackson.databind.type.ClassKey; -import org.apache.commons.lang3.reflect.FieldUtils; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.springdoc.core.providers.ObjectMapperProvider; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.enable-hateoas=false") -public class SpringDocApp8Test extends AbstractSpringDocTest { - - private final Map> springMixins = new HashMap<>(); - - @Autowired - ObjectMapperProvider objectMapperProvider; - - @BeforeEach - void init() throws IllegalAccessException { - SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); - Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); - Iterator>> it = _localMixIns.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry> entry = it.next(); - if (entry.getKey().toString().startsWith("org.springframework")) { - springMixins.put(entry.getKey(), entry.getValue()); - it.remove(); - } - } - - } - - @AfterEach - void clean() throws IllegalAccessException { - SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); - Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); - _localMixIns.putAll(springMixins); - } - - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/FooConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/FooConfiguration.java deleted file mode 100644 index c5a21f1c1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/FooConfiguration.java +++ /dev/null @@ -1,57 +0,0 @@ -package test.org.springdoc.api.app9; - -import java.util.List; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.security.SecurityScheme; -import io.swagger.v3.oas.models.tags.Tag; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class FooConfiguration { - @Bean - OpenAPI customOpenApi() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("bearerScheme", - new SecurityScheme() - .type(SecurityScheme.Type.HTTP) - .scheme("bearer") - .bearerFormat("JWT")) - .addSchemas("FeedResponse", feedResponseSchema())) - .info(new Info() - .title("Response API") - .description("API for some response") - .version("0.0.1") - .contact(new Contact() - .name("EAlf91"))) - .tags(List.of(new Tag() - .name("ResponseTag") - .description("ResponseTag for API"), - new Tag() - .name("ResponseData") - .description("Version 2 ResponseApi"))); - - } - - private Schema feedResponseSchema() { - Schema schema = new Schema<>(); - schema.addProperty("_links", linkSchema()); - schema.addProperty("data", new ArraySchema().items(new Schema<>().$ref("#/components/schemas/ResponseData"))); - return schema; - } - - private Schema linkSchema() { - Schema linkSchema = new Schema<>(); - linkSchema.addProperty("next", new Schema<>().$ref("#/components/schemas/Link").example("http://localhost:8080/some-link")); - linkSchema.addProperty("self", new Schema<>().$ref("#/components/schemas/Link").example("http://localhost:8080/some-other-link")); - return linkSchema; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java deleted file mode 100644 index 2e4cab1b2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app9; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp9Test extends AbstractSpringDocTest { - - @SpringBootApplication - static class SpringDocTestApp { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/FooController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/FooController.java deleted file mode 100644 index 8600ded15..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/FooController.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api.app9.application; - -import java.util.List; -import java.util.UUID; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import test.org.springdoc.api.app9.application.dto.FeedResponse; -import test.org.springdoc.api.app9.application.dto.ResponseData; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; -@Tag(name = "ResponseDataController") -@RestController -@RequestMapping(value = "/some-route", produces = MediaType.APPLICATION_JSON_VALUE) -@RequiredArgsConstructor -@Slf4j -public class FooController { - - - - - @Operation(summary = "Get all data", description = "Get all data") - @GetMapping(value = "foo/{id}") - @ResponseStatus(HttpStatus.OK) - public FeedResponse getFoo(@PathVariable("id") UUID id) { - var dataList = List.of(ResponseData.builder().dataId(id).build()); - return FeedResponse.createForResponseData(dataList, UUID.randomUUID()); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/FeedResponse.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/FeedResponse.java deleted file mode 100644 index a9819e55d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/FeedResponse.java +++ /dev/null @@ -1,39 +0,0 @@ -package test.org.springdoc.api.app9.application.dto; - -import java.util.List; -import java.util.UUID; - -import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.constraints.NotNull; -import lombok.AccessLevel; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.experimental.Accessors; -import test.org.springdoc.api.app9.application.FooController; - -import org.springframework.hateoas.IanaLinkRelations; -import org.springframework.hateoas.RepresentationModel; - -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; -import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; - -@Getter -@Accessors(fluent = true) -@Builder(access = AccessLevel.PACKAGE) -@EqualsAndHashCode(callSuper = true) -public class FeedResponse extends RepresentationModel { - @NotNull - @JsonProperty("data") - private final List data; - - public static FeedResponse createForResponseData(@NotNull List responseData, UUID uuid) { - var feedResponse = new FeedResponse(responseData); - feedResponse.add(linkTo(methodOn(FooController.class).getFoo(uuid)).withSelfRel()); - - - feedResponse.add(linkTo(methodOn(FooController.class).getFoo(uuid)).withRel(IanaLinkRelations.NEXT)); - - return feedResponse; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/ResponseData.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/ResponseData.java deleted file mode 100644 index 4481194c6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/app9/application/dto/ResponseData.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app9.application.dto; - -import java.time.LocalDate; -import java.util.UUID; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; -import lombok.Builder; - -@Builder -public record ResponseData( - @JsonProperty(value = "DATA_ID", required = true) - @NotNull - UUID dataId, - @JsonProperty(value = "DATE", required = true) - @NotNull - @Schema(example = "2024-03-27", format = "date") - LocalDate date -) {} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..4f6c2d241 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) +public abstract class AbstractSpringDocTest { + + public static String className; + + @Autowired + protected MockMvc mockMvc; + + public static String getContent(String fileName) { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.0.1/app" + testNumber + ".json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/DatabaseLoader.java new file mode 100644 index 000000000..f07681cbd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app1; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/Employee.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/Employee.java new file mode 100644 index 000000000..e491214b7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app1; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/EmployeeController.java new file mode 100644 index 000000000..53ce35d71 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/EmployeeController.java @@ -0,0 +1,139 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app1; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.stream.StreamSupport; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.IanaLinkRelations; +import org.springframework.hateoas.Link; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + private final EmployeeRepository repository; + + EmployeeController(EmployeeRepository repository) { + this.repository = repository; + } + + /** + * Look up all employees, and transform them into a REST collection resource. Then return them through Spring Web's + * {@link ResponseEntity} fluent API. + */ + @GetMapping("/employees") + ResponseEntity>> findAll() { + + List> employees = StreamSupport.stream(repository.findAll().spliterator(), false) + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .toList(); + + return ResponseEntity.ok( // + CollectionModel.of(employees, // + linkTo(methodOn(EmployeeController.class).findAll()).withSelfRel())); + } + + @PostMapping("/employees") + @ResponseStatus(HttpStatus.CREATED) + ResponseEntity> newEmployee(@RequestBody Employee employee) { + + try { + Employee savedEmployee = repository.save(employee); + + EntityModel employeeResource = EntityModel.of(savedEmployee, // + linkTo(methodOn(EmployeeController.class).findOne(savedEmployee.getId())).withSelfRel()); + + return ResponseEntity // + .created(new URI(employeeResource.getRequiredLink(IanaLinkRelations.SELF).getHref())) // + .body(employeeResource); + } + catch (URISyntaxException e) { + return ResponseEntity.badRequest().body(null); + } + } + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + ResponseEntity> findOne(@PathVariable long id) { + + return repository.findById(id) // + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .map(ResponseEntity::ok) // + .orElse(ResponseEntity.notFound().build()); + } + + /** + * Update existing employee then return a Location header. + * + * @param employee + * @param id + * @return + */ + @PutMapping("/employees/{id}") + @ResponseStatus(HttpStatus.NO_CONTENT) + ResponseEntity updateEmployee(@RequestBody Employee employee, @PathVariable long id) throws URISyntaxException { + + Employee employeeToUpdate = employee; + employeeToUpdate.setId(id); + repository.save(employeeToUpdate); + + Link newlyCreatedLink = linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); + + return ResponseEntity.noContent().location(new URI(newlyCreatedLink.getHref())).build(); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/EmployeeRepository.java new file mode 100644 index 000000000..0f4a84020 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app1; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..0d4ab7109 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp1Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/Dummy.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/Dummy.java new file mode 100644 index 000000000..85baf2822 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/Dummy.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Dummy { + + private T value; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java new file mode 100644 index 000000000..ae53b9bcc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import java.util.List; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.web.PagedModel; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@SuppressWarnings("rawtypes") +@RestController +public class HelloController { + + @GetMapping("/page-simple") + public Page pageSimple() { + return pageImpl("test"); + } + + @GetMapping("/paged-model-simple") + public PagedModel pagedModelSimple() { + return pagedModel("test"); + } + + @GetMapping("/page-complex") + public Page>> pageComplex() { + return pageImpl(new Dummy<>(List.of("test"))); + } + + @GetMapping("/paged-model-complex") + public PagedModel>> pagedModelComplex() { + return pagedModel(new Dummy<>(List.of("test"))); + } + + @GetMapping("/page-raw") + public Page pageRaw() { + return pageSimple(); + } + + @GetMapping("/paged-model-raw") + public PagedModel pagedModelRaw() { + return pagedModelSimple(); + } + + private PagedModel pagedModel(T value) { + return new PagedModel<>(pageImpl(value)); + } + + private Page pageImpl(T value) { + return new PageImpl<>(List.of(value)); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10DirectTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10DirectTest.java new file mode 100644 index 000000000..b56e3f542 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10DirectTest.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.web.config.EnableSpringDataWebSupport; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp10DirectTest extends AbstractSpringDocTest { + + @Override + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app10-direct.json"), true)); + } + + @SpringBootApplication + @EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.DIRECT) + public static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10NotSpecifiedTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10NotSpecifiedTest.java new file mode 100644 index 000000000..de83b58dc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10NotSpecifiedTest.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.springdoc.core.converters.PageOpenAPIConverter; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp10NotSpecifiedTest extends AbstractSpringDocTest { + + + @BeforeAll + public static void init() { + Optional pageOpenAPIConverter = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof PageOpenAPIConverter).findAny(); + pageOpenAPIConverter.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @Override + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app10-direct.json"), true)); + } + + @SpringBootApplication + public static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10ViaDtoTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10ViaDtoTest.java new file mode 100644 index 000000000..e8917f8d9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10ViaDtoTest.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.web.config.EnableSpringDataWebSupport; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp10ViaDtoTest extends AbstractSpringDocTest { + + @Override + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app10-via_dto.json"), true)); + } + + @SpringBootApplication + @EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO) + public static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..b89e6019b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.model-converters.pageable-converter.enabled=true") +public class SpringDocApp2Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/config/DatabaseConfig.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/config/DatabaseConfig.java new file mode 100644 index 000000000..facf8d943 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/config/DatabaseConfig.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.config; + +import java.time.LocalDate; + +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import test.org.springdoc.api.v30.app2.entities.Post; +import test.org.springdoc.api.v30.app2.repositories.PostRepository; + +import org.springframework.context.annotation.Configuration; + +/** + * @author Davide Pedone + * 2020 + */ +@Configuration +@RequiredArgsConstructor +public class DatabaseConfig { + + private final PostRepository postRepository; + + @PostConstruct + private void postConstruct() { + for (int i = 0; i < 33; i++) { + Post post = new Post(); + post.setAuthor("name" + i); + post.setContent("content" + i); + post.setCreatedAt(LocalDate.now().toEpochDay()); + postRepository.save(post); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/controller/PostController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/controller/PostController.java new file mode 100644 index 000000000..f0745d2ba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/controller/PostController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.controller; + +import lombok.RequiredArgsConstructor; +import test.org.springdoc.api.v30.app2.entities.Post; +import test.org.springdoc.api.v30.app2.service.PostService; + +import org.springframework.data.domain.Pageable; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.PagedModel; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author Davide Pedone + * 2020 + */ +@RestController +@RequiredArgsConstructor +public class PostController { + + private final PostService postService; + + @GetMapping + public ResponseEntity>> getAll(Pageable pageable) { + return new ResponseEntity<>(postService.getAll(pageable), HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/entities/Post.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/entities/Post.java new file mode 100644 index 000000000..0a9bad4b0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/entities/Post.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.entities; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Davide Pedone + * 2020 + */ +@Data +@Entity +@NoArgsConstructor +@AllArgsConstructor +public class Post { + + @Id + @GeneratedValue + private Long id; + + private String author; + + private String content; + + private Long createdAt; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/hateoas/PostResourceAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/hateoas/PostResourceAssembler.java new file mode 100644 index 000000000..66f749466 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/hateoas/PostResourceAssembler.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.hateoas; + + +import test.org.springdoc.api.v30.app2.entities.Post; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.server.RepresentationModelAssembler; +import org.springframework.stereotype.Component; + +/** + * @author Davide Pedone + * 2020 + */ +@Component +public class PostResourceAssembler implements RepresentationModelAssembler> { + + + @Override + public EntityModel toModel(Post entity) { + return EntityModel.of(entity); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/repositories/PostRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/repositories/PostRepository.java new file mode 100644 index 000000000..2b98aed8f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/repositories/PostRepository.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.repositories; + + +import test.org.springdoc.api.v30.app2.entities.Post; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.PagingAndSortingRepository; + +/** + * @author Davide Pedone + * 2020 + */ +public interface PostRepository extends PagingAndSortingRepository, CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/service/PostService.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/service/PostService.java new file mode 100644 index 000000000..9e5bdc6a7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app2/service/PostService.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.service; + + +import lombok.RequiredArgsConstructor; +import test.org.springdoc.api.v30.app2.entities.Post; +import test.org.springdoc.api.v30.app2.hateoas.PostResourceAssembler; +import test.org.springdoc.api.v30.app2.repositories.PostRepository; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PagedResourcesAssembler; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.PagedModel; +import org.springframework.stereotype.Service; + +/** + * @author Davide Pedone + * 2020 + */ +@RequiredArgsConstructor +@Service +public class PostService { + + private final PostRepository postRepository; + + private final PagedResourcesAssembler pagedResourcesAssembler; + + private final PostResourceAssembler postResourceAssembler; + + public PagedModel> getAll(Pageable pageable) { + Page postPage = postRepository.findAll(pageable); + return pagedResourcesAssembler.toModel(postPage, postResourceAssembler); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/DatabaseLoader.java new file mode 100644 index 000000000..28cc70f30 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app3; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/Employee.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/Employee.java new file mode 100644 index 000000000..a3f214c08 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app3; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/EmployeeController.java new file mode 100644 index 000000000..7e667c7bb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/EmployeeController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app3; + +import org.springframework.hateoas.EntityModel; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + EntityModel findOne(@PathVariable long id) { + + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/EmployeeRepository.java new file mode 100644 index 000000000..f0914e0c7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app3; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java new file mode 100644 index 000000000..30a8aeb1a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.remove-broken-reference-definitions=false") +public class SpringDocApp3Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocTestApp.java new file mode 100644 index 000000000..756719ead --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocTestApp.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/Album.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/Album.java new file mode 100644 index 000000000..185011185 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/Album.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +public class Album { + + private String title; + + private String description; + + private String releaseDate; + + public Album(String title, String description, String releaseDate) { + this.title = title; + this.description = description; + this.releaseDate = releaseDate; + } + + public String getTitle() { + return title; + } + + public String getDescription() { + return description; + } + + public String getReleaseDate() { + return releaseDate; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/AlbumController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/AlbumController.java new file mode 100644 index 000000000..87c097c3e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/AlbumController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import java.util.Arrays; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.web.PagedResourcesAssembler; +import org.springframework.hateoas.PagedModel; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SuppressWarnings("unchecked") +public class AlbumController { + + @Autowired + private AlbumModelAssembler albumModelAssembler; + + @Autowired + private PagedResourcesAssembler pagedResourcesAssembler; + + @GetMapping("/api/albums") + public PagedModel getAllAlbums() { + Album album1 = new Album("album-title-1", "album-description-1", "album-release-date-1"); + Album album2 = new Album("album-title-2", "album-description-2", "album-release-date-2"); + Page albumPage = new PageImpl<>(Arrays.asList(album1, album2)); + + return pagedResourcesAssembler.toModel(albumPage, albumModelAssembler); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/AlbumModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/AlbumModelAssembler.java new file mode 100644 index 000000000..4a90ad1b7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/AlbumModelAssembler.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.Link; +import org.springframework.hateoas.server.RepresentationModelAssembler; +import org.springframework.stereotype.Component; + +@Component +public class AlbumModelAssembler implements RepresentationModelAssembler> { + + @Override + public EntityModel toModel(Album entity) { + List links = new ArrayList<>(); + return EntityModel.of(entity, links); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java new file mode 100644 index 000000000..6a3b81f87 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp4Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java new file mode 100644 index 000000000..0f558d601 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.StringSchema; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp5Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI().components(new Components() + .addSchemas("CompanyDtoNew", new ObjectSchema().addProperties("id", new StringSchema().format("uuid" + )).addProperties("name", new StringSchema()))); + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/controller/CompanyController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/controller/CompanyController.java new file mode 100644 index 000000000..922a04f29 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/controller/CompanyController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5.controller; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import test.org.springdoc.api.v30.app5.entities.CompanyDto; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author Davide Pedone + * 2020 + */ +@RestController +@RequiredArgsConstructor +public class CompanyController { + + + @PostMapping + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "Details of the Item to be created", + content = @Content(schema = @Schema(ref = "#/components/schemas/CompanyDtoNew"))) + public CompanyDto create(@Valid @RequestBody final CompanyDto companyDto) { + + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/entities/Company.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/entities/Company.java new file mode 100644 index 000000000..6f7384d96 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/entities/Company.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5.entities; + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import org.springframework.hateoas.RepresentationModel; +import org.springframework.hateoas.server.core.Relation; + +/** + * @author bnasslahsen + */ +@AllArgsConstructor +@Data +@Builder +@EqualsAndHashCode(callSuper = false) +@Relation(collectionRelation = "companies", itemRelation = "company") +public class Company extends RepresentationModel { + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private UUID id; + + @NotNull + private String name; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/entities/CompanyDto.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/entities/CompanyDto.java new file mode 100644 index 000000000..45a863a72 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/entities/CompanyDto.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5.entities; + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import org.springframework.hateoas.RepresentationModel; +import org.springframework.hateoas.server.core.Relation; + +/** + * @author bnasslahsen + */ +@AllArgsConstructor +@Data +@Builder +@EqualsAndHashCode(callSuper = false) +@Relation(collectionRelation = "companies", itemRelation = "company") +public class CompanyDto extends RepresentationModel { + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private UUID id; + + @NotNull + private String name; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/hateoas/CompanyModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/hateoas/CompanyModelAssembler.java new file mode 100644 index 000000000..57ecb5013 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app5/hateoas/CompanyModelAssembler.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5.hateoas; + +import test.org.springdoc.api.v30.app5.controller.CompanyController; +import test.org.springdoc.api.v30.app5.entities.Company; +import test.org.springdoc.api.v30.app5.entities.CompanyDto; + +import org.springframework.hateoas.server.mvc.RepresentationModelAssemblerSupport; +import org.springframework.lang.NonNull; +import org.springframework.stereotype.Component; + +/** + * @author bnasslahsen + */ +@Component +public class CompanyModelAssembler extends RepresentationModelAssemblerSupport { + + public CompanyModelAssembler() { + super(CompanyController.class, CompanyDto.class); + } + + @Override + @NonNull + public CompanyDto toModel(@NonNull final Company company) { + return CompanyDto.builder() + .id(company.getId()) + .name(company.getName()) + .build(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java new file mode 100644 index 000000000..7a238ff74 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.springdoc.core.providers.ObjectMapperProvider; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "spring.hateoas.use-hal-as-default-json-media-type= false") +public class SpringDocApp6Test extends AbstractSpringDocTest { + + private final Map> springMixins = new HashMap<>(); + + @Autowired + ObjectMapperProvider objectMapperProvider; + + @BeforeEach + void init() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(),"_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + Iterator>> iterator = _localMixIns.entrySet().iterator(); + + while (iterator.hasNext()) { + Entry> entry = iterator.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + iterator.remove(); + } + } + } + + @AfterEach + void clean() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + _localMixIns.putAll(springMixins); + } + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/controller/ItemController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/controller/ItemController.java new file mode 100644 index 000000000..b8fd4d2c2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/controller/ItemController.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6.controller; + +import java.util.List; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import test.org.springdoc.api.v30.app6.model.Item; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@RestController +@RequestMapping(value = "/v1/items", produces = MediaType.APPLICATION_JSON_VALUE) +@Tag(name = "Item", description = "The Item API") +public class ItemController { + + List items = Stream.of(new Item("foo"), new Item("bar")).toList(); + + @Operation(summary = "Get all items") + @GetMapping(produces = { MediaType.APPLICATION_JSON_VALUE }) + public ResponseEntity> getAllItems() { + + CollectionModel collection = CollectionModel.of(items); + collection.add(linkTo(methodOn(ItemController.class).getAllItems()).withSelfRel().expand()); + + return new ResponseEntity<>(collection, HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/model/Item.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/model/Item.java new file mode 100644 index 000000000..570b2a487 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app6/model/Item.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6.model; + +import org.springframework.hateoas.Link; +import org.springframework.hateoas.RepresentationModel; + + +public class Item extends RepresentationModel { + + private String description; + + public Item(String description) { + this.description = description; + } + + public Item(Link initialLink, String description) { + super(initialLink); + this.description = description; + } + + public Item(Iterable initialLinks, String description) { + super(initialLinks); + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/FooConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/FooConfiguration.java new file mode 100644 index 000000000..4694d8e15 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/FooConfiguration.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FooConfiguration { + @Bean + public GroupedOpenApi userOpenApi() { + String packagesToscan[] = { "test.org.springdoc.api.app7" }; + return GroupedOpenApi.builder().group("foo-service").packagesToScan(packagesToscan) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java new file mode 100644 index 000000000..6c1a11c2f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp7Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/Foo.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/Foo.java new file mode 100644 index 000000000..a724fe4c1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/Foo.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7.application; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Foo { + String foo; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooController.java new file mode 100644 index 000000000..2d396aeec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooController.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7.application; + +import java.util.UUID; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.MediaTypes; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class FooController { + + private final FooService fooService; + + private final FooResourceAssembler fooResourceAssembler; + + @Autowired + public FooController( + FooService fooService, + FooResourceAssembler fooResourceAssembler) { + this.fooService = fooService; + this.fooResourceAssembler = fooResourceAssembler; + } + + @GetMapping(value = "foo/{id}", produces = MediaTypes.HAL_JSON_VALUE) + public ResponseEntity> getFoo(@PathVariable("id") UUID id) throws Exception { + Foo foo = fooService.getFoo(id).orElseThrow(Exception::new); + return ResponseEntity.ok(fooResourceAssembler.toModel(foo)); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooResourceAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooResourceAssembler.java new file mode 100644 index 000000000..546bad633 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooResourceAssembler.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7.application; + +import java.util.UUID; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.server.SimpleRepresentationModelAssembler; +import org.springframework.stereotype.Component; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@Component +public class FooResourceAssembler + implements SimpleRepresentationModelAssembler { + + @Override + public void addLinks(EntityModel resource) { + Foo foo = resource.getContent(); + if (foo != null) { + try { + resource.add( + linkTo(methodOn(FooController.class).getFoo(UUID.fromString(foo.getFoo()))).withSelfRel()); + } + catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + @Override + public void addLinks(CollectionModel> resources) { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooService.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooService.java new file mode 100644 index 000000000..7a290453e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app7/application/FooService.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7.application; + +import java.util.Optional; +import java.util.UUID; + +import org.springframework.stereotype.Service; + +@Service +public class FooService { + public Optional getFoo(UUID uuid) { + return Optional.of(new Foo(uuid.toString())); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/DatabaseLoader.java new file mode 100644 index 000000000..e362554b2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app8; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/Employee.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/Employee.java new file mode 100644 index 000000000..700df1514 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app8; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/EmployeeController.java new file mode 100644 index 000000000..3a21941b4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/EmployeeController.java @@ -0,0 +1,139 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app8; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.stream.StreamSupport; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.IanaLinkRelations; +import org.springframework.hateoas.Link; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + private final EmployeeRepository repository; + + EmployeeController(EmployeeRepository repository) { + this.repository = repository; + } + + /** + * Look up all employees, and transform them into a REST collection resource. Then return them through Spring Web's + * {@link ResponseEntity} fluent API. + */ + @GetMapping("/employees") + ResponseEntity>> findAll() { + + List> employees = StreamSupport.stream(repository.findAll().spliterator(), false) + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .toList(); + + return ResponseEntity.ok( // + CollectionModel.of(employees, // + linkTo(methodOn(EmployeeController.class).findAll()).withSelfRel())); + } + + @PostMapping("/employees") + @ResponseStatus(HttpStatus.CREATED) + ResponseEntity> newEmployee(@RequestBody Employee employee) { + + try { + Employee savedEmployee = repository.save(employee); + + EntityModel employeeResource = EntityModel.of(savedEmployee, // + linkTo(methodOn(EmployeeController.class).findOne(savedEmployee.getId())).withSelfRel()); + + return ResponseEntity // + .created(new URI(employeeResource.getRequiredLink(IanaLinkRelations.SELF).getHref())) // + .body(employeeResource); + } + catch (URISyntaxException e) { + return ResponseEntity.badRequest().body(null); + } + } + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + ResponseEntity> findOne(@PathVariable long id) { + + return repository.findById(id) // + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .map(ResponseEntity::ok) // + .orElse(ResponseEntity.notFound().build()); + } + + /** + * Update existing employee then return a Location header. + * + * @param employee + * @param id + * @return + */ + @PutMapping("/employees/{id}") + @ResponseStatus(HttpStatus.NO_CONTENT) + ResponseEntity updateEmployee(@RequestBody Employee employee, @PathVariable long id) throws URISyntaxException { + + Employee employeeToUpdate = employee; + employeeToUpdate.setId(id); + repository.save(employeeToUpdate); + + Link newlyCreatedLink = linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); + + return ResponseEntity.noContent().location(new URI(newlyCreatedLink.getHref())).build(); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/EmployeeRepository.java new file mode 100644 index 000000000..dfb350e43 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app8; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java new file mode 100644 index 000000000..ee48105ed --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app8; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.springdoc.core.providers.ObjectMapperProvider; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.enable-hateoas=false") +public class SpringDocApp8Test extends AbstractSpringDocTest { + + private final Map> springMixins = new HashMap<>(); + + @Autowired + ObjectMapperProvider objectMapperProvider; + + @BeforeEach + void init() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + Iterator>> it = _localMixIns.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry> entry = it.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + it.remove(); + } + } + + } + + @AfterEach + void clean() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + _localMixIns.putAll(springMixins); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/FooConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/FooConfiguration.java new file mode 100644 index 000000000..baf92b141 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/FooConfiguration.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import java.util.List; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.tags.Tag; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FooConfiguration { + @Bean + OpenAPI customOpenApi() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("bearerScheme", + new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT")) + .addSchemas("FeedResponse", feedResponseSchema())) + .info(new Info() + .title("Response API") + .description("API for some response") + .version("0.0.1") + .contact(new Contact() + .name("EAlf91"))) + .tags(List.of(new Tag() + .name("ResponseTag") + .description("ResponseTag for API"), + new Tag() + .name("ResponseData") + .description("Version 2 ResponseApi"))); + + } + + private Schema feedResponseSchema() { + Schema schema = new Schema<>(); + schema.addProperty("_links", linkSchema()); + schema.addProperty("data", new ArraySchema().items(new Schema<>().$ref("#/components/schemas/ResponseData"))); + return schema; + } + + private Schema linkSchema() { + Schema linkSchema = new Schema<>(); + linkSchema.addProperty("next", new Schema<>().$ref("#/components/schemas/Link").example("http://localhost:8080/some-link")); + linkSchema.addProperty("self", new Schema<>().$ref("#/components/schemas/Link").example("http://localhost:8080/some-other-link")); + return linkSchema; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..c1557b44f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp9Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/FooController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/FooController.java new file mode 100644 index 000000000..530c4077b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/FooController.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.application; + +import java.util.List; +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import test.org.springdoc.api.v30.app9.application.dto.FeedResponse; +import test.org.springdoc.api.v30.app9.application.dto.ResponseData; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; +@Tag(name = "ResponseDataController") +@RestController +@RequestMapping(value = "/some-route", produces = MediaType.APPLICATION_JSON_VALUE) +@RequiredArgsConstructor +@Slf4j +public class FooController { + + + + + @Operation(summary = "Get all data", description = "Get all data") + @GetMapping(value = "foo/{id}") + @ResponseStatus(HttpStatus.OK) + public FeedResponse getFoo(@PathVariable("id") UUID id) { + var dataList = List.of(ResponseData.builder().dataId(id).build()); + return FeedResponse.createForResponseData(dataList, UUID.randomUUID()); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/dto/FeedResponse.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/dto/FeedResponse.java new file mode 100644 index 000000000..6a7a435ad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/dto/FeedResponse.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.application.dto; + +import java.util.List; +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.experimental.Accessors; +import test.org.springdoc.api.v30.app9.application.FooController; + +import org.springframework.hateoas.IanaLinkRelations; +import org.springframework.hateoas.RepresentationModel; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@Getter +@Accessors(fluent = true) +@Builder(access = AccessLevel.PACKAGE) +@EqualsAndHashCode(callSuper = true) +public class FeedResponse extends RepresentationModel { + @NotNull + @JsonProperty("data") + private final List data; + + public static FeedResponse createForResponseData(@NotNull List responseData, UUID uuid) { + var feedResponse = new FeedResponse(responseData); + feedResponse.add(linkTo(methodOn(FooController.class).getFoo(uuid)).withSelfRel()); + + + feedResponse.add(linkTo(methodOn(FooController.class).getFoo(uuid)).withRel(IanaLinkRelations.NEXT)); + + return feedResponse; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/dto/ResponseData.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/dto/ResponseData.java new file mode 100644 index 000000000..847a9e465 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app9/application/dto/ResponseData.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9.application.dto; + +import java.time.LocalDate; +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.Builder; + +@Builder +public record ResponseData( + @JsonProperty(value = "DATA_ID", required = true) + @NotNull + UUID dataId, + @JsonProperty(value = "DATE", required = true) + @NotNull + @Schema(example = "2024-03-27", format = "date") + LocalDate date +) {} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..a38cc04c9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +public abstract class AbstractSpringDocTest { + + public static String className; + + @Autowired + protected MockMvc mockMvc; + + public static String getContent(String fileName) { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.1.0/app" + testNumber + ".json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/DatabaseLoader.java new file mode 100644 index 000000000..3e1eb517a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app1; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/Employee.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/Employee.java new file mode 100644 index 000000000..8692d25c1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app1; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/EmployeeController.java new file mode 100644 index 000000000..323974545 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/EmployeeController.java @@ -0,0 +1,139 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app1; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.stream.StreamSupport; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.IanaLinkRelations; +import org.springframework.hateoas.Link; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + private final EmployeeRepository repository; + + EmployeeController(EmployeeRepository repository) { + this.repository = repository; + } + + /** + * Look up all employees, and transform them into a REST collection resource. Then return them through Spring Web's + * {@link ResponseEntity} fluent API. + */ + @GetMapping("/employees") + ResponseEntity>> findAll() { + + List> employees = StreamSupport.stream(repository.findAll().spliterator(), false) + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .toList(); + + return ResponseEntity.ok( // + CollectionModel.of(employees, // + linkTo(methodOn(EmployeeController.class).findAll()).withSelfRel())); + } + + @PostMapping("/employees") + @ResponseStatus(HttpStatus.CREATED) + ResponseEntity> newEmployee(@RequestBody Employee employee) { + + try { + Employee savedEmployee = repository.save(employee); + + EntityModel employeeResource = EntityModel.of(savedEmployee, // + linkTo(methodOn(EmployeeController.class).findOne(savedEmployee.getId())).withSelfRel()); + + return ResponseEntity // + .created(new URI(employeeResource.getRequiredLink(IanaLinkRelations.SELF).getHref())) // + .body(employeeResource); + } + catch (URISyntaxException e) { + return ResponseEntity.badRequest().body(null); + } + } + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + ResponseEntity> findOne(@PathVariable long id) { + + return repository.findById(id) // + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .map(ResponseEntity::ok) // + .orElse(ResponseEntity.notFound().build()); + } + + /** + * Update existing employee then return a Location header. + * + * @param employee + * @param id + * @return + */ + @PutMapping("/employees/{id}") + @ResponseStatus(HttpStatus.NO_CONTENT) + ResponseEntity updateEmployee(@RequestBody Employee employee, @PathVariable long id) throws URISyntaxException { + + Employee employeeToUpdate = employee; + employeeToUpdate.setId(id); + repository.save(employeeToUpdate); + + Link newlyCreatedLink = linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); + + return ResponseEntity.noContent().location(new URI(newlyCreatedLink.getHref())).build(); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/EmployeeRepository.java new file mode 100644 index 000000000..e51dff831 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app1; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..76ecc6662 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp1Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/Dummy.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/Dummy.java new file mode 100644 index 000000000..0bf8faf98 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/Dummy.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Dummy { + + private T value; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java new file mode 100644 index 000000000..d028d144d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import java.util.List; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.web.PagedModel; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@SuppressWarnings("rawtypes") +@RestController +public class HelloController { + + @GetMapping("/page-simple") + public Page pageSimple() { + return pageImpl("test"); + } + + @GetMapping("/paged-model-simple") + public PagedModel pagedModelSimple() { + return pagedModel("test"); + } + + @GetMapping("/page-complex") + public Page>> pageComplex() { + return pageImpl(new Dummy<>(List.of("test"))); + } + + @GetMapping("/paged-model-complex") + public PagedModel>> pagedModelComplex() { + return pagedModel(new Dummy<>(List.of("test"))); + } + + @GetMapping("/page-raw") + public Page pageRaw() { + return pageSimple(); + } + + @GetMapping("/paged-model-raw") + public PagedModel pagedModelRaw() { + return pagedModelSimple(); + } + + private PagedModel pagedModel(T value) { + return new PagedModel<>(pageImpl(value)); + } + + private Page pageImpl(T value) { + return new PageImpl<>(List.of(value)); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10DirectTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10DirectTest.java new file mode 100644 index 000000000..954dddce3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10DirectTest.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.web.config.EnableSpringDataWebSupport; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp10DirectTest extends AbstractSpringDocTest { + + @Override + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app10-direct.json"), true)); + } + + @SpringBootApplication + @EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.DIRECT) + public static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10NotSpecifiedTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10NotSpecifiedTest.java new file mode 100644 index 000000000..fd9f13add --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10NotSpecifiedTest.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.springdoc.core.converters.PageOpenAPIConverter; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp10NotSpecifiedTest extends AbstractSpringDocTest { + + + @BeforeAll + public static void init() { + Optional pageOpenAPIConverter = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof PageOpenAPIConverter).findAny(); + pageOpenAPIConverter.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @Override + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app10-direct.json"), true)); + } + + @SpringBootApplication + public static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10ViaDtoTest.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10ViaDtoTest.java new file mode 100644 index 000000000..4b3253cca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10ViaDtoTest.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.web.config.EnableSpringDataWebSupport; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +public class SpringDocApp10ViaDtoTest extends AbstractSpringDocTest { + + @Override + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app10-via_dto.json"), true)); + } + + @SpringBootApplication + @EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO) + public static class SpringDocTestApp { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..9f4d7f515 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.model-converters.pageable-converter.enabled=true") +public class SpringDocApp2Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/config/DatabaseConfig.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/config/DatabaseConfig.java new file mode 100644 index 000000000..8ef2464c6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/config/DatabaseConfig.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.config; + +import java.time.LocalDate; + +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import test.org.springdoc.api.v31.app2.entities.Post; +import test.org.springdoc.api.v31.app2.repositories.PostRepository; + +import org.springframework.context.annotation.Configuration; + +/** + * @author Davide Pedone + * 2020 + */ +@Configuration +@RequiredArgsConstructor +public class DatabaseConfig { + + private final PostRepository postRepository; + + @PostConstruct + private void postConstruct() { + for (int i = 0; i < 33; i++) { + Post post = new Post(); + post.setAuthor("name" + i); + post.setContent("content" + i); + post.setCreatedAt(LocalDate.now().toEpochDay()); + postRepository.save(post); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/controller/PostController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/controller/PostController.java new file mode 100644 index 000000000..8a96491e4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/controller/PostController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.controller; + +import lombok.RequiredArgsConstructor; +import test.org.springdoc.api.v31.app2.entities.Post; +import test.org.springdoc.api.v31.app2.service.PostService; + +import org.springframework.data.domain.Pageable; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.PagedModel; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author Davide Pedone + * 2020 + */ +@RestController +@RequiredArgsConstructor +public class PostController { + + private final PostService postService; + + @GetMapping + public ResponseEntity>> getAll(Pageable pageable) { + return new ResponseEntity<>(postService.getAll(pageable), HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/entities/Post.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/entities/Post.java new file mode 100644 index 000000000..6ac6f1328 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/entities/Post.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.entities; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Davide Pedone + * 2020 + */ +@Data +@Entity +@NoArgsConstructor +@AllArgsConstructor +public class Post { + + @Id + @GeneratedValue + private Long id; + + private String author; + + private String content; + + private Long createdAt; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/hateoas/PostResourceAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/hateoas/PostResourceAssembler.java new file mode 100644 index 000000000..2f64e515f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/hateoas/PostResourceAssembler.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.hateoas; + + +import test.org.springdoc.api.v31.app2.entities.Post; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.server.RepresentationModelAssembler; +import org.springframework.stereotype.Component; + +/** + * @author Davide Pedone + * 2020 + */ +@Component +public class PostResourceAssembler implements RepresentationModelAssembler> { + + + @Override + public EntityModel toModel(Post entity) { + return EntityModel.of(entity); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/repositories/PostRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/repositories/PostRepository.java new file mode 100644 index 000000000..93bb46767 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/repositories/PostRepository.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.repositories; + + +import test.org.springdoc.api.v31.app2.entities.Post; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.PagingAndSortingRepository; + +/** + * @author Davide Pedone + * 2020 + */ +public interface PostRepository extends PagingAndSortingRepository, CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/service/PostService.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/service/PostService.java new file mode 100644 index 000000000..55899bebe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app2/service/PostService.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.service; + + +import lombok.RequiredArgsConstructor; +import test.org.springdoc.api.v31.app2.entities.Post; +import test.org.springdoc.api.v31.app2.hateoas.PostResourceAssembler; +import test.org.springdoc.api.v31.app2.repositories.PostRepository; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PagedResourcesAssembler; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.PagedModel; +import org.springframework.stereotype.Service; + +/** + * @author Davide Pedone + * 2020 + */ +@RequiredArgsConstructor +@Service +public class PostService { + + private final PostRepository postRepository; + + private final PagedResourcesAssembler pagedResourcesAssembler; + + private final PostResourceAssembler postResourceAssembler; + + public PagedModel> getAll(Pageable pageable) { + Page postPage = postRepository.findAll(pageable); + return pagedResourcesAssembler.toModel(postPage, postResourceAssembler); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/DatabaseLoader.java new file mode 100644 index 000000000..77e094e5f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app3; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/Employee.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/Employee.java new file mode 100644 index 000000000..4d7df1a7e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app3; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/EmployeeController.java new file mode 100644 index 000000000..3bbc31e5d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/EmployeeController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app3; + +import org.springframework.hateoas.EntityModel; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + EntityModel findOne(@PathVariable long id) { + + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/EmployeeRepository.java new file mode 100644 index 000000000..0915f1e19 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app3; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java new file mode 100644 index 000000000..fdaddc056 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.remove-broken-reference-definitions=false") +public class SpringDocApp3Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocTestApp.java new file mode 100644 index 000000000..b69b2599c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocTestApp.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringDocTestApp { + + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/Album.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/Album.java new file mode 100644 index 000000000..8cc5876af --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/Album.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +public class Album { + + private String title; + + private String description; + + private String releaseDate; + + public Album(String title, String description, String releaseDate) { + this.title = title; + this.description = description; + this.releaseDate = releaseDate; + } + + public String getTitle() { + return title; + } + + public String getDescription() { + return description; + } + + public String getReleaseDate() { + return releaseDate; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/AlbumController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/AlbumController.java new file mode 100644 index 000000000..e85fc6e73 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/AlbumController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import java.util.Arrays; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.web.PagedResourcesAssembler; +import org.springframework.hateoas.PagedModel; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SuppressWarnings("unchecked") +public class AlbumController { + + @Autowired + private AlbumModelAssembler albumModelAssembler; + + @Autowired + private PagedResourcesAssembler pagedResourcesAssembler; + + @GetMapping("/api/albums") + public PagedModel getAllAlbums() { + Album album1 = new Album("album-title-1", "album-description-1", "album-release-date-1"); + Album album2 = new Album("album-title-2", "album-description-2", "album-release-date-2"); + Page albumPage = new PageImpl<>(Arrays.asList(album1, album2)); + + return pagedResourcesAssembler.toModel(albumPage, albumModelAssembler); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/AlbumModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/AlbumModelAssembler.java new file mode 100644 index 000000000..a22e1aaea --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/AlbumModelAssembler.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.Link; +import org.springframework.hateoas.server.RepresentationModelAssembler; +import org.springframework.stereotype.Component; + +@Component +public class AlbumModelAssembler implements RepresentationModelAssembler> { + + @Override + public EntityModel toModel(Album entity) { + List links = new ArrayList<>(); + return EntityModel.of(entity, links); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java new file mode 100644 index 000000000..c017a86a5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp4Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java new file mode 100644 index 000000000..dc93acbf7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.StringSchema; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp5Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI().components(new Components() + .addSchemas("CompanyDtoNew", new ObjectSchema().addProperties("id", new StringSchema().format("uuid" + )).addProperties("name", new StringSchema()))); + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/controller/CompanyController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/controller/CompanyController.java new file mode 100644 index 000000000..ad955f062 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/controller/CompanyController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5.controller; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import test.org.springdoc.api.v31.app5.entities.CompanyDto; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author Davide Pedone + * 2020 + */ +@RestController +@RequiredArgsConstructor +public class CompanyController { + + + @PostMapping + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "Details of the Item to be created", + content = @Content(schema = @Schema(ref = "#/components/schemas/CompanyDtoNew"))) + public CompanyDto create(@Valid @RequestBody final CompanyDto companyDto) { + + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/entities/Company.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/entities/Company.java new file mode 100644 index 000000000..74f2a0402 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/entities/Company.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5.entities; + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import org.springframework.hateoas.RepresentationModel; +import org.springframework.hateoas.server.core.Relation; + +/** + * @author bnasslahsen + */ +@AllArgsConstructor +@Data +@Builder +@EqualsAndHashCode(callSuper = false) +@Relation(collectionRelation = "companies", itemRelation = "company") +public class Company extends RepresentationModel { + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private UUID id; + + @NotNull + private String name; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/entities/CompanyDto.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/entities/CompanyDto.java new file mode 100644 index 000000000..62fd1d84c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/entities/CompanyDto.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5.entities; + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import org.springframework.hateoas.RepresentationModel; +import org.springframework.hateoas.server.core.Relation; + +/** + * @author bnasslahsen + */ +@AllArgsConstructor +@Data +@Builder +@EqualsAndHashCode(callSuper = false) +@Relation(collectionRelation = "companies", itemRelation = "company") +public class CompanyDto extends RepresentationModel { + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private UUID id; + + @NotNull + private String name; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/hateoas/CompanyModelAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/hateoas/CompanyModelAssembler.java new file mode 100644 index 000000000..ffb87b28b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app5/hateoas/CompanyModelAssembler.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5.hateoas; + +import test.org.springdoc.api.v31.app5.controller.CompanyController; +import test.org.springdoc.api.v31.app5.entities.Company; +import test.org.springdoc.api.v31.app5.entities.CompanyDto; + +import org.springframework.hateoas.server.mvc.RepresentationModelAssemblerSupport; +import org.springframework.lang.NonNull; +import org.springframework.stereotype.Component; + +/** + * @author bnasslahsen + */ +@Component +public class CompanyModelAssembler extends RepresentationModelAssemblerSupport { + + public CompanyModelAssembler() { + super(CompanyController.class, CompanyDto.class); + } + + @Override + @NonNull + public CompanyDto toModel(@NonNull final Company company) { + return CompanyDto.builder() + .id(company.getId()) + .name(company.getName()) + .build(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java new file mode 100644 index 000000000..dc0f8a0f2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.springdoc.core.providers.ObjectMapperProvider; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "spring.hateoas.use-hal-as-default-json-media-type= false") +public class SpringDocApp6Test extends AbstractSpringDocTest { + + private final Map> springMixins = new HashMap<>(); + + @Autowired + ObjectMapperProvider objectMapperProvider; + + @BeforeEach + void init() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(),"_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + Iterator>> iterator = _localMixIns.entrySet().iterator(); + + while (iterator.hasNext()) { + Entry> entry = iterator.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + iterator.remove(); + } + } + } + + @AfterEach + void clean() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + _localMixIns.putAll(springMixins); + } + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/controller/ItemController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/controller/ItemController.java new file mode 100644 index 000000000..cbe732945 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/controller/ItemController.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6.controller; + +import java.util.List; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import test.org.springdoc.api.v31.app6.model.Item; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@RestController +@RequestMapping(value = "/v1/items", produces = MediaType.APPLICATION_JSON_VALUE) +@Tag(name = "Item", description = "The Item API") +public class ItemController { + + List items = Stream.of(new Item("foo"), new Item("bar")).toList(); + + @Operation(summary = "Get all items") + @GetMapping(produces = { MediaType.APPLICATION_JSON_VALUE }) + public ResponseEntity> getAllItems() { + + CollectionModel collection = CollectionModel.of(items); + collection.add(linkTo(methodOn(ItemController.class).getAllItems()).withSelfRel().expand()); + + return new ResponseEntity<>(collection, HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/model/Item.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/model/Item.java new file mode 100644 index 000000000..f78545b0f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app6/model/Item.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6.model; + +import org.springframework.hateoas.Link; +import org.springframework.hateoas.RepresentationModel; + + +public class Item extends RepresentationModel { + + private String description; + + public Item(String description) { + this.description = description; + } + + public Item(Link initialLink, String description) { + super(initialLink); + this.description = description; + } + + public Item(Iterable initialLinks, String description) { + super(initialLinks); + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/FooConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/FooConfiguration.java new file mode 100644 index 000000000..31b684e72 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/FooConfiguration.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FooConfiguration { + @Bean + public GroupedOpenApi userOpenApi() { + String packagesToscan[] = { "test.org.springdoc.api.app7" }; + return GroupedOpenApi.builder().group("foo-service").packagesToScan(packagesToscan) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java new file mode 100644 index 000000000..838a6bfc1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp7Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/Foo.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/Foo.java new file mode 100644 index 000000000..fda9ae798 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/Foo.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7.application; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Foo { + String foo; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooController.java new file mode 100644 index 000000000..49bb8c5d2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooController.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7.application; + +import java.util.UUID; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.MediaTypes; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class FooController { + + private final FooService fooService; + + private final FooResourceAssembler fooResourceAssembler; + + @Autowired + public FooController( + FooService fooService, + FooResourceAssembler fooResourceAssembler) { + this.fooService = fooService; + this.fooResourceAssembler = fooResourceAssembler; + } + + @GetMapping(value = "foo/{id}", produces = MediaTypes.HAL_JSON_VALUE) + public ResponseEntity> getFoo(@PathVariable("id") UUID id) throws Exception { + Foo foo = fooService.getFoo(id).orElseThrow(Exception::new); + return ResponseEntity.ok(fooResourceAssembler.toModel(foo)); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooResourceAssembler.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooResourceAssembler.java new file mode 100644 index 000000000..89ed69013 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooResourceAssembler.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7.application; + +import java.util.UUID; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.server.SimpleRepresentationModelAssembler; +import org.springframework.stereotype.Component; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@Component +public class FooResourceAssembler + implements SimpleRepresentationModelAssembler { + + @Override + public void addLinks(EntityModel resource) { + Foo foo = resource.getContent(); + if (foo != null) { + try { + resource.add( + linkTo(methodOn(FooController.class).getFoo(UUID.fromString(foo.getFoo()))).withSelfRel()); + } + catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + @Override + public void addLinks(CollectionModel> resources) { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooService.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooService.java new file mode 100644 index 000000000..054b495e9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app7/application/FooService.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7.application; + +import java.util.Optional; +import java.util.UUID; + +import org.springframework.stereotype.Service; + +@Service +public class FooService { + public Optional getFoo(UUID uuid) { + return Optional.of(new Foo(uuid.toString())); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/DatabaseLoader.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/DatabaseLoader.java new file mode 100644 index 000000000..fe79f0adb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/DatabaseLoader.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app8; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * Pre-load some data using a Spring Boot {@link CommandLineRunner}. + * + * @author Greg Turnquist + */ +@Component +class DatabaseLoader { + + /** + * Use Spring to inject a {@link EmployeeRepository} that can then load data. Since this will run only after the app + * is operational, the database will be up. + * + * @param repository + */ + @Bean + CommandLineRunner init(EmployeeRepository repository) { + + return args -> { + repository.save(new Employee("Frodo", "Baggins", "ring bearer")); + repository.save(new Employee("Bilbo", "Baggins", "burglar")); + }; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/Employee.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/Employee.java new file mode 100644 index 000000000..2f16d3d6d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/Employee.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app8; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Domain object representing a company employee. Project Lombok keeps actual code at a minimum. {@code @Data} - + * Generates getters, setters, toString, hash, and equals functions {@code @Entity} - JPA annotation to flag this class + * for DB persistence {@code @NoArgsConstructor} - Create a constructor with no args to support JPA + * {@code @AllArgsConstructor} - Create a constructor with all args to support testing + * {@code @JsonIgnoreProperties(ignoreUnknow=true)} When converting JSON to Java, ignore any unrecognized attributes. + * This is critical for REST because it encourages adding new fields in later versions that won't break. It also allows + * things like _links to be ignore as well, meaning HAL documents can be fetched and later posted to the server without + * adjustment. + * + * @author Greg Turnquist + */ +@Data +@Entity +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@AllArgsConstructor +class Employee { + + @Id + @GeneratedValue + private Long id; + + private String firstName; + + private String lastName; + + private String role; + + /** + * Useful constructor when id is not yet known. + * + * @param firstName + * @param lastName + * @param role + */ + Employee(String firstName, String lastName, String role) { + + this.firstName = firstName; + this.lastName = lastName; + this.role = role; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/EmployeeController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/EmployeeController.java new file mode 100644 index 000000000..6399f78f7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/EmployeeController.java @@ -0,0 +1,139 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app8; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.stream.StreamSupport; + +import org.springframework.hateoas.CollectionModel; +import org.springframework.hateoas.EntityModel; +import org.springframework.hateoas.IanaLinkRelations; +import org.springframework.hateoas.Link; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +/** + * Spring Web {@link RestController} used to generate a REST API. + * + * @author Greg Turnquist + */ +@RestController +class EmployeeController { + + private final EmployeeRepository repository; + + EmployeeController(EmployeeRepository repository) { + this.repository = repository; + } + + /** + * Look up all employees, and transform them into a REST collection resource. Then return them through Spring Web's + * {@link ResponseEntity} fluent API. + */ + @GetMapping("/employees") + ResponseEntity>> findAll() { + + List> employees = StreamSupport.stream(repository.findAll().spliterator(), false) + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .toList(); + + return ResponseEntity.ok( // + CollectionModel.of(employees, // + linkTo(methodOn(EmployeeController.class).findAll()).withSelfRel())); + } + + @PostMapping("/employees") + @ResponseStatus(HttpStatus.CREATED) + ResponseEntity> newEmployee(@RequestBody Employee employee) { + + try { + Employee savedEmployee = repository.save(employee); + + EntityModel employeeResource = EntityModel.of(savedEmployee, // + linkTo(methodOn(EmployeeController.class).findOne(savedEmployee.getId())).withSelfRel()); + + return ResponseEntity // + .created(new URI(employeeResource.getRequiredLink(IanaLinkRelations.SELF).getHref())) // + .body(employeeResource); + } + catch (URISyntaxException e) { + return ResponseEntity.badRequest().body(null); + } + } + + /** + * Look up a single {@link Employee} and transform it into a REST resource. Then return it through Spring Web's + * {@link ResponseEntity} fluent API. + * + * @param id + */ + @GetMapping("/employees/{id}") + ResponseEntity> findOne(@PathVariable long id) { + + return repository.findById(id) // + .map(employee -> EntityModel.of(employee, // + linkTo(methodOn(EmployeeController.class).findOne(employee.getId())).withSelfRel(), // + linkTo(methodOn(EmployeeController.class).findAll()).withRel("employees"))) // + .map(ResponseEntity::ok) // + .orElse(ResponseEntity.notFound().build()); + } + + /** + * Update existing employee then return a Location header. + * + * @param employee + * @param id + * @return + */ + @PutMapping("/employees/{id}") + @ResponseStatus(HttpStatus.NO_CONTENT) + ResponseEntity updateEmployee(@RequestBody Employee employee, @PathVariable long id) throws URISyntaxException { + + Employee employeeToUpdate = employee; + employeeToUpdate.setId(id); + repository.save(employeeToUpdate); + + Link newlyCreatedLink = linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); + + return ResponseEntity.noContent().location(new URI(newlyCreatedLink.getHref())).build(); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/EmployeeRepository.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/EmployeeRepository.java new file mode 100644 index 000000000..686499af5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/EmployeeRepository.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app8; + +import org.springframework.data.repository.CrudRepository; + +/** + * A simple Spring Data {@link CrudRepository} for storing {@link Employee}s. + * + * @author Greg Turnquist + */ +interface EmployeeRepository extends CrudRepository { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java new file mode 100644 index 000000000..f0f293ebe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app8; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver; +import com.fasterxml.jackson.databind.type.ClassKey; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.springdoc.core.providers.ObjectMapperProvider; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.enable-hateoas=false") +public class SpringDocApp8Test extends AbstractSpringDocTest { + + private final Map> springMixins = new HashMap<>(); + + @Autowired + ObjectMapperProvider objectMapperProvider; + + @BeforeEach + void init() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + Iterator>> it = _localMixIns.entrySet().iterator(); + while (it.hasNext()) { + Entry> entry = it.next(); + if (entry.getKey().toString().startsWith("org.springframework")) { + springMixins.put(entry.getKey(), entry.getValue()); + it.remove(); + } + } + + } + + @AfterEach + void clean() throws IllegalAccessException { + SimpleMixInResolver _mixIns = (SimpleMixInResolver) FieldUtils.readDeclaredField(objectMapperProvider.jsonMapper(), "_mixIns", true); + Map> _localMixIns = (Map>) FieldUtils.readDeclaredField(_mixIns, "_localMixIns", true); + _localMixIns.putAll(springMixins); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/FooConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/FooConfiguration.java new file mode 100644 index 000000000..75bb7d166 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/FooConfiguration.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import java.util.List; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.tags.Tag; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FooConfiguration { + @Bean + OpenAPI customOpenApi() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("bearerScheme", + new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT")) + .addSchemas("FeedResponse", feedResponseSchema())) + .info(new Info() + .title("Response API") + .description("API for some response") + .version("0.0.1") + .contact(new Contact() + .name("EAlf91"))) + .tags(List.of(new Tag() + .name("ResponseTag") + .description("ResponseTag for API"), + new Tag() + .name("ResponseData") + .description("Version 2 ResponseApi"))); + + } + + private Schema feedResponseSchema() { + Schema schema = new Schema<>(); + schema.addProperty("_links", linkSchema()); + schema.addProperty("data", new ArraySchema().items(new Schema<>().$ref("#/components/schemas/ResponseData"))); + return schema; + } + + private Schema linkSchema() { + Schema linkSchema = new Schema<>(); + linkSchema.addProperty("next", new Schema<>().$ref("#/components/schemas/Link").example("http://localhost:8080/some-link")); + linkSchema.addProperty("self", new Schema<>().$ref("#/components/schemas/Link").example("http://localhost:8080/some-other-link")); + return linkSchema; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..c0bf9885b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp9Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/FooController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/FooController.java new file mode 100644 index 000000000..b8fe61384 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/FooController.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.application; + +import java.util.List; +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import test.org.springdoc.api.v31.app9.application.dto.FeedResponse; +import test.org.springdoc.api.v31.app9.application.dto.ResponseData; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; +@Tag(name = "ResponseDataController") +@RestController +@RequestMapping(value = "/some-route", produces = MediaType.APPLICATION_JSON_VALUE) +@RequiredArgsConstructor +@Slf4j +public class FooController { + + + + + @Operation(summary = "Get all data", description = "Get all data") + @GetMapping(value = "foo/{id}") + @ResponseStatus(HttpStatus.OK) + public FeedResponse getFoo(@PathVariable("id") UUID id) { + var dataList = List.of(ResponseData.builder().dataId(id).build()); + return FeedResponse.createForResponseData(dataList, UUID.randomUUID()); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/dto/FeedResponse.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/dto/FeedResponse.java new file mode 100644 index 000000000..dafa1dfa8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/dto/FeedResponse.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.application.dto; + +import java.util.List; +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.experimental.Accessors; +import test.org.springdoc.api.v31.app9.application.FooController; + +import org.springframework.hateoas.IanaLinkRelations; +import org.springframework.hateoas.RepresentationModel; + +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; +import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; + +@Getter +@Accessors(fluent = true) +@Builder(access = AccessLevel.PACKAGE) +@EqualsAndHashCode(callSuper = true) +public class FeedResponse extends RepresentationModel { + @NotNull + @JsonProperty("data") + private final List data; + + public static FeedResponse createForResponseData(@NotNull List responseData, UUID uuid) { + var feedResponse = new FeedResponse(responseData); + feedResponse.add(linkTo(methodOn(FooController.class).getFoo(uuid)).withSelfRel()); + + + feedResponse.add(linkTo(methodOn(FooController.class).getFoo(uuid)).withRel(IanaLinkRelations.NEXT)); + + return feedResponse; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/dto/ResponseData.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/dto/ResponseData.java new file mode 100644 index 000000000..2210e7c64 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app9/application/dto/ResponseData.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9.application.dto; + +import java.time.LocalDate; +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.Builder; + +@Builder +public record ResponseData( + @JsonProperty(value = "DATA_ID", required = true) + @NotNull + UUID dataId, + @JsonProperty(value = "DATE", required = true) + @NotNull + @Schema(example = "2024-03-27", format = "date") + LocalDate date +) {} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app1.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-direct.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-direct.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-direct.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-via_dto.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app10-via_dto.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-via_dto.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app2.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app3.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app3.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app3.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app3.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app4.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app4.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app4.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app4.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app5.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app5.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app5.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app5.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app6.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app6.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app6.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app6.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app7.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app7.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app7.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app7.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app8.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app8.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app8.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app8.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app9.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app9.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app9.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app9.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app9wrong.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app9wrong.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/app9wrong.json rename to springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app9wrong.json diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app1.json new file mode 100644 index 000000000..60e2a1866 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app1.json @@ -0,0 +1,223 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/employees": { + "get": { + "tags": [ + "employee-controller" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelEmployee" + } + } + } + } + } + }, + "post": { + "tags": [ + "employee-controller" + ], + "operationId": "newEmployee", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + } + } + } + }, + "/employees/{id}": { + "get": { + "tags": [ + "employee-controller" + ], + "operationId": "findOne", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + } + } + }, + "put": { + "tags": [ + "employee-controller" + ], + "operationId": "updateEmployee", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "No Content" + } + } + } + } + }, + "components": { + "schemas": { + "CollectionModelEntityModelEmployee": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "employeeList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Employee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "EntityModelEmployee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app10-direct.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app10-direct.json new file mode 100644 index 000000000..a6b7e6b7c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app10-direct.json @@ -0,0 +1,391 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/paged-model-simple": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelSimple", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelString" + } + } + } + } + } + } + }, + "/paged-model-raw": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelRaw", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModel" + } + } + } + } + } + } + }, + "/paged-model-complex": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelComplex", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelDummyListString" + } + } + } + } + } + } + }, + "/page-simple": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageSimple", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PageString" + } + } + } + } + } + } + }, + "/page-raw": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageRaw", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Page" + } + } + } + } + } + } + }, + "/page-complex": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageComplex", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PageDummyListString" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelString": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "type": "string" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "PagedModel": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "type": "object" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "DummyListString": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PagedModelDummyListString": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DummyListString" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "PageString": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "string" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + }, + "PageableObject": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + } + } + }, + "SortObject": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + } + } + }, + "Page": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "object" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + }, + "PageDummyListString": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DummyListString" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app10-via_dto.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app10-via_dto.json new file mode 100644 index 000000000..3434e8fe1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app10-via_dto.json @@ -0,0 +1,213 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/paged-model-simple": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelSimple", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelString" + } + } + } + } + } + } + }, + "/paged-model-raw": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelRaw", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModel" + } + } + } + } + } + } + }, + "/paged-model-complex": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pagedModelComplex", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelDummyListString" + } + } + } + } + } + } + }, + "/page-simple": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageSimple", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelString" + } + } + } + } + } + } + }, + "/page-raw": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageRaw", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModel" + } + } + } + } + } + } + }, + "/page-complex": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageComplex", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelDummyListString" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelString": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "type": "string" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "PagedModel": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "type": "object" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "DummyListString": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PagedModelDummyListString": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DummyListString" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app2.json new file mode 100644 index 000000000..4f43b9a0e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app2.json @@ -0,0 +1,170 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "post-controller" + ], + "operationId": "getAll", + "parameters": [ + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Pageable" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelEntityModelPost" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Pageable": { + "type": "object", + "properties": { + "page": { + "minimum": 0, + "type": "integer", + "format": "int32" + }, + "size": { + "minimum": 1, + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "EntityModelPost": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "author": { + "type": "string" + }, + "content": { + "type": "string" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelEntityModelPost": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "postList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelPost" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app3.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app3.json new file mode 100644 index 000000000..d9630c227 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app3.json @@ -0,0 +1,124 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/employees/{id}": { + "get": { + "tags": [ + "employee-controller" + ], + "operationId": "findOne", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Employee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "EntityModelEmployee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app4.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app4.json new file mode 100644 index 000000000..4c29ecf08 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app4.json @@ -0,0 +1,131 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/albums": { + "get": { + "tags": [ + "album-controller" + ], + "operationId": "getAllAlbums", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelAlbum" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Album": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "releaseDate": { + "type": "string" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "PageMetadata": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedModelAlbum": { + "type": "object", + "properties": { + "_embedded": { + "type": "object", + "properties": { + "albumList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Album" + } + } + } + }, + "_links": { + "$ref": "#/components/schemas/Links" + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app5.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app5.json new file mode 100644 index 000000000..badd1f750 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app5.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "company-controller" + ], + "operationId": "create", + "requestBody": { + "description": "Details of the Item to be created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompanyDtoNew" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CompanyDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CompanyDtoNew": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + } + } + }, + "CompanyDto": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "readOnly": true + }, + "name": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app6.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app6.json new file mode 100644 index 000000000..9cc16a738 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app6.json @@ -0,0 +1,109 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Item", + "description": "The Item API" + } + ], + "paths": { + "/v1/items": { + "get": { + "tags": [ + "Item" + ], + "summary": "Get all items", + "operationId": "getAllItems", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionModelItem" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CollectionModelItem": { + "type": "object", + "properties": { + "links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Link" + } + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + } + } + } + }, + "Item": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "Link": { + "type": "object", + "properties": { + "rel": { + "type": "string" + }, + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "media": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app7.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app7.json new file mode 100644 index 000000000..e5652df4e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app7.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/foo/{id}": { + "get": { + "tags": [ + "foo-controller" + ], + "operationId": "getFoo", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/EntityModelFoo" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "EntityModelFoo": { + "type": "object", + "properties": { + "foo": { + "type": "string" + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app8.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app8.json new file mode 100644 index 000000000..f345d8420 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app8.json @@ -0,0 +1,221 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/employees/{id}": { + "get": { + "tags": [ + "employee-controller" + ], + "operationId": "findOne", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + } + } + }, + "put": { + "tags": [ + "employee-controller" + ], + "operationId": "updateEmployee", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/employees": { + "get": { + "tags": [ + "employee-controller" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CollectionModelEntityModelEmployee" + } + } + } + } + } + }, + "post": { + "tags": [ + "employee-controller" + ], + "operationId": "newEmployee", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Employee" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Employee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "EntityModelEmployee": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "role": { + "type": "string" + }, + "links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "Link": { + "type": "object", + "properties": { + "rel": { + "type": "string" + }, + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "media": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "CollectionModelEntityModelEmployee": { + "type": "object", + "properties": { + "links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Link" + } + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelEmployee" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app9.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app9.json new file mode 100644 index 000000000..b165286a7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app9.json @@ -0,0 +1,142 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Response API", + "description": "API for some response", + "contact": { + "name": "EAlf91" + }, + "version": "0.0.1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "ResponseTag", + "description": "ResponseTag for API" + }, + { + "name": "ResponseData", + "description": "Version 2 ResponseApi" + } + ], + "paths": { + "/some-route/foo/{id}": { + "get": { + "tags": [ + "ResponseDataController" + ], + "summary": "Get all data", + "description": "Get all data", + "operationId": "getFoo", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "FeedResponse": { + "properties": { + "_links": { + "properties": { + "next": { + "$ref": "#/components/schemas/Link", + "example": "http://localhost:8080/some-link" + }, + "self": { + "$ref": "#/components/schemas/Link", + "example": "http://localhost:8080/some-other-link" + } + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ResponseData" + } + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + }, + "ResponseData": { + "type": "object", + "properties": { + "DATA_ID": { + "type": "string", + "format": "uuid" + }, + "DATE": { + "type": "string", + "format": "date", + "example": "2024-03-27" + } + }, + "required": [ + "DATA_ID", + "DATE" + ] + } + }, + "securitySchemes": { + "bearerScheme": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app9wrong.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app9wrong.json new file mode 100644 index 000000000..6e8c200a3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app9wrong.json @@ -0,0 +1,122 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Response API", + "description": "API for some response", + "contact": { + "name": "EAlf91" + }, + "version": "0.0.1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "ResponseTag", + "description": "ResponseTag for API" + }, + { + "name": "ResponseData", + "description": "Version 2 ResponseApi" + } + ], + "paths": { + "/some-route/foo/{id}": { + "get": { + "tags": [ + "ResponseDataController" + ], + "summary": "Get all data", + "description": "Get all data", + "operationId": "getFoo", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "FeedResponse": { + "properties": { + "_links": { + "properties": { + "next": { + "$ref": "#/components/schemas/Link" + }, + "self": { + "$ref": "#/components/schemas/Link" + } + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ResponseData" + } + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + }, + "securitySchemes": { + "bearerScheme": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index d09755609..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springdoc.core.utils.Constants; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Abstract spring doc test. - */ -@ActiveProfiles("test") -@SpringBootTest -@AutoConfigureMockMvc -@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) -public abstract class AbstractSpringDocTest { - - /** - * The constant LOGGER. - */ - protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractSpringDocTest.class); - - /** - * The constant className. - */ - public static String className; - - /** - * The Mock mvc. - */ - @Autowired - protected MockMvc mockMvc; - - /** - * Gets content. - * - * @param fileName the file name - * @return the content - * @throws Exception the exception - */ - public static String getContent(String fileName) throws Exception { - try { - Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiException.java deleted file mode 100644 index a6bb8f5f4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiException.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -/** - * The type Api exception. - */ -public final class ApiException extends Exception { - - /** - * The constant serialVersionUID. - */ - private static final long serialVersionUID = 1L; - - /** - * The Code. - */ - @SuppressWarnings("unused") - - private final int code; - - /** - * Instantiates a new Api exception. - * - * @param code the code - * @param msg the msg - */ - public ApiException(int code, String msg) { - super(msg); - this.code = code; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiOriginFilter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiOriginFilter.java deleted file mode 100644 index 87e872c4a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiOriginFilter.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import java.io.IOException; - -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.http.HttpServletResponse; - -/** - * The type Api origin filter. - */ -class ApiOriginFilter implements jakarta.servlet.Filter { - /** - * Do filter. - * - * @param request the request - * @param response the response - * @param chain the chain - * @throws IOException the io exception - * @throws ServletException the servlet exception - */ - @Override - public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException, ServletException { - HttpServletResponse res = (HttpServletResponse) response; - res.addHeader("Access-Control-Allow-Origin", "*"); - res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); - res.addHeader("Access-Control-Allow-Headers", "Content-Type"); - chain.doFilter(request, response); - } - - /** - * Destroy. - */ - @Override - public void destroy() { - } - - /** - * Init. - * - * @param filterConfig the filter config - * @throws ServletException the servlet exception - */ - @Override - public void init(FilterConfig filterConfig) throws ServletException { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiResponseMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiResponseMessage.java deleted file mode 100644 index e161afb2a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ApiResponseMessage.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import jakarta.xml.bind.annotation.XmlTransient; - -/** - * The type Api response message. - */ -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") -@jakarta.xml.bind.annotation.XmlRootElement -class ApiResponseMessage { - /** - * The constant ERROR. - */ - public static final int ERROR = 1; - - /** - * The constant WARNING. - */ - public static final int WARNING = 2; - - /** - * The constant INFO. - */ - public static final int INFO = 3; - - /** - * The constant OK. - */ - public static final int OK = 4; - - /** - * The constant TOO_BUSY. - */ - public static final int TOO_BUSY = 5; - - /** - * The Code. - */ - int code; - - /** - * The Type. - */ - String type; - - /** - * The Message. - */ - String message; - - /** - * Instantiates a new Api response message. - */ - public ApiResponseMessage() { - } - - /** - * Instantiates a new Api response message. - * - * @param code the code - * @param message the message - */ - public ApiResponseMessage(int code, String message) { - this.code = code; - switch (code) { - case ERROR: - setType("error"); - break; - case WARNING: - setType("warning"); - break; - case INFO: - setType("info"); - break; - case OK: - setType("ok"); - break; - case TOO_BUSY: - setType("too busy"); - break; - default: - setType("unknown"); - break; - } - this.message = message; - } - - /** - * Gets code. - * - * @return the code - */ - @XmlTransient - public int getCode() { - return code; - } - - /** - * Sets code. - * - * @param code the code - */ - public void setCode(int code) { - this.code = code; - } - - /** - * Gets type. - * - * @return the type - */ - public String getType() { - return type; - } - - /** - * Sets type. - * - * @param type the type - */ - public void setType(String type) { - this.type = type; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ErrorMessage.java deleted file mode 100644 index 7eb1c3f7b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ErrorMessage.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -/** - * The type Error message. - */ -class ErrorMessage { - - /** - * The Id. - */ - private String id; - - /** - * The Message. - */ - private String message; - - /** - * Instantiates a new Error message. - * - * @param id the id - * @param message2 the message 2 - */ - public ErrorMessage(String id, String message2) { - this.id = id; - this.message = message2; - } - - /** - * Gets id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(String id) { - this.id = id; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ExceptionTranslator.java deleted file mode 100644 index 56b2a89e9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ExceptionTranslator.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import java.util.UUID; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; - -/** - * The type Exception translator. - */ -@ControllerAdvice -class ExceptionTranslator { - - /** - * The constant LOGGER. - */ - private static final Logger LOGGER = LoggerFactory.getLogger(ExceptionTranslator.class); - - /** - * Handle run time exception response entity. - * - * @param e the e - * @return the response entity - */ - @ExceptionHandler({ RuntimeException.class }) - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - public ResponseEntity handleRunTimeException(RuntimeException e) { - return error(HttpStatus.INTERNAL_SERVER_ERROR, e); - } - - - /** - * Error response entity. - * - * @param status the status - * @param e the e - * @return the response entity - */ - private ResponseEntity error(HttpStatus status, Exception e) { - LOGGER.error("Exception : ", e); - return ResponseEntity.status(status).body(new ErrorMessage(UUID.randomUUID().toString(), e.getMessage())); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java deleted file mode 100644 index 1ef1f9b75..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - - -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Index string. - * - * @param numTel the num tel - * @param adresse the adresse - * @return the string - */ - @GetMapping(value = "/hello/{numTelco}") - @ResponseStatus(HttpStatus.I_AM_A_TEAPOT) - @Tag(name = "tea") - public String index(@PathVariable("numTelco") String numTel, String adresse) { - return "Greetings from Spring Boot!"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HomeController.java deleted file mode 100644 index d11d30441..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/HomeController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; -import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; -import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; - -/** - * Home redirection to swagger api documentation - */ -@Controller -class HomeController { - - /** - * The Swagger ui path. - */ - @Value(SWAGGER_UI_PATH) - private String swaggerUiPath; - - /** - * Index string. - * - * @return the string - */ - @GetMapping(DEFAULT_PATH_SEPARATOR) - public String index() { - return REDIRECT_URL_PREFIX + swaggerUiPath; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemController.java deleted file mode 100644 index ff5a2b887..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemController.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import java.net.URI; -import java.time.Instant; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.Explode; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.Size; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.support.ServletUriComponentsBuilder; - -/** - * The type Item controller. - */ -@RestController -@Tag(name = "items") -class ItemController { - - /** - * Show items list. - * - * @param customerID the customer id - * @param toto the toto - * @param startDate the start date - * @param filterIds the filter ids - * @return the list - */ - @GetMapping("/items") - public List showItems(@RequestParam("cusID") @Size(min = 4, max = 6) final String customerID, - @Size(min = 4, max = 6) int toto, - @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, - @Parameter(name = "filterIds", in = ParameterIn.QUERY, array = @ArraySchema(schema = @Schema(type = "string")), explode = Explode.FALSE) @RequestParam(required = false) List filterIds) { - return new ArrayList(); - } - - /** - * Add item response entity. - * - * @param itemDTO the item dto - * @return the response entity - */ - @PostMapping("/items") - public ResponseEntity addItem(@Valid @RequestBody final ItemLightDTO itemDTO) { - final URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}") - .buildAndExpand(UUID.randomUUID()).toUri(); - return ResponseEntity.created(location).build(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemDTO.java deleted file mode 100644 index 7f8b0aa02..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemDTO.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import java.io.Serializable; - -/** - * The type Item dto. - * @author bnasslahsen - */ -class ItemDTO implements Serializable { - - /** - * serialVersionUID of type long - */ - private static final long serialVersionUID = 1L; - - /** - * itemID of type String - */ - private String itemID; - - /** - * description of type String - */ - private String description; - - /** - * price of type int - */ - private int price; - - /** - * The Deprecated price. - */ - @Deprecated - private int deprecatedPrice; - - /** - * Instantiates a new Item dto. - */ - public ItemDTO() { - } - - /** - * Instantiates a new Item dto. - * - * @param description description - * @param price price - */ - public ItemDTO(final String description, final int price) { - this.description = description; - this.price = price; - } - - /** - * Instantiates a new Item dto. - * - * @param itemID itemID - * @param description description - * @param price price - */ - public ItemDTO(final String itemID, final String description, final int price) { - this.itemID = itemID; - this.description = description; - this.price = price; - } - - /** - * Gets description. - * - * @return description description - */ - public String getDescription() { - return description; - } - - /** - * Sets description. - * - * @param description description - */ - public void setDescription(final String description) { - this.description = description; - } - - /** - * Gets item id. - * - * @return item id - */ - public String getItemID() { - return itemID; - } - - /** - * Sets item id. - * - * @param itemID itemID - */ - public void setItemID(final String itemID) { - this.itemID = itemID; - } - - /** - * Gets price. - * - * @return price price - */ - public int getPrice() { - return price; - } - - /** - * Sets price. - * - * @param price price - */ - public void setPrice(final int price) { - this.price = price; - } - - /** - * Gets deprecated price. - * - * @return the deprecated price - */ - public int getDeprecatedPrice() { - return deprecatedPrice; - } - - /** - * Sets deprecated price. - * - * @param deprecatedPrice the deprecated price - */ - public void setDeprecatedPrice(int deprecatedPrice) { - this.deprecatedPrice = deprecatedPrice; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemLightDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemLightDTO.java deleted file mode 100644 index 366cfa21d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/ItemLightDTO.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import java.io.Serializable; - -/** - * The type Item light dto. - * @author bnasslahsen - */ -class ItemLightDTO implements Serializable { - - /** - * serialVersionUID of type long - */ - private static final long serialVersionUID = 1L; - - /** - * description of type String - */ - private String description; - - /** - * price of type int - */ - private int price; - - /** - * The Deprecated price. - */ - @Deprecated - private int deprecatedPrice; - - /** - * Instantiates a new Item light dto. - */ - public ItemLightDTO() { - } - - /** - * Instantiates a new Item light dto. - * - * @param description the description - * @param price the price - */ - public ItemLightDTO(String description, int price) { - super(); - this.description = description; - this.price = price; - } - - /** - * Gets description. - * - * @return description description - */ - public String getDescription() { - return description; - } - - /** - * Sets description. - * - * @param description description - */ - public void setDescription(final String description) { - this.description = description; - } - - /** - * Gets price. - * - * @return price price - */ - public int getPrice() { - return price; - } - - /** - * Sets price. - * - * @param price price - */ - public void setPrice(final int price) { - this.price = price; - } - - /** - * Gets deprecated price. - * - * @return the deprecated price - */ - public int getDeprecatedPrice() { - return deprecatedPrice; - } - - /** - * Sets deprecated price. - * - * @param deprecatedPrice the deprecated price - */ - public void setDeprecatedPrice(int deprecatedPrice) { - this.deprecatedPrice = deprecatedPrice; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PersonDTO.java deleted file mode 100644 index cd8dd27bc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PersonDTO.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -/** - * The type Person dto. - */ -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java deleted file mode 100644 index cf33498bc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 1 test. - */ -@TestPropertySource(properties = "springdoc.default-produces-media-type=application/json") -class SpringDocApp1Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("SpringShop API").version("v0") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java deleted file mode 100644 index 72f87433b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app10; - -import java.util.Locale; - -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.servlet.http.HttpSession; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestAttribute; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test. - * - * @param header the header - * @param request the request - * @param response the response - * @param locale the locale - * @param hello the hello - */ - @GetMapping("/test") - public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, - String hello) { - } - - /** - * Test request attribute. - * - * @param sample the sample - * @param s the s - */ - @GetMapping("/testreq") - public void testRequestAttribute(@RequestAttribute String sample, String s) { - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java deleted file mode 100644 index 3af79d360..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app10; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 10 test. - */ -class SpringDocApp10Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/HelloController.java deleted file mode 100644 index 519ecc56d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app100; - -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.tags.Tags; -import jakarta.validation.constraints.NotNull; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@Tags(value = @Tag(name = "hello-ap1")) -class HelloController { - - /** - * Gets all pets. - * - * @param toto the toto - * @return the all pets - */ - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - @Tags(value = @Tag(name = "hello-ap2")) - public PersonDTO getAllPets(@NotNull String toto) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/PersonDTO.java deleted file mode 100644 index 1166d5b3e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/PersonDTO.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app100; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Person dto. - */ -@Schema -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/SpringDocApp100Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/SpringDocApp100Test.java deleted file mode 100644 index 53e24d5ef..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app100/SpringDocApp100Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app100; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 100 test. - */ -class SpringDocApp100Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloController.java deleted file mode 100644 index 82f650bc8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloController.java +++ /dev/null @@ -1,31 +0,0 @@ -package test.org.springdoc.api.app101; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/hello") -class HelloController { - - /** - * Hello hello dto. - * - * @return the hello dto - */ - @GetMapping - @ApiResponse(content = @Content(schema = @Schema( - description = "${test.app101.operation.hello.response.schema.description}", - implementation = HelloDTO.class))) - public HelloDTO hello() { - return new HelloDTO(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloDTO.java deleted file mode 100644 index fe4847ff6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/HelloDTO.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api.app101; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Hello dto. - */ -@Schema(description = "${test.app101.schema.hello.description}") -class HelloDTO { - - /** - * The Id. - */ - @Schema(description = "${test.app101.schema.hello.param.id.description}") - private String id; - - /** - * Gets id. - * - * @return the id - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(String id) { - this.id = id; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/SpringDocApp101Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/SpringDocApp101Test.java deleted file mode 100644 index 7a0368db9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app101/SpringDocApp101Test.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app101; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.ActiveProfiles; - -/** - * The type Spring doc app 101 test. - */ -@ActiveProfiles("101") -class SpringDocApp101Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java deleted file mode 100644 index 13fbe8bbb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/InheritedRequestParams.java +++ /dev/null @@ -1,34 +0,0 @@ -package test.org.springdoc.api.app102; - -import io.swagger.v3.oas.annotations.Parameter; -import jakarta.validation.constraints.NotBlank; - -/** - * The type Inherited request params. - */ -class InheritedRequestParams extends RequestParams { - /** - * The Child param. - */ - @Parameter(description = "parameter from child of RequestParams") - @NotBlank - private String childParam; - - /** - * Gets child param. - * - * @return the child param - */ - public String getChildParam() { - return childParam; - } - - /** - * Sets child param. - * - * @param childParam the child param - */ - public void setChildParam(String childParam) { - this.childParam = childParam; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/RequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/RequestParams.java deleted file mode 100644 index e8d2b6839..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/RequestParams.java +++ /dev/null @@ -1,258 +0,0 @@ -package test.org.springdoc.api.app102; - -import java.math.BigInteger; -import java.util.List; -import java.util.Optional; - -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.lang.Nullable; - -/** - * The type Request params. - */ -class RequestParams { - - /** - * The String param. - */ - @Parameter(description = "string parameter") - private String stringParam; - - /** - * The String param 1. - */ - @Deprecated - private String stringParam1; - - /** - * The String param 2. - */ - @Parameter(description = "string parameter2", required = true) - private String stringParam2; - - /** - * The Int param. - */ - @Parameter(description = "int parameter") - private int intParam; - - /** - * The Int param 2. - */ - private Optional intParam2; - - /** - * The Int param 3. - */ - @Nullable - private String intParam3; - - /** - * The Nested. - */ - private Nested nested; - - /** - * The Nested list. - */ - private List nestedList; - - /** - * Gets string param. - * - * @return the string param - */ - public String getStringParam() { - return stringParam; - } - - /** - * Sets string param. - * - * @param stringParam the string param - */ - public void setStringParam(String stringParam) { - this.stringParam = stringParam; - } - - /** - * Gets int param. - * - * @return the int param - */ - public int getIntParam() { - return intParam; - } - - /** - * Sets int param. - * - * @param intParam the int param - */ - public void setIntParam(int intParam) { - this.intParam = intParam; - } - - /** - * Gets int param 2. - * - * @return the int param 2 - */ - public Optional getIntParam2() { - return intParam2; - } - - /** - * Sets int param 2. - * - * @param intParam2 the int param 2 - */ - public void setIntParam2(Optional intParam2) { - this.intParam2 = intParam2; - } - - /** - * Gets int param 3. - * - * @return the int param 3 - */ - @Nullable - public String getIntParam3() { - return intParam3; - } - - /** - * Sets int param 3. - * - * @param intParam3 the int param 3 - */ - public void setIntParam3(@Nullable String intParam3) { - this.intParam3 = intParam3; - } - - /** - * Gets string param 1. - * - * @return the string param 1 - */ - public String getStringParam1() { - return stringParam1; - } - - /** - * Sets string param 1. - * - * @param stringParam1 the string param 1 - */ - public void setStringParam1(String stringParam1) { - this.stringParam1 = stringParam1; - } - - /** - * Gets string param 2. - * - * @return the string param 2 - */ - public String getStringParam2() { - return stringParam2; - } - - /** - * Sets string param 2. - * - * @param stringParam2 the string param 2 - */ - public void setStringParam2(String stringParam2) { - this.stringParam2 = stringParam2; - } - - /** - * Gets nested. - * - * @return the nested - */ - public Nested getNested() { - return nested; - } - - /** - * Sets nested. - * - * @param nested the nested - */ - public void setNested(Nested nested) { - this.nested = nested; - } - - /** - * Gets nested list. - * - * @return the nested list - */ - public List getNestedList() { - return nestedList; - } - - /** - * Sets nested list. - * - * @param nestedList the nested list - */ - public void setNestedList(List nestedList) { - this.nestedList = nestedList; - } - - /** - * The type Nested. - */ - public static class Nested { - /** - * The Param 1. - */ - private String param1; - - /** - * The Param 2. - */ - private BigInteger param2; - - /** - * Gets param 1. - * - * @return the param 1 - */ - @Parameter(description = "nested string parameter") - public String getParam1() { - return param1; - } - - /** - * Sets param 1. - * - * @param param1 the param 1 - */ - public void setParam1(String param1) { - this.param1 = param1; - } - - /** - * Gets param 2. - * - * @return the param 2 - */ - @Parameter(description = "nested BigInteger parameter") - public BigInteger getParam2() { - return param2; - } - - /** - * Sets param 2. - * - * @param param2 the param 2 - */ - public void setParam2(BigInteger param2) { - this.param2 = param2; - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java deleted file mode 100644 index fe1770c24..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/SpringDocApp102Test.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app102; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 102 test. - */ -class SpringDocApp102Test extends AbstractSpringDocTest { - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/TestController.java deleted file mode 100644 index 7ddae72c8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app102/TestController.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app102; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.lang.Nullable; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Test controller. - */ -@RestController -class TestController { - /** - * Gets test. - * - * @param param the param - * @param requestParams the request params - */ - @GetMapping("test") - public void getTest(@RequestParam @Nullable String param, @ParameterObject InheritedRequestParams requestParams) { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/ExampleBody.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/ExampleBody.java deleted file mode 100644 index e6b831c7c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/ExampleBody.java +++ /dev/null @@ -1,52 +0,0 @@ -package test.org.springdoc.api.app103; - -/** - * The type Example body. - */ -class ExampleBody { - /** - * The String param. - */ - private String stringParam; - - /** - * The Int param. - */ - private int intParam; - - /** - * Gets string param. - * - * @return the string param - */ - public String getStringParam() { - return stringParam; - } - - /** - * Sets string param. - * - * @param stringParam the string param - */ - public void setStringParam(String stringParam) { - this.stringParam = stringParam; - } - - /** - * Gets int param. - * - * @return the int param - */ - public int getIntParam() { - return intParam; - } - - /** - * Sets int param. - * - * @param intParam the int param - */ - public void setIntParam(int intParam) { - this.intParam = intParam; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/HelloController.java deleted file mode 100644 index 9f4af3c26..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/HelloController.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app103; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Encoding; -import io.swagger.v3.oas.annotations.parameters.RequestBody; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Post my request body string. - * - * @param body the body - * @param file the file - * @return the string - */ - @PostMapping(value = "/test/103", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - @Operation( - requestBody = @RequestBody( - content = @Content( - encoding = @Encoding(name = "body", contentType = "application/json") - ) - ) - ) - public String postMyRequestBody( - @RequestPart("body") ExampleBody body, - @RequestParam("file") MultipartFile file - ) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/SpringDocApp103Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/SpringDocApp103Test.java deleted file mode 100644 index cbb84e91d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app103/SpringDocApp103Test.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app103; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 103 test. - */ -class SpringDocApp103Test extends AbstractSpringDocTest { - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/CrudController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/CrudController.java deleted file mode 100644 index e575d7123..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/CrudController.java +++ /dev/null @@ -1,47 +0,0 @@ -package test.org.springdoc.api.app104; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * The type Crud controller. - * - * @param the type parameter - */ -@Controller -@SuppressWarnings("rawtypes") -public abstract class CrudController { - - /** - * Get t. - * - * @param id the id - * @return the t - */ - @GetMapping(path = "{id}") - @ResponseBody - @Operation(description = "Get single object") - public T get( // - @Parameter(description = "The id to get.", required = true) @PathVariable("id") int id) { - return null; - } - - /** - * List list. - * - * @return the list - */ - @GetMapping(path = "") - @ResponseBody - @Operation(description = "Receive a list of objects") - public List list() { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/Design.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/Design.java deleted file mode 100644 index 5c9878a01..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/Design.java +++ /dev/null @@ -1,7 +0,0 @@ -package test.org.springdoc.api.app104; - -/** - * The type Design. - */ -class Design extends HavingPK { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/DesignController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/DesignController.java deleted file mode 100644 index b4e314246..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/DesignController.java +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app104; - -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * The type Design controller. - */ -@Tag(name = "design") -@Controller -@RequestMapping("/design") -class DesignController extends CrudController { - - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/HavingPK.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/HavingPK.java deleted file mode 100644 index ac3d20aa1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/HavingPK.java +++ /dev/null @@ -1,7 +0,0 @@ -package test.org.springdoc.api.app104; - -/** - * The type Having pk. - */ -class HavingPK { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/SpringDocApp104Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/SpringDocApp104Test.java deleted file mode 100644 index 2b1d35afd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app104/SpringDocApp104Test.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app104; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 104 test. - */ -class SpringDocApp104Test extends AbstractSpringDocTest { - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/SpringDocApp105Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/SpringDocApp105Test.java deleted file mode 100644 index 3f91b44c9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/SpringDocApp105Test.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Spring doc app 105 test. - */ -@TestPropertySource(properties = { - "springdoc.group-configs[0].group=stores", - "springdoc.group-configs[0].paths-to-match=/store/**", - "springdoc.group-configs[1].group=users", - "springdoc.group-configs[1].packages-to-scan=test.org.springdoc.api.app105.api.user", - "springdoc.group-configs[2].group=pets", - "springdoc.group-configs[2].paths-to-match=/pet/**", - "springdoc.group-configs[3].group=groups test", - "springdoc.group-configs[3].paths-to-match=/v1/**", - "springdoc.group-configs[3].paths-to-exclude=/v1/users", - "springdoc.group-configs[3].packages-to-scan=test.org.springdoc.api.app105.api.user,test.org.springdoc.api.app105.api.store", -}) -class SpringDocApp105Test extends AbstractSpringDocTest { - - /** - * The constant className. - */ - public static String className; - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app105-1.json"), true)); - } - - /** - * Test app 2. - * - * @throws Exception the exception - */ - @Test - void testApp2() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app105-2.json"), true)); - } - - /** - * Test app 3. - * - * @throws Exception the exception - */ - @Test - void testApp3() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app105-3.json"), true)); - } - - /** - * Test app 4. - * - * @throws Exception the exception - */ - @Test - void testApp4() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app105-4.json"), true)); - } - - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Petstore API").version("v0").description( - "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") - .termsOfService("http://swagger.io/terms/") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ApiUtil.java deleted file mode 100644 index cd5cde760..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ApiUtil.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api; - -import java.io.IOException; - -import jakarta.servlet.http.HttpServletResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.server.ResponseStatusException; - -/** - * The type Api util. - */ -public class ApiUtil { - - /** - * Sets example response. - * - * @param req the req - * @param contentType the content type - * @param example the example - */ - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); - req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - - /** - * Check api key. - * - * @param req the req - */ - public static void checkApiKey(NativeWebRequest req) { - if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { - throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ExceptionTranslator.java deleted file mode 100644 index b743c8622..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/ExceptionTranslator.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api; - -import java.util.Map; - -import jakarta.validation.ConstraintViolationException; - -import org.springframework.boot.web.error.ErrorAttributeOptions; -import org.springframework.boot.web.servlet.error.ErrorAttributes; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.WebRequest; - -/** - * The type Exception translator. - */ -@RestControllerAdvice -class ExceptionTranslator { - - /** - * The Error attributes. - */ - private final ErrorAttributes errorAttributes; - - /** - * Instantiates a new Exception translator. - * - * @param errorAttributes the error attributes - */ - public ExceptionTranslator(ErrorAttributes errorAttributes) { - this.errorAttributes = errorAttributes; - } - - /** - * Process constraint violation exception map. - * - * @param request the request - * @return the map - */ - @ExceptionHandler(ConstraintViolationException.class) - @ResponseStatus(HttpStatus.BAD_REQUEST) - public Map processConstraintViolationException(WebRequest request) { - request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); - return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/HomeController.java deleted file mode 100644 index bb86b3787..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/HomeController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; -import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; -import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; - -/** - * Home redirection to swagger api documentation - */ -@Controller -class HomeController { - - /** - * The Swagger ui path. - */ - @Value(SWAGGER_UI_PATH) - private String swaggerUiPath; - - /** - * Index string. - * - * @return the string - */ - @GetMapping(DEFAULT_PATH_SEPARATOR) - public String index() { - return REDIRECT_URL_PREFIX + swaggerUiPath; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApi.java deleted file mode 100644 index 098ebb480..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApi.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package test.org.springdoc.api.app105.api.pet; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.security.OAuthFlow; -import io.swagger.v3.oas.annotations.security.OAuthFlows; -import io.swagger.v3.oas.annotations.security.OAuthScope; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.security.SecurityScheme; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; -import test.org.springdoc.api.app105.model.ModelApiResponse; -import test.org.springdoc.api.app105.model.Pet; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -/** - * The interface Pet api. - */ -@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { - @OAuthScope(name = "write:pets", description = "modify pets in your account"), - @OAuthScope(name = "read:pets", description = "read your pets") }))) -@Tag(name = "pet", description = "the pet API") -public interface PetApi { - - /** - * Gets delegate. - * - * @return the delegate - */ - default PetApiDelegate getDelegate() { - return new PetApiDelegate() { - }; - } - - /** - * Add pet. - * - * @param pet the pet - */ - @Operation(summary = "Add a new pet to the store", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) - @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) - default void addPet( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { - // return getDelegate().addPet(pet); - } - - /** - * Delete pet response entity. - * - * @param petId the pet id - * @param apiKey the api key - * @return the response entity - */ - @Operation(summary = "Deletes a pet", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") }) - @DeleteMapping(value = "/pet/{petId}") - default ResponseEntity deletePet( - @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { - return getDelegate().deletePet(petId, apiKey); - } - - /** - * Find pets by status response entity. - * - * @param status the status - * @return the response entity - */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), - @ApiResponse(responseCode = "400", description = "Invalid status value") }) - @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) - default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { - return getDelegate().findPetsByStatus(status); - } - - /** - * Find pets by tags response entity. - * - * @param tags the tags - * @return the response entity - */ - @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), - @ApiResponse(responseCode = "400", description = "Invalid tag value") }) - @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) - default ResponseEntity> findPetsByTags( - @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { - return getDelegate().findPetsByTags(tags); - } - - /** - * Gets pet by id. - * - * @param petId the pet id - * @return the pet by id - */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { - @SecurityRequirement(name = "api_key") }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") }) - @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) - default ResponseEntity getPetById( - @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { - return getDelegate().getPetById(petId); - } - - /** - * Update pet response entity. - * - * @param pet the pet - * @return the response entity - */ - @Operation(summary = "Update an existing pet", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") }) - @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) - default ResponseEntity updatePet( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { - return getDelegate().updatePet(pet); - } - - /** - * Update pet with form response entity. - * - * @param petId the pet id - * @param name the name - * @param status the status - * @return the response entity - */ - @Operation(summary = "Updates a pet in the store with form data", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) - @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) - default ResponseEntity updatePetWithForm( - @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, - @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { - return getDelegate().updatePetWithForm(petId, name, status); - } - - /** - * Upload file response entity. - * - * @param petId the pet id - * @param additionalMetadata the additional metadata - * @param file the file - * @return the response entity - */ - @Operation(summary = "uploads an image", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) - @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { - "multipart/form-data" }) - default ResponseEntity uploadFile( - @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { - return getDelegate().uploadFile(petId, additionalMetadata, file); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiController.java deleted file mode 100644 index 65efc6309..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api.pet; - -import java.util.Optional; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Pet api controller. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@RestController -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -class PetApiController implements PetApi { - - /** - * The Delegate. - */ - private final PetApiDelegate delegate; - - /** - * Instantiates a new Pet api controller. - * - * @param delegate the delegate - */ - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { - }); - } - - /** - * Gets delegate. - * - * @return the delegate - */ - @Override - public PetApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegate.java deleted file mode 100644 index 3aefe9b6e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegate.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api.pet; - -import java.util.List; -import java.util.Optional; - -import jakarta.validation.Valid; -import test.org.springdoc.api.app105.api.ApiUtil; -import test.org.springdoc.api.app105.model.ModelApiResponse; -import test.org.springdoc.api.app105.model.Pet; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -/** - * A delegate to be called by the {@link PetApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -public interface PetApiDelegate { - - /** - * Gets request. - * - * @return the request - */ - default Optional getRequest() { - return Optional.empty(); - } - - /** - * Add pet. - * - * @param pet the pet - * @see PetApi#addPet PetApi#addPet - */ - default void addPet(Pet pet) { - - } - - /** - * Delete pet response entity. - * - * @param petId the pet id - * @param apiKey the api key - * @return the response entity - * @see PetApi#deletePet PetApi#deletePet - */ - default ResponseEntity deletePet(Long petId, - String apiKey) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Find pets by status response entity. - * - * @param status the status - * @return the response entity - * @see PetApi#findPetsByStatus PetApi#findPetsByStatus - */ - default ResponseEntity> findPetsByStatus(List status) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Extract. - */ - default void extract() { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); - break; - } - } - }); - } - - /** - * Find pets by tags response entity. - * - * @param tags the tags - * @return the response entity - * @see PetApi#findPetsByTags PetApi#findPetsByTags - */ - default ResponseEntity> findPetsByTags(List tags) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Gets pet by id. - * - * @param petId the pet id - * @return the pet by id - * @see PetApi#getPetById PetApi#getPetById - */ - default ResponseEntity getPetById(Long petId) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Update pet response entity. - * - * @param pet the pet - * @return the response entity - * @see PetApi#updatePet PetApi#updatePet - */ - default ResponseEntity updatePet(Pet pet) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Update pet with form response entity. - * - * @param petId the pet id - * @param name the name - * @param status the status - * @return the response entity - * @see PetApi#updatePetWithForm PetApi#updatePetWithForm - */ - default ResponseEntity updatePetWithForm(Long petId, - String name, - String status) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Upload file response entity. - * - * @param petId the pet id - * @param additionalMetadata the additional metadata - * @param file the file - * @return the response entity - * @see PetApi#uploadFile PetApi#uploadFile - */ - default ResponseEntity uploadFile(Long petId, - String additionalMetadata, - @Valid MultipartFile file) { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegateImpl.java deleted file mode 100644 index feb72bed7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/pet/PetApiDelegateImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api.pet; - -import org.springframework.stereotype.Service; - -/** - * The type Pet api delegate. - */ -@Service -class PetApiDelegateImpl implements PetApiDelegate { - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApi.java deleted file mode 100644 index 8f4ff87e9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApi.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package test.org.springdoc.api.app105.api.store; - -import java.util.Map; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotBlank; -import test.org.springdoc.api.app105.model.Order; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -/** - * The interface Store api. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@Tag(name = "store", description = "the store API") -public interface StoreApi { - - /** - * Gets delegate. - * - * @return the delegate - */ - default StoreApiDelegate getDelegate() { - return new StoreApiDelegate() { - }; - } - - /** - * Delete order response entity. - * - * @param orderId the order id - * @return the response entity - */ - @Operation(summary = "Delete purchase order by ID", tags = { "store" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") }) - @DeleteMapping(value = "/store/order/{orderId}") - default ResponseEntity deleteOrder( - @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { - return getDelegate().deleteOrder(orderId); - } - - /** - * Gets inventory. - * - * @return the inventory - */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { - @SecurityRequirement(name = "api_key") }, tags = { "store" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) - @GetMapping(value = "/store/inventory", produces = { "application/json" }) - default ResponseEntity> getInventory() { - return getDelegate().getInventory(); - } - - /** - * Gets order by id. - * - * @param orderId the order id - * @return the order by id - */ - @Operation(summary = "Find purchase order by ID", tags = { "store" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") }) - @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { - return getDelegate().getOrderById(orderId); - } - - /** - * Place order response entity. - * - * @param order the order - * @return the response entity - */ - @Operation(summary = "Place an order for a pet", tags = { "store" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), - @ApiResponse(responseCode = "400", description = "Invalid Order") }) - @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { - "application/json" }) - default ResponseEntity placeOrder( - @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { - return getDelegate().placeOrder(order); - } - - /** - * Stores. - * - * @param name the name - */ - @GetMapping(value = "/v1/stores") - default void stores(@Valid @NotBlank String name) { - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiController.java deleted file mode 100644 index 7ce9e3984..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api.store; - -import java.util.Optional; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Store api controller. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@RestController -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -class StoreApiController implements StoreApi { - - /** - * The Delegate. - */ - private final StoreApiDelegate delegate; - - /** - * Instantiates a new Store api controller. - * - * @param delegate the delegate - */ - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { - }); - } - - /** - * Gets delegate. - * - * @return the delegate - */ - @Override - public StoreApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegate.java deleted file mode 100644 index 73909fcf3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegate.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api.store; - -import java.util.Map; -import java.util.Optional; - -import test.org.springdoc.api.app105.api.ApiUtil; -import test.org.springdoc.api.app105.model.Order; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; - -/** - * A delegate to be called by the {@link StoreApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -public interface StoreApiDelegate { - - /** - * Gets request. - * - * @return the request - */ - default Optional getRequest() { - return Optional.empty(); - } - - /** - * Delete order response entity. - * - * @param orderId the order id - * @return the response entity - * @see StoreApi#deleteOrder StoreApi#deleteOrder - */ - default ResponseEntity deleteOrder(String orderId) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Gets inventory. - * - * @return the inventory - * @see StoreApi#getInventory StoreApi#getInventory - */ - default ResponseEntity> getInventory() { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Gets order by id. - * - * @param orderId the order id - * @return the order by id - * @see StoreApi#getOrderById StoreApi#getOrderById - */ - default ResponseEntity getOrderById(Long orderId) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Extract. - */ - default void extract() { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); - break; - } - } - }); - } - - /** - * Place order response entity. - * - * @param order the order - * @return the response entity - * @see StoreApi#placeOrder StoreApi#placeOrder - */ - default ResponseEntity placeOrder(Order order) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegateImpl.java deleted file mode 100644 index cd3051772..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/store/StoreApiDelegateImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api.store; - -import org.springframework.stereotype.Service; - -/** - * The type Store api delegate. - */ -@Service -class StoreApiDelegateImpl implements StoreApiDelegate { - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApi.java deleted file mode 100644 index 70f642c76..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApi.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package test.org.springdoc.api.app105.api.user; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; -import test.org.springdoc.api.app105.model.User; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; - -/** - * The interface User api. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@Tag(name = "user", description = "the user API") -public interface UserApi { - - /** - * Gets delegate. - * - * @return the delegate - */ - default UserApiDelegate getDelegate() { - return new UserApiDelegate() { - }; - } - - /** - * Create user response entity. - * - * @param user the user - * @return the response entity - */ - @Operation(summary = "Create user", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - @PostMapping(value = "/user", consumes = { "application/json" }) - default ResponseEntity createUser( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { - return getDelegate().createUser(user); - } - - /** - * Create users with array input response entity. - * - * @param user the user - * @return the response entity - */ - @Operation(summary = "Creates list of users with given input array", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - - @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) - default ResponseEntity createUsersWithArrayInput( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { - return getDelegate().createUsersWithArrayInput(user); - } - - /** - * Create users with list input response entity. - * - * @param user the user - * @return the response entity - */ - @Operation(summary = "Creates list of users with given input array", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) - default ResponseEntity createUsersWithListInput( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { - return getDelegate().createUsersWithListInput(user); - } - - /** - * Delete user response entity. - * - * @param username the username - * @return the response entity - */ - @Operation(summary = "Creates list of users with given input array", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - - @DeleteMapping(value = "/user/{username}") - default ResponseEntity deleteUser( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { - return getDelegate().deleteUser(username); - } - - /** - * Gets user by name. - * - * @param username the username - * @return the user by name - */ - @Operation(summary = "Get user by user name", tags = { "user" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") }) - - @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) - default ResponseEntity getUserByName( - @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { - return getDelegate().getUserByName(username); - } - - /** - * Login user response entity. - * - * @param username the username - * @param password the password - * @return the response entity - */ - @Operation(summary = "Logs user into the system", tags = { "user" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), - @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) - @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) - default ResponseEntity loginUser( - @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { - return getDelegate().loginUser(username, password); - } - - /** - * Logout user response entity. - * - * @return the response entity - */ - @Operation(summary = "Logs out current logged in user session", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - @GetMapping(value = "/user/logout") - default ResponseEntity logoutUser() { - return getDelegate().logoutUser(); - } - - /** - * Update user response entity. - * - * @param username the username - * @param user the user - * @return the response entity - */ - @Operation(summary = "Updated user", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), - @ApiResponse(responseCode = "404", description = "User not found") }) - @PutMapping(value = "/user/{username}", consumes = { "application/json" }) - default ResponseEntity updateUser( - @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { - return getDelegate().updateUser(username, user); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiController.java deleted file mode 100644 index 98692328f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api.user; - -import java.util.Optional; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type User api controller. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@RestController -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -class UserApiController implements UserApi { - - /** - * The Delegate. - */ - private final UserApiDelegate delegate; - - /** - * Instantiates a new User api controller. - * - * @param delegate the delegate - */ - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { - }); - } - - /** - * Gets delegate. - * - * @return the delegate - */ - @Override - public UserApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegate.java deleted file mode 100644 index 2c5078888..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegate.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api.user; - -import java.util.List; -import java.util.Optional; - -import test.org.springdoc.api.app105.api.ApiUtil; -import test.org.springdoc.api.app105.model.User; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; - -/** - * A delegate to be called by the {@link UserApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -public interface UserApiDelegate { - - /** - * Gets request. - * - * @return the request - */ - default Optional getRequest() { - return Optional.empty(); - } - - /** - * Create user response entity. - * - * @param user the user - * @return the response entity - * @see UserApi#createUser UserApi#createUser - */ - default ResponseEntity createUser(User user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Create users with array input response entity. - * - * @param user the user - * @return the response entity - * @see UserApi#createUsersWithArrayInput UserApi#createUsersWithArrayInput - */ - default ResponseEntity createUsersWithArrayInput(List user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Create users with list input response entity. - * - * @param user the user - * @return the response entity - * @see UserApi#createUsersWithListInput UserApi#createUsersWithListInput - */ - default ResponseEntity createUsersWithListInput(List user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Delete user response entity. - * - * @param username the username - * @return the response entity - * @see UserApi#deleteUser UserApi#deleteUser - */ - default ResponseEntity deleteUser(String username) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Gets user by name. - * - * @param username the username - * @return the user by name - * @see UserApi#getUserByName UserApi#getUserByName - */ - default ResponseEntity getUserByName(String username) { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Login user response entity. - * - * @param username the username - * @param password the password - * @return the response entity - * @see UserApi#loginUser UserApi#loginUser - */ - default ResponseEntity loginUser(String username, - String password) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Logout user response entity. - * - * @return the response entity - * @see UserApi#logoutUser UserApi#logoutUser - */ - default ResponseEntity logoutUser() { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Update user response entity. - * - * @param username the username - * @param user the user - * @return the response entity - * @see UserApi#updateUser UserApi#updateUser - */ - default ResponseEntity updateUser(String username, - User user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegateImpl.java deleted file mode 100644 index 91f65c580..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/api/user/UserApiDelegateImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.api.user; - -import org.springframework.stereotype.Service; - -/** - * The type User api delegate. - */ -@Service -class UserApiDelegateImpl implements UserApiDelegate { - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Category.java deleted file mode 100644 index 70f61cf74..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Category.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Category. - */ -class Category { - - /** - * The Id. - */ - @Schema(description = "") - private Long id = null; - - /** - * The Name. - */ - @Schema(description = "") - private String name = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id category. - * - * @param id the id - * @return the category - */ - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get name - * - * @return name name - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Name category. - * - * @param name the name - * @return the category - */ - public Category name(String name) { - this.name = name; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/ModelApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/ModelApiResponse.java deleted file mode 100644 index f3cedc0d2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/ModelApiResponse.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Model api response. - */ -public class ModelApiResponse { - - /** - * The Code. - */ - @Schema(description = "") - private Integer code = null; - - /** - * The Type. - */ - @Schema(description = "") - private String type = null; - - /** - * The Message. - */ - @Schema(description = "") - private String message = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get code - * - * @return code code - */ - @JsonProperty("code") - public Integer getCode() { - return code; - } - - /** - * Sets code. - * - * @param code the code - */ - public void setCode(Integer code) { - this.code = code; - } - - /** - * Code model api response. - * - * @param code the code - * @return the model api response - */ - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get type - * - * @return type type - */ - @JsonProperty("type") - public String getType() { - return type; - } - - /** - * Sets type. - * - * @param type the type - */ - public void setType(String type) { - this.type = type; - } - - /** - * Type model api response. - * - * @param type the type - * @return the model api response - */ - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get message - * - * @return message message - */ - @JsonProperty("message") - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } - - /** - * Message model api response. - * - * @param message the message - * @return the model api response - */ - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Order.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Order.java deleted file mode 100644 index 225f2e5c6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Order.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.model; - -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Order. - */ -public class Order { - - /** - * The Id. - */ - @Schema(description = "") - private Long id = null; - - /** - * The Pet id. - */ - @Schema(description = "") - private Long petId = null; - - /** - * The Quantity. - */ - @Schema(description = "") - private Integer quantity = null; - - /** - * The Ship date. - */ - @Schema(description = "") - private Date shipDate = null; - - /** - * The Status. - */ - @Schema(description = "Order Status") - /** - * Order Status - **/ - private StatusEnum status = null; - - /** - * The Complete. - */ - @Schema(description = "") - private Boolean complete = false; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id order. - * - * @param id the id - * @return the order - */ - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get petId - * - * @return petId pet id - */ - @JsonProperty("petId") - public Long getPetId() { - return petId; - } - - /** - * Sets pet id. - * - * @param petId the pet id - */ - public void setPetId(Long petId) { - this.petId = petId; - } - - /** - * Pet id order. - * - * @param petId the pet id - * @return the order - */ - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get quantity - * - * @return quantity quantity - */ - @JsonProperty("quantity") - public Integer getQuantity() { - return quantity; - } - - /** - * Sets quantity. - * - * @param quantity the quantity - */ - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - /** - * Quantity order. - * - * @param quantity the quantity - * @return the order - */ - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get shipDate - * - * @return shipDate ship date - */ - @JsonProperty("shipDate") - public Date getShipDate() { - return shipDate; - } - - /** - * Sets ship date. - * - * @param shipDate the ship date - */ - public void setShipDate(Date shipDate) { - this.shipDate = shipDate; - } - - /** - * Ship date order. - * - * @param shipDate the ship date - * @return the order - */ - public Order shipDate(Date shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Order Status - * - * @return status status - */ - @JsonProperty("status") - public String getStatus() { - if (status == null) { - return null; - } - return status.getValue(); - } - - /** - * Sets status. - * - * @param status the status - */ - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - * Status order. - * - * @param status the status - * @return the order - */ - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Get complete - * - * @return complete boolean - */ - @JsonProperty("complete") - public Boolean isisComplete() { - return complete; - } - - /** - * Sets complete. - * - * @param complete the complete - */ - public void setComplete(Boolean complete) { - this.complete = complete; - } - - /** - * Complete order. - * - * @param complete the complete - * @return the order - */ - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * The enum Status enum. - */ - public enum StatusEnum { - /** - *Placed status enum. - */ - PLACED("placed"), - /** - *Approved status enum. - */ - APPROVED("approved"), - /** - *Delivered status enum. - */ - DELIVERED("delivered"); - - /** - * The Value. - */ - private String value; - - /** - * Instantiates a new Status enum. - * - * @param value the value - */ - StatusEnum(String value) { - this.value = value; - } - - /** - * From value status enum. - * - * @param text the text - * @return the status enum - */ - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - - /** - * Gets value. - * - * @return the value - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - return String.valueOf(value); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Pet.java deleted file mode 100644 index 62c3b4370..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Pet.java +++ /dev/null @@ -1,384 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.model; - -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; - -/** - * The type Pet. - */ -public class Pet { - - /** - * The Id. - */ - @Schema(description = "") - private Long id = null; - - /** - * The Category. - */ - @Schema(description = "") - private Category category = null; - - /** - * The Name. - */ - @Schema(example = "doggie", required = true, description = "") - private String name = null; - - /** - * The Photo urls. - */ - @Schema(required = true, description = "") - private List photoUrls = new ArrayList(); - - /** - * The Tags. - */ - @Schema(description = "") - private List tags = null; - - /** - * The Status. - */ - @Schema(description = "pet status in the store") - /** - * pet status in the store - **/ - private StatusEnum status = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id pet. - * - * @param id the id - * @return the pet - */ - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get category - * - * @return category category - */ - @JsonProperty("category") - public Category getCategory() { - return category; - } - - /** - * Sets category. - * - * @param category the category - */ - public void setCategory(Category category) { - this.category = category; - } - - /** - * Category pet. - * - * @param category the category - * @return the pet - */ - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get name - * - * @return name name - */ - @JsonProperty("name") - @NotNull - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Name pet. - * - * @param name the name - * @return the pet - */ - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get photoUrls - * - * @return photoUrls photo urls - */ - @JsonProperty("photoUrls") - @NotNull - public List getPhotoUrls() { - return photoUrls; - } - - /** - * Sets photo urls. - * - * @param photoUrls the photo urls - */ - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - /** - * Photo urls pet. - * - * @param photoUrls the photo urls - * @return the pet - */ - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - /** - * Add photo urls item pet. - * - * @param photoUrlsItem the photo urls item - * @return the pet - */ - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get tags - * - * @return tags tags - */ - @JsonProperty("tags") - public List getTags() { - return tags; - } - - /** - * Sets tags. - * - * @param tags the tags - */ - public void setTags(List tags) { - this.tags = tags; - } - - /** - * Tags pet. - * - * @param tags the tags - * @return the pet - */ - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - /** - * Add tags item pet. - * - * @param tagsItem the tags item - * @return the pet - */ - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * pet status in the store - * - * @return status status - */ - @JsonProperty("status") - public StatusEnum getStatus() { - if (status == null) { - return null; - } - return status; - } - - /** - * Sets status. - * - * @param status the status - */ - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - * Status pet. - * - * @param status the status - * @return the pet - */ - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * The enum Status enum. - */ - public enum StatusEnum { - /** - *Available status enum. - */ - AVAILABLE("available"), - /** - *Pending status enum. - */ - PENDING("pending"), - /** - *Sold status enum. - */ - SOLD("sold"); - - /** - * The Value. - */ - private String value; - - /** - * Instantiates a new Status enum. - * - * @param value the value - */ - StatusEnum(String value) { - this.value = value; - } - - /** - * From value status enum. - * - * @param text the text - * @return the status enum - */ - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - - /** - * Gets value. - * - * @return the value - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - return String.valueOf(value); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Tag.java deleted file mode 100644 index 2b5bde9af..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/Tag.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Tag. - */ -class Tag { - - /** - * The Id. - */ - @Schema(description = "") - private Long id = null; - - /** - * The Name. - */ - @Schema(description = "") - private String name = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id tag. - * - * @param id the id - * @return the tag - */ - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get name - * - * @return name name - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Name tag. - * - * @param name the name - * @return the tag - */ - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/User.java deleted file mode 100644 index 1a460b197..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app105/model/User.java +++ /dev/null @@ -1,354 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app105.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type User. - */ -public class User { - - /** - * The Id. - */ - @Schema(description = "") - private Long id = null; - - /** - * The Username. - */ - @Schema(description = "") - private String username = null; - - /** - * The First name. - */ - @Schema(description = "") - private String firstName = null; - - /** - * The Last name. - */ - @Schema(description = "") - private String lastName = null; - - /** - * The Email. - */ - @Schema(description = "") - private String email = null; - - /** - * The Password. - */ - @Schema(description = "") - private String password = null; - - /** - * The Phone. - */ - @Schema(description = "") - private String phone = null; - - /** - * The User status. - */ - @Schema(description = "User Status") - /** - * User Status - **/ - private Integer userStatus = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id user. - * - * @param id the id - * @return the user - */ - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get username - * - * @return username username - */ - @JsonProperty("username") - public String getUsername() { - return username; - } - - /** - * Sets username. - * - * @param username the username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * Username user. - * - * @param username the username - * @return the user - */ - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get firstName - * - * @return firstName first name - */ - @JsonProperty("firstName") - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * First name user. - * - * @param firstName the first name - * @return the user - */ - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get lastName - * - * @return lastName last name - */ - @JsonProperty("lastName") - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * Last name user. - * - * @param lastName the last name - * @return the user - */ - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get email - * - * @return email email - */ - @JsonProperty("email") - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * Email user. - * - * @param email the email - * @return the user - */ - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get password - * - * @return password password - */ - @JsonProperty("password") - public String getPassword() { - return password; - } - - /** - * Sets password. - * - * @param password the password - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * Password user. - * - * @param password the password - * @return the user - */ - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get phone - * - * @return phone phone - */ - @JsonProperty("phone") - public String getPhone() { - return phone; - } - - /** - * Sets phone. - * - * @param phone the phone - */ - public void setPhone(String phone) { - this.phone = phone; - } - - /** - * Phone user. - * - * @param phone the phone - * @return the user - */ - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * User Status - * - * @return userStatus user status - */ - @JsonProperty("userStatus") - public Integer getUserStatus() { - return userStatus; - } - - /** - * Sets user status. - * - * @param userStatus the user status - */ - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - /** - * User status user. - * - * @param userStatus the user status - * @return the user - */ - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/HelloController.java deleted file mode 100644 index fb5acdcab..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/HelloController.java +++ /dev/null @@ -1,40 +0,0 @@ -package test.org.springdoc.api.app106; - -import java.time.Instant; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.http.HttpHeaders; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Find articles response entity. - * - * @param modifiedSince the modified since - * @return the response entity - */ - @Operation(summary = "find-articles") - @GetMapping - @Parameter(name = HttpHeaders.IF_MODIFIED_SINCE, - description = "DateTime", - in = ParameterIn.HEADER, - schema = @Schema(type = "string", format = "date-time"), - example = "2020-01-01T00:00:00.000Z" - ) - public ResponseEntity findArticles(@RequestHeader(value = HttpHeaders.IF_MODIFIED_SINCE, required = false) Instant modifiedSince) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/SpringDocApp106Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/SpringDocApp106Test.java deleted file mode 100644 index 7bd888b6f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app106/SpringDocApp106Test.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app106; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 106 test. - */ -class SpringDocApp106Test extends AbstractSpringDocTest { - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/HelloController.java deleted file mode 100644 index d3197e70f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/HelloController.java +++ /dev/null @@ -1,59 +0,0 @@ -package test.org.springdoc.api.app107; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Gets entity b. - * - * @return the entity b - */ - @GetMapping(path = "/entity-b", produces = { "application/json", "application/xml" }) - public EntityB getEntityB() { - return new EntityB(); - } - - /** - * The type Entity b. - */ - class EntityB { - - /** - * The Field b. - */ - @Schema(required = true) - @JsonProperty("fieldB") - private String fieldB; - - /** - * The Entity a. - */ - @Schema(required = true) - @JsonProperty("entityA") - private EntityA entityA; - //Getters and setters... - } - - /** - * The type Entity a. - */ - class EntityA { - /** - * The Field a. - */ - @Schema(required = true) - @JsonProperty("fieldA") - private String fieldA; - //Getters and setters... - } -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/SpringDocApp107Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/SpringDocApp107Test.java deleted file mode 100644 index 7b9c5e512..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app107/SpringDocApp107Test.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app107; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 107 test. - */ -class SpringDocApp107Test extends AbstractSpringDocTest { - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/ActionResult.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/ActionResult.java deleted file mode 100644 index 0389238b9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/ActionResult.java +++ /dev/null @@ -1,147 +0,0 @@ -package test.org.springdoc.api.app108; - -/** - * The type Action result. - * - * @param the type parameter - */ -class ActionResult { - - /** - * The Value. - */ - protected T value; - - /** - * The Success. - */ - protected boolean success; - - /** - * The Error code. - */ - protected String errorCode; - - /** - * The Message. - */ - protected String message; - - /** - * The Error value. - */ - protected Object errorValue; - - /** - * The Target url. - */ - protected String targetUrl; - - /** - * Gets value. - * - * @return the value - */ - public T getValue() { - return value; - } - - /** - * Sets value. - * - * @param value the value - */ - public void setValue(T value) { - this.value = value; - } - - /** - * Is success boolean. - * - * @return the boolean - */ - public boolean isSuccess() { - return success; - } - - /** - * Sets success. - * - * @param success the success - */ - public void setSuccess(boolean success) { - this.success = success; - } - - /** - * Gets error code. - * - * @return the error code - */ - public String getErrorCode() { - return errorCode; - } - - /** - * Sets error code. - * - * @param errorCode the error code - */ - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } - - /** - * Gets error value. - * - * @return the error value - */ - public Object getErrorValue() { - return errorValue; - } - - /** - * Sets error value. - * - * @param errorValue the error value - */ - public void setErrorValue(Object errorValue) { - this.errorValue = errorValue; - } - - /** - * Gets target url. - * - * @return the target url - */ - public String getTargetUrl() { - return targetUrl; - } - - /** - * Sets target url. - * - * @param targetUrl the target url - */ - public void setTargetUrl(String targetUrl) { - this.targetUrl = targetUrl; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/HelloController.java deleted file mode 100644 index fcb84cde4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/HelloController.java +++ /dev/null @@ -1,23 +0,0 @@ -package test.org.springdoc.api.app108; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Update action result. - * - * @param toto the toto - * @return the action result - */ - @PostMapping - public ActionResult update(String toto) { - return null; - } -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/SpringDocApp108Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/SpringDocApp108Test.java deleted file mode 100644 index f633f2db1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app108/SpringDocApp108Test.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app108; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 108 test. - */ -class SpringDocApp108Test extends AbstractSpringDocTest { - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/HelloController.java deleted file mode 100644 index 2475eb449..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/HelloController.java +++ /dev/null @@ -1,38 +0,0 @@ -package test.org.springdoc.api.app109; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.core.io.ByteArrayResource; -import org.springframework.core.io.Resource; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Gets resource. - * - * @return the resource - */ - @GetMapping("/api/v1/resource") - public Resource getResource() { - return new ByteArrayResource(new byte[] {}); - } - - /** - * Get byte array byte [ ]. - * - * @return the byte [ ] - */ - @GetMapping("/api/v1/bytearray") - @ApiResponse(content = @Content(schema = @Schema(type = "string", format = "binary"))) - public byte[] getByteArray() { - return new byte[] {}; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/SpringDocApp109Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/SpringDocApp109Test.java deleted file mode 100644 index d54099659..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app109/SpringDocApp109Test.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app109; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 109 test. - */ -class SpringDocApp109Test extends AbstractSpringDocTest { - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java deleted file mode 100644 index d331c6143..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app11; - -import java.util.List; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Upload documents response entity. - * - * @param multipartFiles the multipart files - * @return the response entity - */ - @PostMapping(path = "/documents", consumes = "multipart/form-data") - public ResponseEntity uploadDocuments(@RequestPart("doc") List multipartFiles) { - return null; - } - - /** - * Post track string. - * - * @param file the file - * @return the string - */ - @RequestMapping(value = "/tracks", method = RequestMethod.POST, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) - public @ResponseBody - String postTrack(@RequestParam("file") MultipartFile file) { - return "redirect:/"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java deleted file mode 100644 index 12305efa6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app11; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 11 test. - */ -class SpringDocApp11Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/ErrorMessage.java deleted file mode 100644 index acaf87337..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/ErrorMessage.java +++ /dev/null @@ -1,68 +0,0 @@ -package test.org.springdoc.api.app110; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - - -/** - * The type Error message. - */ -class ErrorMessage { - - /** - * The Errors. - */ - private List errors; - - /** - * Instantiates a new Error message. - */ - public ErrorMessage() { - } - - /** - * Instantiates a new Error message. - * - * @param errors the errors - */ - public ErrorMessage(List errors) { - this.errors = errors; - } - - /** - * Instantiates a new Error message. - * - * @param error the error - */ - public ErrorMessage(String error) { - this(Collections.singletonList(error)); - } - - /** - * Instantiates a new Error message. - * - * @param errors the errors - */ - public ErrorMessage(String... errors) { - this(Arrays.asList(errors)); - } - - /** - * Gets errors. - * - * @return the errors - */ - public List getErrors() { - return errors; - } - - /** - * Sets errors. - * - * @param errors the errors - */ - public void setErrors(List errors) { - this.errors = errors; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/GlobalControllerAdvice.java deleted file mode 100644 index c6d326ac5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/GlobalControllerAdvice.java +++ /dev/null @@ -1,166 +0,0 @@ -package test.org.springdoc.api.app110; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.UUID; - -import jakarta.validation.ConstraintViolation; -import jakarta.validation.ConstraintViolationException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.web.HttpMediaTypeNotSupportedException; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.MissingServletRequestParameterException; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; - - -/** - * The type Global controller advice. - */ -@ControllerAdvice(assignableTypes = PersonController.class) -class GlobalControllerAdvice //extends ResponseEntityExceptionHandler -{ - /** - * Note use base class if you wish to leverage its handling. - * Some code will need changing. - */ - private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); - - /** - * Problem response entity. - * - * @param e the e - * @return the response entity - */ - @ExceptionHandler(Throwable.class) - @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) - public ResponseEntity problem(final Throwable e) { - String message = "Problem occured"; - UUID uuid = UUID.randomUUID(); - String logRef = uuid.toString(); - logger.error("logRef=" + logRef, message, e); - return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); - } - - - /** - * Handle method argument not valid response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(MethodArgumentNotValidException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex - ) { - List fieldErrors = ex.getBindingResult().getFieldErrors(); - List globalErrors = ex.getBindingResult().getGlobalErrors(); - List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); - String error; - for (FieldError fieldError : fieldErrors) { - error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); - errors.add(error); - } - for (ObjectError objectError : globalErrors) { - error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); - errors.add(error); - } - ErrorMessage errorMessage = new ErrorMessage(errors); - - //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - - /** - * Handle constraint violated exception response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(ConstraintViolationException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex - ) { - Set> constraintViolations = ex.getConstraintViolations(); - - - List errors = new ArrayList<>(constraintViolations.size()); - String error; - for (ConstraintViolation constraintViolation : constraintViolations) { - - error = constraintViolation.getMessage(); - errors.add(error); - } - - ErrorMessage errorMessage = new ErrorMessage(errors); - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - - /** - * Handle missing servlet request parameter exception response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(MissingServletRequestParameterException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex - ) { - - List errors = new ArrayList<>(); - String error = ex.getParameterName() + ", " + ex.getMessage(); - errors.add(error); - ErrorMessage errorMessage = new ErrorMessage(errors); - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - - - /** - * Handle http media type not supported response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(HttpMediaTypeNotSupportedException.class) - @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) - public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex - ) { - String unsupported = "Unsupported content type: " + ex.getContentType(); - String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); - ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); - return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); - } - - /** - * Handle http message not readable response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(HttpMessageNotReadableException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { - Throwable mostSpecificCause = ex.getMostSpecificCause(); - ErrorMessage errorMessage; - if (mostSpecificCause != null) { - String exceptionName = mostSpecificCause.getClass().getName(); - String message = mostSpecificCause.getMessage(); - errorMessage = new ErrorMessage(exceptionName, message); - } - else { - errorMessage = new ErrorMessage(ex.getMessage()); - } - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Person.java deleted file mode 100644 index b9a8733a9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Person.java +++ /dev/null @@ -1,186 +0,0 @@ -package test.org.springdoc.api.app110; - -import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Pattern; -import jakarta.validation.constraints.Size; -import org.hibernate.validator.constraints.CreditCardNumber; - - -/** - * The type Person. - */ -class Person { - /** - * The Id. - */ - private long id; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - @NotNull - @NotBlank - @Size(max = 10) - private String lastName; - - /** - * The Email. - */ - @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") - private String email; - - /** - * The Email 1. - */ - @Email() - private String email1; - - /** - * The Age. - */ - @Min(18) - @Max(30) - private int age; - - /** - * The Credit card number. - */ - @CreditCardNumber - private String creditCardNumber; - - /** - * Gets credit card number. - * - * @return the credit card number - */ - public String getCreditCardNumber() { - return creditCardNumber; - } - - /** - * Sets credit card number. - * - * @param creditCardNumber the credit card number - */ - public void setCreditCardNumber(String creditCardNumber) { - this.creditCardNumber = creditCardNumber; - } - - /** - * Gets id. - * - * @return the id - */ - public long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(long id) { - this.id = id; - } - - /** - * Gets email 1. - * - * @return the email 1 - */ - public String getEmail1() { - return email1; - } - - /** - * Sets email 1. - * - * @param email1 the email 1 - */ - public void setEmail1(String email1) { - this.email1 = email1; - } - - /** - * Gets first name. - * - * @return the first name - */ - @Size(min = 2) - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * Gets age. - * - * @return the age - */ - public int getAge() { - return age; - } - - /** - * Sets age. - * - * @param age the age - */ - public void setAge(int age) { - this.age = age; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController.java deleted file mode 100644 index 14a140054..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController.java +++ /dev/null @@ -1,70 +0,0 @@ -package test.org.springdoc.api.app110; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - -import org.springframework.validation.annotation.Validated; -import org.springframework.web.HttpMediaTypeNotSupportedException; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Person controller. - */ -@RestController -@Validated -class PersonController { - /** - * The Ran. - */ - private Random ran = new Random(); - - /** - * Person person. - * - * @param person the person - * @return the person - */ - @RequestMapping(path = "/person", method = RequestMethod.POST) - public Person person(@Valid @RequestBody Person person) throws HttpMediaTypeNotSupportedException { - - int nxt = ran.nextInt(10); - if (nxt >= 5) { - throw new RuntimeException("Breaking logic"); - } - return person; - } - - /** - * Find by last name list. - * - * @param lastName the last name - * @return the list - */ - @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) - public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull - @NotBlank - @Size(max = 10) String lastName) throws HttpMediaTypeNotSupportedException { - List hardCoded = new ArrayList<>(); - Person person = new Person(); - person.setAge(20); - person.setCreditCardNumber("4111111111111111"); - person.setEmail("abc@abc.com"); - person.setEmail1("abc1@abc.com"); - person.setFirstName("Somefirstname"); - person.setLastName(lastName); - person.setId(1); - hardCoded.add(person); - return hardCoded; - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController2.java deleted file mode 100644 index 4eaede510..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/PersonController2.java +++ /dev/null @@ -1,69 +0,0 @@ -package test.org.springdoc.api.app110; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Person controller 2. - */ -@RestController -@Validated -class PersonController2 { - /** - * The Ran. - */ - private Random ran = new Random(); - - /** - * Person person. - * - * @param person the person - * @return the person - */ - @RequestMapping(path = "/person2", method = RequestMethod.POST) - public Person person(@Valid @RequestBody Person person) { - - int nxt = ran.nextInt(10); - if (nxt >= 5) { - throw new RuntimeException("Breaking logic"); - } - return person; - } - - /** - * Find by last name list. - * - * @param lastName the last name - * @return the list - */ - @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) - public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull - @NotBlank - @Size(max = 10) String lastName) { - List hardCoded = new ArrayList<>(); - Person person = new Person(); - person.setAge(20); - person.setCreditCardNumber("4111111111111111"); - person.setEmail("abc@abc.com"); - person.setEmail1("abc1@abc.com"); - person.setFirstName("Somefirstname"); - person.setLastName(lastName); - person.setId(1); - hardCoded.add(person); - return hardCoded; - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Problem.java deleted file mode 100644 index 96317413b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/Problem.java +++ /dev/null @@ -1,73 +0,0 @@ -package test.org.springdoc.api.app110; - -/** - * The type Problem. - */ -class Problem { - - /** - * The Log ref. - */ - private String logRef; - - /** - * The Message. - */ - private String message; - - /** - * Instantiates a new Problem. - * - * @param logRef the log ref - * @param message the message - */ - public Problem(String logRef, String message) { - super(); - this.logRef = logRef; - this.message = message; - } - - /** - * Instantiates a new Problem. - */ - public Problem() { - super(); - - } - - /** - * Gets log ref. - * - * @return the log ref - */ - public String getLogRef() { - return logRef; - } - - /** - * Sets log ref. - * - * @param logRef the log ref - */ - public void setLogRef(String logRef) { - this.logRef = logRef; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/SpringDocApp110Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/SpringDocApp110Test.java deleted file mode 100644 index 5436f3051..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app110/SpringDocApp110Test.java +++ /dev/null @@ -1,46 +0,0 @@ -package test.org.springdoc.api.app110; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 110 test. - */ -@TestPropertySource(properties = { - "application-description=description", - "application-version=v1" }) -class SpringDocApp110Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - - /** - * Custom open api open api. - * - * @param appDesciption the app desciption - * @param appVersion the app version - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { - - return new OpenAPI() - .info(new Info() - .title("sample application API") - .version(appVersion) - .description(appDesciption) - .termsOfService("http://swagger.io/terms/") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/ErrorMessage.java deleted file mode 100644 index 987d07087..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/ErrorMessage.java +++ /dev/null @@ -1,68 +0,0 @@ -package test.org.springdoc.api.app111; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - - -/** - * The type Error message. - */ -class ErrorMessage { - - /** - * The Errors. - */ - private List errors; - - /** - * Instantiates a new Error message. - */ - public ErrorMessage() { - } - - /** - * Instantiates a new Error message. - * - * @param errors the errors - */ - public ErrorMessage(List errors) { - this.errors = errors; - } - - /** - * Instantiates a new Error message. - * - * @param error the error - */ - public ErrorMessage(String error) { - this(Collections.singletonList(error)); - } - - /** - * Instantiates a new Error message. - * - * @param errors the errors - */ - public ErrorMessage(String... errors) { - this(Arrays.asList(errors)); - } - - /** - * Gets errors. - * - * @return the errors - */ - public List getErrors() { - return errors; - } - - /** - * Sets errors. - * - * @param errors the errors - */ - public void setErrors(List errors) { - this.errors = errors; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/GlobalControllerAdvice.java deleted file mode 100644 index f33033e8d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/GlobalControllerAdvice.java +++ /dev/null @@ -1,166 +0,0 @@ -package test.org.springdoc.api.app111; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.UUID; - -import jakarta.validation.ConstraintViolation; -import jakarta.validation.ConstraintViolationException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.web.HttpMediaTypeNotSupportedException; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.MissingServletRequestParameterException; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; - - -/** - * The type Global controller advice. - */ -@ControllerAdvice(basePackages = "test.org.springdoc.api.appzzz") -class GlobalControllerAdvice //extends ResponseEntityExceptionHandler -{ - /** - * Note use base class if you wish to leverage its handling. - * Some code will need changing. - */ - private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); - - /** - * Problem response entity. - * - * @param e the e - * @return the response entity - */ - @ExceptionHandler(Throwable.class) - @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) - public ResponseEntity problem(final Throwable e) { - String message = "Problem occured"; - UUID uuid = UUID.randomUUID(); - String logRef = uuid.toString(); - logger.error("logRef=" + logRef, message, e); - return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); - } - - - /** - * Handle method argument not valid response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(MethodArgumentNotValidException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex - ) { - List fieldErrors = ex.getBindingResult().getFieldErrors(); - List globalErrors = ex.getBindingResult().getGlobalErrors(); - List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); - String error; - for (FieldError fieldError : fieldErrors) { - error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); - errors.add(error); - } - for (ObjectError objectError : globalErrors) { - error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); - errors.add(error); - } - ErrorMessage errorMessage = new ErrorMessage(errors); - - //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - - /** - * Handle constraint violated exception response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(ConstraintViolationException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex - ) { - Set> constraintViolations = ex.getConstraintViolations(); - - - List errors = new ArrayList<>(constraintViolations.size()); - String error; - for (ConstraintViolation constraintViolation : constraintViolations) { - - error = constraintViolation.getMessage(); - errors.add(error); - } - - ErrorMessage errorMessage = new ErrorMessage(errors); - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - - /** - * Handle missing servlet request parameter exception response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(MissingServletRequestParameterException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex - ) { - - List errors = new ArrayList<>(); - String error = ex.getParameterName() + ", " + ex.getMessage(); - errors.add(error); - ErrorMessage errorMessage = new ErrorMessage(errors); - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - - - /** - * Handle http media type not supported response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(HttpMediaTypeNotSupportedException.class) - @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) - public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex - ) { - String unsupported = "Unsupported content type: " + ex.getContentType(); - String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); - ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); - return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); - } - - /** - * Handle http message not readable response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(HttpMessageNotReadableException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { - Throwable mostSpecificCause = ex.getMostSpecificCause(); - ErrorMessage errorMessage; - if (mostSpecificCause != null) { - String exceptionName = mostSpecificCause.getClass().getName(); - String message = mostSpecificCause.getMessage(); - errorMessage = new ErrorMessage(exceptionName, message); - } - else { - errorMessage = new ErrorMessage(ex.getMessage()); - } - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Person.java deleted file mode 100644 index a73ca5b25..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Person.java +++ /dev/null @@ -1,186 +0,0 @@ -package test.org.springdoc.api.app111; - -import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Pattern; -import jakarta.validation.constraints.Size; -import org.hibernate.validator.constraints.CreditCardNumber; - - -/** - * The type Person. - */ -class Person { - /** - * The Id. - */ - private long id; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - @NotNull - @NotBlank - @Size(max = 10) - private String lastName; - - /** - * The Email. - */ - @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") - private String email; - - /** - * The Email 1. - */ - @Email() - private String email1; - - /** - * The Age. - */ - @Min(18) - @Max(30) - private int age; - - /** - * The Credit card number. - */ - @CreditCardNumber - private String creditCardNumber; - - /** - * Gets credit card number. - * - * @return the credit card number - */ - public String getCreditCardNumber() { - return creditCardNumber; - } - - /** - * Sets credit card number. - * - * @param creditCardNumber the credit card number - */ - public void setCreditCardNumber(String creditCardNumber) { - this.creditCardNumber = creditCardNumber; - } - - /** - * Gets id. - * - * @return the id - */ - public long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(long id) { - this.id = id; - } - - /** - * Gets email 1. - * - * @return the email 1 - */ - public String getEmail1() { - return email1; - } - - /** - * Sets email 1. - * - * @param email1 the email 1 - */ - public void setEmail1(String email1) { - this.email1 = email1; - } - - /** - * Gets first name. - * - * @return the first name - */ - @Size(min = 2) - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * Gets age. - * - * @return the age - */ - public int getAge() { - return age; - } - - /** - * Sets age. - * - * @param age the age - */ - public void setAge(int age) { - this.age = age; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController.java deleted file mode 100644 index dc9549618..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController.java +++ /dev/null @@ -1,69 +0,0 @@ -package test.org.springdoc.api.app111; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Person controller. - */ -@RestController -@Validated -class PersonController { - /** - * The Ran. - */ - private Random ran = new Random(); - - /** - * Person person. - * - * @param person the person - * @return the person - */ - @RequestMapping(path = "/person", method = RequestMethod.POST) - public Person person(@Valid @RequestBody Person person) { - - int nxt = ran.nextInt(10); - if (nxt >= 5) { - throw new RuntimeException("Breaking logic"); - } - return person; - } - - /** - * Find by last name list. - * - * @param lastName the last name - * @return the list - */ - @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) - public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull - @NotBlank - @Size(max = 10) String lastName) { - List hardCoded = new ArrayList<>(); - Person person = new Person(); - person.setAge(20); - person.setCreditCardNumber("4111111111111111"); - person.setEmail("abc@abc.com"); - person.setEmail1("abc1@abc.com"); - person.setFirstName("Somefirstname"); - person.setLastName(lastName); - person.setId(1); - hardCoded.add(person); - return hardCoded; - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController2.java deleted file mode 100644 index 8d915472a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/PersonController2.java +++ /dev/null @@ -1,69 +0,0 @@ -package test.org.springdoc.api.app111; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Person controller 2. - */ -@RestController -@Validated -class PersonController2 { - /** - * The Ran. - */ - private Random ran = new Random(); - - /** - * Person person. - * - * @param person the person - * @return the person - */ - @RequestMapping(path = "/person2", method = RequestMethod.POST) - public Person person(@Valid @RequestBody Person person) { - - int nxt = ran.nextInt(10); - if (nxt >= 5) { - throw new RuntimeException("Breaking logic"); - } - return person; - } - - /** - * Find by last name list. - * - * @param lastName the last name - * @return the list - */ - @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) - public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull - @NotBlank - @Size(max = 10) String lastName) { - List hardCoded = new ArrayList<>(); - Person person = new Person(); - person.setAge(20); - person.setCreditCardNumber("4111111111111111"); - person.setEmail("abc@abc.com"); - person.setEmail1("abc1@abc.com"); - person.setFirstName("Somefirstname"); - person.setLastName(lastName); - person.setId(1); - hardCoded.add(person); - return hardCoded; - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Problem.java deleted file mode 100644 index 088ca0795..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/Problem.java +++ /dev/null @@ -1,73 +0,0 @@ -package test.org.springdoc.api.app111; - -/** - * The type Problem. - */ -class Problem { - - /** - * The Log ref. - */ - private String logRef; - - /** - * The Message. - */ - private String message; - - /** - * Instantiates a new Problem. - * - * @param logRef the log ref - * @param message the message - */ - public Problem(String logRef, String message) { - super(); - this.logRef = logRef; - this.message = message; - } - - /** - * Instantiates a new Problem. - */ - public Problem() { - super(); - - } - - /** - * Gets log ref. - * - * @return the log ref - */ - public String getLogRef() { - return logRef; - } - - /** - * Sets log ref. - * - * @param logRef the log ref - */ - public void setLogRef(String logRef) { - this.logRef = logRef; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/SpringDocApp111Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/SpringDocApp111Test.java deleted file mode 100644 index 5894369f9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app111/SpringDocApp111Test.java +++ /dev/null @@ -1,45 +0,0 @@ -package test.org.springdoc.api.app111; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 111 test. - */ -@TestPropertySource(properties = { - "application-description=description", - "application-version=v1" }) -class SpringDocApp111Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - - /** - * Custom open api open api. - * - * @param appDesciption the app desciption - * @param appVersion the app version - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { - return new OpenAPI() - .info(new Info() - .title("sample application API") - .version(appVersion) - .description(appDesciption) - .termsOfService("http://swagger.io/terms/") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/ErrorMessage.java deleted file mode 100644 index f0404171c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/ErrorMessage.java +++ /dev/null @@ -1,68 +0,0 @@ -package test.org.springdoc.api.app112; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - - -/** - * The type Error message. - */ -class ErrorMessage { - - /** - * The Errors. - */ - private List errors; - - /** - * Instantiates a new Error message. - */ - public ErrorMessage() { - } - - /** - * Instantiates a new Error message. - * - * @param errors the errors - */ - public ErrorMessage(List errors) { - this.errors = errors; - } - - /** - * Instantiates a new Error message. - * - * @param error the error - */ - public ErrorMessage(String error) { - this(Collections.singletonList(error)); - } - - /** - * Instantiates a new Error message. - * - * @param errors the errors - */ - public ErrorMessage(String... errors) { - this(Arrays.asList(errors)); - } - - /** - * Gets errors. - * - * @return the errors - */ - public List getErrors() { - return errors; - } - - /** - * Sets errors. - * - * @param errors the errors - */ - public void setErrors(List errors) { - this.errors = errors; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/GlobalControllerAdvice.java deleted file mode 100644 index 1de9557f6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/GlobalControllerAdvice.java +++ /dev/null @@ -1,166 +0,0 @@ -package test.org.springdoc.api.app112; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.UUID; - -import jakarta.validation.ConstraintViolation; -import jakarta.validation.ConstraintViolationException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.web.HttpMediaTypeNotSupportedException; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.MissingServletRequestParameterException; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; - - -/** - * The type Global controller advice. - */ -@ControllerAdvice(basePackages = "test.org.springdoc.api.app112.sample") -class GlobalControllerAdvice //extends ResponseEntityExceptionHandler -{ - /** - * Note use base class if you wish to leverage its handling. - * Some code will need changing. - */ - private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); - - /** - * Problem response entity. - * - * @param e the e - * @return the response entity - */ - @ExceptionHandler(Throwable.class) - @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) - public ResponseEntity problem(final Throwable e) { - String message = "Problem occured"; - UUID uuid = UUID.randomUUID(); - String logRef = uuid.toString(); - logger.error("logRef=" + logRef, message, e); - return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); - } - - - /** - * Handle method argument not valid response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(MethodArgumentNotValidException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex - ) { - List fieldErrors = ex.getBindingResult().getFieldErrors(); - List globalErrors = ex.getBindingResult().getGlobalErrors(); - List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); - String error; - for (FieldError fieldError : fieldErrors) { - error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); - errors.add(error); - } - for (ObjectError objectError : globalErrors) { - error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); - errors.add(error); - } - ErrorMessage errorMessage = new ErrorMessage(errors); - - //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - - /** - * Handle constraint violated exception response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(ConstraintViolationException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex - ) { - Set> constraintViolations = ex.getConstraintViolations(); - - - List errors = new ArrayList<>(constraintViolations.size()); - String error; - for (ConstraintViolation constraintViolation : constraintViolations) { - - error = constraintViolation.getMessage(); - errors.add(error); - } - - ErrorMessage errorMessage = new ErrorMessage(errors); - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - - /** - * Handle missing servlet request parameter exception response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(MissingServletRequestParameterException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex - ) { - - List errors = new ArrayList<>(); - String error = ex.getParameterName() + ", " + ex.getMessage(); - errors.add(error); - ErrorMessage errorMessage = new ErrorMessage(errors); - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - - - /** - * Handle http media type not supported response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(HttpMediaTypeNotSupportedException.class) - @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) - public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex - ) { - String unsupported = "Unsupported content type: " + ex.getContentType(); - String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); - ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); - return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); - } - - /** - * Handle http message not readable response entity. - * - * @param ex the ex - * @return the response entity - */ - @ExceptionHandler(HttpMessageNotReadableException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { - Throwable mostSpecificCause = ex.getMostSpecificCause(); - ErrorMessage errorMessage; - if (mostSpecificCause != null) { - String exceptionName = mostSpecificCause.getClass().getName(); - String message = mostSpecificCause.getMessage(); - errorMessage = new ErrorMessage(exceptionName, message); - } - else { - errorMessage = new ErrorMessage(ex.getMessage()); - } - return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Person.java deleted file mode 100644 index 4846397e0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Person.java +++ /dev/null @@ -1,186 +0,0 @@ -package test.org.springdoc.api.app112; - -import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Pattern; -import jakarta.validation.constraints.Size; -import org.hibernate.validator.constraints.CreditCardNumber; - - -/** - * The type Person. - */ -public class Person { - /** - * The Id. - */ - private long id; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - @NotNull - @NotBlank - @Size(max = 10) - private String lastName; - - /** - * The Email. - */ - @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") - private String email; - - /** - * The Email 1. - */ - @Email() - private String email1; - - /** - * The Age. - */ - @Min(18) - @Max(30) - private int age; - - /** - * The Credit card number. - */ - @CreditCardNumber - private String creditCardNumber; - - /** - * Gets credit card number. - * - * @return the credit card number - */ - public String getCreditCardNumber() { - return creditCardNumber; - } - - /** - * Sets credit card number. - * - * @param creditCardNumber the credit card number - */ - public void setCreditCardNumber(String creditCardNumber) { - this.creditCardNumber = creditCardNumber; - } - - /** - * Gets id. - * - * @return the id - */ - public long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(long id) { - this.id = id; - } - - /** - * Gets email 1. - * - * @return the email 1 - */ - public String getEmail1() { - return email1; - } - - /** - * Sets email 1. - * - * @param email1 the email 1 - */ - public void setEmail1(String email1) { - this.email1 = email1; - } - - /** - * Gets first name. - * - * @return the first name - */ - @Size(min = 2) - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * Gets age. - * - * @return the age - */ - public int getAge() { - return age; - } - - /** - * Sets age. - * - * @param age the age - */ - public void setAge(int age) { - this.age = age; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/PersonController.java deleted file mode 100644 index 4d81dd572..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/PersonController.java +++ /dev/null @@ -1,69 +0,0 @@ -package test.org.springdoc.api.app112; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; - -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Person controller. - */ -@RestController -@Validated -class PersonController { - /** - * The Ran. - */ - private Random ran = new Random(); - - /** - * Person person. - * - * @param person the person - * @return the person - */ - @RequestMapping(path = "/person", method = RequestMethod.POST) - public Person person(@Valid @RequestBody Person person) { - - int nxt = ran.nextInt(10); - if (nxt >= 5) { - throw new RuntimeException("Breaking logic"); - } - return person; - } - - /** - * Find by last name list. - * - * @param lastName the last name - * @return the list - */ - @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) - public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull - @NotBlank - @Size(max = 10) String lastName) { - List hardCoded = new ArrayList<>(); - Person person = new Person(); - person.setAge(20); - person.setCreditCardNumber("4111111111111111"); - person.setEmail("abc@abc.com"); - person.setEmail1("abc1@abc.com"); - person.setFirstName("Somefirstname"); - person.setLastName(lastName); - person.setId(1); - hardCoded.add(person); - return hardCoded; - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Problem.java deleted file mode 100644 index ee5127936..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/Problem.java +++ /dev/null @@ -1,73 +0,0 @@ -package test.org.springdoc.api.app112; - -/** - * The type Problem. - */ -class Problem { - - /** - * The Log ref. - */ - private String logRef; - - /** - * The Message. - */ - private String message; - - /** - * Instantiates a new Problem. - * - * @param logRef the log ref - * @param message the message - */ - public Problem(String logRef, String message) { - super(); - this.logRef = logRef; - this.message = message; - } - - /** - * Instantiates a new Problem. - */ - public Problem() { - super(); - - } - - /** - * Gets log ref. - * - * @return the log ref - */ - public String getLogRef() { - return logRef; - } - - /** - * Sets log ref. - * - * @param logRef the log ref - */ - public void setLogRef(String logRef) { - this.logRef = logRef; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/SpringDocApp112Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/SpringDocApp112Test.java deleted file mode 100644 index 83cd397c3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/SpringDocApp112Test.java +++ /dev/null @@ -1,45 +0,0 @@ -package test.org.springdoc.api.app112; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 112 test. - */ -@TestPropertySource(properties = { - "application-description=description", - "application-version=v1" }) -class SpringDocApp112Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - - /** - * Custom open api open api. - * - * @param appDesciption the app desciption - * @param appVersion the app version - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { - return new OpenAPI() - .info(new Info() - .title("sample application API") - .version(appVersion) - .description(appDesciption) - .termsOfService("http://swagger.io/terms/") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/sample/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/sample/PersonController2.java deleted file mode 100644 index 99c5556a1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app112/sample/PersonController2.java +++ /dev/null @@ -1,71 +0,0 @@ -package test.org.springdoc.api.app112.sample; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; -import test.org.springdoc.api.app112.Person; - -import org.springframework.validation.annotation.Validated; -import org.springframework.web.HttpMediaTypeNotSupportedException; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Person controller 2. - */ -@RestController -@Validated -class PersonController2 { - /** - * The Ran. - */ - private Random ran = new Random(); - - /** - * Person person. - * - * @param person the person - * @return the person - */ - @RequestMapping(path = "/person2", method = RequestMethod.POST) - public Person person(@Valid @RequestBody Person person) throws HttpMediaTypeNotSupportedException { - - int nxt = ran.nextInt(10); - if (nxt >= 5) { - throw new RuntimeException("Breaking logic"); - } - return person; - } - - /** - * Find by last name list. - * - * @param lastName the last name - * @return the list - */ - @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) - public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull - @NotBlank - @Size(max = 10) String lastName) throws HttpMediaTypeNotSupportedException { - List hardCoded = new ArrayList<>(); - Person person = new Person(); - person.setAge(20); - person.setCreditCardNumber("4111111111111111"); - person.setEmail("abc@abc.com"); - person.setEmail1("abc1@abc.com"); - person.setFirstName("Somefirstname"); - person.setLastName(lastName); - person.setId(1); - hardCoded.add(person); - return hardCoded; - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/HelloController.java deleted file mode 100644 index 9ae9acdcf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/HelloController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app113; - -import java.util.Optional; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test. - * - * @param body the body - */ - @PostMapping("/lol") - public void test(@RequestBody(required = false) Body body) { - } - - /** - * Test 2. - * - * @param body the body - */ - @PostMapping("/lol2") - public void test2(@RequestBody Optional body) { - } - - /** - * The type Body. - */ - class Body { - /** - * The Field. - */ - public String field; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/SpringDocApp113Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/SpringDocApp113Test.java deleted file mode 100644 index 12bdcb85c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app113/SpringDocApp113Test.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app113; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 113 test. - */ -class SpringDocApp113Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/HelloController.java deleted file mode 100644 index cc51c4e91..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/HelloController.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app114; - -import javax.money.MonetaryAmount; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Gets currency. - * - * @param carDTO the car dto - * @return the currency - */ - @PostMapping(value = "/foos1", consumes = MediaType.APPLICATION_JSON_VALUE) - MonetaryAmount getCurrency(@RequestBody CarDTO carDTO) { - return carDTO.price; - } - - /** - * The type Car dto. - */ - class CarDTO { - /** - * The Price. - */ - @JsonProperty("price") - MonetaryAmount price; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/SpringDocApp114Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/SpringDocApp114Test.java deleted file mode 100644 index 1f1fa7634..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app114/SpringDocApp114Test.java +++ /dev/null @@ -1,25 +0,0 @@ -package test.org.springdoc.api.app114; - -import javax.money.MonetaryAmount; - -import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 114 test. - */ -class SpringDocApp114Test extends AbstractSpringDocTest { - - static { - SpringDocUtils.getConfig().replaceWithClass(MonetaryAmount.class, org.springdoc.core.converters.models.MonetaryAmount.class); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/HelloController.java deleted file mode 100644 index 63f6a4f38..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/HelloController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app115; - -import java.time.Duration; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Timeouts duration. - * - * @return the duration - */ - @GetMapping(value = "/api/v2/timeout", - consumes = { MediaType.ALL_VALUE }, - produces = { MediaType.APPLICATION_JSON_VALUE }) - public Duration timeouts() { - return Duration.ofSeconds(5); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/JavaTimeOperationCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/JavaTimeOperationCustomizer.java deleted file mode 100644 index 5295dcced..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/JavaTimeOperationCustomizer.java +++ /dev/null @@ -1,42 +0,0 @@ -package test.org.springdoc.api.app115; - -import java.time.Duration; -import java.util.Map; - -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.Content; -import io.swagger.v3.oas.models.media.Schema; -import org.springdoc.core.customizers.OperationCustomizer; - -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.method.HandlerMethod; - -/** - * The type Java time operation customizer. - */ -@Component -class JavaTimeOperationCustomizer implements OperationCustomizer { - /** - * Customize operation. - * - * @param operation the operation - * @param handlerMethod the handler method - * @return the operation - */ - @Override - public Operation customize(Operation operation, HandlerMethod handlerMethod) { - if (handlerMethod.getReturnType().getParameterType().isAssignableFrom(Duration.class)) { - for (Map.Entry entry : operation.getResponses().entrySet()) { - io.swagger.v3.oas.models.responses.ApiResponse response = entry.getValue(); - Content content = response.getContent(); - if (content.containsKey(MediaType.APPLICATION_JSON_VALUE)) { - Schema schema = content.get(MediaType.APPLICATION_JSON_VALUE).getSchema(); - schema.getProperties().clear(); - schema.setType("string"); - } - } - } - return operation; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/SpringDocApp115Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/SpringDocApp115Test.java deleted file mode 100644 index 745e9d73e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app115/SpringDocApp115Test.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app115; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 115 test. - */ -class SpringDocApp115Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/FooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/FooErrorHandler.java deleted file mode 100644 index 01be608ce..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/FooErrorHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app116; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; - -/** - * The type Foo error handler. - */ -@ControllerAdvice(assignableTypes = HelloController.class) -class FooErrorHandler { - - /** - * Store assignment publishing error response entity. - * - * @param e the e - * @return the response entity - */ - @ExceptionHandler - public ResponseEntity storeAssignmentPublishingError(Exception e) { - return new ResponseEntity<>("foo", HttpStatus.INTERNAL_SERVER_ERROR); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/HelloController.java deleted file mode 100644 index 22d268c45..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/HelloController.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app116; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.info.Info; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/api") -@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) -class HelloController { - - /** - * Create string. - * - * @param foo the foo - * @return the string - */ - @PostMapping("/foo") - public String create(@RequestBody String foo) { - return "foo"; - } -} - - diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/SpringDocApp116Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/SpringDocApp116Test.java deleted file mode 100644 index dce40d52b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app116/SpringDocApp116Test.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app116; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 116 test. - */ -class SpringDocApp116Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/HelloApplication.java deleted file mode 100644 index 3a8e2ec50..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/HelloApplication.java +++ /dev/null @@ -1,278 +0,0 @@ -package test.org.springdoc.api.app117; - -import java.io.IOException; -import java.net.URI; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.atomic.AtomicLong; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import jakarta.servlet.FilterChain; -import jakarta.servlet.GenericFilter; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.function.RouterFunction; -import org.springframework.web.servlet.function.ServerRequest; -import org.springframework.web.servlet.function.ServerResponse; - -import static org.springframework.web.servlet.function.RouterFunctions.route; -import static org.springframework.web.servlet.function.ServerResponse.ok; - -/** - * The type Hello application. - */ -@Configuration -class HelloApplication { - - /** - * Routes router function. - * - * @param ph the ph - * @return the router function - */ - @Bean - @RouterOperations({ @RouterOperation(path = "/people", method = RequestMethod.GET, beanClass = PersonService.class, beanMethod = "all"), - @RouterOperation(path = "/people/{id}", beanClass = PersonService.class, beanMethod = "byId"), - @RouterOperation(path = "/people", method = RequestMethod.POST, beanClass = PersonService.class, beanMethod = "save") }) - RouterFunction routes(PersonHandler ph) { - String root = ""; - return route() - .GET(root + "/people", ph::handleGetAllPeople) - .GET(root + "/people/{id}", ph::handleGetPersonById) - .POST(root + "/people", ph::handlePostPerson) - .filter((serverRequest, handlerFunction) -> { - return handlerFunction.handle(serverRequest); - }) - .build(); - } -} - -/** - * The type Simple filter. - */ -@Component -class SimpleFilter extends GenericFilter { - - /** - * Do filter. - * - * @param req the req - * @param res the res - * @param filterChain the filter chain - * @throws IOException the io exception - * @throws ServletException the servlet exception - */ - @Override - public void doFilter(ServletRequest req, ServletResponse res, - FilterChain filterChain) throws IOException, ServletException { - filterChain.doFilter(req, res); - } -} - -/** - * The type Person handler. - */ -@Component -class PersonHandler { - - /** - * The Person service. - */ - private final PersonService personService; - - /** - * Instantiates a new Person handler. - * - * @param personService the person service - */ - PersonHandler(PersonService personService) { - this.personService = personService; - } - - /** - * Handle get all people server response. - * - * @param serverRequest the server request - * @return the server response - */ - ServerResponse handleGetAllPeople(ServerRequest serverRequest) { - return ok().body(personService.all()); - } - - /** - * Handle post person server response. - * - * @param r the r - * @return the server response - * @throws ServletException the servlet exception - * @throws IOException the io exception - */ - ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { - Person result = personService.save(new Person(null, r.body(Person.class).getName())); - URI uri = URI.create("/people/" + result.getId()); - return ServerResponse.created(uri).body(result); - } - - /** - * Handle get person by id server response. - * - * @param r the r - * @return the server response - */ - ServerResponse handleGetPersonById(ServerRequest r) { - return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); - } -} - -/** - * The type Greetings rest controller. - */ -@RestController -class GreetingsRestController { - - /** - * Greet string. - * - * @param name the name - * @return the string - */ - @GetMapping("/greet/{name}") - String greet(@PathVariable String name) { - return "hello " + name + "!"; - } -} - -/** - * The type Person service. - */ -@Service -class PersonService { - - /** - * The Counter. - */ - private final AtomicLong counter = new AtomicLong(); - - /** - * The People. - */ - private final Set people = Stream.of( - new Person(counter.incrementAndGet(), "Jane"), - new Person(counter.incrementAndGet(), "Josh"), - new Person(counter.incrementAndGet(), "Gordon")) - .collect(Collectors.toCollection(HashSet::new)); - - - /** - * Save person. - * - * @param p the p - * @return the person - */ - Person save(Person p) { - Person person = new Person(counter.incrementAndGet(), p.getName()); - this.people.add(person); - return person; - } - - /** - * All set. - * - * @return the set - */ - Set all() { - return this.people; - } - - /** - * By id person. - * - * @param id the id - * @return the person - */ - Person byId(@Parameter(in = ParameterIn.PATH) Long id) { - return this.people.stream() - .filter(p -> p.getId().equals(id)) - .findFirst() - .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); - } - -} - -/** - * The type Person. - */ -class Person { - - /** - * The Id. - */ - private Long id; - - /** - * The Name. - */ - private String name; - - /** - * Instantiates a new Person. - * - * @param id the id - * @param name the name - */ - public Person(Long id, String name) { - this.id = id; - this.name = name; - } - - /** - * Gets id. - * - * @return the id - */ - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Gets name. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/SpringDocApp117Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/SpringDocApp117Test.java deleted file mode 100644 index 4841fba3c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app117/SpringDocApp117Test.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app117; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 117 test. - */ -class SpringDocApp117Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/AbstractParent.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/AbstractParent.java deleted file mode 100644 index 16a07c0a6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/AbstractParent.java +++ /dev/null @@ -1,95 +0,0 @@ -package test.org.springdoc.api.app118; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonSubTypes.Type; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; - -/** - * The type Abstract parent. - */ -@JsonTypeInfo(use = Id.NAME, property = "type") -@JsonSubTypes({ - @Type(ChildOfAbstract1.class), - @Type(ChildOfAbstract2.class) -}) -public abstract class AbstractParent { - /** - * The Id. - */ - private int id; - - /** - * Gets id. - * - * @return the id - */ - public int getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(int id) { - this.id = id; - } -} - -/** - * The type Child of abstract 1. - */ -class ChildOfAbstract1 extends AbstractParent { - /** - * The Abstrach child 1 param. - */ - private String abstrachChild1Param; - - /** - * Gets abstrach child 1 param. - * - * @return the abstrach child 1 param - */ - public String getAbstrachChild1Param() { - return abstrachChild1Param; - } - - /** - * Sets abstrach child 1 param. - * - * @param abstrachChild1Param the abstrach child 1 param - */ - public void setAbstrachChild1Param(String abstrachChild1Param) { - this.abstrachChild1Param = abstrachChild1Param; - } -} - -/** - * The type Child of abstract 2. - */ -class ChildOfAbstract2 extends AbstractParent { - /** - * The Abstract child 2 param. - */ - private String abstractChild2Param; - - /** - * Gets abstract child 2 param. - * - * @return the abstract child 2 param - */ - public String getAbstractChild2Param() { - return abstractChild2Param; - } - - /** - * Sets abstract child 2 param. - * - * @param abstractChild2Param the abstract child 2 param - */ - public void setAbstractChild2Param(String abstractChild2Param) { - this.abstractChild2Param = abstractChild2Param; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/ConcreteParent.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/ConcreteParent.java deleted file mode 100644 index 5355669b9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/ConcreteParent.java +++ /dev/null @@ -1,95 +0,0 @@ -package test.org.springdoc.api.app118; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonSubTypes.Type; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; - -/** - * The type Concrete parent. - */ -@JsonTypeInfo(use = Id.NAME, property = "type") -@JsonSubTypes({ - @Type(ChildOfConcrete1.class), - @Type(ChildOfConcrete2.class) -}) -class ConcreteParent { - /** - * The Id. - */ - private int id; - - /** - * Gets id. - * - * @return the id - */ - public int getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(int id) { - this.id = id; - } -} - -/** - * The type Child of concrete 1. - */ -class ChildOfConcrete1 extends ConcreteParent { - /** - * The Concrete child 1 param. - */ - private String concreteChild1Param; - - /** - * Gets concrete child 1 param. - * - * @return the concrete child 1 param - */ - public String getConcreteChild1Param() { - return concreteChild1Param; - } - - /** - * Sets concrete child 1 param. - * - * @param concreteChild1Param the concrete child 1 param - */ - public void setConcreteChild1Param(String concreteChild1Param) { - this.concreteChild1Param = concreteChild1Param; - } -} - -/** - * The type Child of concrete 2. - */ -class ChildOfConcrete2 extends ConcreteParent { - /** - * The Concrete child 2 param. - */ - private String concreteChild2Param; - - /** - * Gets concrete child 2 param. - * - * @return the concrete child 2 param - */ - public String getConcreteChild2Param() { - return concreteChild2Param; - } - - /** - * Sets concrete child 2 param. - * - * @param concreteChild2Param the concrete child 2 param - */ - public void setConcreteChild2Param(String concreteChild2Param) { - this.concreteChild2Param = concreteChild2Param; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/Controller.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/Controller.java deleted file mode 100644 index 34f86e513..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/Controller.java +++ /dev/null @@ -1,88 +0,0 @@ -package test.org.springdoc.api.app118; - -import java.util.List; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Controller. - */ -@RestController -@RequestMapping("class-hierarchy") -class Controller { - /** - * Abstract parent response. - * - * @param payload the payload - * @return the response - */ - @PostMapping("abstract-parent") - public Response abstractParent(@RequestBody AbstractParent payload) { - return null; - } - - /** - * Concrete parent response. - * - * @param payload the payload - * @return the response - */ - @PostMapping("concrete-parent") - public Response concreteParent(@RequestBody ConcreteParent payload) { - return null; - } -} - -/** - * The type Response. - */ -class Response { - /** - * The Abstract parent. - */ - AbstractParent abstractParent; - - /** - * The Concrete parents. - */ - List concreteParents; - - /** - * Gets abstract parent. - * - * @return the abstract parent - */ - public AbstractParent getAbstractParent() { - return abstractParent; - } - - /** - * Sets abstract parent. - * - * @param abstractParent the abstract parent - */ - public void setAbstractParent(AbstractParent abstractParent) { - this.abstractParent = abstractParent; - } - - /** - * Gets concrete parents. - * - * @return the concrete parents - */ - public List getConcreteParents() { - return concreteParents; - } - - /** - * Sets concrete parents. - * - * @param concreteParents the concrete parents - */ - public void setConcreteParents(List concreteParents) { - this.concreteParents = concreteParents; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/SpringDocApp118Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/SpringDocApp118Test.java deleted file mode 100644 index 57c55ff5b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app118/SpringDocApp118Test.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app118; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 118 test. - */ -class SpringDocApp118Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/HelloController.java deleted file mode 100644 index 66b0b2568..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/HelloController.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app119; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Multi files in multi part string. - * - * @param jsonRequest the json request - * @param file1 the file 1 - * @param file2 the file 2 - * @return the string - */ - @Operation(summary = "Multiple files and JSON payloads as multi part request") - @PostMapping( - value = "multi", - consumes = MediaType.MULTIPART_FORM_DATA_VALUE, - produces = MediaType.TEXT_PLAIN_VALUE) - public String multiFilesInMultiPart( - @RequestPart("params") - @Parameter( - description = "This is the configuration", - content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)) final JsonRequest jsonRequest, - @RequestPart(value = "file1", required = false) @Parameter(description = "This is file1") final MultipartFile file1, - @RequestPart(value = "file2", required = false) @Parameter(description = "This is file2") final MultipartFile file2) { - return "Hello World " + jsonRequest.getName(); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/JsonRequest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/JsonRequest.java deleted file mode 100644 index 5f0baf0b1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/JsonRequest.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app119; - -/** - * The type Json request. - */ -class JsonRequest { - - /** - * The Name. - */ - private String name; - - /** - * Gets name. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/SpringDocApp119Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/SpringDocApp119Test.java deleted file mode 100644 index cf9ae5ca3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app119/SpringDocApp119Test.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app119; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 119 test. - */ -class SpringDocApp119Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java deleted file mode 100644 index b5ccfec4e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app12; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons string. - * - * @return the string - */ - @GetMapping(value = "/persons") - @Operation(parameters = { - @Parameter(name = "name", in = ParameterIn.QUERY, schema = @Schema(implementation = String.class)) }) - public String persons() { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java deleted file mode 100644 index 65ee8b3e9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app12; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 12 test. - */ -class SpringDocApp12Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/AccountId.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/AccountId.java deleted file mode 100644 index e749a5d29..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/AccountId.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app120; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.core.annotation.AliasFor; - -import static java.lang.annotation.ElementType.ANNOTATION_TYPE; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; - -/** - * The interface Account id. - */ -@Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) -@Retention(RetentionPolicy.RUNTIME) -@Parameter(description = "non alias description") -public @interface AccountId { - - /** - * Name string. - * - * @return the string - */ - @AliasFor(annotation = Parameter.class, value = "name") - String name() default ""; - - /** - * Example string. - * - * @return the string - */ - @AliasFor(annotation = Parameter.class, value = "example") - String example() default "123456"; - - /** - * In parameter in. - * - * @return the parameter in - */ - @AliasFor(annotation = Parameter.class, value = "in") - ParameterIn in() default ParameterIn.DEFAULT; - - /** - * Schema schema. - * - * @return the schema - */ - @AliasFor(annotation = Parameter.class, value = "schema") - Schema schema() default @Schema(); -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/SpringDocApp120Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/SpringDocApp120Test.java deleted file mode 100644 index 1302ab5fc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/SpringDocApp120Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ -package test.org.springdoc.api.app120; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp120Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/InheritedRequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/InheritedRequestParams.java deleted file mode 100644 index ae7ba5a49..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/InheritedRequestParams.java +++ /dev/null @@ -1,33 +0,0 @@ -package test.org.springdoc.api.app121; - -import jakarta.validation.constraints.NotBlank; - -/** - * The type Inherited request params. - */ -class InheritedRequestParams extends RequestParams { - - /** - * parameter from child of RequestParams - */ - @NotBlank - private String childParam; - - /** - * Gets child param. - * - * @return the child param - */ - public String getChildParam() { - return childParam; - } - - /** - * Sets child param. - * - * @param childParam the child param - */ - public void setChildParam(String childParam) { - this.childParam = childParam; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/RequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/RequestParams.java deleted file mode 100644 index 42c96a2ec..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/RequestParams.java +++ /dev/null @@ -1,255 +0,0 @@ -package test.org.springdoc.api.app121; - -import java.math.BigInteger; -import java.util.List; -import java.util.Optional; - -import io.swagger.v3.oas.annotations.Parameter; - - -/** - * The type Request params. - */ -class RequestParams { - - /** - * The String param. - */ - @Parameter(description = "string parameter") - private String stringParam; - - /** - * The String param 1. - */ - @Deprecated - private String stringParam1; - - /** - * The String param 2. - */ - @Parameter(description = "string parameter2", required = true) - private String stringParam2; - - /** - * The Int param. - */ - @Parameter(description = "int parameter") - private int intParam; - - /** - * The Int param 2. - */ - private Optional intParam2; - - /** - * The Int param 3. - */ - private String intParam3; - - /** - * The Nested. - */ - private Nested nested; - - /** - * The Nested list. - */ - private List nestedList; - - /** - * Gets string param. - * - * @return the string param - */ - public String getStringParam() { - return stringParam; - } - - /** - * Sets string param. - * - * @param stringParam the string param - */ - public void setStringParam(String stringParam) { - this.stringParam = stringParam; - } - - /** - * Gets int param. - * - * @return the int param - */ - public int getIntParam() { - return intParam; - } - - /** - * Sets int param. - * - * @param intParam the int param - */ - public void setIntParam(int intParam) { - this.intParam = intParam; - } - - /** - * Gets int param 2. - * - * @return the int param 2 - */ - public Optional getIntParam2() { - return intParam2; - } - - /** - * Sets int param 2. - * - * @param intParam2 the int param 2 - */ - public void setIntParam2(Optional intParam2) { - this.intParam2 = intParam2; - } - - /** - * Gets int param 3. - * - * @return the int param 3 - */ - public String getIntParam3() { - return intParam3; - } - - /** - * Sets int param 3. - * - * @param intParam3 the int param 3 - */ - public void setIntParam3(String intParam3) { - this.intParam3 = intParam3; - } - - /** - * Gets string param 1. - * - * @return the string param 1 - */ - public String getStringParam1() { - return stringParam1; - } - - /** - * Sets string param 1. - * - * @param stringParam1 the string param 1 - */ - public void setStringParam1(String stringParam1) { - this.stringParam1 = stringParam1; - } - - /** - * Gets string param 2. - * - * @return the string param 2 - */ - public String getStringParam2() { - return stringParam2; - } - - /** - * Sets string param 2. - * - * @param stringParam2 the string param 2 - */ - public void setStringParam2(String stringParam2) { - this.stringParam2 = stringParam2; - } - - /** - * Gets nested. - * - * @return the nested - */ - public Nested getNested() { - return nested; - } - - /** - * Sets nested. - * - * @param nested the nested - */ - public void setNested(Nested nested) { - this.nested = nested; - } - - /** - * Gets nested list. - * - * @return the nested list - */ - public List getNestedList() { - return nestedList; - } - - /** - * Sets nested list. - * - * @param nestedList the nested list - */ - public void setNestedList(List nestedList) { - this.nestedList = nestedList; - } - - /** - * The type Nested. - */ - public static class Nested { - /** - * The Param 1. - */ - private String param1; - - /** - * The Param 2. - */ - private BigInteger param2; - - /** - * Gets param 1. - * - * @return the param 1 - */ - @Parameter(description = "nested string parameter") - public String getParam1() { - return param1; - } - - /** - * Sets param 1. - * - * @param param1 the param 1 - */ - public void setParam1(String param1) { - this.param1 = param1; - } - - /** - * Gets param 2. - * - * @return the param 2 - */ - @Parameter(description = "nested BigInteger parameter") - public BigInteger getParam2() { - return param2; - } - - /** - * Sets param 2. - * - * @param param2 the param 2 - */ - public void setParam2(BigInteger param2) { - this.param2 = param2; - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/SpringDocApp121Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/SpringDocApp121Test.java deleted file mode 100644 index c67567556..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/SpringDocApp121Test.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app121; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp121Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/TestController.java deleted file mode 100644 index da5c4470f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app121/TestController.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app121; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Test controller. - */ -@RestController -class TestController { - - /** - * Gets test. - * - * @param param the param - * @param requestParams the request params - * @return the test - */ - @PostMapping("test") - public InheritedRequestParams getTest(@RequestParam String param, @ParameterObject InheritedRequestParams requestParams) { - return requestParams; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseController.java deleted file mode 100644 index 71c93a12d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseController.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app122; - -import io.swagger.v3.oas.annotations.Operation; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Base controller. - * - * @param the type parameter - */ -@RestController -public abstract class BaseController { - - /** - * Create response entity. - * - * @param payload the payload - * @return the response entity - */ - @PostMapping - @Operation(summary = "create") - public ResponseEntity create(@RequestBody Wrapper payload) { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseObject.java deleted file mode 100644 index 3623d55d7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/BaseObject.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app122; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Base object. - */ -class BaseObject { - - /** - * The Base str. - */ - @JsonProperty("baseStr") - private String baseStr; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/CustomerDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/CustomerDto.java deleted file mode 100644 index b7f53ca04..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/CustomerDto.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app122; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Customer dto. - */ -class CustomerDto extends BaseObject { - - /** - * The Customer name. - */ - @JsonProperty("customerName") - private String customerName; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/FirstController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/FirstController.java deleted file mode 100644 index 05cb73f9d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/FirstController.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app122; - -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.web.bind.annotation.RestController; - -/** - * The type First controller. - */ -@RestController -@Tag(name = "example") -class FirstController extends BaseController { - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/SpringDocApp122Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/SpringDocApp122Test.java deleted file mode 100644 index 580a8447d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/SpringDocApp122Test.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app122; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp122Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/Wrapper.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/Wrapper.java deleted file mode 100644 index 9912cc1a3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app122/Wrapper.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ - -package test.org.springdoc.api.app122; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Wrapper. - * - * @param the type parameter - */ -class Wrapper { - - - /** - * The Wrapper. - */ - @JsonProperty("wrapper") - private String wrapper; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/HelloController.java deleted file mode 100644 index 9b2f80143..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/HelloController.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app123; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - * - * @param the type parameter - */ -@RestController -class HelloController { - - /** - * Index t. - * - * @param numTel the num tel - * @param adresse the adresse - * @return the t - */ - @GetMapping(value = "/hello/{numTelco}") - @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) - public T index(@PathVariable("numTelco") String numTel, String adresse) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/MyExceptionHandler.java deleted file mode 100644 index 2e6942fba..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/MyExceptionHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app123; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -/** - * The type My exception handler. - */ -@RestControllerAdvice -class MyExceptionHandler { - - /** - * Bad. - * - * @param e the e - */ - @ExceptionHandler(IllegalArgumentException.class) - @ApiResponse(responseCode = "404", description = "Not here", content = @Content) - @ResponseStatus(HttpStatus.NOT_FOUND) - public void bad(IllegalArgumentException e) { - - } - - /** - * Gateway object. - * - * @param e the e - * @return the object - */ - @ExceptionHandler(RuntimeException.class) - @ResponseStatus(HttpStatus.BAD_GATEWAY) - public Object gateway(RuntimeException e) { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/SpringDocApp123Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/SpringDocApp123Test.java deleted file mode 100644 index abfe6fa0b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app123/SpringDocApp123Test.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app123; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp123Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/HelloController.java deleted file mode 100644 index 5a86bb351..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/HelloController.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app124; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - * - * @param the type parameter - */ -@RestController -class HelloController { - - /** - * Bad. - * - * @param e the e - */ - @ExceptionHandler(IllegalArgumentException.class) - @ApiResponse(responseCode = "404", description = "Not here", content = @Content) - @ResponseStatus(HttpStatus.NOT_FOUND) - public void bad(IllegalArgumentException e) { - - } - - /** - * Index t. - * - * @param numTel the num tel - * @param adresse the adresse - * @return the t - */ - @GetMapping(value = "/hello/{numTelco}") - @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) - public T index(@PathVariable("numTelco") String numTel, String adresse) { - throw new IllegalArgumentException(); - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/MyExceptionHandler.java deleted file mode 100644 index 53a315624..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/MyExceptionHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app124; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -/** - * The type My exception handler. - */ -@RestControllerAdvice -class MyExceptionHandler { - - /** - * Gateway object. - * - * @param e the e - * @return the object - */ - @ExceptionHandler(RuntimeException.class) - @ResponseStatus(HttpStatus.BAD_GATEWAY) - public Object gateway(RuntimeException e) { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/SpringDocApp124Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/SpringDocApp124Test.java deleted file mode 100644 index 91a4d1629..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app124/SpringDocApp124Test.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app124; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp124Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/DeprecatedEntity.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/DeprecatedEntity.java deleted file mode 100644 index 023a0927d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/DeprecatedEntity.java +++ /dev/null @@ -1,60 +0,0 @@ -package test.org.springdoc.api.app125; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Deprecated entity. - * @author bnasslahsen - */ -class DeprecatedEntity { - /** - * The My non deprecated field. - */ - @Schema(deprecated = false) - private String myNonDeprecatedField; - - /** - * The Mydeprecated field. - */ - @Schema(deprecated = true) - private String mydeprecatedField; - - /** - * Gets my non deprecated field. - * - * @return the my non deprecated field - */ - public String getMyNonDeprecatedField() { - return myNonDeprecatedField; - } - - /** - * Sets my non deprecated field. - * - * @param myNonDeprecatedField the my non deprecated field - * @return the my non deprecated field - */ - @Deprecated - public DeprecatedEntity setMyNonDeprecatedField(String myNonDeprecatedField) { - this.myNonDeprecatedField = myNonDeprecatedField; - return this; - } - - /** - * Gets mydeprecated field. - * - * @return the mydeprecated field - */ - public String getMydeprecatedField() { - return mydeprecatedField; - } - - /** - * Sets mydeprecated field. - * - * @param mydeprecatedField the mydeprecated field - */ - public void setMydeprecatedField(String mydeprecatedField) { - this.mydeprecatedField = mydeprecatedField; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/HelloController.java deleted file mode 100644 index a62df822d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/HelloController.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app125; - -import jakarta.validation.constraints.NotNull; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - * @author bnasslahsen - */ -@RestController -class HelloController { - - /** - * Gets all pets. - * - * @param toto the toto - * @return the all pets - */ - @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) - public DeprecatedEntity getAllPets(@NotNull String toto) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/SpringDocApp125Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/SpringDocApp125Test.java deleted file mode 100644 index a3ee34fcf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app125/SpringDocApp125Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app125; - -import java.util.Optional; - -import io.swagger.v3.core.converter.ModelConverter; -import io.swagger.v3.core.converter.ModelConverters; -import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - - -/** - * Tests Spring meta-annotations as method parameters - */ -@TestPropertySource(properties = "springdoc.model-converters.deprecating-converter.enabled=false") -class SpringDocApp125Test extends AbstractSpringDocTest { - - static { - Optional deprecatingConverterOptional = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); - deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/HelloController.java deleted file mode 100644 index e79a7e570..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/HelloController.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app126; - -import java.util.ArrayList; -import java.util.Collection; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -import static org.springframework.http.ResponseEntity.ok; - -/** - * The type Hello controller. - * - * @param the type parameter - */ -@RestController -@ApiResponses(value = { - @ApiResponse(responseCode = "401", ref = SecurityProblemResponsesConfiguration.UNAUTHORIZED_401_NO_TOKEN_RESPONSE_REF), - @ApiResponse(responseCode = "401", ref = SecurityProblemResponsesConfiguration.UNAUTHORIZED_401_BAD_TOKEN_RESPONSE_REF), - @ApiResponse(responseCode = "403", ref = SecurityProblemResponsesConfiguration.FORBIDDEN_403_RESPONSE_REF) }) -//@ApiResponses(value = { -// @ApiResponse(responseCode = "401", description = "Invalid authentication.", content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), -// @ApiResponse(responseCode = "401", description = "Invalid authentication.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), -// @ApiResponse(responseCode = "403", description = "Missing authorities.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}) }) -class HelloController { - - /** - * The constant CURRENCIES. - */ - private static final Collection CURRENCIES = new ArrayList<>(); - - static { - CURRENCIES.add("EUR"); - CURRENCIES.add("USD"); - } - - /** - * Gets all currencies. - * - * @return the all currencies - */ - @GetMapping - @Operation(description = "Get all currencies", summary = "getAllCurrencies") - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "All currencies returned") }) - public ResponseEntity> getAllCurrencies() { - return ok(CURRENCIES); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/Problem.java deleted file mode 100644 index 6a9fae852..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/Problem.java +++ /dev/null @@ -1,79 +0,0 @@ -package test.org.springdoc.api.app126; - -import java.net.URI; -import java.util.Collections; -import java.util.Map; - -/** - * The interface Problem. - */ -public interface Problem { - - /** - * The constant DEFAULT_TYPE. - */ - URI DEFAULT_TYPE = URI.create("about:blank"); - - /** - * An absolute URI that identifies the problem type. When dereferenced, - * it SHOULD provide human-readable documentation for the problem type - * (e.g., using HTML). When this member is not present, its value is - * assumed to be "about:blank". - * - * @return an absolute URI that identifies this problem's type - */ - default URI getType() { - return DEFAULT_TYPE; - } - - /** - * A short, human-readable summary of the problem type. It SHOULD NOT - * change from occurrence to occurrence of the problem, except for - * purposes of localisation. - * - * @return a short, human-readable summary of this problem - */ - default String getTitle() { - return null; - } - - /** - * The HTTP status code generated by the origin server for this - * occurrence of the problem. - * - * @return the HTTP status code - */ - default Integer getStatus() { - return null; - } - - /** - * A human readable explanation specific to this occurrence of the problem. - * - * @return A human readable explaination of this problem - */ - default String getDetail() { - return null; - } - - /** - * An absolute URI that identifies the specific occurrence of the problem. - * It may or may not yield further information if dereferenced. - * - * @return an absolute URI that identifies this specific problem - */ - default URI getInstance() { - return null; - } - - /** - * Optional, additional attributes of the problem. Implementations can choose to ignore this in favor of concrete, - * typed fields. - * - * @return additional parameters - */ - default Map getParameters() { - return Collections.emptyMap(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SpringDocApp126Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SpringDocApp126Test.java deleted file mode 100644 index 2d2c16ebb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SpringDocApp126Test.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app126; - -import java.util.List; -import java.util.Map; - -import io.swagger.v3.core.converter.AnnotatedType; -import io.swagger.v3.core.converter.ModelConverters; -import io.swagger.v3.core.converter.ResolvedSchema; -import io.swagger.v3.oas.models.responses.ApiResponse; -import org.springdoc.core.customizers.OpenApiCustomizer; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp126Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - - /** - * Response registration customizer open api customiser. - * - * @param responsesToRegister the responses to register - * @return the open api customiser - */ - @Bean - public OpenApiCustomizer responseRegistrationCustomizer(List> responsesToRegister) { - ResolvedSchema resolvedSchema = ModelConverters.getInstance() - .resolveAsResolvedSchema(new AnnotatedType(Problem.class)); - return openApi -> { - openApi.getComponents().addSchemas("Problem", resolvedSchema.schema); - responsesToRegister.forEach(entry -> openApi.getComponents().addResponses(entry.getKey(), entry.getValue())); - }; - } - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/AbstractObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/AbstractObject.java deleted file mode 100644 index a17504cd9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/AbstractObject.java +++ /dev/null @@ -1,57 +0,0 @@ -package test.org.springdoc.api.app127; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -/** - * The type Abstract object. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true -) -@JsonSubTypes({ - @JsonSubTypes.Type(value = ConcreteObjectA.class, name = "Type A") -}) -public abstract class AbstractObject { - - /** - * The Type. - */ - private final ConcreteType type; - - /** - * The Name. - */ - private final String name; - - /** - * Instantiates a new Abstract object. - * - * @param type the type - * @param name the name - */ - protected AbstractObject(ConcreteType type, String name) { - this.type = type; - this.name = name; - } - - /** - * Gets type. - * - * @return the type - */ - public ConcreteType getType() { - return type; - } - - /** - * Gets name. - * - * @return the name - */ - public String getName() { - return name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteObjectA.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteObjectA.java deleted file mode 100644 index d3339226f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteObjectA.java +++ /dev/null @@ -1,32 +0,0 @@ -package test.org.springdoc.api.app127; - -/** - * The type Concrete object a. - */ -class ConcreteObjectA extends AbstractObject { - - /** - * The Description. - */ - private final String description; - - /** - * Instantiates a new Concrete object a. - * - * @param name the name - * @param description the description - */ - public ConcreteObjectA(String name, String description) { - super(ConcreteType.TYPE_A, name); - this.description = description; - } - - /** - * Gets description. - * - * @return the description - */ - public String getDescription() { - return description; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteType.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteType.java deleted file mode 100644 index cfe532ec0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/ConcreteType.java +++ /dev/null @@ -1,38 +0,0 @@ -package test.org.springdoc.api.app127; - -/** - * The enum Concrete type. - */ -public enum ConcreteType { - /** - * The Type a. - */ - TYPE_A("Type A"), - /** - * The Type b. - */ - TYPE_B("Type B"); - - /** - * The Name. - */ - private final String name; - - /** - * Instantiates a new Concrete type. - * - * @param name the name - */ - ConcreteType(String name) { - this.name = name; - } - - /** - * Gets name. - * - * @return the name - */ - public String getName() { - return name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Controller.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Controller.java deleted file mode 100644 index b0be57945..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Controller.java +++ /dev/null @@ -1,36 +0,0 @@ -package test.org.springdoc.api.app127; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.ExampleObject; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Controller. - */ -@RestController -class Controller { - - /** - * Bug umbrella. - * - * @return the umbrella - */ - @Operation(summary = "Test Bug", responses = { - @ApiResponse(responseCode = "200", description = "OK", - content = @Content( - schema = @Schema(implementation = Umbrella.class), - examples = @ExampleObject(ref = "#/components/examples/umbrellaExample", name = "Example with weird YAML tag") - ) - ) - }) - @GetMapping(value = "/bug", produces = MediaType.APPLICATION_JSON_VALUE) - public Umbrella bug() { - return new Umbrella(new ConcreteObjectA("a", "b")); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/SpringDocApp127Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/SpringDocApp127Test.java deleted file mode 100644 index 7fe0afa53..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/SpringDocApp127Test.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app127; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.web.servlet.MvcResult; - -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp127Test extends AbstractSpringDocTest { - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + ".yaml")).andExpect(status().isOk()).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - Assertions.assertTrue(!result.contains("!")); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Umbrella.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Umbrella.java deleted file mode 100644 index ee696ace2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app127/Umbrella.java +++ /dev/null @@ -1,33 +0,0 @@ -package test.org.springdoc.api.app127; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Umbrella. - */ -class Umbrella { - - /** - * The Object. - */ - @Schema(description = "This reference to abstract class causes weird YAML tag to be added", anyOf = ConcreteObjectA.class) - private final AbstractObject object; - - /** - * Instantiates a new Umbrella. - * - * @param object the object - */ - public Umbrella(AbstractObject object) { - this.object = object; - } - - /** - * Gets object. - * - * @return the object - */ - public AbstractObject getObject() { - return object; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/ActualReturnedEntity.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/ActualReturnedEntity.java deleted file mode 100644 index a0f3f4c98..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/ActualReturnedEntity.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app129; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Actual returned entity. - */ -class ActualReturnedEntity { - - /** - * The Result. - */ - @JsonProperty - String result; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/HelloController.java deleted file mode 100644 index b38288785..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/HelloController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app129; - -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.request.async.DeferredResult; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping(path = "/api", headers = { "userId", "registrationId" }) -class HelloController { - - /** - * Update deferred result. - * - * @param entity the entity - * @return the deferred result - * @throws Exception the exception - */ - @PostMapping("/test") - @ApiResponses({ @ApiResponse(responseCode = "200") }) - public DeferredResult> update( - @RequestBody ActualReturnedEntity entity) throws Exception { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/OperationResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/OperationResponse.java deleted file mode 100644 index 7b41eb0e3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/OperationResponse.java +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app129; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Operation response. - * - * @param the type parameter - */ -class OperationResponse { - - /** - * The Operation result. - */ - @JsonProperty - String operationResult; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/SpringDocApp129Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/SpringDocApp129Test.java deleted file mode 100644 index 2dfe85a0c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app129/SpringDocApp129Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app129; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp129Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java deleted file mode 100644 index cd48b3d0f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/HelloController.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app13; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons string. - * - * @param dto the dto - * @return the string - */ - @GetMapping(value = "/persons") - public String persons(final PersonDTO dto) { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java deleted file mode 100644 index 17e68752d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/PersonDTO.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app13; - -import com.fasterxml.jackson.databind.PropertyNamingStrategies; -import com.fasterxml.jackson.databind.annotation.JsonNaming; - -/** - * The type Person dto. - */ -@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java deleted file mode 100644 index a1483e4e7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app13/SpringDocApp13Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app13; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 13 test. - */ -class SpringDocApp13Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/HelloController.java deleted file mode 100644 index 1e3e5e5ac..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/HelloController.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app130; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * List tracker data. - * - * @param toto the toto - * @return the tracker data - */ - @PostMapping(value = "/values/data") - TrackerData list(TrackerData toto) { - return toto; - } - - /** - * Get tracker data. - * - * @param toto the toto - * @return the tracker data - */ - @GetMapping(value = "/values/datakk") - TrackerData get(TrackerData toto) { - return toto; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/SpringDocApp130Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/SpringDocApp130Test.java deleted file mode 100644 index 755a6a025..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/SpringDocApp130Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app130; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp130Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/TrackerData.java deleted file mode 100644 index 2dd4405e6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app130/TrackerData.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app130; - -import java.time.Instant; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.Hidden; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Tracker data. - */ -@Hidden -class TrackerData { - - /** - * The Tracker id. - */ - @JsonProperty("trackerId") - String trackerId; - - /** - * The Timestamp. - */ - @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") - @JsonProperty("timestamp") - Instant timestamp; - - /** - * The Value. - */ - @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") - @JsonProperty("value") - Double value; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/HelloController.java deleted file mode 100644 index 8b8e4f561..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/HelloController.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app131; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - * - * @param the type parameter - */ -@RestController -class HelloController { - - - /** - * Create organization. - * - * @param organization the organization - */ - @Operation(summary = "Create the organization", description = "Create the organization") - @ApiResponses( - value = { - @ApiResponse( - responseCode = "204", - description = "The organization was created successfully"), - @ApiResponse( - responseCode = "400", - description = "Invalid argument", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = RestControllerError.class))), - @ApiResponse( - responseCode = "409", - description = "An organization with the specified ID already exists", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = RestControllerError.class))), - @ApiResponse( - responseCode = "500", - description = - "An error has occurred and the request could not be processed at this time", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = RestControllerError.class))) - }) - @RequestMapping( - value = "/organizations", - method = RequestMethod.POST, - produces = "application/json") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void createOrganization( - @Parameter(name = "organization", required = true) - @RequestBody - Organization organization) { - - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/Organization.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/Organization.java deleted file mode 100644 index 98c01ca42..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/Organization.java +++ /dev/null @@ -1,78 +0,0 @@ -package test.org.springdoc.api.app131; - - -import java.util.UUID; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Organization. - */ -@Schema(description = - "This is the description being overwritten") -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ "id", "name" }) -class Organization { - - /** - * The Id. - */ - @Schema( - description = - "The Universally Unique Identifier (UUID) uniquely identifying the organization", - required = true) - @JsonProperty(required = true) - private UUID id; - - /** - * The Name. - */ - @Schema(description = "The name of the organization", required = true) - @JsonProperty(required = true) - private String name; - - /** - * Instantiates a new Organization. - */ - public Organization() { - } - - /** - * Gets id. - * - * @return the id - */ - public UUID getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(UUID id) { - this.id = id; - } - - /** - * Gets name. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/RestControllerError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/RestControllerError.java deleted file mode 100644 index d49ae4d19..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/RestControllerError.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app131; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Rest controller error. - */ -class RestControllerError { - - /** - * The Id. - */ - @JsonProperty - private String id; - - /** - * The Message. - */ - @JsonProperty - private String message; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/SpringDocApp131Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/SpringDocApp131Test.java deleted file mode 100644 index a7e2bd634..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app131/SpringDocApp131Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app131; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp131Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/HelloController.java deleted file mode 100644 index a038354b5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/HelloController.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app132; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - * - * @param the type parameter - */ -@RestController -class HelloController { - - - /** - * Create organization. - * - * @param organization the organization - */ - @Operation(summary = "Create the organization", description = "Create the organization") - @ApiResponses( - value = { - @ApiResponse( - responseCode = "204", - description = "The organization was created successfully"), - @ApiResponse( - responseCode = "400", - description = "Invalid argument", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = RestControllerError.class))), - @ApiResponse( - responseCode = "409", - description = "An organization with the specified ID already exists", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = RestControllerError.class))), - @ApiResponse( - responseCode = "500", - description = - "An error has occurred and the request could not be processed at this time", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = RestControllerError.class))) - }) - @RequestMapping( - value = "/organizations", - method = RequestMethod.POST, - produces = "application/json") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void createOrganization( - @Parameter(name = "organization", description = "i want to override the description of this object", required = true) - @RequestBody - Organization organization) { - - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/Organization.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/Organization.java deleted file mode 100644 index cd1e1127c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/Organization.java +++ /dev/null @@ -1,78 +0,0 @@ -package test.org.springdoc.api.app132; - - -import java.util.UUID; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Organization. - */ -@Schema(description = - "This is the description being overwritten") -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ "id", "name" }) -class Organization { - - /** - * The Id. - */ - @Schema( - description = - "The Universally Unique Identifier (UUID) uniquely identifying the organization", - required = true) - @JsonProperty(required = true) - private UUID id; - - /** - * The Name. - */ - @Schema(description = "The name of the organization", required = true) - @JsonProperty(required = true) - private String name; - - /** - * Instantiates a new Organization. - */ - public Organization() { - } - - /** - * Gets id. - * - * @return the id - */ - public UUID getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(UUID id) { - this.id = id; - } - - /** - * Gets name. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/RestControllerError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/RestControllerError.java deleted file mode 100644 index d716511b1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/RestControllerError.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app132; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Rest controller error. - */ -class RestControllerError { - - /** - * The Id. - */ - @JsonProperty - private String id; - - /** - * The Message. - */ - @JsonProperty - private String message; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/SpringDocApp132Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/SpringDocApp132Test.java deleted file mode 100644 index 5d5d8fd98..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app132/SpringDocApp132Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app132; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp132Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/HelloController.java deleted file mode 100644 index 7133d1542..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/HelloController.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app133; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Gets message from header 1. - * - * @param header the header - * @return the message from header 1 - */ - @GetMapping(path = "/test1", headers = { "myHeader" }) - public String getMessageFromHeader1( - @Parameter(name = "myHeader", description = "A header", schema = @Schema(allowableValues = { "foo", "bar" })) - @RequestHeader("myHeader") String header - ) { - return "bar " + header; - } - - /** - * Gets message from header 2. - * - * @param header the header - * @return the message from header 2 - */ - @GetMapping("/test2") - public String getMessageFromHeader2( - @Parameter(name = "myHeader", description = "A header", schema = @Schema(type = "integer")) - @RequestHeader("myHeader") Integer header - ) { - return "bar " + header; - } - - /** - * Gets message from header 3. - * - * @param header the header - * @return the message from header 3 - */ - @GetMapping(path = "/test3", headers = { "myHeader" }) - public String getMessageFromHeader3( - @Parameter(name = "myHeader", description = "A header", schema = @Schema(type = "integer")) - @RequestHeader("myHeader") Integer header - ) { - return "bar " + header; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/SpringDocApp133Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/SpringDocApp133Test.java deleted file mode 100644 index 62453d06c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app133/SpringDocApp133Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app133; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp133Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/HelloController.java deleted file mode 100644 index e1379a952..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/HelloController.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app134; - -import java.util.Collections; -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Hello controller. - */ -@SpringBootApplication -@RestController -@Tag(name = "The sample resource") -class HelloController { - - // ----------------------------------------------------------------------------------------------------------------- - - /** - * The constant VERSION_1. - */ - public static final String VERSION_1 = "application/vnd.samples.v1+json"; - - /** - * The constant VERSION_2. - */ - public static final String VERSION_2 = "application/vnd.samples.v2+json"; - - /** - * The constant HEADER_1. - */ - public static final String HEADER_1 = "X-API-VERSION=1"; - - /** - * The constant HEADER_2. - */ - public static final String HEADER_2 = "Accept-version=v2"; - - /** - * Gets sample v 1. - * - * @param id the id - * @return the sample v 1 - */ - @GetMapping(value = "/{id}", produces = VERSION_1, headers = HEADER_1) - @ResponseStatus(HttpStatus.OK) - @Operation(operationId = "getSampleV1", deprecated = true, description = "Get the sample by its id." - ) - @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = SampleV1.class))) - public SampleV1 getSampleV1(@Parameter(description = "The sample's id", required = true) - @PathVariable final String id) { - return new SampleV1(id); - } - - /** - * Gets sample v 2. - * - * @param id the id - * @return the sample v 2 - */ - @GetMapping(value = "/{id}", produces = VERSION_2, headers = { HEADER_2, HEADER_1 }) - @ResponseStatus(HttpStatus.OK) - @Operation(operationId = "getSampleV2", description = "Get the sample by its id. This represents V2.") - @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = SampleV1.class))) - public SampleV2 getSampleV2(@Parameter(description = "The sample's id", required = true) - @PathVariable final Long id) { - return new SampleV2(id); - } - - /** - * Search samples list. - * - * @param searchRequest the search request - * @return the list - */ - @PostMapping(path = "/search", consumes = VERSION_2, produces = VERSION_2) - @Operation(description = "Searches for sample objects using the given search request.") - @ApiResponse(responseCode = "200", - content = @Content(array = @ArraySchema(schema = @Schema(implementation = SampleV2.class)))) - public List searchSamples(@RequestBody final SampleSearchRequest searchRequest) { - return Collections.singletonList(new SampleV2(searchRequest.getId())); - } - - - /** - * The type Sample v 1. - */ - private class SampleV1 { - - /** - * The Id. - */ - private String id; - - /** - * Instantiates a new Sample v 1. - * - * @param id the id - */ - public SampleV1(String id) { - this.id = id; - } - - /** - * Gets id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(String id) { - this.id = id; - } - } - - /** - * The type Sample v 2. - */ - private class SampleV2 { - /** - * The Id. - */ - private long id; - - /** - * Instantiates a new Sample v 2. - * - * @param id the id - */ - public SampleV2(long id) { - this.id = id; - } - - /** - * Gets id. - * - * @return the id - */ - public long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(long id) { - this.id = id; - } - } - - /** - * The type Sample search request. - */ - private class SampleSearchRequest { - /** - * The Id. - */ - private final long id; - - /** - * Instantiates a new Sample search request. - * - * @param id the id - */ - public SampleSearchRequest(long id) { - this.id = id; - } - - /** - * Gets id. - * - * @return the id - */ - public long getId() { - return id; - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/OpenApiConfig.java deleted file mode 100644 index aac5b73df..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/OpenApiConfig.java +++ /dev/null @@ -1,73 +0,0 @@ -package test.org.springdoc.api.app134; - -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * The type Open api config. - */ -@Configuration -class OpenApiConfig { - - /** - * Group v 1 open api grouped open api. - * - * @return the grouped open api - */ - @Bean - public GroupedOpenApi groupV1OpenApi() { - return GroupedOpenApi.builder() - .group("v1-group").producesToMatch(HelloController.VERSION_1) - .build(); - } - - /** - * Group v 2 open api grouped open api. - * - * @return the grouped open api - */ - @Bean - public GroupedOpenApi groupV2OpenApi() { - return GroupedOpenApi.builder() - .group("v2-group").producesToMatch(HelloController.VERSION_2) - .build(); - } - - /** - * Group v 3 open api grouped open api. - * - * @return the grouped open api - */ - @Bean - public GroupedOpenApi groupV3OpenApi() { - return GroupedOpenApi.builder() - .group("v2-consumes-group").consumesToMatch(HelloController.VERSION_2) - .build(); - } - - /** - * Group v 4 open api grouped open api. - * - * @return the grouped open api - */ - @Bean - public GroupedOpenApi groupV4OpenApi() { - return GroupedOpenApi.builder() - .group("v1-headers-group").headersToMatch(HelloController.HEADER_1) - .build(); - } - - /** - * Group v 5 open api grouped open api. - * - * @return the grouped open api - */ - @Bean - public GroupedOpenApi groupV5OpenApi() { - return GroupedOpenApi.builder() - .group("v1-v2-headers-group").headersToMatch(HelloController.HEADER_1, HelloController.HEADER_2) - .build(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/SpringDocApp134Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/SpringDocApp134Test.java deleted file mode 100644 index f619e2ca7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app134/SpringDocApp134Test.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app134; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp134Test extends AbstractSpringDocTest { - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-group")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app134-1.json"), true)); - } - - /** - * Test app 2. - * - * @throws Exception the exception - */ - @Test - void testApp2() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-group")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app134-2.json"), true)); - } - - /** - * Test app 3. - * - * @throws Exception the exception - */ - @Test - void testApp3() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-headers-group")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app134-3.json"), true)); - } - - /** - * Test app 4. - * - * @throws Exception the exception - */ - @Test - void testApp4() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-v2-headers-group")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app134-4.json"), true)); - } - - /** - * Test app 5. - * - * @throws Exception the exception - */ - @Test - void testApp5() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-consumes-group")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(content().json(getContent("results/app134-5.json"), true)); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/Book.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/Book.java deleted file mode 100644 index 9ea698276..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/Book.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app135; - -/** - * The type Book. - */ -class Book { - - /** - * The Id. - */ - private String id; - - /** - * The Title. - */ - private String title; - - /** - * The Author. - */ - private String author; - - /** - * Instantiates a new Book. - * - * @param id the id - * @param title the title - * @param author the author - */ - public Book(String id, String title, String author) { - this.id = id; - this.title = title; - this.author = author; - } - - /** - * Gets id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(String id) { - this.id = id; - } - - /** - * Gets title. - * - * @return the title - */ - public String getTitle() { - return title; - } - - /** - * Sets title. - * - * @param title the title - */ - public void setTitle(String title) { - this.title = title; - } - - /** - * Gets author. - * - * @return the author - */ - public String getAuthor() { - return author; - } - - /** - * Sets author. - * - * @param author the author - */ - public void setAuthor(String author) { - this.author = author; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRepository.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRepository.java deleted file mode 100644 index caf653823..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRepository.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app135; - -import java.util.Arrays; -import java.util.List; - -import org.springframework.stereotype.Component; - -/** - * The type Book repository. - */ -@Component -class BookRepository { - - /** - * Find by author list. - * - * @param author the author - * @return the list - */ - List findByAuthor(String author) { - Book[] books = { new Book("1", "title1", "author1") }; - return Arrays.asList(books); - } - - /** - * Find all list. - * - * @return the list - */ - List findAll() { - Book[] books = { new Book("2", "title2", "author2") }; - return Arrays.asList(books); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRouter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRouter.java deleted file mode 100644 index af0eff3e6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/BookRouter.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app135; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springdoc.core.annotations.RouterOperation; -import org.springdoc.core.annotations.RouterOperations; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.servlet.function.RequestPredicates; -import org.springframework.web.servlet.function.RouterFunction; -import org.springframework.web.servlet.function.RouterFunctions; -import org.springframework.web.servlet.function.ServerResponse; - -import static org.springframework.web.servlet.function.RouterFunctions.nest; -import static org.springframework.web.servlet.function.RouterFunctions.route; -import static org.springframework.web.servlet.function.ServerResponse.ok; - -/** - * The type Book router. - */ -@Configuration -class BookRouter { - - /** - * Routes router function. - * - * @param br the br - * @return the router function - */ - @Bean - @RouterOperations({ - @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) - RouterFunction routes(BookRepository br) { - return - RouterFunctions.nest(RequestPredicates.path("/greeter").and(RequestPredicates.path("/greeter2")), - RouterFunctions.route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) - .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) - .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author"))))); - } - - /** - * Routes 1 router function. - * - * @param br the br - * @return the router function - */ - @Bean - @RouterOperations({ - @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) - RouterFunction routes1(BookRepository br) { - return - RouterFunctions.nest(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), - RouterFunctions.route(RequestPredicates.GET("/books"), req -> ServerResponse.ok().body(br.findAll())) - .andRoute(RequestPredicates.GET("/books/{author}"), req -> ServerResponse.ok().body(br.findByAuthor(req.pathVariable("author"))))); - } - - /** - * Routes 3 router function. - * - * @param br the br - * @return the router function - */ - @Bean - @RouterOperations({ - @RouterOperation(path = "/greeter/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })), - @RouterOperation(path = "/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) - RouterFunction routes3(BookRepository br) { - return - nest(RequestPredicates.path("/greeter").or(RequestPredicates.path("/greeter2")), - route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) - .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) - .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author"))))); - } - - /** - * Routes 4 router function. - * - * @param br the br - * @return the router function - */ - @Bean - @RouterOperations({ - @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), - @RouterOperation(path = "/test/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", - operation = @Operation(operationId = "findByAuthor" - , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) - RouterFunction routes4(BookRepository br) { - return - nest(RequestPredicates.path("/test"), - nest(RequestPredicates.path("/greeter").and(RequestPredicates.path("/greeter2")), - route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) - .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) - .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))))); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/SpringDocApp135Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/SpringDocApp135Test.java deleted file mode 100644 index fc78132ae..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app135/SpringDocApp135Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app135; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp135Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/HelloController.java deleted file mode 100644 index d3fb51c33..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/HelloController.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app137; - -import io.swagger.v3.oas.annotations.security.SecurityRequirement; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@SecurityRequirement(name = "security_auth") -class HelloController { - - /** - * Test. - * - * @param hello the hello - */ - @GetMapping("/test") - public void test(String hello) { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/OpenApiConfig.java deleted file mode 100644 index c48254014..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/OpenApiConfig.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app137; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.info.Info; -import io.swagger.v3.oas.annotations.security.OAuthFlow; -import io.swagger.v3.oas.annotations.security.OAuthFlows; -import io.swagger.v3.oas.annotations.security.SecurityScheme; -import io.swagger.v3.oas.annotations.servers.Server; - -/** - * The type Open api config. - */ -@OpenAPIDefinition(servers = @Server(url = "${test.server}", description = "${test.desc}"), info = @Info(title = "My App", - description = "Some long and useful description", version = "v1")) -@SecurityScheme(name = "security_auth", type = SecuritySchemeType.OAUTH2, - flows = @OAuthFlows(authorizationCode = @OAuthFlow( - authorizationUrl = "http://authorization.url" - , tokenUrl = "http://token.url", scopes = {}))) -class OpenApiConfig {} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/SpringDocApp137Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/SpringDocApp137Test.java deleted file mode 100644 index a952c0967..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app137/SpringDocApp137Test.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app137; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - - -/** - * Tests Spring meta-annotations as method parameters - */ -@TestPropertySource(properties = { "test.server=http://test.toto.com", "test.desc=toto desc" }) -class SpringDocApp137Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/HelloController.java deleted file mode 100644 index 73e75a5ce..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app138; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test a. - * - * @param hello the hello - */ - @GetMapping("/testA") - public void testA(String hello) { - } - - /** - * Test b. - * - * @param hello the hello - */ - @GetMapping("/testB") - public void testB(String hello) { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/SpringDocApp138Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/SpringDocApp138Test.java deleted file mode 100644 index d88d76d96..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app138/SpringDocApp138Test.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app138; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - - -/** - * Tests Spring meta-annotations as method parameters - */ -@TestPropertySource(properties = "springdoc.writer-with-order-by-keys=true") -class SpringDocApp138Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/HelloController.java deleted file mode 100644 index 7357246fa..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/HelloController.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app139; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Echo 1 string. - * - * @param text the text - * @return the string - */ - @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test1") - public String echo1(@RequestParam(name = "${test.name}", defaultValue = "${test.default-value}") String text) { - return text; - } - - /** - * Echo 2 string. - * - * @param text the text - * @return the string - */ - @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test2") - public String echo2(@RequestParam(value = "${test.value}", defaultValue = "${test.default-value}") String text) { - return text; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/SpringDocApp139Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/SpringDocApp139Test.java deleted file mode 100644 index 0c4918c4f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app139/SpringDocApp139Test.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - * - */ -package test.org.springdoc.api.app139; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - - -/** - * Tests Spring meta-annotations as method parameters - */ -@TestPropertySource(properties = { "test.name=text", "test.value=text", "test.default-value=default-text" }) -class SpringDocApp139Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java deleted file mode 100644 index 101fb8a55..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app14; - -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; - -import org.springframework.http.HttpEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons. - * - * @param name the name - */ - @GetMapping("/persons") - public void persons(@Valid @NotBlank String name) { - - } - - /** - * Demo 2 http entity. - * - * @return the http entity - */ - @GetMapping("/test") - public HttpEntity demo2() { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java deleted file mode 100644 index 0faffab68..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app14/SpringDocApp14Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app14; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 14 test. - */ -class SpringDocApp14Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/HelloApplication.java deleted file mode 100644 index 73eab0685..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/HelloApplication.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app140; - -import java.io.IOException; -import java.net.URI; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.atomic.AtomicLong; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import jakarta.servlet.FilterChain; -import jakarta.servlet.GenericFilter; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.function.HandlerFunction; -import org.springframework.web.servlet.function.RouterFunction; -import org.springframework.web.servlet.function.ServerRequest; -import org.springframework.web.servlet.function.ServerResponse; - -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.web.servlet.function.RouterFunctions.route; -import static org.springframework.web.servlet.function.ServerResponse.ok; - -/** - * The type Hello application. - */ -@Configuration -class HelloApplication { - - /** - * Filter server response. - * - * @param serverRequest the server request - * @param handlerFunction the handler function - * @return the server response - * @throws Exception the exception - */ - private static ServerResponse filter(ServerRequest serverRequest, HandlerFunction handlerFunction) throws Exception { - return handlerFunction.handle(serverRequest); - } - - /** - * Routes router function. - * - * @param ph the ph - * @return the router function - */ - @Bean - RouterFunction routes(PersonHandler ph) { - String root = ""; - return route() - .GET(root + "/people", ph::handleGetAllPeople) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("all")) - .GET(root + "/people/{id}", ph::handleGetPersonById) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("byId")) - .POST(root + "/people", ph::handlePostPerson) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("save")) - .filter(HelloApplication::filter) - .build(); - } -} - -/** - * The type Simple filter. - */ -@Component -class SimpleFilter extends GenericFilter { - - /** - * Do filter. - * - * @param req the req - * @param res the res - * @param filterChain the filter chain - * @throws IOException the io exception - * @throws ServletException the servlet exception - */ - @Override - public void doFilter(ServletRequest req, ServletResponse res, - FilterChain filterChain) throws IOException, ServletException { - filterChain.doFilter(req, res); - } -} - -/** - * The type Person handler. - */ -@Component -class PersonHandler { - - /** - * The Person service. - */ - private final PersonService personService; - - /** - * Instantiates a new Person handler. - * - * @param personService the person service - */ - PersonHandler(PersonService personService) { - this.personService = personService; - } - - /** - * Handle get all people server response. - * - * @param serverRequest the server request - * @return the server response - */ - ServerResponse handleGetAllPeople(ServerRequest serverRequest) { - return ok().body(personService.all()); - } - - /** - * Handle post person server response. - * - * @param r the r - * @return the server response - * @throws ServletException the servlet exception - * @throws IOException the io exception - */ - ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { - Person result = personService.save(new Person(null, r.body(Person.class).getName())); - URI uri = URI.create("/people/" + result.getId()); - return ServerResponse.created(uri).body(result); - } - - /** - * Handle get person by id server response. - * - * @param r the r - * @return the server response - */ - ServerResponse handleGetPersonById(ServerRequest r) { - return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); - } -} - -/** - * The type Greetings rest controller. - */ -@RestController -class GreetingsRestController { - - /** - * Greet string. - * - * @param name the name - * @return the string - */ - @GetMapping("/greet/{name}") - String greet(@PathVariable String name) { - return "hello " + name + "!"; - } -} - -/** - * The type Person service. - */ -@Service -class PersonService { - - /** - * The Counter. - */ - private final AtomicLong counter = new AtomicLong(); - - /** - * The People. - */ - private final Set people = Stream.of( - new Person(counter.incrementAndGet(), "Jane"), - new Person(counter.incrementAndGet(), "Josh"), - new Person(counter.incrementAndGet(), "Gordon")) - .collect(Collectors.toCollection(HashSet::new)); - - - /** - * Save person. - * - * @param p the p - * @return the person - */ - Person save(Person p) { - Person person = new Person(counter.incrementAndGet(), p.getName()); - this.people.add(person); - return person; - } - - /** - * All set. - * - * @return the set - */ - Set all() { - return this.people; - } - - /** - * By id person. - * - * @param id the id - * @return the person - */ - Person byId(@Parameter(in = ParameterIn.PATH) Long id) { - return this.people.stream() - .filter(p -> p.getId().equals(id)) - .findFirst() - .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); - } - -} - -/** - * The type Person. - */ -class Person { - - /** - * The Id. - */ - private Long id; - - /** - * The Name. - */ - private String name; - - /** - * Instantiates a new Person. - * - * @param id the id - * @param name the name - */ - public Person(Long id, String name) { - this.id = id; - this.name = name; - } - - /** - * Gets id. - * - * @return the id - */ - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Gets name. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/SpringDocApp140Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/SpringDocApp140Test.java deleted file mode 100644 index d4d169907..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app140/SpringDocApp140Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app140; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 140 test. - */ -class SpringDocApp140Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/Book.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/Book.java deleted file mode 100644 index b0ad55ea9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/Book.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app141; - -/** - * The type Book. - */ -class Book { - - /** - * The Id. - */ - private String id; - - /** - * The Title. - */ - private String title; - - /** - * The Author. - */ - private String author; - - /** - * Instantiates a new Book. - * - * @param id the id - * @param title the title - * @param author the author - */ - public Book(String id, String title, String author) { - this.id = id; - this.title = title; - this.author = author; - } - - /** - * Gets id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(String id) { - this.id = id; - } - - /** - * Gets title. - * - * @return the title - */ - public String getTitle() { - return title; - } - - /** - * Sets title. - * - * @param title the title - */ - public void setTitle(String title) { - this.title = title; - } - - /** - * Gets author. - * - * @return the author - */ - public String getAuthor() { - return author; - } - - /** - * Sets author. - * - * @param author the author - */ - public void setAuthor(String author) { - this.author = author; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRepository.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRepository.java deleted file mode 100644 index 06974d0a7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRepository.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app141; - -import java.util.Arrays; -import java.util.List; - -import org.springframework.stereotype.Component; - -/** - * The type Book repository. - */ -@Component -class BookRepository { - - /** - * Find by author list. - * - * @param author the author - * @return the list - */ - List findByAuthor(String author) { - Book[] books = { new Book("1", "title1", "author1") }; - return Arrays.asList(books); - } - - /** - * Find all list. - * - * @return the list - */ - List findAll() { - Book[] books = { new Book("2", "title2", "author2") }; - return Arrays.asList(books); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRouter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRouter.java deleted file mode 100644 index 0781203e4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/BookRouter.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app141; - -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.servlet.function.RouterFunction; - -import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; -import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; -import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; -import static org.springframework.web.servlet.function.RequestPredicates.GET; -import static org.springframework.web.servlet.function.RequestPredicates.accept; -import static org.springframework.web.servlet.function.RequestPredicates.path; -import static org.springframework.web.servlet.function.RouterFunctions.nest; -import static org.springframework.web.servlet.function.RouterFunctions.route; -import static org.springframework.web.servlet.function.ServerResponse.ok; - -/** - * The type Book router. - */ -@Configuration -class BookRouter { - - - /** - * Routes router function. - * - * @param br the br - * @return the router function - */ - @Bean - RouterFunction routes(BookRepository br) { - return nest(path("/greeter").and(path("/greeter2")), - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) - - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) - - .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() - .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) - .beanClass(BookRepository.class).beanMethod("findByAuthor"))) - ); - } - - /** - * Routes 1 router function. - * - * @param br the br - * @return the router function - */ - @Bean - RouterFunction routes1(BookRepository br) { - return nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), - route(GET("/books"), req -> ok().body(br.findAll())) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) - - .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() - .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) - .beanClass(BookRepository.class).beanMethod("findByAuthor")))); - } - - /** - * Routes 3 router function. - * - * @param br the br - * @return the router function - */ - @Bean - RouterFunction routes3(BookRepository br) { - return nest(path("/greeter").or(path("/greeter2")), - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) - - - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) - - .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() - .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) - .beanClass(BookRepository.class).beanMethod("findByAuthor")))); - } - - /** - * Routes 4 router function. - * - * @param br the br - * @return the router function - */ - @Bean - RouterFunction routes4(BookRepository br) { - return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), - route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) - - .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) - - .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) - .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() - .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) - .beanClass(BookRepository.class).beanMethod("findByAuthor"))))); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/SpringDocApp141Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/SpringDocApp141Test.java deleted file mode 100644 index 4cf55c8dc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app141/SpringDocApp141Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ -package test.org.springdoc.api.app141; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp141Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/HelloApplication.java deleted file mode 100644 index 4a53475d1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/HelloApplication.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app142; - -import java.io.IOException; -import java.net.URI; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.atomic.AtomicLong; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import jakarta.servlet.FilterChain; -import jakarta.servlet.GenericFilter; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import org.springdoc.webmvc.core.fn.SpringdocRouteBuilder; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.function.RouterFunction; -import org.springframework.web.servlet.function.ServerRequest; -import org.springframework.web.servlet.function.ServerResponse; - -import static org.springframework.web.servlet.function.ServerResponse.ok; - -/** - * The type Hello application. - */ -@Configuration -class HelloApplication { - - - /** - * Routes router function. - * - * @param ph the ph - * @return the router function - */ - @Bean - RouterFunction routes(PersonHandler ph) { - String root = ""; - return SpringdocRouteBuilder.route() - .GET(root + "/people", ph::handleGetAllPeople, ops -> ops.beanClass(PersonService.class).beanMethod("all")) - .GET(root + "/people/{id}", ph::handleGetPersonById, ops -> ops.beanClass(PersonService.class).beanMethod("byId")) - .POST(root + "/people", ph::handlePostPerson, ops -> ops.beanClass(PersonService.class).beanMethod("save")).build(); - } - -} - -/** - * The type Simple filter. - */ -@Component -class SimpleFilter extends GenericFilter { - - /** - * Do filter. - * - * @param req the req - * @param res the res - * @param filterChain the filter chain - * @throws IOException the io exception - * @throws ServletException the servlet exception - */ - @Override - public void doFilter(ServletRequest req, ServletResponse res, - FilterChain filterChain) throws IOException, ServletException { - filterChain.doFilter(req, res); - } -} - -/** - * The type Person handler. - */ -@Component -class PersonHandler { - - /** - * The Person service. - */ - private final PersonService personService; - - /** - * Instantiates a new Person handler. - * - * @param personService the person service - */ - PersonHandler(PersonService personService) { - this.personService = personService; - } - - /** - * Handle get all people server response. - * - * @param serverRequest the server request - * @return the server response - */ - ServerResponse handleGetAllPeople(ServerRequest serverRequest) { - return ok().body(personService.all()); - } - - /** - * Handle post person server response. - * - * @param r the r - * @return the server response - * @throws ServletException the servlet exception - * @throws IOException the io exception - */ - ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { - Person result = personService.save(new Person(null, r.body(Person.class).getName())); - URI uri = URI.create("/people/" + result.getId()); - return ServerResponse.created(uri).body(result); - } - - /** - * Handle get person by id server response. - * - * @param r the r - * @return the server response - */ - ServerResponse handleGetPersonById(ServerRequest r) { - return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); - } -} - -/** - * The type Greetings rest controller. - */ -@RestController -class GreetingsRestController { - - /** - * Greet string. - * - * @param name the name - * @return the string - */ - @GetMapping("/greet/{name}") - String greet(@PathVariable String name) { - return "hello " + name + "!"; - } -} - -/** - * The type Person service. - */ -@Service -class PersonService { - - /** - * The Counter. - */ - private final AtomicLong counter = new AtomicLong(); - - /** - * The People. - */ - private final Set people = Stream.of( - new Person(counter.incrementAndGet(), "Jane"), - new Person(counter.incrementAndGet(), "Josh"), - new Person(counter.incrementAndGet(), "Gordon")) - .collect(Collectors.toCollection(HashSet::new)); - - - /** - * Save person. - * - * @param p the p - * @return the person - */ - Person save(Person p) { - Person person = new Person(counter.incrementAndGet(), p.getName()); - this.people.add(person); - return person; - } - - /** - * All set. - * - * @return the set - */ - Set all() { - return this.people; - } - - /** - * By id person. - * - * @param id the id - * @return the person - */ - Person byId(@Parameter(in = ParameterIn.PATH) Long id) { - return this.people.stream() - .filter(p -> p.getId().equals(id)) - .findFirst() - .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); - } - -} - -/** - * The type Person. - */ -class Person { - - /** - * The Id. - */ - private Long id; - - /** - * The Name. - */ - private String name; - - /** - * Instantiates a new Person. - * - * @param id the id - * @param name the name - */ - public Person(Long id, String name) { - this.id = id; - this.name = name; - } - - /** - * Gets id. - * - * @return the id - */ - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Gets name. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/SpringDocApp142Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/SpringDocApp142Test.java deleted file mode 100644 index 243c78eea..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app142/SpringDocApp142Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * - * * - * * * - * * * * Copyright 2019-2020 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app142; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 142 test. - */ -class SpringDocApp142Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloController.java deleted file mode 100644 index ad2c4ba32..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloController.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app149; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -/** - * To test the case a user does not use @RestController but puts @Operation on handler methods - * and wants these methods to be exposed. - * - * @author Azige - */ -@Controller -class HelloController { - - /** - * Hello string. - * - * @return the string - */ - @GetMapping("/hello") - @Operation(responses = @ApiResponse( - responseCode = "200", - description = "OK", - content = @Content(schema = @Schema(implementation = HelloMessage.class)) - )) - public String hello() { - return "forward:/message"; - } - - /** - * Message hello message. - * - * @return the hello message - */ - @GetMapping("/message") - @Operation - @ResponseBody - public HelloMessage message() { - return new HelloMessage("Lucky numbers!", 777); - } - - /** - * Hello model and view model and view. - * - * @return the model and view - */ - @GetMapping("/helloModelAndView") - @Operation(responses = @ApiResponse( - responseCode = "200", - description = "OK", - content = @Content(schema = @Schema(implementation = HelloMessage.class)) - )) - public ModelAndView helloModelAndView() { - ModelAndView mav = new ModelAndView(); - mav.setViewName("forward:/message"); - return mav; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloMessage.java deleted file mode 100644 index 5a59bec2e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/HelloMessage.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app149; - -/** - * The type Hello message. - */ -class HelloMessage { - /** - * The Text. - */ - public String text; - - /** - * The Number. - */ - public int number; - - /** - * Instantiates a new Hello message. - * - * @param text the text - * @param number the number - */ - public HelloMessage(String text, int number) { - this.text = text; - this.number = number; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java deleted file mode 100644 index c744382ba..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app149/SpringDocApp149Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app149; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 149 test. - */ -@TestPropertySource(properties = "springdoc.model-and-view-allowed=true") -class SpringDocApp149Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java deleted file mode 100644 index e45ae4fc0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app15; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import org.json.JSONObject; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons json object. - * - * @return the json object - */ - @GetMapping(value = "/persons") - @Operation(description = "${springdoc.operation-descriptions.myOperation}", responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(hidden = true)))) - public JSONObject persons() { - return new JSONObject(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java deleted file mode 100644 index edf10ffbe..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app15/SpringDocApp15Test.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app15; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.info.Contact; -import io.swagger.v3.oas.annotations.info.Info; -import io.swagger.v3.oas.annotations.info.License; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 15 test. - */ -@TestPropertySource(properties = { - "springdoc.operation-descriptions.myOperation=My Desc", - "springdoc.openapidefinition.info.title=My title", - "springdoc.openapidefinition.info.desc=My description", - "springdoc.openapidefinition.info.version=My version", - "springdoc.openapidefinition.info.terms=My terms", - "springdoc.openapidefinition.info.license.name=My license name", - "springdoc.openapidefinition.info.license.url=My license url", - "springdoc.openapidefinition.info.contact.name=My contact name", - "springdoc.openapidefinition.info.contact.email=My contact email", - "springdoc.openapidefinition.info.contact.url=My contact url" -}) -class SpringDocApp15Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - @OpenAPIDefinition(info = @Info( - title = "${springdoc.openapidefinition.info.title}", - description = "${springdoc.openapidefinition.info.desc}", - version = "${springdoc.openapidefinition.info.version}", - termsOfService = "${springdoc.openapidefinition.info.terms}", - license = @License( - name = "${springdoc.openapidefinition.info.license.name}", - url = "${springdoc.openapidefinition.info.license.url}" - ), - contact = @Contact( - name = "${springdoc.openapidefinition.info.contact.name}", - email = "${springdoc.openapidefinition.info.contact.email}", - url = "${springdoc.openapidefinition.info.contact.url}" - ) - )) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/HelloController.java deleted file mode 100644 index d57664d6a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/HelloController.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app150; - -import java.time.LocalDate; -import java.util.List; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -import static org.springframework.format.annotation.DateTimeFormat.ISO.DATE; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test. - * - * @param toto the toto - */ - @GetMapping("/test/") - @ApiResponse(responseCode = "204", description = "No content") - @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void test(@RequestParam(defaultValue = "1") Integer toto) { - - } - - /** - * Test 1. - * - * @param toto the toto - */ - @GetMapping("/test1") - @ApiResponse(responseCode = "204", description = "No content") - @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void test1(@RequestParam @Parameter(schema = @Schema(defaultValue = "false", type = "boolean")) boolean toto) { - - } - - /** - * Test 3. - * - * @param toto the toto - */ - @GetMapping("/test3") - @ApiResponse(responseCode = "204", description = "No content") - @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void test3(@RequestParam(defaultValue = "users,123") List toto) { - - } - - /** - * Test 4. - * - * @param localDate the local date - */ - @GetMapping("/test4") - @ApiResponse(responseCode = "204", description = "No content") - @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void test4(@DateTimeFormat(iso = DATE) @RequestParam(defaultValue = "2021-03-08") LocalDate localDate) { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java deleted file mode 100644 index c5f419fca..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app150/SpringDocApp150Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app150; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp150Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/HelloController.java deleted file mode 100644 index ddfa63685..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/HelloController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app151; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/test") -class HelloController { - - /** - * Test int. - * - * @return the int - */ - @GetMapping("") - /** - * A test endpoint mounted under `/test` - * @return 0 - */ - public int test() { - return 0; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java deleted file mode 100644 index 9adcff886..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app151/SpringDocApp151Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app151; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp151Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/HelloController.java deleted file mode 100644 index cf60ae7e8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/HelloController.java +++ /dev/null @@ -1,46 +0,0 @@ -package test.org.springdoc.api.app152; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.util.pattern.PathPatternParser; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/api") -class HelloController { - - /** - * Hello world string. - * - * @return the string - */ - @GetMapping - public String helloWorld() { - return "ok"; - } - - /** - * The type Web config. - */ - @Configuration - class WebConfig implements WebMvcConfigurer { - - /** - * Configure path match. - * - * @param configurer the configurer - */ - @Override - public void configurePathMatch(PathMatchConfigurer configurer) { - configurer.setPatternParser(new PathPatternParser()); - } - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java deleted file mode 100644 index f2a86f532..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app152/SpringDocApp152Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app152; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp152Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderState.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderState.java deleted file mode 100644 index 4ac62d79c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderState.java +++ /dev/null @@ -1,42 +0,0 @@ -package test.org.springdoc.api.app153; - -import io.swagger.v3.oas.annotations.media.Schema; - - -/** - * The enum Order state. - */ -@Schema(type = "string", allowableValues = { "finished", "new" }) -public enum OrderState { - /** - *Finished order state. - */ - FINISHED("finished"), - /** - *New order state. - */ - NEW("new"); - - /** - * The Value. - */ - private final String value; - - /** - * Instantiates a new Order state. - * - * @param value the value - */ - OrderState(String value) { - this.value = value; - } - - /** - * Gets value. - * - * @return the value - */ - public String getValue() { - return value; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderStateMapper.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderStateMapper.java deleted file mode 100644 index f887b0985..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/OrderStateMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package test.org.springdoc.api.app153; - -import java.beans.PropertyEditorSupport; -import java.util.Arrays; - -import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; - -/** - * The type Order state mapper. - */ -class OrderStateMapper extends PropertyEditorSupport { - - /** - * Sets as text. - * - * @param text the text - */ - @Override - public void setAsText(String text) { - setValue( - Arrays.stream(OrderState.class.getEnumConstants()) - .filter(e -> e.getValue().equals(text)) - .findFirst() - .orElseThrow(() -> new MethodArgumentTypeMismatchException( - text, OrderState.class, "orderState", null, null))); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java deleted file mode 100644 index 730e8bebd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/SpringDocApp153Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app153; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp153Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/TestController.java deleted file mode 100644 index 59da34044..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app153/TestController.java +++ /dev/null @@ -1,36 +0,0 @@ -package test.org.springdoc.api.app153; - -import org.springframework.web.bind.WebDataBinder; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.InitBinder; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Test controller. - */ -@RestController -class TestController { - - /** - * Init binder. - * - * @param dataBinder the data binder - */ - @InitBinder - public void initBinder(WebDataBinder dataBinder) { - dataBinder.registerCustomEditor(OrderState.class, new OrderStateMapper()); - } - - /** - * Method object. - * - * @param orderState the order state - * @return the object - */ - @GetMapping(value = { "/orders" }) - public Object method( - @RequestParam(value = "state", defaultValue = "finished") OrderState orderState) { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/HelloController.java deleted file mode 100644 index c1d29d062..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/HelloController.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app154; - -import java.time.Instant; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - - /** - * Hello string. - * - * @return the string - */ - @GetMapping(path = "/") - public String hello() { - return "Hello world at " + Instant.now().toString(); - } - - /** - * Create. - * - * @param id the id - * @param o the o - */ - @PostMapping(value = "/persons") - public void create(@ParameterObject Long id, @RequestBody Object o) { - - } - - /** - * Createone. - * - * @param id the id - * @param o the o - */ - @PostMapping(value = "/personsone") - public void createone(Long id, @RequestBody Object o) { - - } - - /** - * Createtwo. - * - * @param id the id - */ - @PostMapping(value = "/createtwo") - public void createtwo(int id) { - - } - - /** - * Createthree. - * - * @param id the id - */ - @PostMapping(value = "/createthree") - public void createthree(Integer id) { - - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/OpenApiConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/OpenApiConfiguration.java deleted file mode 100644 index afb45b440..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/OpenApiConfiguration.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app154; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.info.Info; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.security.SecurityScheme; -import io.swagger.v3.oas.annotations.security.SecuritySchemes; - -/** - * The type Open api configuration. - */ -@OpenAPIDefinition(info = @Info(title = "toto", version = "1.0"), - security = { @SecurityRequirement(name = "basicAuth"), @SecurityRequirement(name = "bearerToken") } -) -@SecuritySchemes({ - @SecurityScheme( - name = "basicAuth", - type = SecuritySchemeType.HTTP, - scheme = "basic" - ), - @SecurityScheme( - name = "bearerToken", - type = SecuritySchemeType.HTTP, - scheme = "bearer", - bearerFormat = "JWT" - ) -}) -class OpenApiConfiguration { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java deleted file mode 100644 index 7f7df1839..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app154/SpringDocApp154Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app154; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp154Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractIntParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractIntParameterObject.java deleted file mode 100644 index 0d89e059d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractIntParameterObject.java +++ /dev/null @@ -1,55 +0,0 @@ -package test.org.springdoc.api.app155; - -/** - * The type Abstract int parameter object. - * - * @param the type parameter - */ -class AbstractIntParameterObject { - - /** - * The Primitive base field. - */ - int primitiveBaseField; - - /** - * The Generic field. - */ - T genericField; - - /** - * Gets primitive base field. - * - * @return the primitive base field - */ - public int getPrimitiveBaseField() { - return primitiveBaseField; - } - - /** - * Sets primitive base field. - * - * @param primitiveBaseField the primitive base field - */ - public void setPrimitiveBaseField(int primitiveBaseField) { - this.primitiveBaseField = primitiveBaseField; - } - - /** - * Gets generic field. - * - * @return the generic field - */ - public T getGenericField() { - return genericField; - } - - /** - * Sets generic field. - * - * @param genericField the generic field - */ - public void setGenericField(T genericField) { - this.genericField = genericField; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractParameterObject.java deleted file mode 100644 index 664a456fd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/AbstractParameterObject.java +++ /dev/null @@ -1,59 +0,0 @@ -package test.org.springdoc.api.app155; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Abstract parameter object. - * - * @param the type parameter - */ -class AbstractParameterObject> { - - /** - * The Primitive base field. - */ - int primitiveBaseField; - - /** - * The Generic field. - */ - @Parameter(schema = @Schema(type = "string", allowableValues = { "ONE", "TWO" })) - T genericField; - - /** - * Gets primitive base field. - * - * @return the primitive base field - */ - public int getPrimitiveBaseField() { - return primitiveBaseField; - } - - /** - * Sets primitive base field. - * - * @param primitiveBaseField the primitive base field - */ - public void setPrimitiveBaseField(int primitiveBaseField) { - this.primitiveBaseField = primitiveBaseField; - } - - /** - * Gets generic field. - * - * @return the generic field - */ - public T getGenericField() { - return genericField; - } - - /** - * Sets generic field. - * - * @param genericField the generic field - */ - public void setGenericField(T genericField) { - this.genericField = genericField; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteEnum.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteEnum.java deleted file mode 100644 index 66595bea8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteEnum.java +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app155; - - -/** - * The enum Concrete enum. - */ -enum ConcreteEnum { - /** - *One concrete enum. - */ - ONE, - /** - *Two concrete enum. - */ - TWO - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteIntParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteIntParameterObject.java deleted file mode 100644 index 97ef003ac..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteIntParameterObject.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app155; - -/** - * The type Concrete int parameter object. - */ -class ConcreteIntParameterObject extends AbstractIntParameterObject { - - /** - * The Primitive concrete field. - */ - int primitiveConcreteField; - - /** - * Gets primitive concrete field. - * - * @return the primitive concrete field - */ - public int getPrimitiveConcreteField() { - return primitiveConcreteField; - } - - /** - * Sets primitive concrete field. - * - * @param primitiveConcreteField the primitive concrete field - */ - public void setPrimitiveConcreteField(int primitiveConcreteField) { - this.primitiveConcreteField = primitiveConcreteField; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteParameterObject.java deleted file mode 100644 index e2a21351d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/ConcreteParameterObject.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app155; - -/** - * The type Concrete parameter object. - */ -class ConcreteParameterObject extends AbstractParameterObject { - - /** - * The Primitive concrete field. - */ - int primitiveConcreteField; - - /** - * Gets primitive concrete field. - * - * @return the primitive concrete field - */ - public int getPrimitiveConcreteField() { - return primitiveConcreteField; - } - - /** - * Sets primitive concrete field. - * - * @param primitiveConcreteField the primitive concrete field - */ - public void setPrimitiveConcreteField(int primitiveConcreteField) { - this.primitiveConcreteField = primitiveConcreteField; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/HelloController.java deleted file mode 100644 index 0587ca62e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/HelloController.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app155; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Say hello response entity. - * - * @param test the test - * @return the response entity - */ - @GetMapping("/test1") - public ResponseEntity sayHello(@ParameterObject final ConcreteParameterObject test) { - System.out.println("Field B = " + test); - return new ResponseEntity("{\"Say\": \"Hello\"}", HttpStatus.OK); - } - - /** - * Say hello response entity. - * - * @param test the test - * @return the response entity - */ - @GetMapping("/test2") - public ResponseEntity sayHello(@ParameterObject final ConcreteIntParameterObject test) { - System.out.println("Field B = " + test); - return new ResponseEntity("{\"Say\": \"Hello\"}", HttpStatus.OK); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/SpringDocApp155Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/SpringDocApp155Test.java deleted file mode 100644 index f27a7c5b8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app155/SpringDocApp155Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app155; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp155Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/HelloController.java deleted file mode 100644 index d645edb0c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/HelloController.java +++ /dev/null @@ -1,54 +0,0 @@ -package test.org.springdoc.api.app156; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -import static io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - /** - * Hello string. - * - * @param user the user - * @return the string - */ - @GetMapping("/hello") - @Parameter(name = "someEnums", in = QUERY, description = "SomeEum decs", - array = @ArraySchema(schema = @Schema(implementation = SomeEnum.class))) - @Parameter(name = "textSet", in = QUERY, description = "First decs", - array = @ArraySchema(schema = @Schema(implementation = String.class))) - @Parameter(name = "someText", in = QUERY, description = "Second decs", - schema = @Schema(type = "string")) - public String hello(@Parameter(hidden = true) User user) { - String forReturn = "Hello "; - StringBuilder stringBuilder = new StringBuilder(forReturn); - - if (user.getSomeEnums() != null) { - for (SomeEnum some : user.getSomeEnums()) { - stringBuilder.append(some); - stringBuilder.append(" "); - } - } - - if (user.getSomeText() != null) { - for (String text : user.getTextSet()) { - stringBuilder.append(text); - stringBuilder.append(" "); - } - } - - if (user.getSomeText() != null) { - stringBuilder.append(user.getSomeText()); - } - - return stringBuilder.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SomeEnum.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SomeEnum.java deleted file mode 100644 index 85410b4a7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SomeEnum.java +++ /dev/null @@ -1,15 +0,0 @@ -package test.org.springdoc.api.app156; - -/** - * The enum Some enum. - */ -public enum SomeEnum { - /** - *First some enum. - */ - FIRST, - /** - *Second some enum. - */ - SECOND -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SpringDocApp156Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SpringDocApp156Test.java deleted file mode 100644 index caeac0895..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/SpringDocApp156Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app156; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Tests Spring meta-annotations as method parameters - */ -class SpringDocApp156Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/User.java deleted file mode 100644 index f4ec1eceb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app156/User.java +++ /dev/null @@ -1,77 +0,0 @@ -package test.org.springdoc.api.app156; - -import java.util.Set; - -/** - * The type User. - */ -class User { - /** - * The Some text. - */ - private String someText; - - /** - * The Text set. - */ - private Set textSet; - - /** - * The Some enums. - */ - private Set someEnums; - - /** - * Gets some text. - * - * @return the some text - */ - public String getSomeText() { - return someText; - } - - /** - * Sets some text. - * - * @param someText the some text - */ - public void setSomeText(String someText) { - this.someText = someText; - } - - /** - * Gets text set. - * - * @return the text set - */ - public Set getTextSet() { - return textSet; - } - - /** - * Sets text set. - * - * @param textSet the text set - */ - public void setTextSet(Set textSet) { - this.textSet = textSet; - } - - /** - * Gets some enums. - * - * @return the some enums - */ - public Set getSomeEnums() { - return someEnums; - } - - /** - * Sets some enums. - * - * @param someEnums the some enums - */ - public void setSomeEnums(Set someEnums) { - this.someEnums = someEnums; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Bar.java deleted file mode 100644 index 4fa42edae..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Bar.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app157; - -/** - * A class without a String in it - */ -class Bar { - /** - * The Child. - */ - private Object child; - - /** - * Gets child. - * - * @return the child - */ - public Object getChild() { - return this.child; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Foo.java deleted file mode 100644 index 05b8c39a7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/Foo.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app157; - -/** - * A class with a String in it - */ -class Foo { - /** - * The Child. - */ - private String child; - - /** - * Gets child. - * - * @return the child - */ - public String getChild() { - return this.child; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/HelloController.java deleted file mode 100644 index 4265a2bdf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app157; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * Put Foo and Bar in the schema's components, make sure there is an ignored wrapper - * ({@code ResponseEntity}). - */ -@RestController -class HelloController { - - /** - * Gets foo. - * - * @return the foo - */ - @GetMapping("/foo") - public ResponseEntity getFoo() { - return new ResponseEntity(HttpStatus.OK); - } - - /** - * Gets bar. - * - * @return the bar - */ - @GetMapping("/bar") - public ResponseEntity getBar() { - return new ResponseEntity(HttpStatus.OK); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/SpringDocApp157Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/SpringDocApp157Test.java deleted file mode 100644 index ffedde82f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/SpringDocApp157Test.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app157; - -import java.util.ArrayList; - -import io.swagger.v3.core.converter.ModelConverters; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * This test is to make sure that a new model converter can access the parent of a type, even if - * the type is enclosed in an ignored wrapper. We test this by setting up a model converter which - * adds "stringy" to the "required" property of a schema's parent, when the sub schema is a String. - */ -class SpringDocApp157Test extends AbstractSpringDocTest { - - /** - * The Converters. - */ - private final ModelConverters converters = ModelConverters.getInstance(); - - @Autowired - private StringyConverter stringyConverter; - - /** - * Unregister converter. - */ - @AfterEach - public void unregisterConverter() { - converters.removeConverter(stringyConverter); - } - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(jsonPath("$.components.schemas.Foo.required", is(new ArrayList() {{ - add("stringy"); - }}))) - .andExpect(jsonPath("$.components.schemas.Bar", not(hasProperty("required")))); - } - - /** - * The type Spring boot app. - */ - @SpringBootApplication - static class SpringBootApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/StringyConverter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/StringyConverter.java deleted file mode 100644 index 97e650607..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app157/StringyConverter.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app157; - -import java.util.Iterator; - -import com.fasterxml.jackson.databind.JavaType; -import io.swagger.v3.core.converter.AnnotatedType; -import io.swagger.v3.core.converter.ModelConverter; -import io.swagger.v3.core.converter.ModelConverterContext; -import io.swagger.v3.oas.models.media.Schema; -import org.springdoc.core.providers.ObjectMapperProvider; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - - -@Component -class StringyConverter implements ModelConverter { - - @Autowired - ObjectMapperProvider objectMapperProvider; - - public StringyConverter(ObjectMapperProvider objectMapperProvider) { - this.objectMapperProvider = objectMapperProvider; - } - - - @Override - public Schema resolve(AnnotatedType type, ModelConverterContext context, - Iterator chain) { - - JavaType javaType = objectMapperProvider.jsonMapper().constructType(type.getType()); - - if (javaType.getRawClass().equals(String.class)) { - type.getParent().addRequiredItem("stringy"); - } - return chain.next().resolve(type, context, chain); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/CommonFooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/CommonFooErrorHandler.java deleted file mode 100644 index 47230839c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/CommonFooErrorHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -package test.org.springdoc.api.app158; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; - -/** - * The type Common foo error handler. - */ -class CommonFooErrorHandler { - - /** - * On exception error dto. - * - * @param e the e - * @return the error dto - */ - @ExceptionHandler - @ResponseStatus(HttpStatus.CONFLICT) - public ErrorDTO onException(Exception e) { - return new ErrorDTO("Something wrong has happened"); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/ErrorDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/ErrorDTO.java deleted file mode 100644 index 1b3eeef92..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/ErrorDTO.java +++ /dev/null @@ -1,44 +0,0 @@ -package test.org.springdoc.api.app158; - -/** - * The type Error dto. - */ -class ErrorDTO { - /** - * The Message. - */ - private String message; - - /** - * Instantiates a new Error dto. - */ - public ErrorDTO() { - } - - /** - * Instantiates a new Error dto. - * - * @param message the message - */ - public ErrorDTO(String message) { - this.message = message; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/HelloController.java deleted file mode 100644 index 0360f2779..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/HelloController.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app158; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.info.Info; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/api") -@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) -class HelloController { - - /** - * Hello simple dto. - * - * @return the simple dto - */ - @GetMapping("/foo") - public SimpleDTO hello() { - return new SimpleDTO("foo"); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SimpleDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SimpleDTO.java deleted file mode 100644 index 33618eb50..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SimpleDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -package test.org.springdoc.api.app158; - -/** - * The type Simple dto. - */ -class SimpleDTO { - - /** - * The Payload. - */ - private String payload; - - /** - * Instantiates a new Simple dto. - */ - public SimpleDTO() { - } - - /** - * Instantiates a new Simple dto. - * - * @param payload the payload - */ - public SimpleDTO(String payload) { - this.payload = payload; - } - - /** - * Gets payload. - * - * @return the payload - */ - public String getPayload() { - return payload; - } - - /** - * Sets payload. - * - * @param payload the payload - */ - public void setPayload(String payload) { - this.payload = payload; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpecificFooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpecificFooErrorHandler.java deleted file mode 100644 index 4680982ae..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpecificFooErrorHandler.java +++ /dev/null @@ -1,10 +0,0 @@ -package test.org.springdoc.api.app158; - -import org.springframework.web.bind.annotation.ControllerAdvice; - -/** - * The type Specific foo error handler. - */ -@ControllerAdvice(assignableTypes = HelloController.class) -class SpecificFooErrorHandler extends CommonFooErrorHandler { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpringDocApp158Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpringDocApp158Test.java deleted file mode 100644 index 9a06672ae..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app158/SpringDocApp158Test.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app158; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 158 test. - */ -class SpringDocApp158Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/CustomException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/CustomException.java deleted file mode 100644 index 7ac1e9802..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/CustomException.java +++ /dev/null @@ -1,15 +0,0 @@ -package test.org.springdoc.api.app159; - -/** - * The type Custom exception. - */ -class CustomException extends RuntimeException { - /** - * Instantiates a new Custom exception. - * - * @param message the message - */ - public CustomException(String message) { - super(message); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooBean.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooBean.java deleted file mode 100644 index 93849d8ce..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooBean.java +++ /dev/null @@ -1,67 +0,0 @@ -package test.org.springdoc.api.app159; - -import com.fasterxml.jackson.annotation.JsonView; - -/** - * The type Foo bean. - */ -class FooBean { - /** - * The Message. - */ - @JsonView(Views.View2.class) - private String message; - - /** - * The Code. - */ - @JsonView(Views.View1.class) - private int code; - - /** - * Instantiates a new Foo bean. - * - * @param message the message - * @param code the code - */ - public FooBean(String message, int code) { - this.message = message; - this.code = code; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } - - /** - * Gets code. - * - * @return the code - */ - public int getCode() { - return code; - } - - /** - * Sets code. - * - * @param code the code - */ - public void setCode(int code) { - this.code = code; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooErrorHandler.java deleted file mode 100644 index 352a93f65..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/FooErrorHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -package test.org.springdoc.api.app159; - -import com.fasterxml.jackson.annotation.JsonView; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; - -/** - * The type Foo error handler. - */ -@ControllerAdvice(assignableTypes = HelloController.class) -class FooErrorHandler { - - /** - * Store assignment publishing error response entity. - * - * @param e the e - * @return the response entity - */ - @ExceptionHandler - @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR) - @JsonView(Views.View1.class) - public ResponseEntity storeAssignmentPublishingError(Exception e) { - return new ResponseEntity<>(new FooBean("INTERNAL_SERVER_ERROR", 500), HttpStatus.INTERNAL_SERVER_ERROR); - } - - /** - * Store assignment publishing error response entity. - * - * @param e the e - * @return the response entity - */ - @ExceptionHandler - @ResponseStatus(value = HttpStatus.BAD_REQUEST) - @JsonView(Views.View2.class) - public ResponseEntity storeAssignmentPublishingError(CustomException e) { - return new ResponseEntity<>(new FooBean("BAD Request", 400), HttpStatus.BAD_REQUEST); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/HelloController.java deleted file mode 100644 index 865a3ab2b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/HelloController.java +++ /dev/null @@ -1,31 +0,0 @@ -package test.org.springdoc.api.app159; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.info.Info; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/api") -@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) -class HelloController { - - /** - * Create string. - * - * @param foo the foo - * @return the string - */ - @PostMapping("/foo") - public String create(@RequestBody String foo) { - return "foo"; - } -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/SpringDocApp159Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/SpringDocApp159Test.java deleted file mode 100644 index c725aa27c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/SpringDocApp159Test.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app159; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 159 test. - */ -class SpringDocApp159Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/Views.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/Views.java deleted file mode 100644 index a1dbcf1e0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app159/Views.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app159; - -/** - * The type Views. - */ -class Views { - /** - * The type View 1. - */ - public static class View1 { - } - - /** - * The type View 2. - */ - public static class View2 extends View1 { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/HelloController.java deleted file mode 100644 index dc4bd8641..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/HelloController.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app16; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons string. - * - * @return the string - */ - @GetMapping("/persons") - public String persons() { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java deleted file mode 100644 index 2899cdd77..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app16/SpringDocApp16Test.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app16; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.SpringBootConfiguration; -import org.springframework.test.context.TestPropertySource; - -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Spring doc app 16 test. - */ -@TestPropertySource(properties = "springdoc.api-docs.enabled=false") -class SpringDocApp16Test extends AbstractSpringDocTest { - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) - .andExpect(status().isNotFound()); - } - - /** - * The type Spring doc test app. - */ - @SpringBootConfiguration - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/HelloController.java deleted file mode 100644 index c81884999..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/HelloController.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app160; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.context.support.ResourceBundleMessageSource; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Do something interesting error response. - * - * @return the error response - */ - @PostMapping("test") - public ErrorResponse doSomethingInteresting() { - return null; - } - - /** - * Bundle api grouped open api. - * - * @return the grouped open api - */ - @Bean - public GroupedOpenApi bundleApi() { - return GroupedOpenApi.builder() - .group("test") - .pathsToMatch("/**") - .build(); - } - - /** - * Translator resource bundle message source. - * - * @return the resource bundle message source - */ - @Bean - public ResourceBundleMessageSource translator() { - ResourceBundleMessageSource source = new ResourceBundleMessageSource(); - source.setBasenames("swagger-message-160"); - source.setUseCodeAsDefaultMessage(true); - source.setDefaultEncoding("utf-8"); - return source; - } - - /** - * The type Swagger message. - */ - @PropertySource("classpath:swagger-message-160.properties") - @Configuration - class SwaggerMessage {} - - /** - * The type Error response. - */ - @Schema(description = "${ErrorResponse}") - class ErrorResponse { - - /** - * The Error code. - */ - @Schema(description = "${ErrorCode}", required = true) - @JsonProperty - private Integer errorCode; - - /** - * The Error message. - */ - @Schema(description = "${ErrorMessage}") - @JsonProperty - private String errorMessage; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/SpringDocApp160Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/SpringDocApp160Test.java deleted file mode 100644 index 84a5a06c7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app160/SpringDocApp160Test.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app160; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 160 test. - */ -@TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") -class SpringDocApp160Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/HelloController.java deleted file mode 100644 index add930dc7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/HelloController.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app161; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - - /** - * Add response entity. - * - * @param content the content - * @return the response entity - * @throws Exception the exception - */ - @Operation(summary = "add") - @PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public ResponseEntity add(@Parameter(description = "content") @RequestPart(value = "content") String content) throws Exception { - return null; - } - - - /** - * Add 2 response entity. - * - * @param content the content - * @param type the type - * @return the response entity - */ - @Operation(summary = "add2") - @PostMapping(value = "/add2", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public ResponseEntity add2( - @Parameter(description = "content") @RequestPart(value = "content") String content, - @RequestPart(value = "type") String type - ) { - return null; - } - - /** - * Test. - * - * @param strValue the str value - * @param intValue the int value - */ - @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - @Operation(summary = "test") - public void test(@RequestPart("strValue") String strValue, - @RequestPart("intValue") Integer intValue) { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/SpringDocApp161Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/SpringDocApp161Test.java deleted file mode 100644 index 13c84e5ad..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app161/SpringDocApp161Test.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.app161; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 161 test. - */ -class SpringDocApp161Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java deleted file mode 100644 index 1bca98ed2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java +++ /dev/null @@ -1,38 +0,0 @@ -package test.org.springdoc.api.app162; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 162 test. - */ -@TestPropertySource(properties = "springdoc.override-with-generic-response=true") -class SpringDocApp162Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info() - .title("SpringShop API") - .version("v1") - .description("The description of the api")); - } - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/exception/NoResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/exception/NoResultException.java deleted file mode 100644 index 3af9a55f7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/exception/NoResultException.java +++ /dev/null @@ -1,4 +0,0 @@ -package test.org.springdoc.api.app162.exception; - -public class NoResultException extends RuntimeException { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/exception/NonUniqueResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/exception/NonUniqueResultException.java deleted file mode 100644 index bed7df86a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/exception/NonUniqueResultException.java +++ /dev/null @@ -1,7 +0,0 @@ -package test.org.springdoc.api.app162.exception; - -/** - * Multiple results found instead of a unique result. - */ -public class NonUniqueResultException extends RuntimeException { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/dto/JavadocOnlyRestDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/dto/JavadocOnlyRestDto.java deleted file mode 100644 index b0fef4237..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/dto/JavadocOnlyRestDto.java +++ /dev/null @@ -1,59 +0,0 @@ -package test.org.springdoc.api.app162.rest.dto; - -/** - * This is the {@code JavadocOnlyRestDto} class javadoc. - */ -public class JavadocOnlyRestDto { - /** - * This is the private {@code #guid} field's javadoc. - */ - private String guid; - - /** - * This is the private {@code #inner} field's javadoc. - * - * This javadoc description is ignored by the REST documentation: - * the {@code $ref} can't have a description as any sibling elements of a $ref are ignored. - */ - private JavadocOnlyStaticInnerRestDto inner; - - public JavadocOnlyRestDto() { - } - - public String getGuid() { - return guid; - } - - public void setGuid(String guid) { - this.guid = guid; - } - - public JavadocOnlyStaticInnerRestDto getInner() { - return inner; - } - - public void setInner(JavadocOnlyStaticInnerRestDto inner) { - this.inner = inner; - } - - /** - * This is the {@code JavadocOnlyStaticInnerRestDto} class javadoc. - */ - public static class JavadocOnlyStaticInnerRestDto { - /** - * This is the private {@code #content} field's javadoc. - */ - private String content; - - public JavadocOnlyStaticInnerRestDto() { - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java deleted file mode 100644 index f921989d6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -package test.org.springdoc.api.app162.rest.util; - -import test.org.springdoc.api.app162.exception.NoResultException; -import test.org.springdoc.api.app162.exception.NonUniqueResultException; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -/** - * REST exception handlers. - * - * This javadoc description is ignored by the REST documentation. - */ -@RestControllerAdvice -class RestExceptionHandler { - /** - * REST exception handler for {@code NoResultException}. - * - * This javadoc description is ignored by the REST documentation. - * - * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method - */ - @ExceptionHandler(NoResultException.class) - @ResponseStatus(code = HttpStatus.NOT_FOUND) - public ResponseEntity handleNotFoundException(NoResultException exception) { - return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); - } - - /** - * REST exception handler for {@code NonUniqueResultException}. - * - * This javadoc description is ignored by the REST documentation. - * - * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method - */ - @ExceptionHandler(NonUniqueResultException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { - return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java deleted file mode 100644 index 4fc870f61..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java +++ /dev/null @@ -1,38 +0,0 @@ -package test.org.springdoc.api.app163; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 163 test. - */ -@TestPropertySource(properties = "springdoc.override-with-generic-response=true") -class SpringDocApp163Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info() - .title("SpringShop API") - .version("v1") - .description("The description of the api")); - } - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/exception/NoResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/exception/NoResultException.java deleted file mode 100644 index b051533bc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/exception/NoResultException.java +++ /dev/null @@ -1,4 +0,0 @@ -package test.org.springdoc.api.app163.exception; - -public class NoResultException extends RuntimeException { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/exception/NonUniqueResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/exception/NonUniqueResultException.java deleted file mode 100644 index 081f53264..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/exception/NonUniqueResultException.java +++ /dev/null @@ -1,7 +0,0 @@ -package test.org.springdoc.api.app163.exception; - -/** - * Multiple results found instead of a unique result. - */ -public class NonUniqueResultException extends RuntimeException { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java deleted file mode 100644 index 42401b4bc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java +++ /dev/null @@ -1,60 +0,0 @@ -package test.org.springdoc.api.app163.rest.dto; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * This is the {@code AnnotationOverrideForJavadocRestDto} class javadoc. - */ -@Schema( - title = "annotation-override-dto", - description = "Description for the tag." -) -public class AnnotationOverrideForJavadocRestDto { - /** - * This is the private {@code #guid} field's javadoc. - */ - @Schema(description = "Description for the #guid field") - private String guid; - - /** - * This is the private {@code #inner} field's javadoc. - *

- * This javadoc description is ignored by the REST documentation: - * the {@code $ref} can't have a description as any sibling elements of a $ref are ignored. - */ - private AnnotationOverrideForJavadocStaticInnerRestDto inner; - - public String getGuid() { - return guid; - } - - public void setGuid(String guid) { - this.guid = guid; - } - - public AnnotationOverrideForJavadocStaticInnerRestDto getInner() { - return inner; - } - - public void setInner(AnnotationOverrideForJavadocStaticInnerRestDto inner) { - this.inner = inner; - } - - /** - * This is the {@code AnnotationOverrideForJavadocStaticInnerRestDto} class javadoc. - */ - public static class AnnotationOverrideForJavadocStaticInnerRestDto { - /** - * This is the private {@code #content} field's javadoc. - */ - private String content; - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java deleted file mode 100644 index b8908c924..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app163.rest.dto; - -/** - * This is the {@code AnnotationOverrideForJavadocRestDto2} class javadoc. - */ -class AnnotationOverrideForJavadocRestDto2 { - /** - * This is the private {@code #guid3} field's javadoc. - */ - private String guid3; - - public String getGuid3() { - return guid3; - } - - public void setGuid3(String guid3) { - this.guid3 = guid3; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java deleted file mode 100644 index b5714e4b2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app163.rest.dto; - -/** - * This is the {@code AnnotationOverrideForJavadocRestDto3} class javadoc. - */ -class AnnotationOverrideForJavadocRestDto3 { - /** - * This is the private {@code #guid4} field's javadoc. - */ - private String guid4; - - public String getGuid4() { - return guid4; - } - - public void setGuid4(String guid4) { - this.guid4 = guid4; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java deleted file mode 100644 index 6c0d1e800..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -package test.org.springdoc.api.app163.rest.util; - -import test.org.springdoc.api.app163.exception.NoResultException; -import test.org.springdoc.api.app163.exception.NonUniqueResultException; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -/** - * REST exception handlers. - * - * This javadoc description is ignored by the REST documentation. - */ -@RestControllerAdvice -class RestExceptionHandler { - /** - * REST exception handler for {@code NoResultException}. - * - * This javadoc description is ignored by the REST documentation. - * - * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method - */ - @ExceptionHandler(NoResultException.class) - @ResponseStatus(code = HttpStatus.NOT_FOUND) - public ResponseEntity handleNotFoundException(NoResultException exception) { - return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); - } - - /** - * REST exception handler for {@code NonUniqueResultException}. - * - * This javadoc description is ignored by the REST documentation. - * - * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method - */ - @ExceptionHandler(NonUniqueResultException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { - return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java deleted file mode 100644 index bcfa41c01..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java +++ /dev/null @@ -1,36 +0,0 @@ -package test.org.springdoc.api.app164; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -/** - * The type Spring doc app 164 test. - */ -class SpringDocApp164Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info() - .title("SpringShop API") - .version("v1") - .description("The description of the api")); - } - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocJavadocProviderTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocJavadocProviderTest.java deleted file mode 100644 index f6c43aee7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/SpringDocJavadocProviderTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package test.org.springdoc.api.app164; - -import java.util.stream.Stream; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; -import org.springdoc.core.providers.JavadocProvider; -import org.springdoc.core.providers.SpringDocJavadocProvider; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.params.provider.Arguments.arguments; - -class SpringDocJavadocProviderTest { - private JavadocProvider javadocProvider; - - static Stream getFirstSentence() { - return Stream.of( - arguments(null, null), - arguments("", ""), - arguments("A b c. D e f", "A b c."), - arguments("A b c", "A b c"), - arguments("A b c

D e f", "A b c"), - arguments("A b c. D

e f", "A b c"), - arguments("A b c

D. e f", "A b c"), - arguments("

A b c

D e f", "A b c"), - arguments("

A b c. D

e f", "A b c"), - arguments("A b c.d e f", "A b c.d e f") - ); - } - - /** - * Edge cases not handled by the implementation. - */ - static Stream getFirstSentenceNotHandled() { - return Stream.of( - arguments("

A b c

d e f

", "A b c") - ); - } - - @BeforeEach - public void setup() { - javadocProvider = new SpringDocJavadocProvider(); - } - - @ParameterizedTest - @MethodSource - public void getFirstSentence(String javadoc, String expectedFirstSentence) { - assertThat(javadocProvider.getFirstSentence(javadoc)) - .isEqualTo(expectedFirstSentence); - } - - @ParameterizedTest - @MethodSource - public void getFirstSentenceNotHandled(String javadoc, String correctFirstSentence) { - assertThat(javadocProvider.getFirstSentence(javadoc)) - .isNotEqualTo(correctFirstSentence); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/exception/NoResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/exception/NoResultException.java deleted file mode 100644 index ced3e68df..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/exception/NoResultException.java +++ /dev/null @@ -1,4 +0,0 @@ -package test.org.springdoc.api.app164.exception; - -public class NoResultException extends RuntimeException { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/exception/NonUniqueResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/exception/NonUniqueResultException.java deleted file mode 100644 index 3e4fd48a9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/exception/NonUniqueResultException.java +++ /dev/null @@ -1,7 +0,0 @@ -package test.org.springdoc.api.app164.exception; - -/** - * Multiple results found instead of a unique result. - */ -public class NonUniqueResultException extends RuntimeException { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java deleted file mode 100644 index a1072449b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java +++ /dev/null @@ -1,49 +0,0 @@ -package test.org.springdoc.api.app164.rest; - -import test.org.springdoc.api.app164.exception.NoResultException; -import test.org.springdoc.api.app164.exception.NonUniqueResultException; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -/** - * This is the {@code JavadocOnlyRestController} class javadoc. - */ -@RestController -@RequestMapping("/no-generic-override") -class NoGenericOverrideRestController { - /** - * This is the create method's javadoc. - * The method's signature: {@code #create(JavadocOnlyRestDto)} - * - * @param input the {@code @param input} javadoc for the {@code #create(JavadocOnlyRestDto)} method - * @return the {@code @return} javadoc for the {@code #create(JavadocOnlyRestDto)} method - */ - @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseStatus(HttpStatus.CREATED) - public ResponseEntity create(@RequestBody String input) { - return new ResponseEntity<>(HttpStatus.CREATED); - } - - /** - * This is the findStartsBy method's javadoc. - * The method's signature: {@code #findStartsBy(String)} - * - * @param prefix the {@code @param prefix} javadoc for the {@code #findStartsBy(String)} method - * @return the {@code @return} javadoc for the {@code #findStartsBy(String)} method - * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #findStartsBy(String)} method - * @throws NonUniqueResultException the {@code @throws NonUniqueResultException} javadoc for the {@code #findStartsBy(String)} method - */ - @GetMapping(path = "startsBy/{prefix}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findStartsBy(@PathVariable String prefix) throws NoResultException, NonUniqueResultException { - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java deleted file mode 100644 index 3bc2c4f54..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -package test.org.springdoc.api.app164.rest.util; - -import test.org.springdoc.api.app164.exception.NoResultException; -import test.org.springdoc.api.app164.exception.NonUniqueResultException; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -/** - * REST exception handlers. - * - * This javadoc description is ignored by the REST documentation. - */ -@RestControllerAdvice -class RestExceptionHandler { - /** - * REST exception handler for {@code NoResultException}. - * - * This javadoc description is ignored by the REST documentation. - * - * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method - */ - @ExceptionHandler(NoResultException.class) - @ResponseStatus(code = HttpStatus.NOT_FOUND) - public ResponseEntity handleNotFoundException(NoResultException exception) { - return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); - } - - /** - * REST exception handler for {@code NonUniqueResultException}. - * - * This javadoc description is ignored by the REST documentation. - * - * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method - */ - @ExceptionHandler(NonUniqueResultException.class) - @ResponseStatus(code = HttpStatus.BAD_REQUEST) - public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { - return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/ConcreteSubclassFromGeneric.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/ConcreteSubclassFromGeneric.java deleted file mode 100644 index d2c390853..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/ConcreteSubclassFromGeneric.java +++ /dev/null @@ -1,13 +0,0 @@ -package test.org.springdoc.api.app166; - -class ConcreteSubclassFromGeneric extends SimpleGeneric { - - /** - * Return the top name - */ - private String topName; - - public String getTopName() { - return topName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/HelloController.java deleted file mode 100644 index 9079a8c4c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/HelloController.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * * - * * * - * * * * Copyright 2019-2024 the original author or authors. - * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at - * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. - * * * - * * - * - */ - -package test.org.springdoc.api.app166; - - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -class HelloController { - @GetMapping("/nested") - public ResponseEntity nested(@ParameterObject final SimpleOuterClass filter) { - return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); - } - - @GetMapping("/nestedTypeErasureGeneric") - public ResponseEntity nestedTypeErasureGeneric(@ParameterObject final SimpleGeneric filter) { - return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); - } - - @GetMapping("/nestedReifiableGeneric") - public ResponseEntity nestedReifiableGeneric(@ParameterObject final ConcreteSubclassFromGeneric filter) { - return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/MyData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/MyData.java deleted file mode 100644 index 6a06f045b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/MyData.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app166; - -class MyData { - - /** - * Returns the first name - */ - private String firstName; - - /** - * Returns the max number - */ - private Integer maxNumber; - - public Integer getMaxNumber() { - return maxNumber; - } - - public String getFirstName() { - return firstName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleGeneric.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleGeneric.java deleted file mode 100644 index f17f82d3d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleGeneric.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app166; - -class SimpleGeneric { - - /** - * Returns name - */ - private String name; - - /** - * Returns the generic child - */ - private T child; - - public T getChild() { - return child; - } - - public String getName() { - return name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerClass.java deleted file mode 100644 index 2066685ff..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerClass.java +++ /dev/null @@ -1,31 +0,0 @@ -package test.org.springdoc.api.app166; - -class SimpleInnerClass { - - /** - * Returns the inner inner class - */ - private SimpleInnerInnerClass innerInnerClass; - - /** - * Returns the boolean name - */ - private Boolean name; - - /** - * Returns the max number - */ - private Integer maxNumber; - - public Integer getMaxNumber() { - return maxNumber; - } - - public Boolean getName() { - return name; - } - - public SimpleInnerInnerClass getInnerInnerClass() { - return innerInnerClass; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerInnerClass.java deleted file mode 100644 index cce502f14..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleInnerInnerClass.java +++ /dev/null @@ -1,21 +0,0 @@ -package test.org.springdoc.api.app166; - -class SimpleInnerInnerClass { - /** - * Returns the name of the inner inner class - */ - Boolean name; - - /** - * Returns the maxNumber of the inner inner class - */ - private Integer maxNumber; - - public Integer getMaxNumber() { - return maxNumber; - } - - public Boolean getName() { - return name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleOuterClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleOuterClass.java deleted file mode 100644 index 0b27785e3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SimpleOuterClass.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app166; - -class SimpleOuterClass { - - /** - * Returns the name of the outer class - */ - private String name; - - /** - * Returns the inner class - */ - private SimpleInnerClass innerClass; - - public String getName() { - return name; - } - - public SimpleInnerClass getInnerClass() { - return innerClass; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SpringDocApp166Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SpringDocApp166Test.java deleted file mode 100644 index 326d7e07d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app166/SpringDocApp166Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app166; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 165 test. - */ -class SpringDocApp166Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/HelloController.java deleted file mode 100644 index ecb71d40a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/HelloController.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app167; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController("/api") -class HelloController { - - @RequestMapping("/process") - public void process() { - - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/SpringDocApp167Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/SpringDocApp167Test.java deleted file mode 100644 index 4a4b62b9a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app167/SpringDocApp167Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app167; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 167 test. - */ -class SpringDocApp167Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/DescriptionFieldInRequestBodyIsNullController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/DescriptionFieldInRequestBodyIsNullController.java deleted file mode 100644 index b22cd3cb1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/DescriptionFieldInRequestBodyIsNullController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app168; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * If the RequestBody description field is null, get the description from the javadoc. - */ -@RestController -@RequestMapping("description-in-requestbody-is-null") -class DescriptionFieldInRequestBodyIsNullController { - - /** - * Person person. - * - * @param person the person - */ - @PostMapping - public void person( - @io.swagger.v3.oas.annotations.parameters.RequestBody(content = @Content(schema = @Schema(implementation = Person.class))) @RequestBody Person person) { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/Person.java deleted file mode 100644 index 005af9d69..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/Person.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app168; - -/** - * The type Person. - */ -class Person { - /** - * The Id. - */ - private long id; - - /** - * Gets id. - * - * @return the id - */ - public long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(long id) { - this.id = id; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/SpringDocApp168Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/SpringDocApp168Test.java deleted file mode 100644 index 600327a20..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app168/SpringDocApp168Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app168; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 168 test. - */ -class SpringDocApp168Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/RecordController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/RecordController.java deleted file mode 100644 index 0e35bbf72..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/RecordController.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app169; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("record") -class RecordController { - @GetMapping - public SimpleOuterClass index(@ParameterObject SimpleOuterClass filter) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SimpleInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SimpleInnerClass.java deleted file mode 100644 index 36a885ea3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SimpleInnerClass.java +++ /dev/null @@ -1,10 +0,0 @@ -package test.org.springdoc.api.app169; - -/** - * simple inner class - * - * @param name the boolean name - * @param maxNumber the max number - */ -public record SimpleInnerClass(Boolean name, Integer maxNumber) { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SimpleOuterClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SimpleOuterClass.java deleted file mode 100644 index 9223ef9dc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SimpleOuterClass.java +++ /dev/null @@ -1,10 +0,0 @@ -package test.org.springdoc.api.app169; - -/** - * simple outer class - * - * @param name the name of the outer class - * @param simpleInnerClass the inner class - */ -public record SimpleOuterClass(String name, SimpleInnerClass simpleInnerClass) { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SpringDocApp169Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SpringDocApp169Test.java deleted file mode 100644 index ef59a25aa..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app169/SpringDocApp169Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app169; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 169 test. - */ -class SpringDocApp169Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/HelloController.java deleted file mode 100644 index 3afd50f7d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/HelloController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app17; - -import jakarta.validation.Valid; -import jakarta.validation.constraints.Size; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons. - * - * @param name the name - */ - @GetMapping(value = "/persons") - public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java deleted file mode 100644 index 1459831ac..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app17/SpringDocApp17Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app17; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 17 test. - */ -class SpringDocApp17Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Animal.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Animal.java deleted file mode 100644 index b3494ed3b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Animal.java +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app170; - - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * Interface of the Animal. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT) -@JsonSubTypes({ - @JsonSubTypes.Type(value = Dog.class, name = "dog"), - @JsonSubTypes.Type(value = Cat.class, name = "cat"), -}) -@Schema(description = "Represents an Animal class.") -public interface Animal {} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/BasicController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/BasicController.java deleted file mode 100644 index 82484d5a0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/BasicController.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app170; - -import io.swagger.v3.oas.annotations.Operation; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping(path = "/") -class BasicController { - - @GetMapping("/test1") - @Operation(summary = "get1", description = "Provides an animal.") - public Animal get1() { - - return new Dog("Foo", 12); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Cat.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Cat.java deleted file mode 100644 index 842c381be..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Cat.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app170; - - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema -class Cat implements Animal { - - private Integer speed; - - public Cat(Integer speed) { - this.speed = speed; - } - - public Integer getSpeed() { - return speed; - } - - public void setSpeed(Integer speed) { - this.speed = speed; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Dog.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Dog.java deleted file mode 100644 index 2cf7b0d61..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/Dog.java +++ /dev/null @@ -1,33 +0,0 @@ -package test.org.springdoc.api.app170; - - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema(description = "Represents a Dog class.") -class Dog implements Animal { - - private String name; - - private Integer age; - - public Dog(String name, Integer age) { - this.name = name; - this.age = age; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getAge() { - return age; - } - - public void setAge(Integer age) { - this.age = age; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/SpringDocApp170Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/SpringDocApp170Test.java deleted file mode 100644 index ad6c52307..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app170/SpringDocApp170Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app170; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 193 test. - */ -class SpringDocApp170Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/HelloController.java deleted file mode 100644 index b2aba84a3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/HelloController.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app171; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * PersonProjection interface. - * - * @return the PersonProjection - */ - @GetMapping(value = "/persons") - public PersonProjection persons() { - return new PersonDTO(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonDTO.java deleted file mode 100644 index f85cddf1b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonDTO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app171; - -/** - * Simulate a dynamically generated class that implements the PersonProjection interface. - */ -class PersonDTO implements PersonProjection { - private String email; - - private String firstName; - - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(final String email) { - this.email = email; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonProjection.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonProjection.java deleted file mode 100644 index a750b8573..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/PersonProjection.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app171; - -/** - * The type PersonProjection dto interface. - */ -public interface PersonProjection { - /** - * The Email. - * - */ - String getEmail(); - - /** - * The First name. - * - */ - String getFirstName(); - - /** - * The Last name. - * - */ - String getLastName(); -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/SpringDocApp171Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/SpringDocApp171Test.java deleted file mode 100644 index 552bb8fc4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app171/SpringDocApp171Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app171; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 193 test. - */ -class SpringDocApp171Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/Example.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/Example.java deleted file mode 100644 index 82ef811f3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/Example.java +++ /dev/null @@ -1,21 +0,0 @@ -package test.org.springdoc.api.app173; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The Example object - */ -@Schema -class Example { - - private String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/ExampleController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/ExampleController.java deleted file mode 100644 index 03cf2f588..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/ExampleController.java +++ /dev/null @@ -1,39 +0,0 @@ -package test.org.springdoc.api.app173; - -import java.util.UUID; - -import io.swagger.v3.oas.annotations.Operation; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PatchMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import static org.springframework.http.HttpStatus.OK; - -/** - * The Example Controller - */ -@RestController -class ExampleController { - - @PostMapping("/example") - @Operation(summary = "insert example", description = "Allows to insert an example") - public ResponseEntity postExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "${example.description}") @RequestBody Example example) { - return new ResponseEntity<>(UUID.randomUUID(), OK); - } - - @PutMapping("/example") - @Operation(summary = "update example", description = "Allows to update an example") - public ResponseEntity putExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "${example2.description:Default description for example}") @RequestBody Example example) { - return new ResponseEntity<>(UUID.randomUUID(), OK); - } - - @PatchMapping("/example") - @Operation(summary = "patch example", description = "Allows to patch an example") - public ResponseEntity patchExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Description without the use of variables") @RequestBody Example example) { - return new ResponseEntity<>(UUID.randomUUID(), OK); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/SpringDocApp173Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/SpringDocApp173Test.java deleted file mode 100644 index 84d942153..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app173/SpringDocApp173Test.java +++ /dev/null @@ -1,21 +0,0 @@ -package test.org.springdoc.api.app173; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 173 test. - */ -@TestPropertySource(properties = "example.description=The example object") -class SpringDocApp173Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java deleted file mode 100644 index 85c78cae4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/ExampleController.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app174; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The Example Controller - */ -@RestController -class ExampleController { - - @PostMapping - public Test post(){ - return null; - } - -} - - - - - - - diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Question.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Question.java deleted file mode 100644 index d0ebf7952..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Question.java +++ /dev/null @@ -1,42 +0,0 @@ -package test.org.springdoc.api.app174; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -/** - * The type Question. - * - * @author bnasslahsen base class for all questions in test with polymorphism - */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = TestQuestion.class, name = "test"), - @JsonSubTypes.Type(value = TextQuestion.class, name = "text") -}) -public abstract class Question { - private final String question; - private final String type; - - public Question(String question, String type) { - this.question = question; - this.type = type; - } - - public String getQuestion() { - return question; - } - - public String getType() { - return type; - } - - @Override - public String toString() { - return "Question{" + - "question='" + question + '\'' + - ", type='" + type + '\'' + - '}'; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java deleted file mode 100644 index a69cd90ec..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/SpringDocApp174Test.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.org.springdoc.api.app174; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 174 test. - */ -class SpringDocApp174Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java deleted file mode 100644 index 6c872392b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/Test.java +++ /dev/null @@ -1,44 +0,0 @@ -package test.org.springdoc.api.app174; - -import java.io.Serializable; -import java.util.List; - -/** - * The type Test. - * - * @author bnasslahsen - */ - -class Test implements Serializable { - - private static final long serialVersionUID = 1L; // Recommended for Serializable classes - - private List questions; - - // No-argument constructor - public Test() { - } - - // Constructor with arguments - public Test(List questions) { - this.questions = questions; - } - - // Getter method for 'questions' - public List getQuestions() { - return questions; - } - - // Setter method for 'questions' - public void setQuestions(List questions) { - this.questions = questions; - } - - // Optionally, you can override toString, hashCode, equals, etc. - @Override - public String toString() { - return "Test{" + - "questions=" + questions + - '}'; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java deleted file mode 100644 index 2483f271f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TestQuestion.java +++ /dev/null @@ -1,42 +0,0 @@ -package test.org.springdoc.api.app174; - -import java.util.List; - -/** - * The type Test question. - * - * @author bnasslahsen test question - */ -class TestQuestion extends Question { - /** - * list of variants - */ - private final List variants; - /** - * correct answer - */ - private final int answer; - - public TestQuestion(String question, String type, List variants, int answer) { - super(question, type); - this.variants = variants; - this.answer = answer; - } - - public List getVariants() { - return variants; - } - - public int getAnswer() { - return answer; - } - - @Override - public String toString() { - return "TestQuestion{" + - "question='" + getQuestion() + '\'' + - ", variants=" + variants + - ", answer=" + answer + - '}'; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java deleted file mode 100644 index 1e6cac956..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app174/TextQuestion.java +++ /dev/null @@ -1,28 +0,0 @@ -package test.org.springdoc.api.app174; - -/** - * The type Text question. - * - * @author bnasslahsen - */ -class TextQuestion extends Question { - private final String answer; - - public TextQuestion(String question, String type, String answer) { - super(question, type); - this.answer = answer; - } - - public String getAnswer() { - return answer; - } - - @Override - public String toString() { - return "TextQuestion{" + - "question='" + getQuestion() + '\'' + - ", type='" + getType() + '\'' + - ", answer='" + answer + '\'' + - '}'; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java deleted file mode 100644 index 5521bf253..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/HelloController.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app18; - -import io.swagger.v3.oas.annotations.Parameter; -import jakarta.validation.constraints.NegativeOrZero; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.PositiveOrZero; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons string. - * - * @param name the name - * @return the string - */ - @GetMapping(value = "/persons") - public String persons(@NotBlank String name) { - return "OK"; - } - - /** - * Persons 2 string. - * - * @param name the name - * @return the string - */ - @GetMapping(value = "/persons2") - public String persons2(@NotBlank @Parameter(description = "persons name") String name) { - return "OK"; - } - - /** - * Persons 3 string. - * - * @param name the name - * @return the string - */ - @GetMapping(value = "/persons3") - public String persons3(@NotBlank @Parameter(description = "persons name") @RequestParam String name) { - return "OK"; - } - - /** - * Persons 4 string. - * - * @param age the age - * @return the string - */ - @GetMapping(value = "/persons4") - public String persons4(@PositiveOrZero int age) { - return "OK"; - } - - /** - * Persons 5 string. - * - * @param age the age - * @return the string - */ - @GetMapping(value = "/persons5") - public String persons5(@NegativeOrZero int age) { - return "OK"; - } - - /** - * Persons 6 string. - * - * @param name the name - * @return the string - */ - @GetMapping(value = "/persons6") - public String persons6(@NotEmpty @Parameter(description = "persons name") String name) { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java deleted file mode 100644 index 12807f317..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app18/SpringDocApp18Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app18; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 18 test. - */ -@TestPropertySource(properties = "springdoc.pre-loading-enabled=true") -class SpringDocApp18Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/HelloController.java deleted file mode 100644 index 64862233e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/HelloController.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app19; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import jakarta.validation.constraints.NotBlank; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons string. - * - * @param name the name - * @return the string - */ - @PostMapping(value = "/persons") - public String persons(@RequestBody(description = "requestBody description as parameter") String name) { - return "OK"; - } - - /** - * Persons 2 string. - * - * @param name the name - * @return the string - */ - @RequestBody(description = "requestBody description outside") - @PostMapping(value = "/persons2") - public String persons2(String name) { - return "OK"; - } - - /** - * Persons 3 string. - * - * @param name the name - * @return the string - */ - @Operation(requestBody = @RequestBody(description = "requestBody inside operation annotation")) - @PostMapping(value = "/persons3") - public String persons3(@NotBlank String name) { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java deleted file mode 100644 index a6daf77dc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app19/SpringDocApp19Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app19; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 19 test. - */ -class SpringDocApp19Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java deleted file mode 100644 index 22da251c5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityScheme; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -/** - * The type Spring doc app 2 test. - */ -class SpringDocApp2Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) - .info(new Info().title("Petstore API").version("v0").description( - "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") - .termsOfService("http://swagger.io/terms/") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ApiUtil.java deleted file mode 100644 index 424fa0e23..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ApiUtil.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import java.io.IOException; - -import jakarta.servlet.http.HttpServletResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.server.ResponseStatusException; - -/** - * The type Api util. - */ -class ApiUtil { - - /** - * Sets example response. - * - * @param req the req - * @param contentType the content type - * @param example the example - */ - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); - req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - - /** - * Check api key. - * - * @param req the req - */ - public static void checkApiKey(NativeWebRequest req) { - if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { - throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ExceptionTranslator.java deleted file mode 100644 index 12fe1d702..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/ExceptionTranslator.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import java.util.Map; - -import jakarta.validation.ConstraintViolationException; - -import org.springframework.boot.web.error.ErrorAttributeOptions; -import org.springframework.boot.web.servlet.error.ErrorAttributes; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.WebRequest; - -/** - * The type Exception translator. - */ -@RestControllerAdvice -class ExceptionTranslator { - - /** - * The Error attributes. - */ - private final ErrorAttributes errorAttributes; - - /** - * Instantiates a new Exception translator. - * - * @param errorAttributes the error attributes - */ - public ExceptionTranslator(ErrorAttributes errorAttributes) { - this.errorAttributes = errorAttributes; - } - - /** - * Process constraint violation exception map. - * - * @param request the request - * @return the map - */ - @ExceptionHandler(ConstraintViolationException.class) - @ResponseStatus(HttpStatus.BAD_REQUEST) - public Map processConstraintViolationException(WebRequest request) { - request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); - return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/HomeController.java deleted file mode 100644 index 19a4c29ba..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/HomeController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; -import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; -import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; - -/** - * Home redirection to swagger api documentation - */ -@Controller -class HomeController { - - /** - * The Swagger ui path. - */ - @Value(SWAGGER_UI_PATH) - private String swaggerUiPath; - - /** - * Index string. - * - * @return the string - */ - @GetMapping(DEFAULT_PATH_SEPARATOR) - public String index() { - return REDIRECT_URL_PREFIX + swaggerUiPath; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApi.java deleted file mode 100644 index 424dd04be..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApi.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package test.org.springdoc.api.app2.api; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.security.OAuthFlow; -import io.swagger.v3.oas.annotations.security.OAuthFlows; -import io.swagger.v3.oas.annotations.security.OAuthScope; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.security.SecurityScheme; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; -import test.org.springdoc.api.app2.model.ModelApiResponse; -import test.org.springdoc.api.app2.model.Pet; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -/** - * The interface Pet api. - */ -@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { - @OAuthScope(name = "write:pets", description = "modify pets in your account"), - @OAuthScope(name = "read:pets", description = "read your pets") }))) -@Tag(name = "pet", description = "the pet API") -@ResponseBody -public interface PetApi { - - /** - * Gets delegate. - * - * @return the delegate - */ - default PetApiDelegate getDelegate() { - return new PetApiDelegate() { - }; - } - - /** - * Add pet. - * - * @param pet the pet - */ - @Operation(summary = "Add a new pet to the store", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) - @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) - default void addPet( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { - // return getDelegate().addPet(pet); - } - - /** - * Delete pet response entity. - * - * @param petId the pet id - * @param apiKey the api key - * @return the response entity - */ - @Operation(summary = "Deletes a pet", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") }) - @DeleteMapping(value = "/pet/{petId}") - default ResponseEntity deletePet( - @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { - return getDelegate().deletePet(petId, apiKey); - } - - /** - * Find pets by status response entity. - * - * @param status the status - * @return the response entity - */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), - @ApiResponse(responseCode = "400", description = "Invalid status value") }) - @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) - default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { - return getDelegate().findPetsByStatus(status); - } - - /** - * Find pets by tags response entity. - * - * @param tags the tags - * @return the response entity - */ - @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), - @ApiResponse(responseCode = "400", description = "Invalid tag value") }) - @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) - default ResponseEntity> findPetsByTags( - @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { - return getDelegate().findPetsByTags(tags); - } - - /** - * Gets pet by id. - * - * @param petId the pet id - * @return the pet by id - */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { - @SecurityRequirement(name = "api_key") }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") }) - @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) - default ResponseEntity getPetById( - @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { - return getDelegate().getPetById(petId); - } - - /** - * Update pet response entity. - * - * @param pet the pet - * @return the response entity - */ - @Operation(summary = "Update an existing pet", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") }) - @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) - default ResponseEntity updatePet( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { - return getDelegate().updatePet(pet); - } - - /** - * Update pet with form response entity. - * - * @param petId the pet id - * @param name the name - * @param status the status - * @return the response entity - */ - @Operation(summary = "Updates a pet in the store with form data", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) - @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) - default ResponseEntity updatePetWithForm( - @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, - @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { - return getDelegate().updatePetWithForm(petId, name, status); - } - - /** - * Upload file response entity. - * - * @param petId the pet id - * @param additionalMetadata the additional metadata - * @param file the file - * @return the response entity - */ - @Operation(summary = "uploads an image", description = "", security = { - @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) - @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { - "multipart/form-data" }) - default ResponseEntity uploadFile( - @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { - return getDelegate().uploadFile(petId, additionalMetadata, file); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiController.java deleted file mode 100644 index afca46da4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import java.util.Optional; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * The type Pet api controller. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -class PetApiController implements PetApi { - - /** - * The Delegate. - */ - private final PetApiDelegate delegate; - - /** - * Instantiates a new Pet api controller. - * - * @param delegate the delegate - */ - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { - }); - } - - /** - * Gets delegate. - * - * @return the delegate - */ - @Override - public PetApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegate.java deleted file mode 100644 index ae8eab18c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegate.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import java.util.List; -import java.util.Optional; - -import jakarta.validation.Valid; -import test.org.springdoc.api.app2.model.ModelApiResponse; -import test.org.springdoc.api.app2.model.Pet; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -/** - * A delegate to be called by the {@link PetApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -public interface PetApiDelegate { - - /** - * Gets request. - * - * @return the request - */ - default Optional getRequest() { - return Optional.empty(); - } - - /** - * Add pet. - * - * @param pet the pet - * @see PetApi#addPet PetApi#addPet - */ - default void addPet(Pet pet) { - - } - - /** - * Delete pet response entity. - * - * @param petId the pet id - * @param apiKey the api key - * @return the response entity - * @see PetApi#deletePet PetApi#deletePet - */ - default ResponseEntity deletePet(Long petId, - String apiKey) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Find pets by status response entity. - * - * @param status the status - * @return the response entity - * @see PetApi#findPetsByStatus PetApi#findPetsByStatus - */ - default ResponseEntity> findPetsByStatus(List status) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Extract. - */ - default void extract() { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); - break; - } - } - }); - } - - /** - * Find pets by tags response entity. - * - * @param tags the tags - * @return the response entity - * @see PetApi#findPetsByTags PetApi#findPetsByTags - */ - default ResponseEntity> findPetsByTags(List tags) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Gets pet by id. - * - * @param petId the pet id - * @return the pet by id - * @see PetApi#getPetById PetApi#getPetById - */ - default ResponseEntity getPetById(Long petId) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Update pet response entity. - * - * @param pet the pet - * @return the response entity - * @see PetApi#updatePet PetApi#updatePet - */ - default ResponseEntity updatePet(Pet pet) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Update pet with form response entity. - * - * @param petId the pet id - * @param name the name - * @param status the status - * @return the response entity - * @see PetApi#updatePetWithForm PetApi#updatePetWithForm - */ - default ResponseEntity updatePetWithForm(Long petId, - String name, - String status) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Upload file response entity. - * - * @param petId the pet id - * @param additionalMetadata the additional metadata - * @param file the file - * @return the response entity - * @see PetApi#uploadFile PetApi#uploadFile - */ - default ResponseEntity uploadFile(Long petId, - String additionalMetadata, - @Valid MultipartFile file) { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegateImpl.java deleted file mode 100644 index cde0ed585..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/PetApiDelegateImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import org.springframework.stereotype.Service; - -/** - * The type Pet api delegate. - */ -@Service -class PetApiDelegateImpl implements PetApiDelegate { - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApi.java deleted file mode 100644 index 4c1e4eb7b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApi.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package test.org.springdoc.api.app2.api; - -import java.util.Map; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; -import test.org.springdoc.api.app2.model.Order; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * The interface Store api. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@Tag(name = "store", description = "the store API") -public interface StoreApi { - - /** - * Gets delegate. - * - * @return the delegate - */ - default StoreApiDelegate getDelegate() { - return new StoreApiDelegate() { - }; - } - - /** - * Delete order response entity. - * - * @param orderId the order id - * @return the response entity - */ - @Operation(summary = "Delete purchase order by ID", tags = { "store" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") }) - @DeleteMapping(value = "/store/order/{orderId}") - @ResponseBody - default ResponseEntity deleteOrder( - @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { - return getDelegate().deleteOrder(orderId); - } - - /** - * Gets inventory. - * - * @return the inventory - */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { - @SecurityRequirement(name = "api_key") }, tags = { "store" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) - @GetMapping(value = "/store/inventory", produces = { "application/json" }) - @ResponseBody - default ResponseEntity> getInventory() { - return getDelegate().getInventory(); - } - - /** - * Gets order by id. - * - * @param orderId the order id - * @return the order by id - */ - @Operation(summary = "Find purchase order by ID", tags = { "store" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") }) - @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) - @ResponseBody - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { - return getDelegate().getOrderById(orderId); - } - - /** - * Place order response entity. - * - * @param order the order - * @return the response entity - */ - @Operation(summary = "Place an order for a pet", tags = { "store" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), - @ApiResponse(responseCode = "400", description = "Invalid Order") }) - @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { - "application/json" }) - @ResponseBody - default ResponseEntity placeOrder( - @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { - return getDelegate().placeOrder(order); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiController.java deleted file mode 100644 index 475a59209..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import java.util.Optional; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * The type Store api controller. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -class StoreApiController implements StoreApi { - - /** - * The Delegate. - */ - private final StoreApiDelegate delegate; - - /** - * Instantiates a new Store api controller. - * - * @param delegate the delegate - */ - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { - }); - } - - /** - * Gets delegate. - * - * @return the delegate - */ - @Override - public StoreApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegate.java deleted file mode 100644 index 728cbcb05..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegate.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import java.util.Map; -import java.util.Optional; - -import test.org.springdoc.api.app2.model.Order; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; - -/** - * A delegate to be called by the {@link StoreApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -public interface StoreApiDelegate { - - /** - * Gets request. - * - * @return the request - */ - default Optional getRequest() { - return Optional.empty(); - } - - /** - * Delete order response entity. - * - * @param orderId the order id - * @return the response entity - * @see StoreApi#deleteOrder StoreApi#deleteOrder - */ - default ResponseEntity deleteOrder(String orderId) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Gets inventory. - * - * @return the inventory - * @see StoreApi#getInventory StoreApi#getInventory - */ - default ResponseEntity> getInventory() { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Gets order by id. - * - * @param orderId the order id - * @return the order by id - * @see StoreApi#getOrderById StoreApi#getOrderById - */ - default ResponseEntity getOrderById(Long orderId) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Extract. - */ - default void extract() { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); - break; - } - } - }); - } - - /** - * Place order response entity. - * - * @param order the order - * @return the response entity - * @see StoreApi#placeOrder StoreApi#placeOrder - */ - default ResponseEntity placeOrder(Order order) { - extract(); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegateImpl.java deleted file mode 100644 index 48cca44fa..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/StoreApiDelegateImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import org.springframework.stereotype.Service; - -/** - * The type Store api delegate. - */ -@Service -class StoreApiDelegateImpl implements StoreApiDelegate { - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApi.java deleted file mode 100644 index 4ad60538c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApi.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package test.org.springdoc.api.app2.api; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; -import test.org.springdoc.api.app2.model.User; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; - -/** - * The interface User api. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@Tag(name = "user", description = "the user API") -public interface UserApi { - - /** - * Gets delegate. - * - * @return the delegate - */ - default UserApiDelegate getDelegate() { - return new UserApiDelegate() { - }; - } - - /** - * Create user response entity. - * - * @param user the user - * @return the response entity - */ - @Operation(summary = "Create user", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - @PostMapping(value = "/user", consumes = { "application/json" }) - default ResponseEntity createUser( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { - return getDelegate().createUser(user); - } - - /** - * Create users with array input response entity. - * - * @param user the user - * @return the response entity - */ - @Operation(summary = "Creates list of users with given input array", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - - @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) - default ResponseEntity createUsersWithArrayInput( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { - return getDelegate().createUsersWithArrayInput(user); - } - - /** - * Create users with list input response entity. - * - * @param user the user - * @return the response entity - */ - @Operation(summary = "Creates list of users with given input array", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) - default ResponseEntity createUsersWithListInput( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { - return getDelegate().createUsersWithListInput(user); - } - - /** - * Delete user response entity. - * - * @param username the username - * @return the response entity - */ - @Operation(summary = "Creates list of users with given input array", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - - @DeleteMapping(value = "/user/{username}") - default ResponseEntity deleteUser( - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { - return getDelegate().deleteUser(username); - } - - /** - * Gets user by name. - * - * @param username the username - * @return the user by name - */ - @Operation(summary = "Get user by user name", tags = { "user" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") }) - - @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) - default ResponseEntity getUserByName( - @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { - return getDelegate().getUserByName(username); - } - - /** - * Login user response entity. - * - * @param username the username - * @param password the password - * @return the response entity - */ - @Operation(summary = "Logs user into the system", tags = { "user" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), - @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) - @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) - default ResponseEntity loginUser( - @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { - return getDelegate().loginUser(username, password); - } - - /** - * Logout user response entity. - * - * @return the response entity - */ - @Operation(summary = "Logs out current logged in user session", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) - @GetMapping(value = "/user/logout") - default ResponseEntity logoutUser() { - return getDelegate().logoutUser(); - } - - /** - * Update user response entity. - * - * @param username the username - * @param user the user - * @return the response entity - */ - @Operation(summary = "Updated user", tags = { "user" }) - @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), - @ApiResponse(responseCode = "404", description = "User not found") }) - @PutMapping(value = "/user/{username}", consumes = { "application/json" }) - default ResponseEntity updateUser( - @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, - @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { - return getDelegate().updateUser(username, user); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiController.java deleted file mode 100644 index a7900af95..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiController.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import java.util.Optional; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * The type User api controller. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -@Controller -@ResponseBody -@RequestMapping("${openapi.openAPIPetstore.base-path:/}") -class UserApiController implements UserApi { - - /** - * The Delegate. - */ - private final UserApiDelegate delegate; - - /** - * Instantiates a new User api controller. - * - * @param delegate the delegate - */ - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { - }); - } - - /** - * Gets delegate. - * - * @return the delegate - */ - @Override - public UserApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegate.java deleted file mode 100644 index 57ddcaf9f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegate.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import java.util.List; -import java.util.Optional; - -import test.org.springdoc.api.app2.model.User; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; - -/** - * A delegate to be called by the {@link UserApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") - -public interface UserApiDelegate { - - /** - * Gets request. - * - * @return the request - */ - default Optional getRequest() { - return Optional.empty(); - } - - /** - * Create user response entity. - * - * @param user the user - * @return the response entity - * @see UserApi#createUser UserApi#createUser - */ - default ResponseEntity createUser(User user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Create users with array input response entity. - * - * @param user the user - * @return the response entity - * @see UserApi#createUsersWithArrayInput UserApi#createUsersWithArrayInput - */ - default ResponseEntity createUsersWithArrayInput(List user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Create users with list input response entity. - * - * @param user the user - * @return the response entity - * @see UserApi#createUsersWithListInput UserApi#createUsersWithListInput - */ - default ResponseEntity createUsersWithListInput(List user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Delete user response entity. - * - * @param username the username - * @return the response entity - * @see UserApi#deleteUser UserApi#deleteUser - */ - default ResponseEntity deleteUser(String username) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Gets user by name. - * - * @param username the username - * @return the user by name - * @see UserApi#getUserByName UserApi#getUserByName - */ - default ResponseEntity getUserByName(String username) { - getRequest().ifPresent(request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Login user response entity. - * - * @param username the username - * @param password the password - * @return the response entity - * @see UserApi#loginUser UserApi#loginUser - */ - default ResponseEntity loginUser(String username, - String password) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Logout user response entity. - * - * @return the response entity - * @see UserApi#logoutUser UserApi#logoutUser - */ - default ResponseEntity logoutUser() { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * Update user response entity. - * - * @param username the username - * @param user the user - * @return the response entity - * @see UserApi#updateUser UserApi#updateUser - */ - default ResponseEntity updateUser(String username, - User user) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegateImpl.java deleted file mode 100644 index 81c53dc09..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/api/UserApiDelegateImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.api; - -import org.springframework.stereotype.Service; - -/** - * The type User api delegate. - */ -@Service -class UserApiDelegateImpl implements UserApiDelegate { - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Category.java deleted file mode 100644 index 5673b8e34..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Category.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Category. - */ -class Category { - - /** - * The Id. - */ - private Long id = null; - - /** - * The Name. - */ - private String name = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id category. - * - * @param id the id - * @return the category - */ - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get name - * - * @return name name - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Name category. - * - * @param name the name - * @return the category - */ - public Category name(String name) { - this.name = name; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/ModelApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/ModelApiResponse.java deleted file mode 100644 index e60dcf1f5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/ModelApiResponse.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Model api response. - */ -public class ModelApiResponse { - - /** - * The Code. - */ - private Integer code = null; - - /** - * The Type. - */ - private String type = null; - - /** - * The Message. - */ - private String message = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get code - * - * @return code code - */ - @JsonProperty("code") - public Integer getCode() { - return code; - } - - /** - * Sets code. - * - * @param code the code - */ - public void setCode(Integer code) { - this.code = code; - } - - /** - * Code model api response. - * - * @param code the code - * @return the model api response - */ - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get type - * - * @return type type - */ - @JsonProperty("type") - public String getType() { - return type; - } - - /** - * Sets type. - * - * @param type the type - */ - public void setType(String type) { - this.type = type; - } - - /** - * Type model api response. - * - * @param type the type - * @return the model api response - */ - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get message - * - * @return message message - */ - @JsonProperty("message") - public String getMessage() { - return message; - } - - /** - * Sets message. - * - * @param message the message - */ - public void setMessage(String message) { - this.message = message; - } - - /** - * Message model api response. - * - * @param message the message - * @return the model api response - */ - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Order.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Order.java deleted file mode 100644 index 6f4c69e7b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Order.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.model; - -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Order. - */ -public class Order { - - /** - * The Id. - */ - @Schema(description = "") - private Long id = null; - - /** - * The Pet id. - */ - @Schema(description = "") - private Long petId = null; - - /** - * The Quantity. - */ - @Schema(description = "") - private Integer quantity = null; - - /** - * The Ship date. - */ - @Schema(description = "") - private Date shipDate = null; - - /** - * Order Status - */ - private StatusEnum status = null; - - /** - * The Complete. - */ - @Schema(description = "") - private Boolean complete = false; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id order. - * - * @param id the id - * @return the order - */ - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get petId - * - * @return petId pet id - */ - @JsonProperty("petId") - public Long getPetId() { - return petId; - } - - /** - * Sets pet id. - * - * @param petId the pet id - */ - public void setPetId(Long petId) { - this.petId = petId; - } - - /** - * Pet id order. - * - * @param petId the pet id - * @return the order - */ - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get quantity - * - * @return quantity quantity - */ - @JsonProperty("quantity") - public Integer getQuantity() { - return quantity; - } - - /** - * Sets quantity. - * - * @param quantity the quantity - */ - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - /** - * Quantity order. - * - * @param quantity the quantity - * @return the order - */ - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get shipDate - * - * @return shipDate ship date - */ - @JsonProperty("shipDate") - public Date getShipDate() { - return shipDate; - } - - /** - * Sets ship date. - * - * @param shipDate the ship date - */ - public void setShipDate(Date shipDate) { - this.shipDate = shipDate; - } - - /** - * Ship date order. - * - * @param shipDate the ship date - * @return the order - */ - public Order shipDate(Date shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Order Status - * - * @return status status - */ - @JsonProperty("status") - public String getStatus() { - if (status == null) { - return null; - } - return status.getValue(); - } - - /** - * Sets status. - * - * @param status the status - */ - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - * Status order. - * - * @param status the status - * @return the order - */ - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Get complete - * - * @return complete boolean - */ - @JsonProperty("complete") - public Boolean isisComplete() { - return complete; - } - - /** - * Sets complete. - * - * @param complete the complete - */ - public void setComplete(Boolean complete) { - this.complete = complete; - } - - /** - * Complete order. - * - * @param complete the complete - * @return the order - */ - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * The enum Status enum. - */ - public enum StatusEnum { - /** - *Placed status enum. - */ - PLACED("placed"), - /** - *Approved status enum. - */ - APPROVED("approved"), - /** - *Delivered status enum. - */ - DELIVERED("delivered"); - - /** - * The Value. - */ - private String value; - - /** - * Instantiates a new Status enum. - * - * @param value the value - */ - StatusEnum(String value) { - this.value = value; - } - - /** - * From value status enum. - * - * @param text the text - * @return the status enum - */ - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - - /** - * Gets value. - * - * @return the value - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - return String.valueOf(value); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Pet.java deleted file mode 100644 index 2fdffd905..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Pet.java +++ /dev/null @@ -1,384 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.model; - -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; - -/** - * The type Pet. - */ -public class Pet { - - /** - * The Id. - */ - @Schema(description = "") - private Long id = null; - - /** - * The Category. - */ - @Schema(description = "") - private Category category = null; - - /** - * The Name. - */ - @Schema(example = "doggie", required = true, description = "") - private String name = null; - - /** - * The Photo urls. - */ - @Schema(required = true, description = "") - private List photoUrls = new ArrayList(); - - /** - * The Tags. - */ - @Schema(description = "") - private List tags = null; - - /** - * The Status. - */ - @Schema(description = "pet status in the store") - /** - * pet status in the store - **/ - private StatusEnum status = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id pet. - * - * @param id the id - * @return the pet - */ - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get category - * - * @return category category - */ - @JsonProperty("category") - public Category getCategory() { - return category; - } - - /** - * Sets category. - * - * @param category the category - */ - public void setCategory(Category category) { - this.category = category; - } - - /** - * Category pet. - * - * @param category the category - * @return the pet - */ - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get name - * - * @return name name - */ - @JsonProperty("name") - @NotNull - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Name pet. - * - * @param name the name - * @return the pet - */ - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get photoUrls - * - * @return photoUrls photo urls - */ - @JsonProperty("photoUrls") - @NotNull - public List getPhotoUrls() { - return photoUrls; - } - - /** - * Sets photo urls. - * - * @param photoUrls the photo urls - */ - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - /** - * Photo urls pet. - * - * @param photoUrls the photo urls - * @return the pet - */ - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - /** - * Add photo urls item pet. - * - * @param photoUrlsItem the photo urls item - * @return the pet - */ - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get tags - * - * @return tags tags - */ - @JsonProperty("tags") - public List getTags() { - return tags; - } - - /** - * Sets tags. - * - * @param tags the tags - */ - public void setTags(List tags) { - this.tags = tags; - } - - /** - * Tags pet. - * - * @param tags the tags - * @return the pet - */ - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - /** - * Add tags item pet. - * - * @param tagsItem the tags item - * @return the pet - */ - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * pet status in the store - * - * @return status status - */ - @JsonProperty("status") - public StatusEnum getStatus() { - if (status == null) { - return null; - } - return status; - } - - /** - * Sets status. - * - * @param status the status - */ - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - * Status pet. - * - * @param status the status - * @return the pet - */ - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * The enum Status enum. - */ - public enum StatusEnum { - /** - *Available status enum. - */ - AVAILABLE("available"), - /** - *Pending status enum. - */ - PENDING("pending"), - /** - *Sold status enum. - */ - SOLD("sold"); - - /** - * The Value. - */ - private String value; - - /** - * Instantiates a new Status enum. - * - * @param value the value - */ - StatusEnum(String value) { - this.value = value; - } - - /** - * From value status enum. - * - * @param text the text - * @return the status enum - */ - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - - /** - * Gets value. - * - * @return the value - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - return String.valueOf(value); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Tag.java deleted file mode 100644 index dc541984c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/Tag.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Tag. - */ -class Tag { - - /** - * The Id. - */ - @Schema(description = "") - private Long id = null; - - /** - * The Name. - */ - @Schema(description = "") - private String name = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id tag. - * - * @param id the id - * @return the tag - */ - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get name - * - * @return name name - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * Sets name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Name tag. - * - * @param name the name - * @return the tag - */ - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/User.java deleted file mode 100644 index 0d6a85e03..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app2/model/User.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type User. - */ -public class User { - - /** - * The Id. - */ - @Schema(description = "") - private Long id = null; - - /** - * The Username. - */ - @Schema(description = "") - private String username = null; - - /** - * The First name. - */ - @Schema(description = "") - private String firstName = null; - - /** - * The Last name. - */ - @Schema(description = "") - private String lastName = null; - - /** - * The Email. - */ - @Schema(description = "") - private String email = null; - - /** - * The Password. - */ - @Schema(description = "") - private String password = null; - - /** - * The Phone. - */ - @Schema(description = "") - private String phone = null; - - /** - * User Status - */ - private Integer userStatus = null; - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Get id - * - * @return id id - */ - @JsonProperty("id") - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - /** - * Id user. - * - * @param id the id - * @return the user - */ - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get username - * - * @return username username - */ - @JsonProperty("username") - public String getUsername() { - return username; - } - - /** - * Sets username. - * - * @param username the username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * Username user. - * - * @param username the username - * @return the user - */ - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get firstName - * - * @return firstName first name - */ - @JsonProperty("firstName") - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * First name user. - * - * @param firstName the first name - * @return the user - */ - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get lastName - * - * @return lastName last name - */ - @JsonProperty("lastName") - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * Last name user. - * - * @param lastName the last name - * @return the user - */ - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get email - * - * @return email email - */ - @JsonProperty("email") - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * Email user. - * - * @param email the email - * @return the user - */ - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get password - * - * @return password password - */ - @JsonProperty("password") - public String getPassword() { - return password; - } - - /** - * Sets password. - * - * @param password the password - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * Password user. - * - * @param password the password - * @return the user - */ - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get phone - * - * @return phone phone - */ - @JsonProperty("phone") - public String getPhone() { - return phone; - } - - /** - * Sets phone. - * - * @param phone the phone - */ - public void setPhone(String phone) { - this.phone = phone; - } - - /** - * Phone user. - * - * @param phone the phone - * @return the user - */ - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * User Status - * - * @return userStatus user status - */ - @JsonProperty("userStatus") - public Integer getUserStatus() { - return userStatus; - } - - /** - * Sets user status. - * - * @param userStatus the user status - */ - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - /** - * User status user. - * - * @param userStatus the user status - * @return the user - */ - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/HelloController.java deleted file mode 100644 index a47bf7f0c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/HelloController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app20; - -import io.swagger.v3.oas.annotations.Hidden; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons. - * - * @param name the name - */ - @GetMapping(value = "/persons") - @Hidden - public void persons(@Valid @NotBlank String name) { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java deleted file mode 100644 index df7d4359d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app20/SpringDocApp20Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app20; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 20 test. - */ -class SpringDocApp20Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java deleted file mode 100644 index 0fdd1b83e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app21; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.security.OAuthFlow; -import io.swagger.v3.oas.annotations.security.OAuthFlows; -import io.swagger.v3.oas.annotations.security.OAuthScope; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.security.SecurityScheme; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@SecurityScheme(name = "personstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "${springdoc.oAuthFlow.authorizationUrl}", scopes = { - @OAuthScope(name = "write:persons", description = "modify persons in your account"), - @OAuthScope(name = "read:persons", description = "read your persons") }))) -class HelloController { - - /** - * Persons. - * - * @param name the name - */ - @Operation(summary = "Add a new person to the store", description = "", security = { - @SecurityRequirement(name = "personstore_auth", scopes = { "write:persons", "read:persons" }) }, tags = { - "person" }) - @GetMapping(value = "/persons") - public void persons(@Valid @NotBlank String name) { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java deleted file mode 100644 index 9d4cb5a3e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app21; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 21 test. - */ -@TestPropertySource(properties = "springdoc.oAuthFlow.authorizationUrl=http://personstore.swagger.io/oauth/dialog") -class SpringDocApp21Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/HelloController.java deleted file mode 100644 index 5a5a01002..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/HelloController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app22; - -import java.util.List; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - - /** - * Do get response entity. - * - * @return the response entity - */ - @GetMapping(value = "/persons") - public ResponseEntity>> doGet() { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/PersonDTO.java deleted file mode 100644 index a0f5932e6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/PersonDTO.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app22; - -/** - * The type Person dto. - */ -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java deleted file mode 100644 index e39d6c820..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app22/SpringDocApp22Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app22; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 22 test. - */ -class SpringDocApp22Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/HelloController.java deleted file mode 100644 index a6cb22640..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/HelloController.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app23; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.security.SecurityScheme; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", paramName = "JWT", description = "A core-auth Bearer token") -class HelloController { - - /** - * Persons. - * - * @param name the name - */ - @Operation(summary = "Add a new person to the store", description = "", security = { - @SecurityRequirement(name = "Authorization") }) - @GetMapping(value = "/persons") - public void persons(@Valid @NotBlank String name) { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java deleted file mode 100644 index d6600286c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app23/SpringDocApp23Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app23; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 23 test. - */ -class SpringDocApp23Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/HelloController.java deleted file mode 100644 index f5b863c78..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/HelloController.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app24; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.security.SecurityScheme; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", description = "A core-auth Bearer token") -class HelloController { - - /** - * Persons. - * - * @param name the name - */ - @Operation(summary = "Add a new person to the store", description = "", security = { - @SecurityRequirement(name = "Authorization") }) - @GetMapping(value = "/persons") - public void persons(@Valid @NotBlank String name) { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java deleted file mode 100644 index cf24c85eb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocApp24Test.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app24; - -import test.org.springdoc.api.AbstractSpringDocTest; - -/** - * The type Spring doc app 24 test. - */ -class SpringDocApp24Test extends AbstractSpringDocTest { - - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocTestApp.java deleted file mode 100644 index 172d4166a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app24/SpringDocTestApp.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app24; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.headers.Header; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.media.StringSchema; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.security.SecurityScheme; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -/** - * The type Spring doc test app. - */ -@SpringBootApplication -class SpringDocTestApp { - - /** - * The entry point of application. - * - * @param args the input arguments - */ - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components() - .addSecuritySchemes("basicScheme", - new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic")) - .addParameters("myHeader1", - new Parameter().in("header").schema(new StringSchema()).name("myHeader1")) - .addHeaders("myHeader2", - new Header().description("myHeader2 header").schema(new StringSchema()))) - .info(new Info().title("Petstore API").version("v0").description( - "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") - .termsOfService("http://swagger.io/terms/") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/HelloController.java deleted file mode 100644 index a2760a194..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/HelloController.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app25; - -import java.time.Instant; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Check. - */ - @GetMapping(value = "/check") - @ResponseStatus(HttpStatus.OK) - void check() { - } - - /** - * List. - * - * @param trackerId the tracker id - * @param startDate the start date - * @param endDate the end date - */ - @GetMapping(value = "/list/{trackerId}") - void list( - - @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")) @PathVariable String trackerId, - @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, - @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")) @RequestParam(value = "end", required = false) Instant endDate) { - } - - /** - * Secondlist. - * - * @param trackerId the tracker id - * @param startDate the start date - * @param endDate the end date - */ - @GetMapping(value = "/secondlist/{trackerId}") - void secondlist( - @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")) @PathVariable String trackerId, - @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, - @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")) @RequestParam(value = "end", required = false) Instant endDate) { - - } - - /** - * Third list. - * - * @param trackerId the tracker id - * @param start the start - * @param end the end - * @param limit the limit - */ - @Operation(description = "Get last data from a tracker", parameters = { - @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")), - @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")), - @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")), - @Parameter(name = "limit", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "number", required = false, example = "10")) }, responses = { - @ApiResponse(responseCode = "200") }) - - @GetMapping(value = "/values/{trackerId}/data") - void thirdList(@PathVariable String trackerId, @RequestParam(value = "start", required = false) Instant start, - @RequestParam(value = "end", required = false) Instant end, - @RequestParam(value = "limit", required = false) Integer limit) { - - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java deleted file mode 100644 index f4a12140a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app25/SpringDocApp25Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app25; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 25 test. - */ -class SpringDocApp25Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Bar.java deleted file mode 100644 index 0f0f32164..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Bar.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app26; - -/** - * The type Bar. - */ -class Bar { - /** - * The Bar. - */ - private String bar; - - /** - * Gets bar. - * - * @return the bar - */ - public String getBar() { - return bar; - } - - /** - * Sets bar. - * - * @param bar the bar - */ - public void setBar(String bar) { - this.bar = bar; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Foo.java deleted file mode 100644 index da6b0a2fb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/Foo.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app26; - -/** - * The type Foo. - */ -class Foo { - - /** - * The Foo. - */ - private String foo; - - /** - * Gets foo. - * - * @return the foo - */ - public String getFoo() { - return foo; - } - - /** - * Sets foo. - * - * @param foo the foo - */ - public void setFoo(String foo) { - this.foo = foo; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/HelloController.java deleted file mode 100644 index 6584e3711..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/HelloController.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app26; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons my model. - * - * @param myModel the my model - * @return the my model - */ - @PostMapping(value = "/persons") - public MyModel persons(MyModel myModel) { - return new MyModel(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/MyModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/MyModel.java deleted file mode 100644 index 045de17e0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/MyModel.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app26; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type My model. - */ -class MyModel { - - /** - * The Thing. - */ - @Schema(description = "Hello", type = "object", oneOf = { Foo.class, Bar.class }) - private Object thing; - - /** - * Gets thing. - * - * @return the thing - */ - public Object getThing() { - return thing; - } - - /** - * Sets thing. - * - * @param thing the thing - */ - public void setThing(Object thing) { - this.thing = thing; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java deleted file mode 100644 index b871ae8a6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app26/SpringDocApp26Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app26; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 26 test. - */ -class SpringDocApp26Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Advice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Advice.java deleted file mode 100644 index 6ba5ed55e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Advice.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app27; - -import io.swagger.v3.oas.annotations.Hidden; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.springframework.web.context.request.WebRequest; - -/** - * The type Advice. - */ -@RestControllerAdvice -class Advice { - - /** - * Handle exception foo. - * - * @param ex the ex - * @param request the request - * @return the foo - */ - @ExceptionHandler(Exception.class) - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - public Foo handleException(Exception ex, WebRequest request) { - return new Foo(); - } - - /** - * Handle my exception bar. - * - * @param ex the ex - * @param request the request - * @return the bar - */ - @ExceptionHandler(MyException.class) - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - public Bar handleMyException(MyException ex, WebRequest request) { - return new Bar(); - } - - /** - * Handle my exception 2 bar. - * - * @param ex the ex - * @param request the request - * @return the bar - */ - @Hidden - @ExceptionHandler(Throwable.class) - @ResponseStatus(HttpStatus.NOT_FOUND) - public Bar handleMyException2(MyException ex, WebRequest request) { - return new Bar(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Bar.java deleted file mode 100644 index dccaf02a8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Bar.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app27; - -/** - * The type Bar. - */ -class Bar { - /** - * The Bar. - */ - public String bar = "bar"; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Foo.java deleted file mode 100644 index 5e3b5bb0d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/Foo.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app27; - -/** - * The type Foo. - */ -class Foo { - /** - * The Foo. - */ - public String foo = "foo"; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java deleted file mode 100644 index 3c2742c65..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/HelloController.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app27; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * The Flag. - */ - private boolean flag = false; - - /** - * Index string. - * - * @return the string - */ - @RequestMapping("/") - public String index() { - return ""; - } - - /** - * Test string. - * - * @return the string - */ - @GetMapping("/test") - public String test() { - flag = !flag; - throw flag ? new MyException() : new RuntimeException(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/MyException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/MyException.java deleted file mode 100644 index f49c3a6e8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/MyException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app27; - -/** - * The type My exception. - */ -class MyException extends RuntimeException { - - /** - * The constant serialVersionUID. - */ - private static final long serialVersionUID = 1L; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java deleted file mode 100644 index 9e17ed72b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app27/SpringDocApp27Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app27; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Spring doc app 27 test. - */ -class SpringDocApp27Test extends AbstractSpringDocTest { - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/Bar", - "#/components/schemas/Foo"))); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java deleted file mode 100644 index 30f2c77c6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/HelloController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app28; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Upload 2 string. - * - * @param one the one - * @param two the two - * @return the string - */ - @PostMapping(value = "/upload2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public String upload2(@RequestPart("one") MultipartFile one, @RequestPart("two") MultipartFile two) { - return "Ok"; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java deleted file mode 100644 index a3c5fc1e8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app28/SpringDocApp28Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app28; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 28 test. - */ -class SpringDocApp28Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/HelloController.java deleted file mode 100644 index 5f4f4b6db..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/HelloController.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app29; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Post entity list. - * - * @param postEntity the post entity - * @return the list - */ - @PostMapping(value = "/post-entity") - @Operation(description = "Post entity", - requestBody = @RequestBody(content = @Content(mediaType = "application/json", schema = @Schema(implementation = TrackerData.class))), - responses = - { @ApiResponse(responseCode = "200", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = TrackerData.class)))) }) - List postEntity(@RequestBody TrackerData postEntity) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java deleted file mode 100644 index dca022fc9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/SpringDocApp29Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app29; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 29 test. - */ -class SpringDocApp29Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/TrackerData.java deleted file mode 100644 index 190835bc3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app29/TrackerData.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app29; - -import java.time.Instant; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Tracker data. - */ -@Schema(name = "TrackerData") -class TrackerData { - - /** - * The Tracker id. - */ - @Schema(name = "trackerId", type = "string", required = true, example = "the-tracker-id") - @JsonProperty("trackerId") - String trackerId; - - /** - * The Timestamp. - */ - @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") - @JsonProperty("timestamp") - Instant timestamp; - - /** - * The Value. - */ - @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") - @JsonProperty("value") - Double value; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java deleted file mode 100644 index 0e3e4e96f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/HelloController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Echo playing card. - * - * @param card the card baby - * @param toto the toto baby - * @return the playing card baby - */ - @PostMapping - public PersonDTO echo(@RequestBody PlayingCard card, @RequestParam String toto) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PersonDTO.java deleted file mode 100644 index 973c8443b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PersonDTO.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3; - -/** - * The type Person dto. - */ -class PersonDTO { - - /** - * The email - */ - private String email; - - /** - * The firstName - */ - private String firstName; - - /** - * The lastName - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PlayingCard.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PlayingCard.java deleted file mode 100644 index 747a0c2d4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/PlayingCard.java +++ /dev/null @@ -1,125 +0,0 @@ -package test.org.springdoc.api.app3; - -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * The type Playing card. - */ -class PlayingCard { - /** - * The Suit. - */ - private Suit suit; - - /** - * The Value. - */ - private Integer value; - - /** - * The Toto. - */ - private Date toto; - - /** - * Gets toto. - * - * @return the toto - */ - public Date getToto() { - return toto; - } - - /** - * Sets toto. - * - * @param toto the toto - */ - public void setToto(Date toto) { - this.toto = toto; - } - - /** - * Gets suit. - * - * @return the suit - */ - public Suit getSuit() { - return suit; - } - - /** - * Sets suit. - * - * @param suit the suit - */ - public void setSuit(Suit suit) { - this.suit = suit; - } - - /** - * Gets value. - * - * @return the value - */ - public Integer getValue() { - return value; - } - - /** - * Sets value. - * - * @param value the value - */ - public void setValue(Integer value) { - this.value = value; - } - - /** - * The enum Suit. - */ - public enum Suit { - /** - *Hearts suit. - */ - HEARTS("Hearts"), - /** - *Diamonds suit. - */ - DIAMONDS("Diamonds"), - /** - *Clubs suit. - */ - CLUBS("Clubs"), - /** - *Spades suit. - */ - SPADES("Spades"); - - /** - * The Json value. - */ - private final String jsonValue; - - /** - * Instantiates a new Suit. - * - * @param jsonValue the json value - */ - Suit(String jsonValue) { - this.jsonValue = jsonValue; - } - - /** - * Gets json value. - * - * @return the json value - */ - @JsonValue - public String getJsonValue() { - return jsonValue; - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java deleted file mode 100644 index 25467759a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app3/SpringDocApp3Test.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app3; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 3 test. - */ -class SpringDocApp3Test extends AbstractSpringDocTest { - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java deleted file mode 100644 index fe0d6daae..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/HelloController.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app30; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Echo string. - * - * @param text the text - * @return the string - */ - @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test") - public String echo(@RequestParam(name = "text", defaultValue = "Hello, World!") String text) { - return text; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java deleted file mode 100644 index 9b06f5862..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app30/SpringDocApp30Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app30; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 30 test. - */ -class SpringDocApp30Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java deleted file mode 100644 index 082a24e48..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/HelloController.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app31; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.callbacks.Callback; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Subscribe subscription response. - * - * @param token the token - * @param url the url - * @return the subscription response - */ - @PostMapping("/test") - @Callback(callbackUrlExpression = "http://$request.query.url", name = "subscription", operation = { - @Operation(method = "post", description = "payload data will be sent", parameters = { - @Parameter(in = ParameterIn.PATH, name = "subscriptionId", required = true, schema = @Schema(type = "string", format = "uuid", description = "the generated UUID", accessMode = Schema.AccessMode.READ_ONLY)) }, responses = { - @ApiResponse(responseCode = "200", description = "Return this code if the callback was received and processed successfully"), - @ApiResponse(responseCode = "205", description = "Return this code to unsubscribe from future data updates"), - @ApiResponse(responseCode = "default", description = "All other response codes will disable this callback subscription") }) }) - @Operation(description = "subscribes a client to updates relevant to the requestor's account, as " - + "identified by the input token. The supplied url will be used as the delivery address for response payloads") - public SubscriptionResponse subscribe(@Schema(required = true, description = "the authentication token " - + "provided after initially authenticating to the application") @RequestHeader("x-auth-token") String token, - @Schema(required = true, description = "the URL to call with response " - + "data") @RequestParam("url") String url) { - return null; - } - - /** - * The type Subscription response. - */ - static class SubscriptionResponse { - /** - * The Subscription uuid. - */ - private String subscriptionUuid; - - /** - * Gets subscription uuid. - * - * @return the subscription uuid - */ - public String getSubscriptionUuid() { - return subscriptionUuid; - } - - /** - * Sets subscription uuid. - * - * @param subscriptionUuid the subscription uuid - */ - public void setSubscriptionUuid(String subscriptionUuid) { - this.subscriptionUuid = subscriptionUuid; - } - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java deleted file mode 100644 index ca0a7ecc4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app31/SpringDocApp31Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app31; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 31 test. - */ -class SpringDocApp31Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java deleted file mode 100644 index 9da86e547..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/HelloController.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app32; - -import io.swagger.v3.oas.annotations.parameters.RequestBody; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Filter post string. - * - * @param filter the filter - * @return the string - */ - @RequestMapping(value = "/filter", method = RequestMethod.POST) - @ResponseStatus(value = HttpStatus.OK) - public String filterPost(@RequestBody final MyTestDto filter) { - return "OK"; - } - - /** - * The type My test dto. - */ - class MyTestDto { - /** - * The Object 1. - */ - public String object1; - - /** - * The Object 2. - */ - public String object2; - - /** - * The Object 3. - */ - public String object3; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java deleted file mode 100644 index 403a3e8be..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app32/SpringDocApp32Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app32; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 32 test. - */ -class SpringDocApp32Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java deleted file mode 100644 index 085dbf071..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/HelloController.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app33; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - * - * @param the type parameter - */ -@RestController -class HelloController { - - /** - * Index t. - * - * @param numTel the num tel - * @param adresse the adresse - * @return the t - */ - @GetMapping(value = "/hello/{numTelco}") - @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) - public T index(@PathVariable("numTelco") String numTel, String adresse) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java deleted file mode 100644 index 84116c241..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app33/SpringDocApp33Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app33; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 33 test. - */ -class SpringDocApp33Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/HelloController.java deleted file mode 100644 index e192e5093..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/HelloController.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app34; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - * - * @param the type parameter - */ -@RestController -class HelloController { - - /** - * Index t. - * - * @param numTel the num tel - * @param adresse the adresse - * @return the t - */ - @GetMapping(value = "/hello/{numTelco}") - @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) - public T index(@PathVariable("numTelco") String numTel, String adresse) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/MyExceptionHandler.java deleted file mode 100644 index f83158ab7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/MyExceptionHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app34; - -import io.swagger.v3.oas.annotations.Hidden; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; - -/** - * The type My exception handler. - */ -@RestControllerAdvice -@Hidden -class MyExceptionHandler extends ResponseEntityExceptionHandler { - /** - * Bad object. - * - * @param e the e - * @return the object - */ - @ExceptionHandler(IllegalArgumentException.class) - @ResponseStatus(HttpStatus.BAD_REQUEST) - public Object bad(IllegalArgumentException e) { - return null; - } - - /** - * Gateway object. - * - * @param e the e - * @return the object - */ - @ExceptionHandler(RuntimeException.class) - @ResponseStatus(HttpStatus.BAD_GATEWAY) - public Object gateway(RuntimeException e) { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java deleted file mode 100644 index 5d5acccf0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app34/SpringDocApp34Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app34; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 34 test. - */ -class SpringDocApp34Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/HelloController.java deleted file mode 100644 index 8d2c1dfd7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/HelloController.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app35; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -/** - * The type Hello controller. - */ -@Controller -@RequestMapping("/api/v1/poc/") -class HelloController { - - /** - * Testme response entity. - * - * @return the response entity - */ - @Operation(summary = "Get thing", responses = { - @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), - @ApiResponse(responseCode = "404", description = "Not found", content = @Content), - @ApiResponse(responseCode = "401", description = "Authentication Failure", content = @Content(schema = @Schema(hidden = true))) }) - @RequestMapping(path = "/testme", method = RequestMethod.GET) - ResponseEntity testme() { - return ResponseEntity.ok("Hello"); - } - - /** - * Test response entity. - * - * @return the response entity - */ - @Operation(summary = "Get thing", responses = { - @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), - @ApiResponse(responseCode = "404", description = "Not found", content = @Content(schema = @Schema(hidden = true))), - @ApiResponse(responseCode = "401", description = "Authentication Failure", content = @Content(schema = @Schema(hidden = true))) }) - @RequestMapping(path = "/test", method = RequestMethod.GET) - ResponseEntity test() { - return ResponseEntity.ok("Hello"); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java deleted file mode 100644 index 686ba0304..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app35/SpringDocApp35Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app35; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import static org.springdoc.core.utils.SpringDocUtils.getConfig; - -/** - * The type Spring doc app 35 test. - */ -class SpringDocApp35Test extends AbstractSpringDocTest { - - static { - getConfig().addRestControllers(HelloController.class); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Bar.java deleted file mode 100644 index 0ef75bedf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Bar.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app37; - -/** - * The type Bar. - */ -class Bar { - /** - * The Bar. - */ - public String bar = "bar"; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Car.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Car.java deleted file mode 100644 index 8e8d11c13..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Car.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app37; - -/** - * The type Car. - */ -class Car { - /** - * The Car. - */ - public String car = "car"; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Foo.java deleted file mode 100644 index 85756d914..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Foo.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app37; - -/** - * The type Foo. - */ -class Foo { - /** - * The Foo. - */ - public String foo = "foo"; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/HelloController.java deleted file mode 100644 index 3df46159a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/HelloController.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app37; - -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import jakarta.validation.Valid; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController("/api") -class HelloController { - - /** - * Process foo. - * - * @param a the a - * @return the foo - */ - @PostMapping(path = "/bar/baz", consumes = "application/x.a+json", produces = MediaType.TEXT_PLAIN_VALUE) - public Foo process(@RequestBody Foo a) { - return a; - } - - /** - * Process bar. - * - * @param b the b - * @return the bar - */ - @PostMapping(path = "/bar/baz", consumes = "application/x.b+json", produces = MediaType.TEXT_PLAIN_VALUE) - public Bar process(@RequestBody Bar b) { - return b; - } - - /** - * Process car. - * - * @param c the c - * @return the car - */ - @PostMapping(path = "/bar/baz", consumes = "application/x.c+json", produces = MediaType.APPLICATION_JSON_VALUE) - public Car process(@RequestBody Car c) { - return c; - } - - - /** - * Pets post response entity. - * - * @param pet the pet - * @return the response entity - */ - @PostMapping(value = "/pets1", consumes = "text/plain") - public ResponseEntity petsPost1(@Valid @RequestBody String pet) { - return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); - } - - /** - * Pets post response entity. - * - * @param pet the pet - * @return the response entity - */ - @PostMapping(value = "/pets2", consumes = "application/json") - public ResponseEntity petsPost2(@Valid @RequestBody Pet pet) { - return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Pet.java deleted file mode 100644 index dd3446b17..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/Pet.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app37; - -/** - * The type Pet. - */ -class Pet { - /** - * The Pet. - */ - public String pet = "pet"; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java deleted file mode 100644 index 624d08eca..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app37/SpringDocApp37Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app37; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 37 test. - */ -class SpringDocApp37Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/HelloController.java deleted file mode 100644 index 090351308..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/HelloController.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app38; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController("/api") -class HelloController { - - /** - * Gets model resource. - * - * @return the model resource - */ - @RequestMapping(value = "/npe_error", method = RequestMethod.GET) - public ResponseEntity getModelResource() { - return new ResponseEntity<>(new byte[0], HttpStatus.OK); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java deleted file mode 100644 index cf49de2bf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app38/SpringDocApp38Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app38; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 38 test. - */ -class SpringDocApp38Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/HelloController.java deleted file mode 100644 index 84af2ee98..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/HelloController.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app39; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.parameters.RequestBody; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Search employee. - * - * @param test the test - */ - @Operation(summary = "test Request") - @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) - @PostMapping("/test") - public void searchEmployee(String test) { - } - - /** - * Hello string. - * - * @return the string - */ - @GetMapping("/hello") - public String hello() { - return "hello"; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java deleted file mode 100644 index 03c832a91..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocApp39Test.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app39; - -import test.org.springdoc.api.AbstractSpringDocTest; - -/** - * The type Spring doc app 39 test. - */ -class SpringDocApp39Test extends AbstractSpringDocTest { - - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java deleted file mode 100644 index 185111bb0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app39/SpringDocTestApp.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app39; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.StringSchema; -import io.swagger.v3.oas.models.parameters.HeaderParameter; -import org.springdoc.core.customizers.OpenApiCustomizer; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -/** - * The type Spring doc test app. - */ -@SpringBootApplication -class SpringDocTestApp { - - /** - * The entry point of application. - * - * @param args the input arguments - */ - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - StringSchema schema = new StringSchema(); - return new OpenAPI() - .components(new Components().addParameters("myGlobalHeader", new HeaderParameter().required(true).name("My-Global-Header").description("My Global Header").schema(schema))); - } - - /** - * Customer global header open api customiser open api customiser. - * - * @return the open api customiser - */ - @Bean - public OpenApiCustomizer customerGlobalHeaderOpenApiCustomizer() { - return openApi -> openApi.getPaths().values().stream().flatMap(pathItem -> pathItem.readOperations().stream()) - .forEach(operation -> operation.addParametersItem(new HeaderParameter().$ref("#/components/parameters/myGlobalHeader"))); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/HelloController.java deleted file mode 100644 index f86ea0cca..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/HelloController.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * List tracker data. - * - * @param toto the toto - * @return the tracker data - */ - @PostMapping(value = "/values/data") - TrackerData list(TrackerData toto) { - return toto; - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java deleted file mode 100644 index eef0de0a4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/SpringDocApp4Test.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4; - -import io.swagger.v3.core.jackson.TypeNameResolver; -import org.junit.jupiter.api.AfterAll; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 4 test. - */ -@TestPropertySource(properties = "springdoc.use-fqn=true") -class SpringDocApp4Test extends AbstractSpringDocTest { - - /** - * Restore. - */ - @AfterAll - static void restore() { - TypeNameResolver.std.setUseFqn(false); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/TrackerData.java deleted file mode 100644 index 19f06fb86..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app4/TrackerData.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4; - -import java.time.Instant; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Tracker data. - */ -class TrackerData { - - /** - * The Tracker id. - */ - @Schema(name = "trackerId", type = "string", required = true, example = "the-tracker-id") - @JsonProperty("trackerId") - String trackerId; - - /** - * The Timestamp. - */ - @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") - @JsonProperty("timestamp") - Instant timestamp; - - /** - * The Value. - */ - @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") - @JsonProperty("value") - Double value; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/HelloController.java deleted file mode 100644 index 6b88a1d03..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/HelloController.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app40; - -import com.fasterxml.jackson.databind.node.ObjectNode; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController("/api") -class HelloController { - - /** - * Gets start form properties. - * - * @return the start form properties - */ - @RequestMapping(value = "/iae_error", method = RequestMethod.GET) - public ObjectNode getStartFormProperties() { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/SpringDocApp40Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/SpringDocApp40Test.java deleted file mode 100644 index 6877c71ee..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app40/SpringDocApp40Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app40; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 40 test. - */ -class SpringDocApp40Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/HelloController.java deleted file mode 100644 index c1eae2978..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/HelloController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app41; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController("/api") -class HelloController { - - /** - * Gets file. - * - * @param path the path - * @return the file - */ - @Operation(description = "Download file") - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "File resource", content = @Content(schema = @Schema(implementation = java.io.File.class))), - @ApiResponse(responseCode = "400", description = "Wrong request", content = @Content(schema = @Schema(implementation = Error.class))), - @ApiResponse(responseCode = "500", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) }) - @GetMapping(value = "/file", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity getFile( - @NotNull @Parameter(description = "File path", required = true) @Valid @RequestParam(value = "path") String path) { - return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp411Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp411Test.java deleted file mode 100644 index 19de007a6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp411Test.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app41; - -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Spring doc app 411 test. - */ -class SpringDocApp411Test extends AbstractSpringDocTest { - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - String className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - // Test result consistency - mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - Path path = Paths.get(getClass().getClassLoader().getResource("results/app41.json").toURI()); - byte[] fileBytes = Files.readAllBytes(path); - String expected = new String(fileBytes); - assertEquals(expected, result, false); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp41Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp41Test.java deleted file mode 100644 index 32892d65e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app41/SpringDocApp41Test.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app41; - -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Spring doc app 41 test. - */ -@TestPropertySource(properties = "springdoc.cache.disabled=true") -class SpringDocApp41Test extends AbstractSpringDocTest { - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - String className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - // Test result consistency - mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - Path path = Paths.get(getClass().getClassLoader().getResource("results/app" + testNumber + ".json").toURI()); - byte[] fileBytes = Files.readAllBytes(path); - String expected = new String(fileBytes); - assertEquals(expected, result, false); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/HelloController.java deleted file mode 100644 index da264542d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/HelloController.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app42; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Hello controller. - */ -@RestController("/api") -class HelloController { - - /** - * Tweets. - * - * @param id the id - */ - @GetMapping(value = "/tweets/{id}") - public void tweets(@PathVariable TweetId id) { - - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/SpringDocApp42Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/SpringDocApp42Test.java deleted file mode 100644 index 0c92fc0cd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/SpringDocApp42Test.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app42; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.StringSchema; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -/** - * The type Spring doc app 42 test. - */ -class SpringDocApp42Test extends AbstractSpringDocTest { - - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI().components(new Components().addSchemas("TweetId", new StringSchema())); - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/TweetId.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/TweetId.java deleted file mode 100644 index dc34326e0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app42/TweetId.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app42; - -/** - * The type Tweet id. - */ -class TweetId { - /** - * The Value. - */ - private final String value; - - /** - * Instantiates a new Tweet id. - * - * @param value the value - */ - public TweetId(String value) { - this.value = value; - } - - /** - * Gets value. - * - * @return the value - */ - public String getValue() { - return value; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/HelloController.java deleted file mode 100644 index c99a02e26..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/HelloController.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app43; - -import java.util.List; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Upload documents response entity. - * - * @param multipartFiles the multipart files - * @return the response entity - */ - @PostMapping(path = "/documents", consumes = "multipart/form-data") - public ResponseEntity uploadDocuments(@RequestPart("doc") List multipartFiles) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/SpringDocApp43Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/SpringDocApp43Test.java deleted file mode 100644 index 7d6f801d0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app43/SpringDocApp43Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app43; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 43 test. - */ -class SpringDocApp43Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/HelloController.java deleted file mode 100644 index 6b78db2f1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/HelloController.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app44; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController("/api") -class HelloController { - - /** - * Hello response entity. - * - * @param request the request - * @return the response entity - */ - @PostMapping(value = "/helloworld", produces = "application/json", consumes = "application/vnd.v1+json") - @ApiResponses({ - @ApiResponse(responseCode = "200", description = "Successful operation", content = @Content(schema = @Schema(implementation = HelloDTO1.class))), - @ApiResponse(responseCode = "400", description = "Bad name", content = @Content(schema = @Schema(implementation = ErrorDTO.class))) }) - public ResponseEntity hello(@RequestBody RequestV1 request) { - final String name = request.getNameV1(); - if ("error".equalsIgnoreCase(name)) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ErrorDTO("invalid name: " + name)); - } - return ResponseEntity.ok(new HelloDTO1("Greetings from Spring Boot v1! " + name)); - } - - /** - * Hello response entity. - * - * @param request the request - * @return the response entity - */ - @PostMapping(value = "/helloworld", produces = "application/json", consumes = "application/vnd.v2+json") - @ApiResponses({ - @ApiResponse(responseCode = "200", description = "Successful operation", content = @Content(schema = @Schema(implementation = HelloDTO2.class))), - @ApiResponse(responseCode = "400", description = "Bad name", content = @Content(schema = @Schema(implementation = ErrorDTO.class))) }) - public ResponseEntity hello(@RequestBody RequestV2 request) { - final String name = request.getNameV2(); - if ("error".equalsIgnoreCase(name)) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ErrorDTO("invalid name: " + name)); - } - return ResponseEntity.ok(new HelloDTO2("Greetings from Spring Boot v2! " + name)); - } - - /** - * The type Request v 1. - */ - static class RequestV1 { - /** - * The Name v 1. - */ - private String nameV1; - - /** - * Instantiates a new Request v 1. - */ - public RequestV1() { - } - - /** - * Gets name v 1. - * - * @return the name v 1 - */ - public String getNameV1() { - return nameV1; - } - - /** - * Sets name v 1. - * - * @param nameV1 the name v 1 - */ - public void setNameV1(String nameV1) { - this.nameV1 = nameV1; - } - } - - /** - * The type Request v 2. - */ - static class RequestV2 { - /** - * The Name v 2. - */ - private String nameV2; - - /** - * Instantiates a new Request v 2. - */ - public RequestV2() { - } - - /** - * Gets name v 2. - * - * @return the name v 2 - */ - public String getNameV2() { - return nameV2; - } - - /** - * Sets name v 2. - * - * @param nameV2 the name v 2 - */ - public void setNameV2(String nameV2) { - this.nameV2 = nameV2; - } - } - - /** - * The type Hello dto 1. - */ - class HelloDTO1 { - /** - * The Message. - */ - private String message; - - /** - * Instantiates a new Hello dto 1. - * - * @param message the message - */ - public HelloDTO1(String message) { - this.message = message; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - } - - /** - * The type Hello dto 2. - */ - class HelloDTO2 { - /** - * The Message. - */ - private String message; - - /** - * Instantiates a new Hello dto 2. - * - * @param message the message - */ - public HelloDTO2(String message) { - this.message = message; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - } - - /** - * The type Error dto. - */ - class ErrorDTO { - /** - * The Error message. - */ - private String errorMessage; - - /** - * Instantiates a new Error dto. - * - * @param errorMessage the error message - */ - public ErrorDTO(String errorMessage) { - this.errorMessage = errorMessage; - } - - /** - * Gets error message. - * - * @return the error message - */ - public String getErrorMessage() { - return errorMessage; - } - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/SpringDocApp44Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/SpringDocApp44Test.java deleted file mode 100644 index 52d07050d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app44/SpringDocApp44Test.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app44; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Spring doc app 44 test. - */ -class SpringDocApp44Test extends AbstractSpringDocTest { - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/HelloDTO2", - "#/components/schemas/HelloDTO1"))) - .andExpect(jsonPath("$.paths./helloworld.post.requestBody.content.['application/vnd.v1+json'].schema.$ref", is("#/components/schemas/RequestV1"))) - .andExpect(jsonPath("$.paths./helloworld.post.requestBody.content.['application/vnd.v2+json'].schema.$ref", is("#/components/schemas/RequestV2"))) - .andExpect(jsonPath("$.paths./helloworld.post.responses.400.content.['application/json'].schema.$ref", is("#/components/schemas/ErrorDTO"))); - - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController.java deleted file mode 100644 index 55440ef8a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app45; - -import java.util.Collections; -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Hello controller. - */ -@Tag(name = "People", description = "Use this resource to serve all requests and initiate all operations related to people") -@RestController -@RequestMapping(value = "/v1/people") -class HelloController { - - - /** - * List list. - * - * @return the list - */ - @Operation(description = "List all persons") - @SecurityRequirement(name = "bearer") - @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) - @GetMapping(path = "/list", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public List list() { - PersonDTO person = new PersonDTO(); - person.setFirstName("Nass"); - return Collections.singletonList(person); - } - - /** - * List two list. - * - * @return the list - */ - @Operation(description = "List all persons") - @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) - @GetMapping(path = "/listTwo", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public List listTwo() { - PersonDTO person = new PersonDTO(); - person.setFirstName("Nass"); - return Collections.singletonList(person); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController2.java deleted file mode 100644 index d2bf8df88..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/HelloController2.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app45; - -import java.util.Collections; -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Hello controller 2. - */ -@Tag(name = "People", description = "Use this resource to serve all requests and initiate all operations related to people") -@SecurityRequirement(name = "bearer") -@RestController -@RequestMapping(value = "/v1/people2") -class HelloController2 { - - - /** - * List list. - * - * @return the list - */ - @Operation(description = "List all persons") - @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) - @GetMapping(path = "/list", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public List list() { - PersonDTO person = new PersonDTO(); - person.setFirstName("Nass"); - return Collections.singletonList(person); - } - - /** - * List two list. - * - * @return the list - */ - @Operation(description = "List all persons") - @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) - @GetMapping(path = "/listTwo", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public List listTwo() { - PersonDTO person = new PersonDTO(); - person.setFirstName("Nass"); - return Collections.singletonList(person); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/OpenApiConfig.java deleted file mode 100644 index de9a8d0e4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/OpenApiConfig.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app45; - -import io.swagger.v3.oas.annotations.OpenAPIDefinition; -import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; -import io.swagger.v3.oas.annotations.info.Info; -import io.swagger.v3.oas.annotations.info.License; -import io.swagger.v3.oas.annotations.security.SecurityScheme; - -/** - * The type Open api config. - */ -@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) -@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") -class OpenApiConfig { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/PersonDTO.java deleted file mode 100644 index 9f2912e80..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/PersonDTO.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app45; - -/** - * The type Person dto. - */ -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/SpringDocApp45Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/SpringDocApp45Test.java deleted file mode 100644 index 762e7ff56..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app45/SpringDocApp45Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app45; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 45 test. - */ -class SpringDocApp45Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/HelloController.java deleted file mode 100644 index 7fb014288..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app46; - -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons string. - * - * @param subscriptionId the subscription id - * @return the string - */ - @GetMapping("/persons/{subscriptionId}") - @Operation(operationId = "operationId", summary = "Operation Summary", description = "Operation Description", tags = { - "Example Tag" }, externalDocs = @ExternalDocumentation(description = "External documentation description", url = "http://url.com"), parameters = { - @Parameter(in = ParameterIn.PATH, name = "subscriptionId", required = true, description = "parameter description", allowEmptyValue = true, allowReserved = true, schema = @Schema(type = "string", format = "uuid", description = "the generated UUID", accessMode = Schema.AccessMode.READ_ONLY)) }, responses = { - @ApiResponse(responseCode = "200", description = "voila!", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) }) - public String persons(String subscriptionId) { - return "OK"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/SpringDocApp46Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/SpringDocApp46Test.java deleted file mode 100644 index 8b6eacd97..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app46/SpringDocApp46Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app46; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 46 test. - */ -class SpringDocApp46Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/HelloController.java deleted file mode 100644 index f75afbfc1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app47; - -import java.util.Locale; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - /** - * Gets documents with locale. - * - * @param locale the locale - * @return the documents with locale - */ - @GetMapping(path = "/documents/{locale}") - public ResponseEntity getDocumentsWithLocale( - @Parameter(schema = @Schema(type = "string")) @PathVariable("locale") Locale locale) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/SpringDocApp47Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/SpringDocApp47Test.java deleted file mode 100644 index bdea686c2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app47/SpringDocApp47Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app47; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 47 test. - */ -class SpringDocApp47Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/AbstractHelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/AbstractHelloController.java deleted file mode 100644 index 2f91b87ca..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/AbstractHelloController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app48; - -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; - -/** - * The type Abstract hello controller. - */ -@ApiResponse(responseCode = "410") -@ApiResponses({ - @ApiResponse(responseCode = "411") -}) -class AbstractHelloController { - - /** - * Gets documents. - * - * @return the documents - */ - @GetMapping(path = "/documents/{locale}") - @ApiResponse(responseCode = "412") - @ApiResponses({ - @ApiResponse(responseCode = "413") - }) - public ResponseEntity getDocuments() { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/HelloController.java deleted file mode 100644 index efa7bb7f7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app48; - -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController - -@ApiResponse(responseCode = "400") -@ApiResponses({ - @ApiResponse(responseCode = "401") -}) -class HelloController extends AbstractHelloController { - - /** - * Gets documents. - * - * @return the documents - */ - @Override - @GetMapping(path = "/documents/{locale}") - @ApiResponse(responseCode = "402") - @ApiResponses({ - @ApiResponse(responseCode = "403") - }) - public ResponseEntity getDocuments() { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/SpringDocApp48Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/SpringDocApp48Test.java deleted file mode 100644 index e13b06ee5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app48/SpringDocApp48Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app48; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 48 test. - */ -class SpringDocApp48Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/HelloController.java deleted file mode 100644 index 7b75fa82a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/HelloController.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app49; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * List list. - * - * @return the list - */ - @Operation(description = "Obtain the list of services available in the system") - @ApiResponses({ @ApiResponse(responseCode = "401", ref = "Unauthorized") }) - @GetMapping(value = "/hello", produces = MediaType.APPLICATION_JSON_VALUE) - List list() { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocApp49Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocApp49Test.java deleted file mode 100644 index 8a1ac3db3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocApp49Test.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app49; - -import test.org.springdoc.api.AbstractSpringDocTest; - -/** - * The type Spring doc app 49 test. - */ -class SpringDocApp49Test extends AbstractSpringDocTest { - - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocTestApp.java deleted file mode 100644 index 603e563af..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app49/SpringDocTestApp.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app49; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.Content; -import io.swagger.v3.oas.models.media.StringSchema; -import io.swagger.v3.oas.models.responses.ApiResponse; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.http.MediaType; - -/** - * The type Spring doc test app. - */ -@SpringBootApplication -class SpringDocTestApp { - - /** - * The entry point of application. - * - * @param args the input arguments - */ - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - /** - * Define open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI defineOpenApi() { - OpenAPI api = new OpenAPI(); - api.components(new Components().addResponses("Unauthorized", - new ApiResponse().description("Unauthorized") - .content(new Content().addMediaType(MediaType.APPLICATION_JSON_VALUE, - new io.swagger.v3.oas.models.media.MediaType().schema(new StringSchema()))))); - return api; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/CustomOpenAPIConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/CustomOpenAPIConfig.java deleted file mode 100644 index b2f659365..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/CustomOpenAPIConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.tags.Tag; - -import org.springframework.context.annotation.Bean; - -/** - * The type Custom open api config. - */ -public class CustomOpenAPIConfig { - /** - * Custom open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .components(new Components()) - .info(new Info().title("Custom API").version("100")).addTagsItem(new Tag().name("mytag")); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceCustomConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceCustomConfigurationTest.java deleted file mode 100644 index c354dcd65..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceCustomConfigurationTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5.sample; - -import org.junit.jupiter.api.Test; -import test.org.springdoc.api.AbstractSpringDocTest; -import test.org.springdoc.api.app5.CustomOpenAPIConfig; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.TestPropertySource; - -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Open api resource custom configuration test. - */ -@Import(CustomOpenAPIConfig.class) -@TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") -class OpenApiResourceCustomConfigurationTest extends AbstractSpringDocTest { - - /** - * givenNoConfiguration_whenGetApiJson_returnsDefaultEmptyDocs - should return - * {"openapi":"3.0.1","info":{"title":"Custom API","version":"100"},"paths":{},"components":{}} - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc - .perform(get("/api-docs")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(jsonPath("$.info.title", is("Custom API"))) - .andExpect(jsonPath("$.info.version", is("100"))) - .andExpect(jsonPath("$.paths").isEmpty()) - .andExpect(jsonPath("$.components").isEmpty()) - .andExpect(jsonPath("$.tags").isNotEmpty()) - .andExpect(jsonPath("$.tags[0].name", is("mytag"))); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceNoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceNoConfigurationTest.java deleted file mode 100644 index 9e94b8bcb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenApiResourceNoConfigurationTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5.sample; - -import org.junit.jupiter.api.Test; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Open api resource no configuration test. - */ -@TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") -class OpenApiResourceNoConfigurationTest extends AbstractSpringDocTest { - - /** - * givenNoConfiguration_whenGetApiJson_returnsDefaultEmptyDocs - should return - * {"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"paths":{},"components":{}} - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc - .perform(get("/api-docs")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(jsonPath("$.info.title", is("OpenAPI definition"))) - .andExpect(jsonPath("$.info.version", is("v0"))) - .andExpect(jsonPath("$.paths").isEmpty()) - .andExpect(jsonPath("$.components").isEmpty()); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/HelloController.java deleted file mode 100644 index d634d8207..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/HelloController.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app50; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * List list. - * - * @return the list - */ - @Operation(description = "Some operation", responses = { @ApiResponse(responseCode = "401") }) - //@ApiResponse(responseCode = "401", content = @Content()) - @GetMapping(value = "/hello", produces = MediaType.APPLICATION_JSON_VALUE) - List list() { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocApp50Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocApp50Test.java deleted file mode 100644 index 55c44dc39..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocApp50Test.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app50; - -import test.org.springdoc.api.AbstractSpringDocTest; - -/** - * The type Spring doc app 50 test. - */ -class SpringDocApp50Test extends AbstractSpringDocTest { - - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocTestApp.java deleted file mode 100644 index 3d84acfe7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app50/SpringDocTestApp.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app50; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.Content; -import io.swagger.v3.oas.models.media.StringSchema; -import io.swagger.v3.oas.models.responses.ApiResponse; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.http.MediaType; - -/** - * The type Spring doc test app. - */ -@SpringBootApplication -class SpringDocTestApp { - - /** - * The entry point of application. - * - * @param args the input arguments - */ - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - /** - * Define open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI defineOpenApi() { - OpenAPI api = new OpenAPI(); - api.components(new Components().addResponses("Unauthorized", - new ApiResponse().description("Unauthorized") - .content(new Content().addMediaType(MediaType.APPLICATION_JSON_VALUE, - new io.swagger.v3.oas.models.media.MediaType().schema(new StringSchema()))))); - return api; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/HelloController.java deleted file mode 100644 index 19bad65da..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/HelloController.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app51; - -import java.util.HashMap; -import java.util.Map; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test 1 string. - * - * @return the string - */ - @Operation(parameters = { - @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")) }) - @GetMapping("/test1") - public String test1() { - return "test"; - } - - /** - * Test 2 string. - * - * @param param1 the param 1 - * @return the string - */ - @Operation(parameters = { - @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")) }) - @GetMapping("/test2") - public String test2(@RequestParam(name = "param1") String param1) { - return "test"; - } - - /** - * Test 3 string. - * - * @param param1 the param 1 - * @return the string - */ - @Operation(parameters = { - @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")), - @Parameter(description = "desc1", in = ParameterIn.QUERY, name = "param1", required = true, schema = @Schema(type = "string", example = "something")) }) - @GetMapping("/test3") - public String test3( - @RequestParam(name = "param1") @Parameter(description = "desc2", in = ParameterIn.QUERY) String param1) { - return "test"; - } - - /** - * Get string. - * - * @param path the path - * @param params the params - * @return the string - */ - @GetMapping("/test/{path}") - public String get( - @PathVariable String path, - @RequestParam(required = false) Map params) { - return null; - } - - /** - * Hello response entity. - * - * @param map the map - * @return the response entity - */ - @PostMapping - public ResponseEntity> hello(@RequestBody HashMap map) { - return ResponseEntity.ok(map); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/SpringDocApp51Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/SpringDocApp51Test.java deleted file mode 100644 index 4a19e4253..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app51/SpringDocApp51Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app51; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 51 test. - */ -class SpringDocApp51Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/HelloController.java deleted file mode 100644 index 4ac240cc1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/HelloController.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app52; - -import java.util.List; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Create test 1 string. - * - * @param username the username - * @param test the test - * @param imageFile the image file - * @return the string - */ - @PostMapping(value = "/test1/{username}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public String createTest1(@PathVariable String username, @RequestPart("test") MyTestDto test, - @RequestPart("image") MultipartFile imageFile) { - return null; - } - - /** - * Create test 2 string. - * - * @param username the username - * @param imageFile the image file - * @param test the test - * @return the string - */ - @PostMapping(value = "/test2/{username}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public String createTest2(@PathVariable String username, @RequestPart("image") MultipartFile imageFile, - @RequestPart("test") MyTestDto test) { - return null; - } - - /** - * Create test 3 string. - * - * @param test the test - * @param multipartFiles the multipart files - * @return the string - */ - @PostMapping(value = "/test3", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public String createTest3(@RequestPart("test") MyTestDto test, - @RequestPart("doc") List multipartFiles) { - return null; - } - - /** - * The type My test dto. - */ - class MyTestDto { - /** - * The Object 1. - */ - public String object1; - - /** - * The Object 2. - */ - public String object2; - - /** - * The Object 3. - */ - public String object3; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/SpringDocApp52Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/SpringDocApp52Test.java deleted file mode 100644 index be590d244..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app52/SpringDocApp52Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app52; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 52 test. - */ -class SpringDocApp52Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloController.java deleted file mode 100644 index 8da9c35ff..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloController.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app53; - - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * List with no api response list. - * - * @return the list - */ - @Operation(description = "Some operation") - @GetMapping(value = "/hello1", produces = MediaType.APPLICATION_JSON_VALUE) - List listWithNoApiResponse() { - return null; - } - - /** - * List with empty api response list. - * - * @return the list - */ - @Operation(description = "Some operation") - @ApiResponse - @GetMapping(value = "/hello2", produces = MediaType.APPLICATION_JSON_VALUE) - List listWithEmptyApiResponse() { - return null; - } - - /** - * List with explicit response status list. - * - * @return the list - */ - @Operation(description = "Some operation") - @GetMapping(value = "/hello3", produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseStatus(HttpStatus.NO_CONTENT) - List listWithExplicitResponseStatus() { - return null; - } - - /** - * Gets dto with explicit response status. - * - * @return the dto with explicit response status - */ - @Operation(description = "Some operation") - @GetMapping(value = "/hello4", produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseStatus(HttpStatus.NO_CONTENT) - HelloDTO1 getDTOWithExplicitResponseStatus() { - return null; - } - - /** - * List with default response status list. - * - * @return the list - */ - @Operation(description = "Some operation") - @GetMapping(value = "/hello5", produces = MediaType.APPLICATION_JSON_VALUE) - List listWithDefaultResponseStatus() { - return null; - } - - /** - * Gets dto with default response status. - * - * @return the dto with default response status - */ - @Operation(description = "Some operation") - @GetMapping(value = "/hello6", produces = MediaType.APPLICATION_JSON_VALUE) - HelloDTO1 getDTOWithDefaultResponseStatus() { - return null; - } - - /** - * Gets nested dto with default response status. - * - * @return the nested dto with default response status - */ - @Operation(description = "Some operation") - @GetMapping(value = "/hello7", produces = MediaType.APPLICATION_JSON_VALUE) - ResponseEntity getNestedDTOWithDefaultResponseStatus() { - return null; - } - - /** - * The type Hello dto 1. - */ - static class HelloDTO1 { - /** - * The Message. - */ - private String message; - - /** - * Instantiates a new Hello dto 1. - * - * @param message the message - */ - public HelloDTO1(String message) { - this.message = message; - } - - /** - * Gets message. - * - * @return the message - */ - public String getMessage() { - return message; - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloControllerWithGlobalApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloControllerWithGlobalApiResponse.java deleted file mode 100644 index 4aeb6e41e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/HelloControllerWithGlobalApiResponse.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app53; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller with global api response. - */ -@RestController -@RequestMapping(path = "/global") -class HelloControllerWithGlobalApiResponse { - - /** - * List with no api response list. - * - * @return the list - */ - @Operation(description = "Some operation", responses = { - @ApiResponse(responseCode = "204", description = "Explicit description for this response") }) - @ResponseStatus(HttpStatus.NO_CONTENT) - @GetMapping(value = "/hello1", produces = MediaType.APPLICATION_JSON_VALUE) - List listWithNoApiResponse() { - return null; - } - - /** - * List with default response status list. - * - * @return the list - */ - @Operation(description = "Some operation") - @ApiResponse(responseCode = "200", description = "Explicit description for this response") - @GetMapping(value = "/hello2", produces = MediaType.APPLICATION_JSON_VALUE) - List listWithDefaultResponseStatus() { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/SpringDocApp53Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/SpringDocApp53Test.java deleted file mode 100644 index 907519058..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app53/SpringDocApp53Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app53; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 53 test. - */ -class SpringDocApp53Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/HelloController.java deleted file mode 100644 index c62439f8d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/HelloController.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app54; - -import com.fasterxml.jackson.annotation.JsonView; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Gets meal party. - * - * @param mealPartyId the meal party id - * @return the meal party - */ - @GetMapping(value = "/parties/{id}") - @JsonView(Views.Public.class) - @Operation(summary = "Gets meal party details [Meal party admin restricted]") - @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Successfully retrieved the meal party") }) - public MealParty getMealParty(@PathVariable("id") long mealPartyId) { - return null; - } - - /** - * Save meal party response entity. - * - * @param p the p - * @return the response entity - */ - @JsonView(Views.MealPartyAdmin.class) - @PostMapping(value = "/parties") - public ResponseEntity saveMealParty(@JsonView(Views.Public.class) @RequestBody MealParty p) { - return null; - } - - /** - * Save meal new party response entity. - * - * @param p the p - * @return the response entity - */ - @JsonView(Views.MealPartyAdmin.class) - @PostMapping(value = "/new-parties") - public ResponseEntity saveMealNewParty(@JsonView(Views.Public.class) @org.springframework.web.bind.annotation.RequestBody MealParty p) { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/MealParty.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/MealParty.java deleted file mode 100644 index 5f5f4020f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/MealParty.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app54; - -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonView; - -/** - * The type Meal party. - */ -class MealParty { - /** - * The Name. - */ - @JsonView(Views.Public.class) - private String name; - - /** - * The Members. - */ - @JsonView(Views.MealPartyAdmin.class) - private List members = new ArrayList<>(); -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/SpringDocApp54Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/SpringDocApp54Test.java deleted file mode 100644 index c01ac10c9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/SpringDocApp54Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app54; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 54 test. - */ -class SpringDocApp54Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/Views.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/Views.java deleted file mode 100644 index d18177afe..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app54/Views.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app54; - -/** - * The interface Views. - */ -public interface Views { - /** - * The interface Public. - */ - public interface Public { - } - - /** - * The interface Meal party admin. - */ - public interface MealPartyAdmin extends Public { - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/HelloController.java deleted file mode 100644 index c1cd59288..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/HelloController.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app55; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.http.HttpStatus; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ResponseStatus; - -/** - * The type Hello controller. - */ -@Controller -@Tag(name = "health") -class HelloController { - - /** - * Ping endpoint used for health checks. - * @return the boolean - */ - @RequestMapping(value = "/ping", method = RequestMethod.GET) - @Operation(summary = "Simple health check") - @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public Boolean ping() { - return true; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/SpringDocApp55Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/SpringDocApp55Test.java deleted file mode 100644 index 949c6cd7e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app55/SpringDocApp55Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app55; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 55 test. - */ -class SpringDocApp55Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/GlobalExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/GlobalExceptionHandler.java deleted file mode 100644 index a9fdfc46d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/GlobalExceptionHandler.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app56; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -/** - * The type Global exception handler. - */ -@RestControllerAdvice -class GlobalExceptionHandler { - /** - * Handle unhandled error error dto. - * - * @return the error dto - */ - @ExceptionHandler(Exception.class) - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ApiResponse( - responseCode = "500", - description = "Internal server error", - content = @Content( - mediaType = MediaType.APPLICATION_JSON_VALUE, - schema = @Schema(implementation = ErrorDTO.class) - ) - ) - ErrorDTO handleUnhandledError() { - return new ErrorDTO("internal error: "); - } - - /** - * The type Error dto. - */ - class ErrorDTO { - /** - * The Error message. - */ - private String errorMessage; - - /** - * Instantiates a new Error dto. - * - * @param errorMessage the error message - */ - ErrorDTO(String errorMessage) { - this.errorMessage = errorMessage; - } - - /** - * Gets error message. - * - * @return the error message - */ - public String getErrorMessage() { - return errorMessage; - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/HelloController.java deleted file mode 100644 index f5b696dc2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/HelloController.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app56; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons string. - * - * @return the string - */ - @GetMapping("/persons") - public String persons() { - return "OK"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/SpringDocApp56Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/SpringDocApp56Test.java deleted file mode 100644 index 6fa54f02e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app56/SpringDocApp56Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app56; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 56 test. - */ -class SpringDocApp56Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/HelloController.java deleted file mode 100644 index 1e88921ca..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/HelloController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app57; - -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Gets text. - * - * @param name the name - * @return the text - */ - @GetMapping("/{name:.+}") - public ResponseEntity getText(@Parameter(description = "desc", required = true) @PathVariable String name) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/SpringDocApp57Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/SpringDocApp57Test.java deleted file mode 100644 index 085514048..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app57/SpringDocApp57Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app57; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 57 test. - */ -class SpringDocApp57Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/HelloController.java deleted file mode 100644 index bc90da29c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/HelloController.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app58; - -import com.fasterxml.jackson.databind.JsonNode; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Example object. - * - * @param json the json - * @return the object - */ - @PostMapping("/examplePost") - @Operation(summary = "schema example") - public Object example(@Parameter(schema = @Schema(hidden = true)) JsonNode json) { - return null; - } - - /** - * Test. - * - * @param json the json - */ - @GetMapping("/example") - public void test(@Parameter(schema = @Schema(hidden = true)) JsonNode json) { - } - - /** - * Foobar. - * - * @param bar the bar - */ - @GetMapping(value = "/foo") - public void foobar(@Parameter(description = "User", name = "user", - schema = @Schema(implementation = PersonDTO.class)) @RequestParam("bar") String bar) { - - } - - /** - * Foobar 1. - * - * @param bar the bar - */ - @GetMapping(value = "/foo1") - public void foobar1(@Parameter(description = "User", name = "user", - content = @Content(mediaType = "application/json", - schema = @Schema(implementation = PersonDTO.class))) @RequestParam("bar") String bar) { - - } - - /** - * The type Person dto. - */ - class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/SpringDocApp58Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/SpringDocApp58Test.java deleted file mode 100644 index e9326afa4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app58/SpringDocApp58Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app58; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 58 test. - */ -class SpringDocApp58Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/HelloController.java deleted file mode 100644 index 45c8db86d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/HelloController.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app59; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - /** - * Test. - */ - @Deprecated - @GetMapping("/example") - public void test() { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/SpringDocApp59Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/SpringDocApp59Test.java deleted file mode 100644 index 6779a221d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app59/SpringDocApp59Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app59; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 59 test. - */ -class SpringDocApp59Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/HelloController.java deleted file mode 100644 index a7b5ffdb6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app6; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.ExampleObject; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Say hello response entity. - * - * @return the response entity - */ - @Operation(summary = "Get Something by key", responses = { - @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(oneOf = { - String.class, Integer.class }), examples = { - @ExampleObject(name = "The String example", value = "urgheiurgheirghieurg"), - @ExampleObject(name = "The Integer example", value = "311414") })), - @ApiResponse(responseCode = "404", description = "Thing not found"), - @ApiResponse(responseCode = "401", description = "Authentication Failure") }) - @GetMapping(value = "/hello") - ResponseEntity sayHello() { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java deleted file mode 100644 index f5e18904b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app6; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 6 test. - */ -class SpringDocApp6Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/HelloController.java deleted file mode 100644 index e51a5b071..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/HelloController.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app60; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * List 1 list. - * - * @param page the page - * @param size the size - * @return the list - */ - @GetMapping("/hello1") - @Operation(summary = "summary1") - @Parameters({ - @Parameter(name = "page", description = "The page"), - @Parameter(name = "size", description = "The size") - }) - public List list1(String page, String size) { - return null; - } - - /** - * List 2 list. - * - * @param page the page - * @param size the size - * @param sort the sort - * @return the list - */ - @GetMapping("/hello2") - @Operation(summary = "summary2") - @QuerySort - @QueryPaging - public List list2(String page, String size, String sort) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/QueryPaging.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/QueryPaging.java deleted file mode 100644 index 649ae149a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/QueryPaging.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app60; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; - -/** - * The interface Query paging. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.METHOD }) -@Parameters({ - @Parameter(name = "page", description = "desc page from Annotated interface"), - @Parameter(name = "size", description = "desc page from Annotated interface") -}) -public @interface QueryPaging { -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/QuerySort.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/QuerySort.java deleted file mode 100644 index da3ac664e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/QuerySort.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app60; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import io.swagger.v3.oas.annotations.Parameter; - -/** - * The interface Query sort. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.METHOD }) -@Parameter(name = "sort", description = "desc sort from Annotated interface") -public @interface QuerySort { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/SpringDocApp60Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/SpringDocApp60Test.java deleted file mode 100644 index 4e607b47e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app60/SpringDocApp60Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app60; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 60 test. - */ -class SpringDocApp60Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/HelloController.java deleted file mode 100644 index 970eebc77..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/HelloController.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app61; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - - /** - * Persons string. - * - * @param name the name - * @param phone the phone - * @param createdFrom the created from - * @param createdRange the created range - * @return the string - */ - @Operation(description = "List", parameters = { - @Parameter(description = "Name", name = "name", in = ParameterIn.QUERY), - @Parameter(description = "Phone", name = "phone", in = ParameterIn.QUERY), - @Parameter(description = "createdFrom", name = "createdFrom", in = ParameterIn.QUERY, content = @Content(array = @ArraySchema(schema = @Schema(type = "string")))), - @Parameter(description = "createdRange", name = "createdRange", in = ParameterIn.QUERY, array = @ArraySchema(schema = @Schema(type = "string", format = "date"), minItems = 2, maxItems = 2)) - }) - @GetMapping(value = "/persons-with-user") - public String persons(String name, String phone, String createdFrom, String createdRange) { - return "OK"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/SpringDocApp61Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/SpringDocApp61Test.java deleted file mode 100644 index 050afb6d7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app61/SpringDocApp61Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app61; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 61 test. - */ -class SpringDocApp61Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/BaseController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/BaseController.java deleted file mode 100644 index 209ed33af..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/BaseController.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app62; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.springframework.core.annotation.AliasFor; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The interface Base controller. - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping -public @interface BaseController { - /** - * Value string [ ]. - * - * @return the string [ ] - */ - @AliasFor(annotation = RequestMapping.class) - String[] value() default {}; - - /** - * Produces string [ ]. - * - * @return the string [ ] - */ - @AliasFor(annotation = RequestMapping.class) - String[] produces() default { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }; -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/SpringDocApp62Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/SpringDocApp62Test.java deleted file mode 100644 index 08f628182..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/SpringDocApp62Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app62; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 62 test. - */ -class SpringDocApp62Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/TestController.java deleted file mode 100644 index cc61e35eb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app62/TestController.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app62; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -/** - * The type Test controller. - */ -@BaseController -@Tag(name = "Test Controller") -class TestController { - - /** - * Test string. - * - * @param accept the accept - * @return the string - */ - @RequestMapping(value = "/test", method = RequestMethod.GET) - @Operation(summary = "This is the test endpoint") - public String test(@RequestHeader("Accept") String accept) { - return "This is a test"; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/HelloController.java deleted file mode 100644 index 471f45b20..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/HelloController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app63; - -import java.util.Locale; - -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.servlet.http.HttpSession; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test. - * - * @param header the header - * @param request the request - * @param response the response - * @param locale the locale - * @param hello the hello - */ - @GetMapping("/test") - public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, - String hello) { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java deleted file mode 100644 index aa1cf7088..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app63/SpringDocApp63Test.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app63; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - - -/** - * The type Spring doc app 63 test. - */ -@TestPropertySource(properties = { - "springdoc.packagesToScan=hell,hello1, hello.me", - "springdoc.packagesToExclude=test.org.springdoc.api.app63.65" }) -class SpringDocApp63Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/HelloController.java deleted file mode 100644 index 758acfb7d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app64; - -import io.swagger.v3.oas.annotations.Operation; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test 1. - * - * @param hello the hello - */ - @GetMapping("/v1/test") - public void test1(String hello) { - } - - /** - * Test 2 string. - * - * @param from the from - * @return the string - */ - @GetMapping(value = "/api/balance/abcd") - @Operation(summary = "This is the test endpoint") - public String test2(String from) { - return "This is a fake test"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java deleted file mode 100644 index 2251b372d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app64/SpringDocApp64Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app64; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 64 test. - */ -@TestPropertySource(properties = "springdoc.paths-to-match=/v1, /api/**") -class SpringDocApp64Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/HelloController.java deleted file mode 100644 index e479d9e88..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app65; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@Tag(name = "Health", description = "Health check / ping API") -@RestController -class HelloController { - - /** - * Ping response entity. - * - * @return the response entity - */ - @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") - @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) - public ResponseEntity ping() { - return ResponseEntity.ok("Healthy"); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java deleted file mode 100644 index 102afe729..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app65/SpringDocApp65Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app65; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 65 test. - */ -class SpringDocApp65Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/DefaultHealthCheckApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/DefaultHealthCheckApi.java deleted file mode 100644 index 651299d3b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/DefaultHealthCheckApi.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66; - -import java.time.LocalDate; - -import io.swagger.v3.oas.annotations.Hidden; - -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Default health check api. - */ -@RestController -@Hidden -class DefaultHealthCheckApi { - - /** - * Test date echo string. - * - * @param date the date - * @return the string - */ - @GetMapping("/test/date/echo/{date}") - public String testDateEcho(@DateTimeFormat(pattern = "yyyyMMdd") @PathVariable LocalDate date) { - return date.toString(); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/HelloController.java deleted file mode 100644 index dc32d1cfa..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/HelloController.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@Tag(name = "Health", description = "Health check / ping API") -@RestController -class HelloController { - - /** - * Ping response entity. - * - * @param possiblyInjectedByAspect the possibly injected by aspect - * @return the response entity - */ - @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") - @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) - public ResponseEntity ping(UndocumentedClass possiblyInjectedByAspect) { - return ResponseEntity.ok("Healthy"); - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java deleted file mode 100644 index c54781196..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/SpringDocApp66Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 66 test. - */ -class SpringDocApp66Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/UndocumentedClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/UndocumentedClass.java deleted file mode 100644 index 9404d0987..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app66/UndocumentedClass.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app66; - -import io.swagger.v3.oas.annotations.Hidden; - -/** - * The type Undocumented class. - */ -@Hidden -class UndocumentedClass { - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/HelloController.java deleted file mode 100644 index e60ca14cd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/HelloController.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app67; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping(path = "/demo", - produces = MediaType.TEXT_PLAIN_VALUE) -class HelloController { - - /** - * Operation 1 string. - * - * @return the string - */ - @GetMapping("operation1") - @Operation(summary = "Operation 1 (expected result - no parameters)") - public String operation1() { - return "operation1"; - } - - /** - * Operation 2 string. - * - * @return the string - */ - @GetMapping("operation2") - @Operation(summary = "Operation 2 (expected result - 3 parameters)", parameters = { - @Parameter(name = "pageNumber", description = "page number", - in = ParameterIn.QUERY, schema = @Schema(type = "integer")), - @Parameter(name = "pageSize", description = "page size", - in = ParameterIn.QUERY, schema = @Schema(type = "integer")), - @Parameter(name = "sort", description = "sort specification", - in = ParameterIn.QUERY, schema = @Schema(type = "string")) - }) - public String operation2() { - return "operation2"; - } - - /** - * Operation 3 string. - * - * @return the string - */ - @GetMapping("operation3") - @Operation(summary = "Operation 3 (expected result - 3 parameters)") - @Parameters({ - @Parameter(name = "pageNumber", description = "page number", - in = ParameterIn.QUERY, schema = @Schema(type = "integer")), - @Parameter(name = "pageSize", description = "page size", - in = ParameterIn.QUERY, schema = @Schema(type = "integer")), - @Parameter(name = "sort", description = "sort specification", - in = ParameterIn.QUERY, schema = @Schema(type = "string")) - }) - public String operation3() { - return "operation3"; - } - - /** - * Operation 4 string. - * - * @return the string - */ - @GetMapping("operation4") - @Operation(summary = "Operation 4 (expected result - 3 parameters)") - @QueryPaging - @QuerySort - public String operation4() { - return "operation4"; - } - - /** - * The interface Query paging. - */ - @Retention(RetentionPolicy.RUNTIME) - @Target({ ElementType.METHOD }) - @Parameters({ - @Parameter(name = "pageNumber", description = "page number", - in = ParameterIn.QUERY, schema = @Schema(type = "integer")), - @Parameter(name = "pageSize", description = "page size", - in = ParameterIn.QUERY, schema = @Schema(type = "integer")) - }) - public @interface QueryPaging { - - } - - /** - * The interface Query sort. - */ - @Retention(RetentionPolicy.RUNTIME) - @Target({ ElementType.METHOD }) - @Parameters({ - @Parameter(name = "sort", description = "sort specification", - in = ParameterIn.QUERY, schema = @Schema(type = "string")) - }) - public @interface QuerySort { - - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java deleted file mode 100644 index 01dd40162..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app67/SpringDocApp67Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app67; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 67 test. - */ -class SpringDocApp67Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/HelloController.java deleted file mode 100644 index a9a837cd8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/HelloController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app69; - -import java.util.concurrent.Callable; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Gets tasks. - * - * @param str the str - * @return the tasks - */ - @RequestMapping(value = "/tasks", method = RequestMethod.GET) - private Callable> getTasks(String str) { - return null; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/PersonDTO.java deleted file mode 100644 index 614c352d5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/PersonDTO.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app69; - -/** - * The type Person dto. - */ -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java deleted file mode 100644 index 5e2d3632c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app69/SpringDocApp69Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app69; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 69 test. - */ -class SpringDocApp69Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java deleted file mode 100644 index 926ba4511..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.parameters.RequestBody; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Search employee. - * - * @param test the test - */ - @Operation(summary = "test Request") - @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) - @PostMapping("/test") - public void searchEmployee(String test) { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java deleted file mode 100644 index a6fee1e8d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 7 test. - */ -class SpringDocApp7Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/HelloController.java deleted file mode 100644 index 99bb18f19..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/HelloController.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app70; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import test.org.springdoc.api.app70.customizer.CustomizedOperation; -import test.org.springdoc.api.app70.customizer.CustomizedParameter; -import test.org.springdoc.api.app70.model.ApiType; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test api type. - * - * @param test the test - * @return the api type - */ - @CustomizedOperation - @Operation(description = "Some operation") - @GetMapping("/example/{test}") - public ApiType test(@PathVariable @CustomizedParameter @Parameter(description = "Parameter description") String test) { - return new ApiType(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java deleted file mode 100644 index 1b400bae2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/SpringDocApp70Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app70; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 70 test. - */ -class SpringDocApp70Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedOperation.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedOperation.java deleted file mode 100644 index 33984147c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedOperation.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app70.customizer; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * The interface Customized operation. - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface CustomizedOperation { - /** - * Addition string. - * - * @return the string - */ - String addition() default "customized operation!"; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedParameter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedParameter.java deleted file mode 100644 index 0cf44ca69..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedParameter.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app70.customizer; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * The interface Customized parameter. - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface CustomizedParameter { - /** - * Addition string. - * - * @return the string - */ - String addition() default "customized parameter!"; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedProperty.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedProperty.java deleted file mode 100644 index 1c42e60bd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/CustomizedProperty.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app70.customizer; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * The interface Customized property. - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface CustomizedProperty { - /** - * Addition string. - * - * @return the string - */ - String addition() default "customized property!"; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/OperationCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/OperationCustomizer.java deleted file mode 100644 index ed8d5cf2f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/OperationCustomizer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app70.customizer; - -import io.swagger.v3.oas.models.Operation; - -import org.springframework.stereotype.Component; -import org.springframework.web.method.HandlerMethod; - -/** - * The type Operation customizer. - */ -@Component -class OperationCustomizer implements org.springdoc.core.customizers.OperationCustomizer { - /** - * Customize operation. - * - * @param operation the operation - * @param handlerMethod the handler method - * @return the operation - */ - @Override - public Operation customize(Operation operation, HandlerMethod handlerMethod) { - CustomizedOperation annotation = handlerMethod.getMethodAnnotation(CustomizedOperation.class); - if (annotation != null) { - operation.description(operation.getDescription() + ", " + annotation.addition()); - } - return operation; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/ParameterCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/ParameterCustomizer.java deleted file mode 100644 index 8611b8c12..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/ParameterCustomizer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app70.customizer; - -import io.swagger.v3.oas.models.parameters.Parameter; - -import org.springframework.core.MethodParameter; -import org.springframework.stereotype.Component; - -/** - * The type Parameter customizer. - */ -@Component -class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { - /** - * Customize parameter. - * - * @param parameterModel the parameter model - * @param methodParameter the method parameter - * @return the parameter - */ - @Override - public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { - CustomizedParameter annotation = methodParameter.getParameterAnnotation(CustomizedParameter.class); - if (annotation != null) { - parameterModel.description(parameterModel.getDescription() + ", " + annotation.addition()); - } - return parameterModel; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/PropertyCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/PropertyCustomizer.java deleted file mode 100644 index 3a71c3dbc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/customizer/PropertyCustomizer.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app70.customizer; - -import java.lang.annotation.Annotation; -import java.time.Duration; -import java.util.Collections; -import java.util.Optional; -import java.util.stream.Stream; - -import com.fasterxml.jackson.databind.JavaType; -import io.swagger.v3.core.converter.AnnotatedType; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.StringSchema; -import org.springdoc.core.providers.ObjectMapperProvider; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * The type Property customizer. - */ -@Component -class PropertyCustomizer implements org.springdoc.core.customizers.PropertyCustomizer { - - @Autowired - ObjectMapperProvider objectMapperProvider; - - /** - * Customize schema. - * - * @param property the property - * @param type the type - * @return the schema - */ - @Override - public Schema customize(Schema property, AnnotatedType type) { - Annotation[] ctxAnnotations = type.getCtxAnnotations(); - if (ctxAnnotations == null) { - return property; - } - - Optional propertyAnnotation = Stream.of(ctxAnnotations) - .filter(CustomizedProperty.class::isInstance) - .findFirst() - .map(CustomizedProperty.class::cast); - - JavaType javaType = objectMapperProvider.jsonMapper().constructType(type.getType()); - if (javaType.getRawClass().equals(Duration.class)) { - property = new StringSchema().format("duration").properties(Collections.emptyMap()); - } - return property; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/model/ApiType.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/model/ApiType.java deleted file mode 100644 index c79da0218..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app70/model/ApiType.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app70.model; - -import java.time.Duration; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import test.org.springdoc.api.app70.customizer.CustomizedProperty; - -/** - * The type Api type. - */ -public class ApiType { - /** - * The Some property. - */ - @CustomizedProperty - @Schema(description = "Test description") - @JsonProperty("someProperty") - private Duration someProperty; - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/Dog.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/Dog.java deleted file mode 100644 index edcf892b4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/Dog.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app71; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - - -/** - * The type Dog. - */ -@Schema(name = "Dog") -class Dog { - - /** - * The Display name. - */ - @JsonProperty("display_name") - @Schema( - name = "display_name", - description = "A name given to the Dog", - example = "Fido" - ) - String displayName; - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/HelloController.java deleted file mode 100644 index 4d1e0c56b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/HelloController.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app71; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons string. - * - * @param dog the dog - * @return the string - */ - @PostMapping("/persons") - public String persons(Dog dog) { - return null; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java deleted file mode 100644 index 051921c85..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app71/SpringDocApp71Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app71; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 71 test. - */ -class SpringDocApp71Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java deleted file mode 100644 index c553ef06b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/BlockingAutoConfigurationTest.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app72; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.FilteredClassLoader; -import org.springframework.boot.test.context.runner.ApplicationContextRunner; -import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.context.annotation.Bean; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * The type Blocking auto configuration test. - */ -class BlockingAutoConfigurationTest { - - /** - * The Context runner. - */ - private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() - .withUserConfiguration(TestApp.class); - - - /** - * Configurations not loaded when application is not web. - */ - @Test - void configurations_not_loaded_when_application_is_not_web() { - new ApplicationContextRunner() - .withUserConfiguration(TestApp.class) - .run(context -> assertThat(context) - .hasNotFailed() - .doesNotHaveBean("openApiResource") - .doesNotHaveBean("actuatorProvider") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - /** - * Actuator configuration not loaded when not enabled explicitly. - */ - @Test - void actuator_configuration_not_loaded_when_not_enabled_explicitly() { - contextRunner - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .doesNotHaveBean("actuatorPprrovider") - .hasBean("multipleOpenApiResource") - ); - } - - /** - * Configurations not loaded when disabled. - */ - @Test - void configurations_not_loaded_when_disabled() { - contextRunner - .withPropertyValues("springdoc.api-docs.enabled=false") - .run(context -> assertThat(context) - .hasNotFailed() - .doesNotHaveBean("openApiResource") - .doesNotHaveBean("actuatorProvider") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - /** - * Configurations not loaded when mvc is not on class path. - */ - @Test - void configurations_not_loaded_when_mvc_is_not_on_class_path() { - contextRunner - .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) - .run(context -> assertThat(context) - .hasNotFailed() - .doesNotHaveBean("openApiResource") - .doesNotHaveBean("actuatorProvider") - .doesNotHaveBean("multipleOpenApiResource") - ); - - } - - /** - * The type Test app. - */ - @SpringBootApplication - static class TestApp { - /** - * Test grouped open api grouped open api. - * - * @return the grouped open api - */ - @Bean - GroupedOpenApi testGroupedOpenApi() { - return GroupedOpenApi.builder() - .group("test-group") - .packagesToScan("org.test") - .build(); - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java deleted file mode 100644 index 01a1c1945..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app72; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.runner.WebApplicationContextRunner; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * The type Cache auto configuration test 1. - */ -class CacheAutoConfigurationTest1 { - - /** - * The Context runner. - */ - private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() - .withUserConfiguration(TestApp.class); - - /** - * Cache configuration loaded when not disabled explicitly. - */ - @Test - void cache_configuration_loaded_when_not_disabled_explicitly() { - contextRunner - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .doesNotHaveBean("springdocBeanFactoryPostProcessor") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - /** - * Cache configuration loaded when disabled explicitly. - */ - @Test - void cache_configuration_loaded_when_disabled_explicitly() { - contextRunner - .withPropertyValues("springdoc.cache.disabled=false") - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .doesNotHaveBean("springdocBeanFactoryPostProcessor") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - /** - * Cache configurations successfully disabled. - */ - @Test - void cache_configurations_successfully_disabled() { - contextRunner - .withPropertyValues("springdoc.cache.disabled=true") - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .hasBean("springdocBeanFactoryPostProcessor") - .doesNotHaveBean("multipleOpenApiResource") - ); - } - - /** - * Group configuration loaded. - */ - @Test - void group_configuration_loaded() { - contextRunner - .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .hasBean("multipleOpenApiResource") - .hasBean("springdocBeanFactoryPostProcessor") - ); - } - - - /** - * The type Test app. - */ - @EnableAutoConfiguration - static class TestApp { - - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java deleted file mode 100644 index ae17c3212..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app72/GroupAutoConfigurationTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app72; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.models.GroupedOpenApi; - -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.context.annotation.Bean; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * The type Group auto configuration test. - */ -class GroupAutoConfigurationTest { - - /** - * The Context runner. - */ - private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() - .withUserConfiguration(TestApp.class); - - /** - * Group configuration loaded. - */ - @Test - void group_configuration_loaded() { - contextRunner - .run(context -> assertThat(context) - .hasNotFailed() - .hasBean("openApiResource") - .hasBean("springdocBeanFactoryPostProcessor") - .hasBean("multipleOpenApiResource") - ); - } - - /** - * The type Test app. - */ - @EnableAutoConfiguration - static class TestApp { - /** - * Test grouped open api grouped open api. - * - * @return the grouped open api - */ - @Bean - GroupedOpenApi testGroupedOpenApi() { - return GroupedOpenApi.builder() - .group("test-group") - .packagesToScan("org.test") - .build(); - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/HelloController.java deleted file mode 100644 index 66b2debc0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/HelloController.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app73; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping({ "/{country_code}/persons/", "/persons" }) -class HelloController { - - /** - * Delete. - * - * @param countryCode the country code - * @param id the id - */ - @DeleteMapping("/{id}") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void delete(@Parameter(name = "country_code", in = ParameterIn.QUERY) String countryCode, @PathVariable("id") String id) { - - } - - /** - * Get string. - * - * @param countryCode the country code - * @param id the id - * @return the string - */ - @GetMapping("/{id}") - public String get(@Parameter(name = "country_code", in = ParameterIn.QUERY) String countryCode, @PathVariable("id") String id) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java deleted file mode 100644 index 330a6ffdf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app73/SpringDocApp73Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app73; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 73 test. - */ -class SpringDocApp73Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/HelloController.java deleted file mode 100644 index aab5ab2c0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/HelloController.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app74; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.ExampleObject; -import io.swagger.v3.oas.annotations.parameters.RequestBody; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Post my request body string. - * - * @param myRequestBody the my request body - * @return the string - */ - @PostMapping("/test") - @RequestBody( - content = @Content( - examples = @ExampleObject( - value = "sample" - ) - ) - ) - public String postMyRequestBody( - String myRequestBody) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java deleted file mode 100644 index 3006d60e5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app74/SpringDocApp74Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app74; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 74 test. - */ -class SpringDocApp74Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/HelloController.java deleted file mode 100644 index 5cd7892de..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/HelloController.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app75; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Post my request body 1 string. - * - * @return the string - */ - @PostMapping("/test1/{uuid}") - @Operation(summary = "Example api that realize an ECHO operation", - description = "The result of the echo is the input value of the api", - parameters = { @Parameter(in = ParameterIn.PATH, - name = "uuid", - required = true, - description = "Is the identification of the document", - schema = @Schema(type = "string", - example = "uuid")) } - - - ) - @ApiResponses(value = { - @ApiResponse(description = "Successful Operation", - responseCode = "200", - content = @Content(mediaType = "application/json", - schema = @Schema(implementation = PersonDTO.class))), - @ApiResponse(responseCode = "201", - description = "other possible response") - }) - public String postMyRequestBody1() { - return null; - } - - /** - * Post my request body 2 string. - * - * @return the string - */ - @PostMapping("/test2/{uuid}") - @Operation(summary = "Example api that realize an ECHO operation", - description = "The result of the echo is the input value of the api", - responses = { - @ApiResponse(description = "Successful Operation", - responseCode = "200", - content = @Content(mediaType = "application/json", - schema = @Schema(implementation = PersonDTO.class))), - @ApiResponse(responseCode = "201", - description = "other possible response") - }, - parameters = { @Parameter(in = ParameterIn.PATH, - name = "uuid", - required = true, - description = "Is the identification of the document", - schema = @Schema(type = "string", - example = "uuid")) } - - - ) - public String postMyRequestBody2() { - return null; - } - - /** - * Post my request body 3 string. - * - * @return the string - */ - @PostMapping("/test3/{uuid}") - @Operation(summary = "Example api that realize an ECHO operation", - description = "The result of the echo is the input value of the api", - parameters = { @Parameter(in = ParameterIn.PATH, - name = "uuid", - required = true, - description = "Is the identification of the document", - schema = @Schema(type = "string", - example = "uuid")) } - - - ) - @ApiResponse(responseCode = "201", - description = "other possible response") - public String postMyRequestBody3() { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/PersonDTO.java deleted file mode 100644 index e07dbfcea..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/PersonDTO.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app75; - -/** - * The type Person dto. - */ -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/RestResponseEntityExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/RestResponseEntityExceptionHandler.java deleted file mode 100644 index 4d0feeddb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/RestResponseEntityExceptionHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app75; - -import java.util.List; - -import jakarta.servlet.http.HttpServletRequest; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; - -/** - * The type Rest response entity exception handler. - */ -@ControllerAdvice -class RestResponseEntityExceptionHandler - extends ResponseEntityExceptionHandler { - /** - * Bad request response entity. - * - * @param req the req - * @param exception the exception - * @return the response entity - */ - @ResponseStatus(value = HttpStatus.OK) - @ExceptionHandler({ Exception.class }) - public ResponseEntity> badRequest(HttpServletRequest req, Exception exception) { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java deleted file mode 100644 index 5dbd1acc9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app75/SpringDocApp75Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app75; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 75 test. - */ -class SpringDocApp75Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java deleted file mode 100644 index fb8df1e31..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/HelloController.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app76; - -import io.swagger.v3.oas.annotations.security.SecurityRequirements; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Secured string. - * - * @return the string - */ - @GetMapping("/secure") - @ResponseBody - public String secured() { - return "It works!"; - } - - /** - * Open string. - * - * @return the string - */ - @GetMapping("/open") - @ResponseBody - @SecurityRequirements - public String open() { - return "It works!"; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java deleted file mode 100644 index 422cb11fb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app76/SpringDocApp76Test.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app76; - -import java.util.Arrays; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.security.SecurityRequirement; -import io.swagger.v3.oas.models.security.SecurityScheme; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -/** - * The type Spring doc app 76 test. - */ -class SpringDocApp76Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp { - /** - * Open api open api. - * - * @return the open api - */ - @Bean - public OpenAPI openAPI() { - return new OpenAPI() - .components(new Components().addSecuritySchemes("bearer-jwt", - new SecurityScheme() - .type(SecurityScheme.Type.HTTP) - .scheme("bearer") - .bearerFormat("JWT")) - ) - .addSecurityItem( - new SecurityRequirement().addList("bearer-jwt", Arrays.asList("read", "write"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/HelloController.java deleted file mode 100644 index 6eb96004e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/HelloController.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app77; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.extensions.Extension; -import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import jakarta.validation.Valid; -import org.hibernate.validator.constraints.NotBlank; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons. - * - * @param name the name - */ - @ApiResponse(content = @Content(schema = @Schema(type = "string")), extensions = @Extension(properties = @ExtensionProperty(name = "x-is-file", value = "true"))) - @GetMapping(value = "/persons") - public void persons(@Valid @NotBlank String name) { - - } - - - /** - * Persons 2. - * - * @param name the name - */ - @Operation(responses = @ApiResponse(content = @Content(schema = @Schema(type = "string")), extensions = @Extension(properties = @ExtensionProperty(name = "x-is-file", value = "true")))) - @GetMapping(value = "/persons2") - public void persons2(@Valid @NotBlank String name) { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/SpringDocApp77Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/SpringDocApp77Test.java deleted file mode 100644 index af48953bf..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app77/SpringDocApp77Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app77; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 77 test. - */ -class SpringDocApp77Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/HelloController.java deleted file mode 100644 index a7099fc40..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/HelloController.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app78; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Gets person 1. - * - * @param str the str - * @return the person 1 - */ - @RequestMapping(value = "/person1", method = RequestMethod.GET) - private CompletionStage> getPerson1(String str) { - return null; - } - - /** - * Gets person 2. - * - * @param str the str - * @return the person 2 - */ - @RequestMapping(value = "/person2", method = RequestMethod.GET) - private CompletableFuture getPerson2(String str) { - return null; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/PersonDTO.java deleted file mode 100644 index ab764145b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/PersonDTO.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app78; - -/** - * The type Person dto. - */ -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java deleted file mode 100644 index e16cd0967..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app78/SpringDocApp78Test.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app78; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 78 test. - */ -class SpringDocApp78Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/HelloController.java deleted file mode 100644 index fb6f299bd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/HelloController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app79; - -import java.util.Optional; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Echo string. - * - * @param text the text - * @return the string - */ - @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test") - public String echo(@RequestParam Optional text) { - return text.orElse("not-specified"); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java deleted file mode 100644 index 131461c13..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app79/SpringDocApp79Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app79; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - - -/** - * The type Spring doc app 79 test. - */ -class SpringDocApp79Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/HelloController.java deleted file mode 100644 index bcb51786d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/HelloController.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app8; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test. - * - * @param hello the hello - */ - @GetMapping("/test") - public void test(String hello) { - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java deleted file mode 100644 index 9b42f39b0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app8; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - - -/** - * The type Spring doc app 8 test. - */ -class SpringDocApp8Test extends AbstractSpringDocTest { - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc.perform(get("/myapp" + Constants.DEFAULT_API_DOCS_URL).contextPath("/myapp")) - .andExpect(status().isOk()); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/HelloController.java deleted file mode 100644 index d7f13a317..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/HelloController.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app80; - -import java.net.URISyntaxException; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/api") -class HelloController { - - - /** - * Testpost 1 response entity. - * - * @param dto the dto - * @return the response entity - * @throws URISyntaxException the uri syntax exception - */ - @RequestMapping(value = "/testpost1", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity testpost1(@RequestBody TestObject dto) throws URISyntaxException { - return ResponseEntity.ok(dto); - } - - /** - * Testpost 2 response entity. - * - * @param dto the dto - * @return the response entity - * @throws URISyntaxException the uri syntax exception - */ - @RequestMapping(value = "/testpost2", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity testpost2(@RequestBody TestObject dto) throws URISyntaxException { - return ResponseEntity.ok(dto); - } - - /** - * Hello response entity. - * - * @return the response entity - * @throws URISyntaxException the uri syntax exception - */ - @RequestMapping(value = "/hello", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity hello() throws URISyntaxException { - return ResponseEntity.ok("Hello World"); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java deleted file mode 100644 index dcb068d88..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/SpringDocApp80Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app80; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.ActiveProfiles; - -/** - * The type Spring doc app 80 test. - */ -@ActiveProfiles("80") -class SpringDocApp80Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/TestObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/TestObject.java deleted file mode 100644 index cc6a2182b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app80/TestObject.java +++ /dev/null @@ -1,54 +0,0 @@ -package test.org.springdoc.api.app80; - -import java.time.LocalDateTime; - -/** - * The type Test object. - */ -class TestObject { - /** - * The String value. - */ - public String stringValue; - - /** - * The Local date time. - */ - public LocalDateTime localDateTime; - - /** - * Gets string value. - * - * @return the string value - */ - public String getStringValue() { - return stringValue; - } - - /** - * Sets string value. - * - * @param stringValue the string value - */ - public void setStringValue(String stringValue) { - this.stringValue = stringValue; - } - - /** - * Gets local date time. - * - * @return the local date time - */ - public LocalDateTime getLocalDateTime() { - return localDateTime; - } - - /** - * Sets local date time. - * - * @param localDateTime the local date time - */ - public void setLocalDateTime(LocalDateTime localDateTime) { - this.localDateTime = localDateTime; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/HelloController.java deleted file mode 100644 index ddd00b1ac..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/HelloController.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app81; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/api") -class HelloController { - - /** - * Test string. - * - * @return the string - */ - @RequestMapping - public String test() { - return "ok"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java deleted file mode 100644 index ac273d741..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app81/SpringDocApp81Test.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app81; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.startsWith; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -/** - * The type Spring doc app 81 test. - */ -class SpringDocApp81Test extends AbstractSpringDocTest { - - /** - * Test app. - * - * @throws Exception the exception - */ - @Test - protected void testApp() throws Exception { - mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))) - .andExpect(jsonPath("$.paths./api.get.tags[0]", containsString("hello-controller"))) - .andExpect(jsonPath("$.paths./api.get.operationId", startsWith("test"))) - .andExpect(jsonPath("$.paths./api.get.responses.200.content.['*/*'].schema.type", is("string"))) - .andExpect(jsonPath("$.paths./api.post.tags[0]", containsString("hello-controller"))) - .andExpect(jsonPath("$.paths./api.post.operationId", startsWith("test"))) - .andExpect(jsonPath("$.paths./api.post.responses.200.content.['*/*'].schema.type", is("string"))) - .andExpect(jsonPath("$.paths./api.put.tags[0]", containsString("hello-controller"))) - .andExpect(jsonPath("$.paths./api.put.operationId", startsWith("test"))) - .andExpect(jsonPath("$.paths./api.put.responses.200.content.['*/*'].schema.type", is("string"))) - .andExpect(jsonPath("$.paths./api.patch.tags[0]", containsString("hello-controller"))) - .andExpect(jsonPath("$.paths./api.patch.operationId", startsWith("test"))) - .andExpect(jsonPath("$.paths./api.patch.responses.200.content.['*/*'].schema.type", is("string"))) - .andExpect(jsonPath("$.paths./api.delete.tags[0]", containsString("hello-controller"))) - .andExpect(jsonPath("$.paths./api.delete.operationId", startsWith("test"))) - .andExpect(jsonPath("$.paths./api.delete.responses.200.content.['*/*'].schema.type", is("string"))) - .andExpect(jsonPath("$.paths./api.options.tags[0]", containsString("hello-controller"))) - .andExpect(jsonPath("$.paths./api.options.operationId", startsWith("test"))) - .andExpect(jsonPath("$.paths./api.options.responses.200.content.['*/*'].schema.type", is("string"))) - .andExpect(jsonPath("$.paths./api.head.tags[0]", containsString("hello-controller"))) - .andExpect(jsonPath("$.paths./api.head.operationId", startsWith("test"))) - .andExpect(jsonPath("$.paths./api.head.responses.200.content.['*/*'].schema.type", is("string"))); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/HelloController.java deleted file mode 100644 index 9e1496699..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/HelloController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app82; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - - /** - * Put response entity. - * - * @param configuration the configuration - * @param second the second - * @param personDTO the person dto - * @return the response entity - */ - @PutMapping(value = "/test") - public ResponseEntity put( - String configuration, - String second, PersonDTO personDTO) { - return null; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/PersonDTO.java deleted file mode 100644 index 5cdfbce51..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/PersonDTO.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app82; - -/** - * The type Person dto. - */ -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java deleted file mode 100644 index ce42a3b2a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app82/SpringDocApp82Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app82; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 82 test. - */ -class SpringDocApp82Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/HelloController.java deleted file mode 100644 index df5fd5935..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/HelloController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app83; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; - -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - - /** - * Put response entity. - * - * @param config the config - * @param configuration the configuration - * @param aFile the a file - * @return the response entity - */ - @RequestMapping(value = "/{config}", - method = RequestMethod.PUT, - consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }, - produces = { MediaType.APPLICATION_JSON_VALUE } - ) - public ResponseEntity put( - @PathVariable("config") final String config, - @Parameter(name = "configuration", schema = @Schema(name = "configuration", type = "string", format = "binary")) @RequestPart(value = "configuration") final PersonDTO configuration, - @RequestPart(value = "file") final MultipartFile aFile) { - return null; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/PersonDTO.java deleted file mode 100644 index 82b3d6afc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/PersonDTO.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app83; - -/** - * The type Person dto. - */ -class PersonDTO { - /** - * The Email. - */ - private String email; - - /** - * The First name. - */ - private String firstName; - - /** - * The Last name. - */ - private String lastName; - - /** - * Instantiates a new Person dto. - */ - public PersonDTO() { - } - - /** - * Instantiates a new Person dto. - * - * @param email the email - * @param firstName the first name - * @param lastName the last name - */ - public PersonDTO(final String email, final String firstName, final String lastName) { - this.email = email; - this.firstName = firstName; - this.lastName = lastName; - } - - /** - * Gets email. - * - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(final String email) { - this.email = email; - } - - /** - * Gets first name. - * - * @return the first name - */ - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(final String firstName) { - this.firstName = firstName; - } - - /** - * Gets last name. - * - * @return the last name - */ - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(final String lastName) { - this.lastName = lastName; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java deleted file mode 100644 index 8088cb240..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app83/SpringDocApp83Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app83; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 83 test. - */ -class SpringDocApp83Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/HelloController.java deleted file mode 100644 index 1e7476764..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/HelloController.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app84; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/api") -class HelloController { - - /** - * Persons string. - * - * @return the string - */ - @GetMapping("/persons") - public String persons() { - return "OK"; - } - - /** - * Persons string. - * - * @param toto the toto - * @return the string - */ - @GetMapping("/persons1") - public String persons(String toto) { - return "OK"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java deleted file mode 100644 index c48dcf3df..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app84/SpringDocApp84Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app84; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 84 test. - */ -class SpringDocApp84Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/HelloController.java deleted file mode 100644 index 8579bcf0a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/HelloController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app85; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/api") -class HelloController { - - /** - * Testme. - * - * @param id the id - */ - @PostMapping("/test/{id}") - @Operation( - parameters = { - @Parameter(ref = "#/components/parameters/paramA"), - @Parameter(ref = "#/components/parameters/paramB") - } - ) - public void testme(@PathVariable("id") String id) { - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java deleted file mode 100644 index 7ec0b689b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app85/SpringDocApp85Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app85; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 85 test. - */ -class SpringDocApp85Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/HelloController.java deleted file mode 100644 index 0a4158c98..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/HelloController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app86; - -import java.util.Locale; - -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.servlet.http.HttpSession; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test. - * - * @param header the header - * @param request the request - * @param response the response - * @param locale the locale - * @param hello the hello - */ - @GetMapping("/test") - public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, - String hello) { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java deleted file mode 100644 index a9ab50eb9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/SpringDocApp86Test.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app86; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 86 test. - */ -@TestPropertySource(properties = { - "springdoc.packagesToScan=test.org.springdoc.api.app86", - "springdoc.packagesToExclude=test.org.springdoc.api.app86.test" }) -class SpringDocApp86Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/test/HelloController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/test/HelloController2.java deleted file mode 100644 index d90c176c3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app86/test/HelloController2.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app86.test; - -import java.util.Locale; - -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.servlet.http.HttpSession; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller 2. - */ -@RestController -class HelloController2 { - - /** - * Test. - * - * @param header the header - * @param request the request - * @param response the response - * @param locale the locale - * @param hello the hello - */ - @GetMapping("/test2") - public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, - String hello) { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/HelloController.java deleted file mode 100644 index 54f05e75a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/HelloController.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app87; - -import java.util.UUID; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.parameters.RequestBody; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RestController; - - -/** - * The type Hello controller. - */ -@RestController("cookie") -class HelloController { - - /** - * Put item response entity. - * - * @param cookie the cookie - * @param itemId the item id - * @param item the item - * @return the response entity - */ - @PutMapping("/{itemId}") - @Operation - public ResponseEntity putItem( - @CookieValue( - name = "cookie" - ) String cookie, - @PathVariable UUID itemId, - @RequestBody Item item - ) { - return ResponseEntity.ok(item); - } - - /** - * The type Item. - */ - public static class Item { - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java deleted file mode 100644 index 4e42c27a7..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app87/SpringDocApp87Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app87; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 87 test. - */ -class SpringDocApp87Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/HelloController.java deleted file mode 100644 index 7f0d0755a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/HelloController.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app88; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons string. - * - * @return the string - */ - @GetMapping(value = "/persons") - public String persons() { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java deleted file mode 100644 index a9a47dc5c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app88/SpringDocApp88Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app88; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 88 test. - */ -@TestPropertySource(properties = "springdoc.auto-tag-classes=false") -class SpringDocApp88Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/HelloController.java deleted file mode 100644 index 4f882cc2d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/HelloController.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app89; - -import io.swagger.v3.oas.annotations.Operation; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.ModelAndView; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Gets address. - * - * @param id the id - * @return the address - */ - @Operation(summary = "Get Status") - @GetMapping(value = "/status/{id}", produces = MediaType.TEXT_HTML_VALUE) - public ModelAndView getAddress(@PathVariable String id) { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java deleted file mode 100644 index cc124b074..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app89/SpringDocApp89Test.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app89; - - -import io.swagger.v3.oas.models.media.ObjectSchema; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; -import org.springframework.web.servlet.ModelAndView; - -import static org.springdoc.core.utils.SpringDocUtils.getConfig; - -/** - * The type Spring doc app 89 test. - */ -@TestPropertySource(properties = "springdoc.model-and-view-allowed=true") -class SpringDocApp89Test extends AbstractSpringDocTest { - - static { - getConfig().replaceWithSchema(ModelAndView.class, new ObjectSchema()); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApi.java deleted file mode 100644 index 2ac9f7a3d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApi.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app9; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; - -import org.springframework.http.HttpHeaders; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * The interface My api. - */ -@RequestMapping("/myapi") -public interface MyApi { - - /** - * Get string. - * - * @param language the language - * @return the string - */ - @Operation(description = "Annotations from interfaces test") - @GetMapping - String get( - @Parameter(hidden = true, in = ParameterIn.HEADER, name = HttpHeaders.ACCEPT_LANGUAGE) @RequestHeader(value = HttpHeaders.ACCEPT_LANGUAGE, required = false) String language); -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApiController.java deleted file mode 100644 index 304ec0fbb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/MyApiController.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app9; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type My api controller. - */ -@RestController -class MyApiController implements MyApi { - /** - * Get string. - * - * @param language the language - * @return the string - */ - public String get(String language) { - return language; - } - - - /** - * Gets code. - * - * @param code the code - * @return the code - */ - @Operation(description = "Annotations from class with hidden parameter code") - @GetMapping("/getCode") - public String getCode(@Parameter(hidden = true) String code) { - return code; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java deleted file mode 100644 index 743b3482a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app9; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 9 test. - */ -class SpringDocApp9Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/HelloController.java deleted file mode 100644 index ee39766e1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/HelloController.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app90; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.ExampleObject; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.parameters.RequestBody; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Test 1. - * - * @param hello the hello - */ - @GetMapping("/test") - @ApiResponses(value = { @ApiResponse(description = "successful operation", content = { @Content(examples = @ExampleObject(name = "500", ref = "#/components/examples/http500Example"), mediaType = "application/json", schema = @Schema(implementation = User.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)) }) }) - public void test1(String hello) { - } - - /** - * Test 2. - * - * @param hello the hello - */ - @PostMapping("/test2") - @RequestBody( - description = "Details of the Item to be created", - required = true, - content = @Content( - schema = @Schema(implementation = User.class), - mediaType = MediaType.APPLICATION_JSON_VALUE, - examples = { - @ExampleObject( - name = "An example request with the minimum required fields to create.", - value = "min", - summary = "Minimal request"), - @ExampleObject( - name = "An example request with all fields provided with example values.", - value = "full", - summary = "Full request") })) - public void test2(String hello) { - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java deleted file mode 100644 index 08ea75648..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocApp90Test.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app90; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -/** - * The type Spring doc app 90 test. - */ -class SpringDocApp90Test extends AbstractSpringDocTest { - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocTestApp.java deleted file mode 100644 index 36dc05d61..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/SpringDocTestApp.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app90; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.UncheckedIOException; -import java.util.AbstractMap; -import java.util.Collection; -import java.util.Map.Entry; - -import io.swagger.v3.oas.models.examples.Example; -import org.springdoc.core.customizers.OpenApiCustomizer; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.core.io.Resource; -import org.springframework.util.FileCopyUtils; - -/** - * The type Spring doc test app. - */ -@SpringBootApplication -class SpringDocTestApp { - - /** - * The Http 500 example resource. - */ - @Value("classpath:/500-90.txt") - private Resource http500ExampleResource; - - /** - * As string string. - * - * @param resource the resource - * @return the string - */ - public static String asString(Resource resource) { - try (Reader reader = new InputStreamReader(resource.getInputStream())) { - return FileCopyUtils.copyToString(reader); - } - catch (IOException e) { - throw new UncheckedIOException(e); - } - } - - /** - * Open api customiser open api customiser. - * - * @param examples the examples - * @return the open api customiser - */ - @Bean - public OpenApiCustomizer openApiCustomizer(Collection> examples) { - return openAPI -> { - examples.forEach(example -> { - openAPI.getComponents().addExamples(example.getKey(), example.getValue()); - }); - }; - } - - /** - * Http 500 example entry. - * - * @return the entry - */ - @Bean - public Entry http500Example() { - Example http500Example = new Example(); - Entry entry = new AbstractMap.SimpleEntry("http500Example", http500Example); - http500Example.setSummary("HTTP 500 JSON Body response example"); - http500Example.setDescription( - "An example of HTTP response in case an error occurs on server side. instance attribute reference a traceId to ease server side analysis."); - http500Example.setValue(asString(http500ExampleResource)); - return entry; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/User.java deleted file mode 100644 index 49a51389f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app90/User.java +++ /dev/null @@ -1,440 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app90; - -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * User - */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-11-30T09:49:26.034469-01:00[Atlantic/Azores]") - - -class User { - - /** - * The Id. - */ - @JsonProperty("id") - - private Long id; - - - /** - * The Username. - */ - @JsonProperty("username") - - private String username; - - - /** - * The First name. - */ - @JsonProperty("firstName") - - private String firstName; - - - /** - * The Last name. - */ - @JsonProperty("lastName") - - private String lastName; - - - /** - * The Email. - */ - @JsonProperty("email") - - private String email; - - - /** - * The Password. - */ - @JsonProperty("password") - - private String password; - - - /** - * The Phone. - */ - @JsonProperty("phone") - - private String phone; - - - /** - * The User status. - */ - @JsonProperty("userStatus") - - private Integer userStatus; - - - /** - * Id user. - * - * @param id the id - * @return the user - */ - public User id(Long id) { - this.id = id; - return this; - } - - - /** - * Get id - * - * @return id id - */ - @Schema(example = "10", description = "") - - - public Long getId() { - return id; - } - - /** - * Sets id. - * - * @param id the id - */ - public void setId(Long id) { - this.id = id; - } - - - /** - * Username user. - * - * @param username the username - * @return the user - */ - public User username(String username) { - this.username = username; - return this; - } - - - /** - * Get username - * - * @return username username - */ - @Schema(example = "theUser", description = "") - - - public String getUsername() { - return username; - } - - /** - * Sets username. - * - * @param username the username - */ - public void setUsername(String username) { - this.username = username; - } - - - /** - * First name user. - * - * @param firstName the first name - * @return the user - */ - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - - /** - * Get firstName - * - * @return firstName first name - */ - @Schema(example = "John", description = "") - - - public String getFirstName() { - return firstName; - } - - /** - * Sets first name. - * - * @param firstName the first name - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - - /** - * Last name user. - * - * @param lastName the last name - * @return the user - */ - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - - /** - * Get lastName - * - * @return lastName last name - */ - @Schema(example = "James", description = "") - - - public String getLastName() { - return lastName; - } - - /** - * Sets last name. - * - * @param lastName the last name - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - - /** - * Email user. - * - * @param email the email - * @return the user - */ - public User email(String email) { - this.email = email; - return this; - } - - - /** - * Get email - * - * @return email email - */ - @Schema(example = "john@email.com", description = "") - - - public String getEmail() { - return email; - } - - /** - * Sets email. - * - * @param email the email - */ - public void setEmail(String email) { - this.email = email; - } - - - /** - * Password user. - * - * @param password the password - * @return the user - */ - public User password(String password) { - this.password = password; - return this; - } - - - /** - * Get password - * - * @return password password - */ - @Schema(example = "12345", description = "") - - - public String getPassword() { - return password; - } - - /** - * Sets password. - * - * @param password the password - */ - public void setPassword(String password) { - this.password = password; - } - - - /** - * Phone user. - * - * @param phone the phone - * @return the user - */ - public User phone(String phone) { - this.phone = phone; - return this; - } - - - /** - * Get phone - * - * @return phone phone - */ - @Schema(example = "12345", description = "") - - - public String getPhone() { - return phone; - } - - /** - * Sets phone. - * - * @param phone the phone - */ - public void setPhone(String phone) { - this.phone = phone; - } - - - /** - * User status user. - * - * @param userStatus the user status - * @return the user - */ - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - - /** - * User Status - * - * @return userStatus user status - */ - @Schema(example = "1", description = "User Status") - - - public Integer getUserStatus() { - return userStatus; - } - - /** - * Sets user status. - * - * @param userStatus the user status - */ - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - - /** - * Equals boolean. - * - * @param o the o - * @return the boolean - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - /** - * Hash code int. - * - * @return the int - */ - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - /** - * To string string. - * - * @return the string - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - * @param o the o - * @return the string - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Advice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Advice.java deleted file mode 100644 index fb5baf5cc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Advice.java +++ /dev/null @@ -1,84 +0,0 @@ -package test.org.springdoc.api.app91; - -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.ExampleObject; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import jakarta.servlet.http.HttpServletRequest; - -import org.springframework.beans.TypeMismatchException; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -/** - * The type Advice. - */ -@RestControllerAdvice -class Advice { - - /** - * Bad request response entity. - * - * @param req the req - * @param exception the exception - * @return the response entity - */ - @ExceptionHandler(TypeMismatchException.class) - @ResponseStatus(HttpStatus.BAD_REQUEST) - @ApiResponse( - responseCode = "400", - description = "Bad Request", - content = - @Content( - mediaType = MediaType.APPLICATION_JSON_VALUE, - schema = @Schema(implementation = ApiError.class), - examples = { - @ExampleObject( - name = "Service-400", - summary = "400 from the service directly", - value = - "{\"status\": 400," - + "\"errorCode\": \"ERROR_001\"," - + "\"message\": \"An example message...\"" - + "}") - })) - public ResponseEntity badRequest(HttpServletRequest req, Exception exception) { - ApiError erroObj = new ApiError(400, "A code", "A message"); - return new ResponseEntity<>(erroObj, HttpStatus.BAD_REQUEST); - } - - /** - * Internal server error response entity. - * - * @param req the req - * @param exception the exception - * @return the response entity - */ - @ExceptionHandler(Exception.class) - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ApiResponse( - responseCode = "500", - description = "Internal Server Error", - content = - @Content( - mediaType = MediaType.APPLICATION_JSON_VALUE, - schema = @Schema(implementation = ApiError.class), - examples = { - @ExampleObject( - name = "Service-500", - summary = "500 from the service directly", - value = - "{\"status\": 500," - + "\"errorCode\": \"ERROR_002\"," - + "\"message\": \"Another example message...\"" - + "}") - })) - public ResponseEntity internalServerError(HttpServletRequest req, Exception exception) { - ApiError erroObj = new ApiError(500, "A different code", "A different message"); - return new ResponseEntity<>(erroObj, HttpStatus.INTERNAL_SERVER_ERROR); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/ApiError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/ApiError.java deleted file mode 100644 index 4cf6bdcb3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/ApiError.java +++ /dev/null @@ -1,53 +0,0 @@ -package test.org.springdoc.api.app91; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Api error. - */ -@Schema( - type = "object", - name = "ApiError", - title = "ApiError", - description = "A consistent response object for sending errors over the wire.") -class ApiError { - - /** - * The Status. - */ - @Schema(name = "status", description = "The Http Status value", type = "int", nullable = true) - @JsonProperty("status") - private int status; - - /** - * The Error code. - */ - @Schema( - name = "errorCode", - description = "An Error Code which can help with identifying issues.", - type = "string", - nullable = true) - @JsonProperty("errorCode") - private String errorCode; - - /** - * The Message. - */ - @Schema(name = "message", description = "The Error Message.", type = "string", nullable = false) - @JsonProperty("message") - private String message; - - /** - * Instantiates a new Api error. - * - * @param status the status - * @param errorCode the error code - * @param message the message - */ - public ApiError(int status, String errorCode, String message) { - this.status = status; - this.errorCode = errorCode; - this.message = message; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Greeting.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Greeting.java deleted file mode 100644 index fb37663f6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/Greeting.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api.app91; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Greeting. - */ -@Schema( - type = "object", - name = "Greeting", - title = "Greeting", - description = "An object containing a greeting message") -class Greeting { - - - /** - * The Payload. - */ - @Schema( - name = "payload", - description = "The greeting value", - type = "string", - nullable = false, - example = "sdfsdfs") - @JsonProperty("payload") - private String payload; - - /** - * Instantiates a new Greeting. - * - * @param payload the payload - */ - public Greeting(String payload) { - this.payload = payload; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/GreetingController.java deleted file mode 100644 index edb144c15..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/GreetingController.java +++ /dev/null @@ -1,46 +0,0 @@ -package test.org.springdoc.api.app91; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.commons.lang3.RandomStringUtils; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; - -/** - * The type Greeting controller. - */ -@RestController -@Tag(name = "Demo", description = "The Demo API") -class GreetingController { - - /** - * Say hello response entity. - * - * @return the response entity - */ - @GetMapping(produces = APPLICATION_JSON_VALUE) - @Operation(summary = "This API will return a random greeting.") - public ResponseEntity sayHello() { - return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); - } - - /** - * Say hello 2 response entity. - * - * @return the response entity - */ - @GetMapping("/test") - @ApiResponses(value = { @ApiResponse(responseCode = "201", description = "item created"), - @ApiResponse(responseCode = "400", description = "invalid input, object invalid"), - @ApiResponse(responseCode = "409", description = "an existing item already exists") }) - public ResponseEntity sayHello2() { - return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/SpringDocApp91Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/SpringDocApp91Test.java deleted file mode 100644 index 23a390257..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app91/SpringDocApp91Test.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app91; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -/** - * The type Spring doc app 91 test. - */ -@TestPropertySource(properties = "springdoc.override-with-generic-response=false") -class SpringDocApp91Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/HelloController.java deleted file mode 100644 index 5c9ce3272..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/HelloController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app92; - -import jakarta.validation.constraints.NotNull; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/test") -class HelloController { - - /** - * Index string. - * - * @param test the test - * @return the string - */ - @GetMapping - String index(@NotNull String test) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/ParameterCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/ParameterCustomizer.java deleted file mode 100644 index 351251c49..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/ParameterCustomizer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app92; - -import io.swagger.v3.oas.models.parameters.Parameter; -import jakarta.validation.constraints.NotNull; - -import org.springframework.core.MethodParameter; -import org.springframework.stereotype.Component; - -/** - * The type Parameter customizer. - */ -@Component -class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { - /** - * Customize parameter. - * - * @param parameterModel the parameter model - * @param methodParameter the method parameter - * @return the parameter - */ - @Override - public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { - NotNull annotation = methodParameter.getParameterAnnotation(NotNull.class); - if (annotation != null) { - parameterModel.required(false); - } - return parameterModel; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/SpringDocApp92Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/SpringDocApp92Test.java deleted file mode 100644 index dbfbf1657..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app92/SpringDocApp92Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app92; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 92 test. - */ -class SpringDocApp92Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/BaseClientModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/BaseClientModel.java deleted file mode 100644 index 22be1373e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/BaseClientModel.java +++ /dev/null @@ -1,14 +0,0 @@ -package test.org.springdoc.api.app93; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Base client model. - */ -public abstract class BaseClientModel { - /** - * The Id. - */ - @JsonProperty("id") - int id; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/BaseController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/BaseController.java deleted file mode 100644 index bb0b57e46..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/BaseController.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app93; - -import io.swagger.v3.oas.annotations.Operation; - -import org.springframework.web.bind.annotation.GetMapping; - -/** - * The type Base controller. - * - * @param the type parameter - */ -public abstract class BaseController { - /** - * Get t client model. - * - * @param param the param - * @return the t client model - */ - @Operation - @GetMapping - TClientModel get(TClientModel param) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificClientModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificClientModel.java deleted file mode 100644 index 591bc5804..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificClientModel.java +++ /dev/null @@ -1,14 +0,0 @@ -package test.org.springdoc.api.app93; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Specific client model. - */ -class SpecificClientModel extends BaseClientModel { - /** - * The Name. - */ - @JsonProperty("name") - String name; -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificController.java deleted file mode 100644 index 8c45f0910..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpecificController.java +++ /dev/null @@ -1,9 +0,0 @@ -package test.org.springdoc.api.app93; - -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Specific controller. - */ -@RestController -class SpecificController extends BaseController {} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpringDocApp93Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpringDocApp93Test.java deleted file mode 100644 index 40f48fb16..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app93/SpringDocApp93Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app93; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 93 test. - */ -class SpringDocApp93Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/Greeting.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/Greeting.java deleted file mode 100644 index 1cfca3a7a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/Greeting.java +++ /dev/null @@ -1,37 +0,0 @@ -package test.org.springdoc.api.app94; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * The type Greeting. - */ -@Schema( - type = "object", - name = "Greeting", - title = "Greeting", - description = "An object containing a greeting message") -class Greeting { - - - /** - * The Payload. - */ - @Schema( - name = "payload", - description = "The greeting value", - type = "string", - nullable = false, - example = "sdfsdfs") - @JsonProperty("payload") - private String payload; - - /** - * Instantiates a new Greeting. - * - * @param payload the payload - */ - public Greeting(String payload) { - this.payload = payload; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/HelloController.java deleted file mode 100644 index 9e6bc3a9b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/HelloController.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app95; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/persons") -class HelloController { - - /** - * Persons. - * - * @param name the name - */ - @GetMapping - @Operation(summary = "${test.app95.operation.persons.summary}", - description = "${test.app95.operation.persons.description}") - public void persons(@Parameter(description = "${test.app95.param.name.description}") String name) { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/SpringDocApp95Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/SpringDocApp95Test.java deleted file mode 100644 index 8f197c9c9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app95/SpringDocApp95Test.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app95; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.ActiveProfiles; - -/** - * The type Spring doc app 95 test. - */ -@ActiveProfiles("95") -class SpringDocApp95Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/HelloController.java deleted file mode 100644 index 25c658079..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/HelloController.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app96; - -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotNull; - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - - /** - * Test 1 string. - * - * @param test the test - * @return the string - */ - @PostMapping("/api1") - String test1(@RequestBody @Min(2) int test) { - return null; - } - - /** - * Test 2 string. - * - * @param test the test - * @return the string - */ - @PostMapping("/api2") - String test2(@RequestBody String test) { - return null; - } - - /** - * Test 3 string. - * - * @param test the test - * @return the string - */ - @PostMapping("/api3") - String test3(@NotNull String test) { - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/SpringDocApp96Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/SpringDocApp96Test.java deleted file mode 100644 index eb13e5e75..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app96/SpringDocApp96Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app96; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 96 test. - */ -class SpringDocApp96Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/HelloController.java deleted file mode 100644 index 65986b5e0..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/HelloController.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app97; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/api") -class HelloController { - - /** - * Header v 1 student v 1. - * - * @return the student v 1 - */ - @GetMapping(value = "/student/header1", headers = "X-API-VERSION=1") - public StudentV1 headerV1() { - return new StudentV1("Bob Charlie"); - } - - /** - * Header v 2 student v 2. - * - * @return the student v 2 - */ - @GetMapping(value = "/student/header2", headers = "X-API-VERSION=2") - public StudentV2 headerV2() { - return new StudentV2("Charlie"); - } - - /** - * Header v 3 student v 3. - * - * @return the student v 3 - */ - @GetMapping(value = "/student/header3", headers = "X-API-VERSION") - public StudentV3 headerV3() { - return new StudentV3("Tom Charlie"); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/SpringDocApp97Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/SpringDocApp97Test.java deleted file mode 100644 index 1340c442d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/SpringDocApp97Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app97; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 97 test. - */ -class SpringDocApp97Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV1.java deleted file mode 100644 index 5a6a5ae2d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV1.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app97; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Student v 1. - */ -class StudentV1 { - - /** - * The Name. - */ - @JsonProperty("name") - private String name; - - /** - * Instantiates a new Student v 1. - * - * @param name the name - */ - public StudentV1(String name) { - this.name = name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV2.java deleted file mode 100644 index e76f0cb46..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV2.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app97; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Student v 2. - */ -class StudentV2 { - - /** - * The Name. - */ - @JsonProperty("bb") - private String name; - - /** - * Instantiates a new Student v 2. - * - * @param name the name - */ - public StudentV2(String name) { - this.name = name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV3.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV3.java deleted file mode 100644 index 9907b8544..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app97/StudentV3.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app97; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The type Student v 3. - */ -class StudentV3 { - - /** - * The Name. - */ - @JsonProperty("name") - private String name; - - /** - * Instantiates a new Student v 3. - * - * @param name the name - */ - public StudentV3(String name) { - this.name = name; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/HelloController.java deleted file mode 100644 index b5becd942..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/HelloController.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app98; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -class HelloController { - - /** - * Persons. - * - * @param name the name - */ - @GetMapping("/persons") - public void persons(@IgnoredAnnotationParameter String name) { - - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/IgnoredAnnotationParameter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/IgnoredAnnotationParameter.java deleted file mode 100644 index 5e53ba7de..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/IgnoredAnnotationParameter.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app98; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * The interface Ignored annotation parameter. - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface IgnoredAnnotationParameter { - /** - * Addition string. - * - * @return the string - */ - String addition() default "customized parameter!"; -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/SpringDocApp98Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/SpringDocApp98Test.java deleted file mode 100644 index cacfce2ac..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app98/SpringDocApp98Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app98; - - -import org.springdoc.core.utils.SpringDocUtils; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * The type Spring doc app 98 test. - */ -class SpringDocApp98Test extends AbstractSpringDocTest { - - static { - SpringDocUtils.getConfig().addAnnotationsToIgnore(IgnoredAnnotationParameter.class); - } - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/HelloController.java deleted file mode 100644 index 5980368b2..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/HelloController.java +++ /dev/null @@ -1,28 +0,0 @@ -package test.org.springdoc.api.app99; - -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * The type Hello controller. - */ -@RestController -@RequestMapping("/persons") -class HelloController { - - /** - * Persons. - */ - @GetMapping - @ApiResponses({ - @ApiResponse(responseCode = "202", description = "${test.app99.operation.persons.response.202.description}") - }) - public void persons() { - - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/SpringDocApp99Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/SpringDocApp99Test.java deleted file mode 100644 index f7639bf8a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app99/SpringDocApp99Test.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app99; - - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.ActiveProfiles; - -/** - * The type Spring doc app 99 test. - */ -@ActiveProfiles("99") -class SpringDocApp99Test extends AbstractSpringDocTest { - - /** - * The type Spring doc test app. - */ - @SpringBootApplication - static class SpringDocTestApp {} - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..4c3990c94 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Abstract spring doc test. + */ +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) +public abstract class AbstractSpringDocTest { + + /** + * The constant className. + */ + public static String className; + + /** + * The Mock mvc. + */ + @Autowired + protected MockMvc mockMvc; + + /** + * Gets content. + * + * @param fileName the file name + * @return the content + * @throws Exception the exception + */ + public static String getContent(String fileName) throws Exception { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiException.java new file mode 100644 index 000000000..0145e3e9d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiException.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +/** + * The type Api exception. + */ +public final class ApiException extends Exception { + + /** + * The constant serialVersionUID. + */ + private static final long serialVersionUID = 1L; + + /** + * The Code. + */ + @SuppressWarnings("unused") + + private final int code; + + /** + * Instantiates a new Api exception. + * + * @param code the code + * @param msg the msg + */ + public ApiException(int code, String msg) { + super(msg); + this.code = code; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiOriginFilter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiOriginFilter.java new file mode 100644 index 000000000..cd5a1f1f2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiOriginFilter.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import java.io.IOException; + +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletResponse; + +/** + * The type Api origin filter. + */ +class ApiOriginFilter implements jakarta.servlet.Filter { + /** + * Do filter. + * + * @param request the request + * @param response the response + * @param chain the chain + * @throws IOException the io exception + * @throws ServletException the servlet exception + */ + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletResponse res = (HttpServletResponse) response; + res.addHeader("Access-Control-Allow-Origin", "*"); + res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); + res.addHeader("Access-Control-Allow-Headers", "Content-Type"); + chain.doFilter(request, response); + } + + /** + * Destroy. + */ + @Override + public void destroy() { + } + + /** + * Init. + * + * @param filterConfig the filter config + * @throws ServletException the servlet exception + */ + @Override + public void init(FilterConfig filterConfig) throws ServletException { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiResponseMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiResponseMessage.java new file mode 100644 index 000000000..e1d3d09e6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ApiResponseMessage.java @@ -0,0 +1,168 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import jakarta.xml.bind.annotation.XmlTransient; + +/** + * The type Api response message. + */ +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") +@jakarta.xml.bind.annotation.XmlRootElement +class ApiResponseMessage { + /** + * The constant ERROR. + */ + public static final int ERROR = 1; + + /** + * The constant WARNING. + */ + public static final int WARNING = 2; + + /** + * The constant INFO. + */ + public static final int INFO = 3; + + /** + * The constant OK. + */ + public static final int OK = 4; + + /** + * The constant TOO_BUSY. + */ + public static final int TOO_BUSY = 5; + + /** + * The Code. + */ + int code; + + /** + * The Type. + */ + String type; + + /** + * The Message. + */ + String message; + + /** + * Instantiates a new Api response message. + */ + public ApiResponseMessage() { + } + + /** + * Instantiates a new Api response message. + * + * @param code the code + * @param message the message + */ + public ApiResponseMessage(int code, String message) { + this.code = code; + switch (code) { + case ERROR: + setType("error"); + break; + case WARNING: + setType("warning"); + break; + case INFO: + setType("info"); + break; + case OK: + setType("ok"); + break; + case TOO_BUSY: + setType("too busy"); + break; + default: + setType("unknown"); + break; + } + this.message = message; + } + + /** + * Gets code. + * + * @return the code + */ + @XmlTransient + public int getCode() { + return code; + } + + /** + * Sets code. + * + * @param code the code + */ + public void setCode(int code) { + this.code = code; + } + + /** + * Gets type. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Sets type. + * + * @param type the type + */ + public void setType(String type) { + this.type = type; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ErrorMessage.java new file mode 100644 index 000000000..98c03b30b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ErrorMessage.java @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +/** + * The type Error message. + */ +class ErrorMessage { + + /** + * The Id. + */ + private String id; + + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Error message. + * + * @param id the id + * @param message2 the message 2 + */ + public ErrorMessage(String id, String message2) { + this.id = id; + this.message = message2; + } + + /** + * Gets id. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ExceptionTranslator.java new file mode 100644 index 000000000..0da4240d2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ExceptionTranslator.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import java.util.UUID; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * The type Exception translator. + */ +@ControllerAdvice +class ExceptionTranslator { + + /** + * The constant LOGGER. + */ + private static final Logger LOGGER = LoggerFactory.getLogger(ExceptionTranslator.class); + + /** + * Handle run time exception response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler({ RuntimeException.class }) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity handleRunTimeException(RuntimeException e) { + return error(HttpStatus.INTERNAL_SERVER_ERROR, e); + } + + + /** + * Error response entity. + * + * @param status the status + * @param e the e + * @return the response entity + */ + private ResponseEntity error(HttpStatus status, Exception e) { + LOGGER.error("Exception : ", e); + return ResponseEntity.status(status).body(new ErrorMessage(UUID.randomUUID().toString(), e.getMessage())); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java new file mode 100644 index 000000000..68475fe16 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Index string. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the string + */ + @GetMapping(value = "/hello/{numTelco}") + @ResponseStatus(HttpStatus.I_AM_A_TEAPOT) + @Tag(name = "tea") + public String index(@PathVariable("numTelco") String numTel, String adresse) { + return "Greetings from Spring Boot!"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/HomeController.java new file mode 100644 index 000000000..9b6bbeb6d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/HomeController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; +import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; + +/** + * Home redirection to swagger api documentation + */ +@Controller +class HomeController { + + /** + * The Swagger ui path. + */ + @Value(SWAGGER_UI_PATH) + private String swaggerUiPath; + + /** + * Index string. + * + * @return the string + */ + @GetMapping(DEFAULT_PATH_SEPARATOR) + public String index() { + return REDIRECT_URL_PREFIX + swaggerUiPath; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/InventoryApi.java similarity index 77% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApi.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/InventoryApi.java index 129204198..5a4c4938e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApi.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/InventoryApi.java @@ -1,19 +1,27 @@ /* * - * * Copyright 2019-2020 the original author or authors. * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * + * */ /** @@ -21,7 +29,7 @@ * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ -package test.org.springdoc.api.app1; +package test.org.springdoc.api.v30.app1; import java.util.List; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/InventoryApiController.java similarity index 75% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApiController.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/InventoryApiController.java index 8969acf11..b9972fb9f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryApiController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/InventoryApiController.java @@ -1,22 +1,30 @@ /* * - * * Copyright 2019-2020 the original author or authors. * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * + * */ -package test.org.springdoc.api.app1; +package test.org.springdoc.api.v30.app1; import java.util.List; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryItem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/InventoryItem.java similarity index 82% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryItem.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/InventoryItem.java index bd8a96720..e6b02165b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/InventoryItem.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/InventoryItem.java @@ -1,22 +1,30 @@ /* * - * * Copyright 2019-2020 the original author or authors. * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * + * */ -package test.org.springdoc.api.app1; +package test.org.springdoc.api.v30.app1; import java.util.Objects; import java.util.UUID; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemController.java new file mode 100644 index 000000000..ecc120f11 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemController.java @@ -0,0 +1,89 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import java.net.URI; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; + +/** + * The type Item controller. + */ +@RestController +@Tag(name = "items") +class ItemController { + + /** + * Show items list. + * + * @param customerID the customer id + * @param toto the toto + * @param startDate the start date + * @param filterIds the filter ids + * @return the list + */ + @GetMapping("/items") + public List showItems(@RequestParam("cusID") @Size(min = 4, max = 6) final String customerID, + @Size(min = 4, max = 6) int toto, + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, + @Parameter(name = "filterIds", in = ParameterIn.QUERY, array = @ArraySchema(schema = @Schema(type = "string")), explode = Explode.FALSE) @RequestParam(required = false) List filterIds) { + return new ArrayList(); + } + + /** + * Add item response entity. + * + * @param itemDTO the item dto + * @return the response entity + */ + @PostMapping("/items") + public ResponseEntity addItem(@Valid @RequestBody final ItemLightDTO itemDTO) { + final URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}") + .buildAndExpand(UUID.randomUUID()).toUri(); + return ResponseEntity.created(location).build(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemDTO.java new file mode 100644 index 000000000..8e427e0b4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemDTO.java @@ -0,0 +1,164 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import java.io.Serializable; + +/** + * The type Item dto. + * @author bnasslahsen + */ +class ItemDTO implements Serializable { + + /** + * serialVersionUID of type long + */ + private static final long serialVersionUID = 1L; + + /** + * itemID of type String + */ + private String itemID; + + /** + * description of type String + */ + private String description; + + /** + * price of type int + */ + private int price; + + /** + * The Deprecated price. + */ + @Deprecated + private int deprecatedPrice; + + /** + * Instantiates a new Item dto. + */ + public ItemDTO() { + } + + /** + * Instantiates a new Item dto. + * + * @param description description + * @param price price + */ + public ItemDTO(final String description, final int price) { + this.description = description; + this.price = price; + } + + /** + * Instantiates a new Item dto. + * + * @param itemID itemID + * @param description description + * @param price price + */ + public ItemDTO(final String itemID, final String description, final int price) { + this.itemID = itemID; + this.description = description; + this.price = price; + } + + /** + * Gets description. + * + * @return description description + */ + public String getDescription() { + return description; + } + + /** + * Sets description. + * + * @param description description + */ + public void setDescription(final String description) { + this.description = description; + } + + /** + * Gets item id. + * + * @return item id + */ + public String getItemID() { + return itemID; + } + + /** + * Sets item id. + * + * @param itemID itemID + */ + public void setItemID(final String itemID) { + this.itemID = itemID; + } + + /** + * Gets price. + * + * @return price price + */ + public int getPrice() { + return price; + } + + /** + * Sets price. + * + * @param price price + */ + public void setPrice(final int price) { + this.price = price; + } + + /** + * Gets deprecated price. + * + * @return the deprecated price + */ + public int getDeprecatedPrice() { + return deprecatedPrice; + } + + /** + * Sets deprecated price. + * + * @param deprecatedPrice the deprecated price + */ + public void setDeprecatedPrice(int deprecatedPrice) { + this.deprecatedPrice = deprecatedPrice; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemLightDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemLightDTO.java new file mode 100644 index 000000000..7f557efb6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/ItemLightDTO.java @@ -0,0 +1,129 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import java.io.Serializable; + +/** + * The type Item light dto. + * @author bnasslahsen + */ +class ItemLightDTO implements Serializable { + + /** + * serialVersionUID of type long + */ + private static final long serialVersionUID = 1L; + + /** + * description of type String + */ + private String description; + + /** + * price of type int + */ + private int price; + + /** + * The Deprecated price. + */ + @Deprecated + private int deprecatedPrice; + + /** + * Instantiates a new Item light dto. + */ + public ItemLightDTO() { + } + + /** + * Instantiates a new Item light dto. + * + * @param description the description + * @param price the price + */ + public ItemLightDTO(String description, int price) { + super(); + this.description = description; + this.price = price; + } + + /** + * Gets description. + * + * @return description description + */ + public String getDescription() { + return description; + } + + /** + * Sets description. + * + * @param description description + */ + public void setDescription(final String description) { + this.description = description; + } + + /** + * Gets price. + * + * @return price price + */ + public int getPrice() { + return price; + } + + /** + * Sets price. + * + * @param price price + */ + public void setPrice(final int price) { + this.price = price; + } + + /** + * Gets deprecated price. + * + * @return the deprecated price + */ + public int getDeprecatedPrice() { + return deprecatedPrice; + } + + /** + * Sets deprecated price. + * + * @param deprecatedPrice the deprecated price + */ + public void setDeprecatedPrice(int deprecatedPrice) { + this.deprecatedPrice = deprecatedPrice; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/Manufacturer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/Manufacturer.java similarity index 78% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/Manufacturer.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/Manufacturer.java index d995b98d5..db8eb7732 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/Manufacturer.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/Manufacturer.java @@ -1,22 +1,30 @@ /* * - * * Copyright 2019-2020 the original author or authors. * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * + * */ -package test.org.springdoc.api.app1; +package test.org.springdoc.api.v30.app1; import java.util.Objects; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PeopleRestService.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/PeopleRestService.java similarity index 83% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PeopleRestService.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/PeopleRestService.java index 803b88779..742e97f54 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app1/PeopleRestService.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/PeopleRestService.java @@ -1,22 +1,30 @@ /* * - * * Copyright 2019-2020 the original author or authors. * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * + * */ -package test.org.springdoc.api.app1; +package test.org.springdoc.api.v30.app1; import java.net.URI; import java.util.Collection; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/PersonDTO.java new file mode 100644 index 000000000..de48411cb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..80d44a073 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 1 test. + */ +@TestPropertySource(properties = "springdoc.default-produces-media-type=application/json") +class SpringDocApp1Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("SpringShop API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java new file mode 100644 index 000000000..8655b18b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param header the header + * @param request the request + * @param response the response + * @param locale the locale + * @param hello the hello + */ + @GetMapping("/test") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + + /** + * Test request attribute. + * + * @param sample the sample + * @param s the s + */ + @GetMapping("/testreq") + public void testRequestAttribute(@RequestAttribute String sample, String s) { + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java new file mode 100644 index 000000000..90606fa9c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 10 test. + */ +class SpringDocApp10Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/HelloController.java new file mode 100644 index 000000000..0c938edd0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app100; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.tags.Tags; +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@Tags(value = @Tag(name = "hello-ap1")) +class HelloController { + + /** + * Gets all pets. + * + * @param toto the toto + * @return the all pets + */ + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + @Tags(value = @Tag(name = "hello-ap2")) + public PersonDTO getAllPets(@NotNull String toto) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/PersonDTO.java new file mode 100644 index 000000000..3b7f6a394 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/PersonDTO.java @@ -0,0 +1,123 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app100; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Person dto. + */ +@Schema +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/SpringDocApp100Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/SpringDocApp100Test.java new file mode 100644 index 000000000..761338601 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app100/SpringDocApp100Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app100; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 100 test. + */ +class SpringDocApp100Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/HelloController.java new file mode 100644 index 000000000..12f76bfd5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app101; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/hello") +class HelloController { + + /** + * Hello hello dto. + * + * @return the hello dto + */ + @GetMapping + @ApiResponse(content = @Content(schema = @Schema( + description = "${test.app101.operation.hello.response.schema.description}", + implementation = HelloDTO.class))) + public HelloDTO hello() { + return new HelloDTO(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/HelloDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/HelloDTO.java new file mode 100644 index 000000000..d6732e42d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/HelloDTO.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app101; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Hello dto. + */ +@Schema(description = "${test.app101.schema.hello.description}") +class HelloDTO { + + /** + * The Id. + */ + @Schema(description = "${test.app101.schema.hello.param.id.description}") + private String id; + + /** + * Gets id. + * + * @return the id + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/SpringDocApp101Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/SpringDocApp101Test.java new file mode 100644 index 000000000..41d339064 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app101/SpringDocApp101Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app101; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +/** + * The type Spring doc app 101 test. + */ +@ActiveProfiles("101") +class SpringDocApp101Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java new file mode 100644 index 000000000..a12a5f23d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/InheritedRequestParams.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app102; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NotBlank; + +/** + * The type Inherited request params. + */ +class InheritedRequestParams extends RequestParams { + /** + * The Child param. + */ + @Parameter(description = "parameter from child of RequestParams") + @NotBlank + private String childParam; + + /** + * Gets child param. + * + * @return the child param + */ + public String getChildParam() { + return childParam; + } + + /** + * Sets child param. + * + * @param childParam the child param + */ + public void setChildParam(String childParam) { + this.childParam = childParam; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java new file mode 100644 index 000000000..90563e969 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/RequestParams.java @@ -0,0 +1,284 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app102; + +import java.math.BigInteger; +import java.util.List; +import java.util.Optional; + +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.lang.Nullable; + +/** + * The type Request params. + */ +class RequestParams { + + /** + * The String param. + */ + @Parameter(description = "string parameter") + private String stringParam; + + /** + * The String param 1. + */ + @Deprecated + private String stringParam1; + + /** + * The String param 2. + */ + @Parameter(description = "string parameter2", required = true) + private String stringParam2; + + /** + * The Int param. + */ + @Parameter(description = "int parameter") + private int intParam; + + /** + * The Int param 2. + */ + private Optional intParam2; + + /** + * The Int param 3. + */ + @Nullable + private String intParam3; + + /** + * The Nested. + */ + private Nested nested; + + /** + * The Nested list. + */ + private List nestedList; + + /** + * Gets string param. + * + * @return the string param + */ + public String getStringParam() { + return stringParam; + } + + /** + * Sets string param. + * + * @param stringParam the string param + */ + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + /** + * Gets int param. + * + * @return the int param + */ + public int getIntParam() { + return intParam; + } + + /** + * Sets int param. + * + * @param intParam the int param + */ + public void setIntParam(int intParam) { + this.intParam = intParam; + } + + /** + * Gets int param 2. + * + * @return the int param 2 + */ + public Optional getIntParam2() { + return intParam2; + } + + /** + * Sets int param 2. + * + * @param intParam2 the int param 2 + */ + public void setIntParam2(Optional intParam2) { + this.intParam2 = intParam2; + } + + /** + * Gets int param 3. + * + * @return the int param 3 + */ + @Nullable + public String getIntParam3() { + return intParam3; + } + + /** + * Sets int param 3. + * + * @param intParam3 the int param 3 + */ + public void setIntParam3(@Nullable String intParam3) { + this.intParam3 = intParam3; + } + + /** + * Gets string param 1. + * + * @return the string param 1 + */ + public String getStringParam1() { + return stringParam1; + } + + /** + * Sets string param 1. + * + * @param stringParam1 the string param 1 + */ + public void setStringParam1(String stringParam1) { + this.stringParam1 = stringParam1; + } + + /** + * Gets string param 2. + * + * @return the string param 2 + */ + public String getStringParam2() { + return stringParam2; + } + + /** + * Sets string param 2. + * + * @param stringParam2 the string param 2 + */ + public void setStringParam2(String stringParam2) { + this.stringParam2 = stringParam2; + } + + /** + * Gets nested. + * + * @return the nested + */ + public Nested getNested() { + return nested; + } + + /** + * Sets nested. + * + * @param nested the nested + */ + public void setNested(Nested nested) { + this.nested = nested; + } + + /** + * Gets nested list. + * + * @return the nested list + */ + public List getNestedList() { + return nestedList; + } + + /** + * Sets nested list. + * + * @param nestedList the nested list + */ + public void setNestedList(List nestedList) { + this.nestedList = nestedList; + } + + /** + * The type Nested. + */ + public static class Nested { + /** + * The Param 1. + */ + private String param1; + + /** + * The Param 2. + */ + private BigInteger param2; + + /** + * Gets param 1. + * + * @return the param 1 + */ + @Parameter(description = "nested string parameter") + public String getParam1() { + return param1; + } + + /** + * Sets param 1. + * + * @param param1 the param 1 + */ + public void setParam1(String param1) { + this.param1 = param1; + } + + /** + * Gets param 2. + * + * @return the param 2 + */ + @Parameter(description = "nested BigInteger parameter") + public BigInteger getParam2() { + return param2; + } + + /** + * Sets param 2. + * + * @param param2 the param 2 + */ + public void setParam2(BigInteger param2) { + this.param2 = param2; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java new file mode 100644 index 000000000..ea42b187b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/SpringDocApp102Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app102; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 102 test. + */ +class SpringDocApp102Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/TestController.java new file mode 100644 index 000000000..e987fb7aa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app102/TestController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app102; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.lang.Nullable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Test controller. + */ +@RestController +class TestController { + /** + * Gets test. + * + * @param param the param + * @param requestParams the request params + */ + @GetMapping("test") + public void getTest(@RequestParam @Nullable String param, @ParameterObject InheritedRequestParams requestParams) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/ExampleBody.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/ExampleBody.java new file mode 100644 index 000000000..8cbc2e1ac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/ExampleBody.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app103; + +/** + * The type Example body. + */ +class ExampleBody { + /** + * The String param. + */ + private String stringParam; + + /** + * The Int param. + */ + private int intParam; + + /** + * Gets string param. + * + * @return the string param + */ + public String getStringParam() { + return stringParam; + } + + /** + * Sets string param. + * + * @param stringParam the string param + */ + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + /** + * Gets int param. + * + * @return the int param + */ + public int getIntParam() { + return intParam; + } + + /** + * Sets int param. + * + * @param intParam the int param + */ + public void setIntParam(int intParam) { + this.intParam = intParam; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/HelloController.java new file mode 100644 index 000000000..c94308c19 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/HelloController.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app103; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Encoding; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Post my request body string. + * + * @param body the body + * @param file the file + * @return the string + */ + @PostMapping(value = "/test/103", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Operation( + requestBody = @RequestBody( + content = @Content( + encoding = @Encoding(name = "body", contentType = "application/json") + ) + ) + ) + public String postMyRequestBody( + @RequestPart("body") ExampleBody body, + @RequestParam("file") MultipartFile file + ) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/SpringDocApp103Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/SpringDocApp103Test.java new file mode 100644 index 000000000..b607f58b0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app103/SpringDocApp103Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app103; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 103 test. + */ +class SpringDocApp103Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/CrudController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/CrudController.java new file mode 100644 index 000000000..ff8a6a701 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/CrudController.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app104; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * The type Crud controller. + * + * @param the type parameter + */ +@Controller +@SuppressWarnings("rawtypes") +public abstract class CrudController { + + /** + * Get t. + * + * @param id the id + * @return the t + */ + @GetMapping(path = "{id}") + @ResponseBody + @Operation(description = "Get single object") + public T get( // + @Parameter(description = "The id to get.", required = true) @PathVariable("id") int id) { + return null; + } + + /** + * List list. + * + * @return the list + */ + @GetMapping(path = "") + @ResponseBody + @Operation(description = "Receive a list of objects") + public List list() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/Design.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/Design.java new file mode 100644 index 000000000..c6b846d0f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/Design.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app104; + +/** + * The type Design. + */ +class Design extends HavingPK { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/DesignController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/DesignController.java new file mode 100644 index 000000000..b540e8753 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/DesignController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app104; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * The type Design controller. + */ +@Tag(name = "design") +@Controller +@RequestMapping("/design") +class DesignController extends CrudController { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/HavingPK.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/HavingPK.java new file mode 100644 index 000000000..c2869a01d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/HavingPK.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app104; + +/** + * The type Having pk. + */ +class HavingPK { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/SpringDocApp104Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/SpringDocApp104Test.java new file mode 100644 index 000000000..f24f696c2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app104/SpringDocApp104Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app104; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 104 test. + */ +class SpringDocApp104Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/SpringDocApp105Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/SpringDocApp105Test.java new file mode 100644 index 000000000..4b90155b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/SpringDocApp105Test.java @@ -0,0 +1,144 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 105 test. + */ +@TestPropertySource(properties = { + "springdoc.group-configs[0].group=stores", + "springdoc.group-configs[0].paths-to-match=/store/**", + "springdoc.group-configs[1].group=users", + "springdoc.group-configs[1].packages-to-scan=test.org.springdoc.api.v30.app105.api.user", + "springdoc.group-configs[2].group=pets", + "springdoc.group-configs[2].paths-to-match=/pet/**", + "springdoc.group-configs[3].group=groups test", + "springdoc.group-configs[3].paths-to-match=/v1/**", + "springdoc.group-configs[3].paths-to-exclude=/v1/users", + "springdoc.group-configs[3].packages-to-scan=test.org.springdoc.api.v30.app105.api.user,test.org.springdoc.api.v30.app105.api.store", +}) +class SpringDocApp105Test extends AbstractSpringDocTest { + + /** + * The constant className. + */ + public static String className; + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app105-1.json"), true)); + } + + /** + * Test app 2. + * + * @throws Exception the exception + */ + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app105-2.json"), true)); + } + + /** + * Test app 3. + * + * @throws Exception the exception + */ + @Test + void testApp3() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app105-3.json"), true)); + } + + /** + * Test app 4. + * + * @throws Exception the exception + */ + @Test + void testApp4() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app105-4.json"), true)); + } + + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/ApiUtil.java new file mode 100644 index 000000000..0f4d89b78 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/ApiUtil.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api; + +import java.io.IOException; + +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.server.ResponseStatusException; + +/** + * The type Api util. + */ +public class ApiUtil { + + /** + * Sets example response. + * + * @param req the req + * @param contentType the content type + * @param example the example + */ + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); + req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Check api key. + * + * @param req the req + */ + public static void checkApiKey(NativeWebRequest req) { + if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { + throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/ExceptionTranslator.java new file mode 100644 index 000000000..99d109db6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/ExceptionTranslator.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api; + +import java.util.Map; + +import jakarta.validation.ConstraintViolationException; + +import org.springframework.boot.web.error.ErrorAttributeOptions; +import org.springframework.boot.web.servlet.error.ErrorAttributes; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.WebRequest; + +/** + * The type Exception translator. + */ +@RestControllerAdvice +class ExceptionTranslator { + + /** + * The Error attributes. + */ + private final ErrorAttributes errorAttributes; + + /** + * Instantiates a new Exception translator. + * + * @param errorAttributes the error attributes + */ + public ExceptionTranslator(ErrorAttributes errorAttributes) { + this.errorAttributes = errorAttributes; + } + + /** + * Process constraint violation exception map. + * + * @param request the request + * @return the map + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Map processConstraintViolationException(WebRequest request) { + request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); + return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/HomeController.java new file mode 100644 index 000000000..f1f293b9f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/HomeController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; +import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; + +/** + * Home redirection to swagger api documentation + */ +@Controller +class HomeController { + + /** + * The Swagger ui path. + */ + @Value(SWAGGER_UI_PATH) + private String swaggerUiPath; + + /** + * Index string. + * + * @return the string + */ + @GetMapping(DEFAULT_PATH_SEPARATOR) + public String index() { + return REDIRECT_URL_PREFIX + swaggerUiPath; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApi.java new file mode 100644 index 000000000..58dbc0872 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApi.java @@ -0,0 +1,227 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v30.app105.api.pet; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v30.app105.model.ModelApiResponse; +import test.org.springdoc.api.v30.app105.model.Pet; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +/** + * The interface Pet api. + */ +@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { + @OAuthScope(name = "write:pets", description = "modify pets in your account"), + @OAuthScope(name = "read:pets", description = "read your pets") }))) +@Tag(name = "pet", description = "the pet API") +public interface PetApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default PetApiDelegate getDelegate() { + return new PetApiDelegate() { + }; + } + + /** + * Add pet. + * + * @param pet the pet + */ + @Operation(summary = "Add a new pet to the store", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default void addPet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + // return getDelegate().addPet(pet); + } + + /** + * Delete pet response entity. + * + * @param petId the pet id + * @param apiKey the api key + * @return the response entity + */ + @Operation(summary = "Deletes a pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @DeleteMapping(value = "/pet/{petId}") + default ResponseEntity deletePet( + @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + return getDelegate().deletePet(petId, apiKey); + } + + /** + * Find pets by status response entity. + * + * @param status the status + * @return the response entity + */ + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid status value") }) + @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByStatus( + @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { + return getDelegate().findPetsByStatus(status); + } + + /** + * Find pets by tags response entity. + * + * @param tags the tags + * @return the response entity + */ + @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid tag value") }) + @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByTags( + @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + return getDelegate().findPetsByTags(tags); + } + + /** + * Gets pet by id. + * + * @param petId the pet id + * @return the pet by id + */ + @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { + @SecurityRequirement(name = "api_key") }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getPetById( + @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + return getDelegate().getPetById(petId); + } + + /** + * Update pet response entity. + * + * @param pet the pet + * @return the response entity + */ + @Operation(summary = "Update an existing pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") }) + @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default ResponseEntity updatePet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + return getDelegate().updatePet(pet); + } + + /** + * Update pet with form response entity. + * + * @param petId the pet id + * @param name the name + * @param status the status + * @return the response entity + */ + @Operation(summary = "Updates a pet in the store with form data", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) + default ResponseEntity updatePetWithForm( + @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, + @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { + return getDelegate().updatePetWithForm(petId, name, status); + } + + /** + * Upload file response entity. + * + * @param petId the pet id + * @param additionalMetadata the additional metadata + * @param file the file + * @return the response entity + */ + @Operation(summary = "uploads an image", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) + @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { + "multipart/form-data" }) + default ResponseEntity uploadFile( + @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { + return getDelegate().uploadFile(petId, additionalMetadata, file); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiController.java new file mode 100644 index 000000000..f20e6d307 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api.pet; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Pet api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class PetApiController implements PetApi { + + /** + * The Delegate. + */ + private final PetApiDelegate delegate; + + /** + * Instantiates a new Pet api controller. + * + * @param delegate the delegate + */ + public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public PetApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegate.java new file mode 100644 index 000000000..8c4c79157 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegate.java @@ -0,0 +1,193 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api.pet; + +import java.util.List; +import java.util.Optional; + +import jakarta.validation.Valid; +import test.org.springdoc.api.v30.app105.api.ApiUtil; +import test.org.springdoc.api.v30.app105.model.ModelApiResponse; +import test.org.springdoc.api.v30.app105.model.Pet; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface PetApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Add pet. + * + * @param pet the pet + * @see PetApi#addPet PetApi#addPet + */ + default void addPet(Pet pet) { + + } + + /** + * Delete pet response entity. + * + * @param petId the pet id + * @param apiKey the api key + * @return the response entity + * @see PetApi#deletePet PetApi#deletePet + */ + default ResponseEntity deletePet(Long petId, + String apiKey) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Find pets by status response entity. + * + * @param status the status + * @return the response entity + * @see PetApi#findPetsByStatus PetApi#findPetsByStatus + */ + default ResponseEntity> findPetsByStatus(List status) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Extract. + */ + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + break; + } + } + }); + } + + /** + * Find pets by tags response entity. + * + * @param tags the tags + * @return the response entity + * @see PetApi#findPetsByTags PetApi#findPetsByTags + */ + default ResponseEntity> findPetsByTags(List tags) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets pet by id. + * + * @param petId the pet id + * @return the pet by id + * @see PetApi#getPetById PetApi#getPetById + */ + default ResponseEntity getPetById(Long petId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update pet response entity. + * + * @param pet the pet + * @return the response entity + * @see PetApi#updatePet PetApi#updatePet + */ + default ResponseEntity updatePet(Pet pet) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update pet with form response entity. + * + * @param petId the pet id + * @param name the name + * @param status the status + * @return the response entity + * @see PetApi#updatePetWithForm PetApi#updatePetWithForm + */ + default ResponseEntity updatePetWithForm(Long petId, + String name, + String status) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Upload file response entity. + * + * @param petId the pet id + * @param additionalMetadata the additional metadata + * @param file the file + * @return the response entity + * @see PetApi#uploadFile PetApi#uploadFile + */ + default ResponseEntity uploadFile(Long petId, + String additionalMetadata, + @Valid MultipartFile file) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegateImpl.java new file mode 100644 index 000000000..88c50c130 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/pet/PetApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api.pet; + +import org.springframework.stereotype.Service; + +/** + * The type Pet api delegate. + */ +@Service +class PetApiDelegateImpl implements PetApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApi.java new file mode 100644 index 000000000..9f80a2b02 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApi.java @@ -0,0 +1,148 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v30.app105.api.store; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import test.org.springdoc.api.v30.app105.model.Order; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * The interface Store api. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() { + }; + } + + /** + * Delete order response entity. + * + * @param orderId the order id + * @return the response entity + */ + @Operation(summary = "Delete purchase order by ID", tags = { "store" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @DeleteMapping(value = "/store/order/{orderId}") + default ResponseEntity deleteOrder( + @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { + return getDelegate().deleteOrder(orderId); + } + + /** + * Gets inventory. + * + * @return the inventory + */ + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { + @SecurityRequirement(name = "api_key") }, tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) + @GetMapping(value = "/store/inventory", produces = { "application/json" }) + default ResponseEntity> getInventory() { + return getDelegate().getInventory(); + } + + /** + * Gets order by id. + * + * @param orderId the order id + * @return the order by id + */ + @Operation(summary = "Find purchase order by ID", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { + return getDelegate().getOrderById(orderId); + } + + /** + * Place order response entity. + * + * @param order the order + * @return the response entity + */ + @Operation(summary = "Place an order for a pet", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid Order") }) + @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { + "application/json" }) + default ResponseEntity placeOrder( + @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { + return getDelegate().placeOrder(order); + } + + /** + * Stores. + * + * @param name the name + */ + @GetMapping(value = "/v1/stores") + default void stores(@Valid @NotBlank String name) { + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiController.java new file mode 100644 index 000000000..86454ab89 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api.store; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Store api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class StoreApiController implements StoreApi { + + /** + * The Delegate. + */ + private final StoreApiDelegate delegate; + + /** + * Instantiates a new Store api controller. + * + * @param delegate the delegate + */ + public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public StoreApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegate.java new file mode 100644 index 000000000..99e159a0d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegate.java @@ -0,0 +1,124 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api.store; + +import java.util.Map; +import java.util.Optional; + +import test.org.springdoc.api.v30.app105.api.ApiUtil; +import test.org.springdoc.api.v30.app105.model.Order; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface StoreApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Delete order response entity. + * + * @param orderId the order id + * @return the response entity + * @see StoreApi#deleteOrder StoreApi#deleteOrder + */ + default ResponseEntity deleteOrder(String orderId) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets inventory. + * + * @return the inventory + * @see StoreApi#getInventory StoreApi#getInventory + */ + default ResponseEntity> getInventory() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets order by id. + * + * @param orderId the order id + * @return the order by id + * @see StoreApi#getOrderById StoreApi#getOrderById + */ + default ResponseEntity getOrderById(Long orderId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Extract. + */ + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + break; + } + } + }); + } + + /** + * Place order response entity. + * + * @param order the order + * @return the response entity + * @see StoreApi#placeOrder StoreApi#placeOrder + */ + default ResponseEntity placeOrder(Order order) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegateImpl.java new file mode 100644 index 000000000..c100604bd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/store/StoreApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api.store; + +import org.springframework.stereotype.Service; + +/** + * The type Store api delegate. + */ +@Service +class StoreApiDelegateImpl implements StoreApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApi.java new file mode 100644 index 000000000..5c3223f05 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApi.java @@ -0,0 +1,197 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v30.app105.api.user; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v30.app105.model.User; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * The interface User api. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "user", description = "the user API") +public interface UserApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default UserApiDelegate getDelegate() { + return new UserApiDelegate() { + }; + } + + /** + * Create user response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Create user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user", consumes = { "application/json" }) + default ResponseEntity createUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { + return getDelegate().createUser(user); + } + + /** + * Create users with array input response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) + default ResponseEntity createUsersWithArrayInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithArrayInput(user); + } + + /** + * Create users with list input response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) + default ResponseEntity createUsersWithListInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithListInput(user); + } + + /** + * Delete user response entity. + * + * @param username the username + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @DeleteMapping(value = "/user/{username}") + default ResponseEntity deleteUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + return getDelegate().deleteUser(username); + } + + /** + * Gets user by name. + * + * @param username the username + * @return the user by name + */ + @Operation(summary = "Get user by user name", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + + @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) + default ResponseEntity getUserByName( + @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + return getDelegate().getUserByName(username); + } + + /** + * Login user response entity. + * + * @param username the username + * @param password the password + * @return the response entity + */ + @Operation(summary = "Logs user into the system", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) + @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) + default ResponseEntity loginUser( + @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + return getDelegate().loginUser(username, password); + } + + /** + * Logout user response entity. + * + * @return the response entity + */ + @Operation(summary = "Logs out current logged in user session", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @GetMapping(value = "/user/logout") + default ResponseEntity logoutUser() { + return getDelegate().logoutUser(); + } + + /** + * Update user response entity. + * + * @param username the username + * @param user the user + * @return the response entity + */ + @Operation(summary = "Updated user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + @PutMapping(value = "/user/{username}", consumes = { "application/json" }) + default ResponseEntity updateUser( + @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { + return getDelegate().updateUser(username, user); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiController.java new file mode 100644 index 000000000..c36144b9d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api.user; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type User api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class UserApiController implements UserApi { + + /** + * The Delegate. + */ + private final UserApiDelegate delegate; + + /** + * Instantiates a new User api controller. + * + * @param delegate the delegate + */ + public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public UserApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegate.java new file mode 100644 index 000000000..6b27efa02 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegate.java @@ -0,0 +1,168 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api.user; + +import java.util.List; +import java.util.Optional; + +import test.org.springdoc.api.v30.app105.api.ApiUtil; +import test.org.springdoc.api.v30.app105.model.User; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface UserApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Create user response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUser UserApi#createUser + */ + default ResponseEntity createUser(User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Create users with array input response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUsersWithArrayInput UserApi#createUsersWithArrayInput + */ + default ResponseEntity createUsersWithArrayInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Create users with list input response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUsersWithListInput UserApi#createUsersWithListInput + */ + default ResponseEntity createUsersWithListInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Delete user response entity. + * + * @param username the username + * @return the response entity + * @see UserApi#deleteUser UserApi#deleteUser + */ + default ResponseEntity deleteUser(String username) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets user by name. + * + * @param username the username + * @return the user by name + * @see UserApi#getUserByName UserApi#getUserByName + */ + default ResponseEntity getUserByName(String username) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Login user response entity. + * + * @param username the username + * @param password the password + * @return the response entity + * @see UserApi#loginUser UserApi#loginUser + */ + default ResponseEntity loginUser(String username, + String password) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Logout user response entity. + * + * @return the response entity + * @see UserApi#logoutUser UserApi#logoutUser + */ + default ResponseEntity logoutUser() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update user response entity. + * + * @param username the username + * @param user the user + * @return the response entity + * @see UserApi#updateUser UserApi#updateUser + */ + default ResponseEntity updateUser(String username, + User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegateImpl.java new file mode 100644 index 000000000..3490a2665 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/api/user/UserApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.api.user; + +import org.springframework.stereotype.Service; + +/** + * The type User api delegate. + */ +@Service +class UserApiDelegateImpl implements UserApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Category.java new file mode 100644 index 000000000..81e44e96d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Category.java @@ -0,0 +1,137 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Category. + */ +class Category { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Name. + */ + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id category. + * + * @param id the id + * @return the category + */ + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name category. + * + * @param name the name + * @return the category + */ + public Category name(String name) { + this.name = name; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/ModelApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/ModelApiResponse.java new file mode 100644 index 000000000..931c735c7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/ModelApiResponse.java @@ -0,0 +1,174 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Model api response. + */ +public class ModelApiResponse { + + /** + * The Code. + */ + @Schema(description = "") + private Integer code = null; + + /** + * The Type. + */ + @Schema(description = "") + private String type = null; + + /** + * The Message. + */ + @Schema(description = "") + private String message = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get code + * + * @return code code + */ + @JsonProperty("code") + public Integer getCode() { + return code; + } + + /** + * Sets code. + * + * @param code the code + */ + public void setCode(Integer code) { + this.code = code; + } + + /** + * Code model api response. + * + * @param code the code + * @return the model api response + */ + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * + * @return type type + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * Sets type. + * + * @param type the type + */ + public void setType(String type) { + this.type = type; + } + + /** + * Type model api response. + * + * @param type the type + * @return the model api response + */ + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * + * @return message message + */ + @JsonProperty("message") + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * Message model api response. + * + * @param message the message + * @return the model api response + */ + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Order.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Order.java new file mode 100644 index 000000000..f0d175f07 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Order.java @@ -0,0 +1,364 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.model; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Order. + */ +public class Order { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Pet id. + */ + @Schema(description = "") + private Long petId = null; + + /** + * The Quantity. + */ + @Schema(description = "") + private Integer quantity = null; + + /** + * The Ship date. + */ + @Schema(description = "") + private Date shipDate = null; + + /** + * The Status. + */ + @Schema(description = "Order Status") + /** + * Order Status + **/ + private StatusEnum status = null; + + /** + * The Complete. + */ + @Schema(description = "") + private Boolean complete = false; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id order. + * + * @param id the id + * @return the order + */ + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * + * @return petId pet id + */ + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + + /** + * Sets pet id. + * + * @param petId the pet id + */ + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + * Pet id order. + * + * @param petId the pet id + * @return the order + */ + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * + * @return quantity quantity + */ + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + + /** + * Sets quantity. + * + * @param quantity the quantity + */ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + * Quantity order. + * + * @param quantity the quantity + * @return the order + */ + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * + * @return shipDate ship date + */ + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + + /** + * Sets ship date. + * + * @param shipDate the ship date + */ + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Ship date order. + * + * @param shipDate the ship date + * @return the order + */ + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * + * @return status status + */ + @JsonProperty("status") + public String getStatus() { + if (status == null) { + return null; + } + return status.getValue(); + } + + /** + * Sets status. + * + * @param status the status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Status order. + * + * @param status the status + * @return the order + */ + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * + * @return complete boolean + */ + @JsonProperty("complete") + public Boolean isisComplete() { + return complete; + } + + /** + * Sets complete. + * + * @param complete the complete + */ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + /** + * Complete order. + * + * @param complete the complete + * @return the order + */ + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * The enum Status enum. + */ + public enum StatusEnum { + /** + *Placed status enum. + */ + PLACED("placed"), + /** + *Approved status enum. + */ + APPROVED("approved"), + /** + *Delivered status enum. + */ + DELIVERED("delivered"); + + /** + * The Value. + */ + private String value; + + /** + * Instantiates a new Status enum. + * + * @param value the value + */ + StatusEnum(String value) { + this.value = value; + } + + /** + * From value status enum. + * + * @param text the text + * @return the status enum + */ + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + /** + * Gets value. + * + * @return the value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Pet.java new file mode 100644 index 000000000..80cb02aef --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Pet.java @@ -0,0 +1,392 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.model; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +/** + * The type Pet. + */ +public class Pet { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Category. + */ + @Schema(description = "") + private Category category = null; + + /** + * The Name. + */ + @Schema(example = "doggie", required = true, description = "") + private String name = null; + + /** + * The Photo urls. + */ + @Schema(required = true, description = "") + private List photoUrls = new ArrayList(); + + /** + * The Tags. + */ + @Schema(description = "") + private List tags = null; + + /** + * The Status. + */ + @Schema(description = "pet status in the store") + /** + * pet status in the store + **/ + private StatusEnum status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id pet. + * + * @param id the id + * @return the pet + */ + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * + * @return category category + */ + @JsonProperty("category") + public Category getCategory() { + return category; + } + + /** + * Sets category. + * + * @param category the category + */ + public void setCategory(Category category) { + this.category = category; + } + + /** + * Category pet. + * + * @param category the category + * @return the pet + */ + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name pet. + * + * @param name the name + * @return the pet + */ + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * + * @return photoUrls photo urls + */ + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + /** + * Sets photo urls. + * + * @param photoUrls the photo urls + */ + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + * Photo urls pet. + * + * @param photoUrls the photo urls + * @return the pet + */ + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + /** + * Add photo urls item pet. + * + * @param photoUrlsItem the photo urls item + * @return the pet + */ + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * + * @return tags tags + */ + @JsonProperty("tags") + public List getTags() { + return tags; + } + + /** + * Sets tags. + * + * @param tags the tags + */ + public void setTags(List tags) { + this.tags = tags; + } + + /** + * Tags pet. + * + * @param tags the tags + * @return the pet + */ + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + /** + * Add tags item pet. + * + * @param tagsItem the tags item + * @return the pet + */ + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * + * @return status status + */ + @JsonProperty("status") + public StatusEnum getStatus() { + if (status == null) { + return null; + } + return status; + } + + /** + * Sets status. + * + * @param status the status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Status pet. + * + * @param status the status + * @return the pet + */ + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * The enum Status enum. + */ + public enum StatusEnum { + /** + *Available status enum. + */ + AVAILABLE("available"), + /** + *Pending status enum. + */ + PENDING("pending"), + /** + *Sold status enum. + */ + SOLD("sold"); + + /** + * The Value. + */ + private String value; + + /** + * Instantiates a new Status enum. + * + * @param value the value + */ + StatusEnum(String value) { + this.value = value; + } + + /** + * From value status enum. + * + * @param text the text + * @return the status enum + */ + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + /** + * Gets value. + * + * @return the value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Tag.java new file mode 100644 index 000000000..9c7ba4a06 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/Tag.java @@ -0,0 +1,137 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tag. + */ +class Tag { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Name. + */ + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id tag. + * + * @param id the id + * @return the tag + */ + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name tag. + * + * @param name the name + * @return the tag + */ + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/User.java new file mode 100644 index 000000000..3e09cc23c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app105/model/User.java @@ -0,0 +1,362 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type User. + */ +public class User { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Username. + */ + @Schema(description = "") + private String username = null; + + /** + * The First name. + */ + @Schema(description = "") + private String firstName = null; + + /** + * The Last name. + */ + @Schema(description = "") + private String lastName = null; + + /** + * The Email. + */ + @Schema(description = "") + private String email = null; + + /** + * The Password. + */ + @Schema(description = "") + private String password = null; + + /** + * The Phone. + */ + @Schema(description = "") + private String phone = null; + + /** + * The User status. + */ + @Schema(description = "User Status") + /** + * User Status + **/ + private Integer userStatus = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id user. + * + * @param id the id + * @return the user + */ + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * + * @return username username + */ + @JsonProperty("username") + public String getUsername() { + return username; + } + + /** + * Sets username. + * + * @param username the username + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * Username user. + * + * @param username the username + * @return the user + */ + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * + * @return firstName first name + */ + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * First name user. + * + * @param firstName the first name + * @return the user + */ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * + * @return lastName last name + */ + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Last name user. + * + * @param lastName the last name + * @return the user + */ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * + * @return email email + */ + @JsonProperty("email") + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Email user. + * + * @param email the email + * @return the user + */ + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * + * @return password password + */ + @JsonProperty("password") + public String getPassword() { + return password; + } + + /** + * Sets password. + * + * @param password the password + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * Password user. + * + * @param password the password + * @return the user + */ + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * + * @return phone phone + */ + @JsonProperty("phone") + public String getPhone() { + return phone; + } + + /** + * Sets phone. + * + * @param phone the phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * Phone user. + * + * @param phone the phone + * @return the user + */ + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * + * @return userStatus user status + */ + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + + /** + * Sets user status. + * + * @param userStatus the user status + */ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + /** + * User status user. + * + * @param userStatus the user status + * @return the user + */ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app106/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app106/HelloController.java new file mode 100644 index 000000000..4ec9507e7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app106/HelloController.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app106; + +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Find articles response entity. + * + * @param modifiedSince the modified since + * @return the response entity + */ + @Operation(summary = "find-articles") + @GetMapping + @Parameter(name = HttpHeaders.IF_MODIFIED_SINCE, + description = "DateTime", + in = ParameterIn.HEADER, + schema = @Schema(type = "string", format = "date-time"), + example = "2020-01-01T00:00:00.000Z" + ) + public ResponseEntity findArticles(@RequestHeader(value = HttpHeaders.IF_MODIFIED_SINCE, required = false) Instant modifiedSince) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app106/SpringDocApp106Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app106/SpringDocApp106Test.java new file mode 100644 index 000000000..1378b6d31 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app106/SpringDocApp106Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app106; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 106 test. + */ +class SpringDocApp106Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app107/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app107/HelloController.java new file mode 100644 index 000000000..6bc235c9c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app107/HelloController.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app107; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets entity b. + * + * @return the entity b + */ + @GetMapping(path = "/entity-b", produces = { "application/json", "application/xml" }) + public EntityB getEntityB() { + return new EntityB(); + } + + /** + * The type Entity b. + */ + class EntityB { + + /** + * The Field b. + */ + @Schema(required = true) + @JsonProperty("fieldB") + private String fieldB; + + /** + * The Entity a. + */ + @Schema(required = true) + @JsonProperty("entityA") + private EntityA entityA; + //Getters and setters... + } + + /** + * The type Entity a. + */ + class EntityA { + /** + * The Field a. + */ + @Schema(required = true) + @JsonProperty("fieldA") + private String fieldA; + //Getters and setters... + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app107/SpringDocApp107Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app107/SpringDocApp107Test.java new file mode 100644 index 000000000..a3d4aa53d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app107/SpringDocApp107Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app107; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 107 test. + */ +class SpringDocApp107Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/ActionResult.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/ActionResult.java new file mode 100644 index 000000000..621700d17 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/ActionResult.java @@ -0,0 +1,173 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app108; + +/** + * The type Action result. + * + * @param the type parameter + */ +class ActionResult { + + /** + * The Value. + */ + protected T value; + + /** + * The Success. + */ + protected boolean success; + + /** + * The Error code. + */ + protected String errorCode; + + /** + * The Message. + */ + protected String message; + + /** + * The Error value. + */ + protected Object errorValue; + + /** + * The Target url. + */ + protected String targetUrl; + + /** + * Gets value. + * + * @return the value + */ + public T getValue() { + return value; + } + + /** + * Sets value. + * + * @param value the value + */ + public void setValue(T value) { + this.value = value; + } + + /** + * Is success boolean. + * + * @return the boolean + */ + public boolean isSuccess() { + return success; + } + + /** + * Sets success. + * + * @param success the success + */ + public void setSuccess(boolean success) { + this.success = success; + } + + /** + * Gets error code. + * + * @return the error code + */ + public String getErrorCode() { + return errorCode; + } + + /** + * Sets error code. + * + * @param errorCode the error code + */ + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * Gets error value. + * + * @return the error value + */ + public Object getErrorValue() { + return errorValue; + } + + /** + * Sets error value. + * + * @param errorValue the error value + */ + public void setErrorValue(Object errorValue) { + this.errorValue = errorValue; + } + + /** + * Gets target url. + * + * @return the target url + */ + public String getTargetUrl() { + return targetUrl; + } + + /** + * Sets target url. + * + * @param targetUrl the target url + */ + public void setTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/HelloController.java new file mode 100644 index 000000000..d92664602 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app108; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Update action result. + * + * @param toto the toto + * @return the action result + */ + @PostMapping + public ActionResult update(String toto) { + return null; + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/SpringDocApp108Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/SpringDocApp108Test.java new file mode 100644 index 000000000..8ae0b068e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app108/SpringDocApp108Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app108; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 108 test. + */ +class SpringDocApp108Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app109/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app109/HelloController.java new file mode 100644 index 000000000..032efdb4c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app109/HelloController.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app109; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.core.io.ByteArrayResource; +import org.springframework.core.io.Resource; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets resource. + * + * @return the resource + */ + @GetMapping("/api/v1/resource") + public Resource getResource() { + return new ByteArrayResource(new byte[] {}); + } + + /** + * Get byte array byte [ ]. + * + * @return the byte [ ] + */ + @GetMapping("/api/v1/bytearray") + @ApiResponse(content = @Content(schema = @Schema(type = "string", format = "binary"))) + public byte[] getByteArray() { + return new byte[] {}; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app109/SpringDocApp109Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app109/SpringDocApp109Test.java new file mode 100644 index 000000000..c43cc5f83 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app109/SpringDocApp109Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app109; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 109 test. + */ +class SpringDocApp109Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java new file mode 100644 index 000000000..8099afd0b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import java.util.List; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Upload documents response entity. + * + * @param multipartFiles the multipart files + * @return the response entity + */ + @PostMapping(path = "/documents", consumes = "multipart/form-data") + public ResponseEntity uploadDocuments(@RequestPart("doc") List multipartFiles) { + return null; + } + + /** + * Post track string. + * + * @param file the file + * @return the string + */ + @RequestMapping(value = "/tracks", method = RequestMethod.POST, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + public @ResponseBody + String postTrack(@RequestParam("file") MultipartFile file) { + return "redirect:/"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..a6355d729 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 11 test. + */ +class SpringDocApp11Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/ErrorMessage.java new file mode 100644 index 000000000..cd99880b8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/ErrorMessage.java @@ -0,0 +1,94 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app110; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +/** + * The type Error message. + */ +class ErrorMessage { + + /** + * The Errors. + */ + private List errors; + + /** + * Instantiates a new Error message. + */ + public ErrorMessage() { + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(List errors) { + this.errors = errors; + } + + /** + * Instantiates a new Error message. + * + * @param error the error + */ + public ErrorMessage(String error) { + this(Collections.singletonList(error)); + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(String... errors) { + this(Arrays.asList(errors)); + } + + /** + * Gets errors. + * + * @return the errors + */ + public List getErrors() { + return errors; + } + + /** + * Sets errors. + * + * @param errors the errors + */ + public void setErrors(List errors) { + this.errors = errors; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/GlobalControllerAdvice.java new file mode 100644 index 000000000..2e7ecc91f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/GlobalControllerAdvice.java @@ -0,0 +1,192 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app110; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.FieldError; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +/** + * The type Global controller advice. + */ +@ControllerAdvice(assignableTypes = PersonController.class) +class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +{ + /** + * Note use base class if you wish to leverage its handling. + * Some code will need changing. + */ + private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); + + /** + * Problem response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler(Throwable.class) + @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity problem(final Throwable e) { + String message = "Problem occured"; + UUID uuid = UUID.randomUUID(); + String logRef = uuid.toString(); + logger.error("logRef=" + logRef, message, e); + return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); + } + + + /** + * Handle method argument not valid response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex + ) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + List globalErrors = ex.getBindingResult().getGlobalErrors(); + List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); + String error; + for (FieldError fieldError : fieldErrors) { + error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); + errors.add(error); + } + for (ObjectError objectError : globalErrors) { + error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); + errors.add(error); + } + ErrorMessage errorMessage = new ErrorMessage(errors); + + //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle constraint violated exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex + ) { + Set> constraintViolations = ex.getConstraintViolations(); + + + List errors = new ArrayList<>(constraintViolations.size()); + String error; + for (ConstraintViolation constraintViolation : constraintViolations) { + + error = constraintViolation.getMessage(); + errors.add(error); + } + + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle missing servlet request parameter exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex + ) { + + List errors = new ArrayList<>(); + String error = ex.getParameterName() + ", " + ex.getMessage(); + errors.add(error); + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + + /** + * Handle http media type not supported response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMediaTypeNotSupportedException.class) + @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) + public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex + ) { + String unsupported = "Unsupported content type: " + ex.getContentType(); + String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); + ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); + return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); + } + + /** + * Handle http message not readable response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { + Throwable mostSpecificCause = ex.getMostSpecificCause(); + ErrorMessage errorMessage; + if (mostSpecificCause != null) { + String exceptionName = mostSpecificCause.getClass().getName(); + String message = mostSpecificCause.getMessage(); + errorMessage = new ErrorMessage(exceptionName, message); + } + else { + errorMessage = new ErrorMessage(ex.getMessage()); + } + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/Person.java new file mode 100644 index 000000000..c28859044 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/Person.java @@ -0,0 +1,212 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app110; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import org.hibernate.validator.constraints.CreditCardNumber; + + +/** + * The type Person. + */ +class Person { + /** + * The Id. + */ + private long id; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + @NotNull + @NotBlank + @Size(max = 10) + private String lastName; + + /** + * The Email. + */ + @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") + private String email; + + /** + * The Email 1. + */ + @Email() + private String email1; + + /** + * The Age. + */ + @Min(18) + @Max(30) + private int age; + + /** + * The Credit card number. + */ + @CreditCardNumber + private String creditCardNumber; + + /** + * Gets credit card number. + * + * @return the credit card number + */ + public String getCreditCardNumber() { + return creditCardNumber; + } + + /** + * Sets credit card number. + * + * @param creditCardNumber the credit card number + */ + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } + + /** + * Gets email 1. + * + * @return the email 1 + */ + public String getEmail1() { + return email1; + } + + /** + * Sets email 1. + * + * @param email1 the email 1 + */ + public void setEmail1(String email1) { + this.email1 = email1; + } + + /** + * Gets first name. + * + * @return the first name + */ + @Size(min = 2) + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Gets age. + * + * @return the age + */ + public int getAge() { + return age; + } + + /** + * Sets age. + * + * @param age the age + */ + public void setAge(int age) { + this.age = age; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/PersonController.java new file mode 100644 index 000000000..61255bb4a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/PersonController.java @@ -0,0 +1,96 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app110; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller. + */ +@RestController +@Validated +class PersonController { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) throws HttpMediaTypeNotSupportedException { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) throws HttpMediaTypeNotSupportedException { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/PersonController2.java new file mode 100644 index 000000000..5f5f465d6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/PersonController2.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app110; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller 2. + */ +@RestController +@Validated +class PersonController2 { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person2", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/Problem.java new file mode 100644 index 000000000..249b9761a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/Problem.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app110; + +/** + * The type Problem. + */ +class Problem { + + /** + * The Log ref. + */ + private String logRef; + + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Problem. + * + * @param logRef the log ref + * @param message the message + */ + public Problem(String logRef, String message) { + super(); + this.logRef = logRef; + this.message = message; + } + + /** + * Instantiates a new Problem. + */ + public Problem() { + super(); + + } + + /** + * Gets log ref. + * + * @return the log ref + */ + public String getLogRef() { + return logRef; + } + + /** + * Sets log ref. + * + * @param logRef the log ref + */ + public void setLogRef(String logRef) { + this.logRef = logRef; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/SpringDocApp110Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/SpringDocApp110Test.java new file mode 100644 index 000000000..c277bc3ad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app110/SpringDocApp110Test.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app110; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 110 test. + */ +@TestPropertySource(properties = { + "application-description=description", + "application-version=v1" }) +class SpringDocApp110Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + + /** + * Custom open api open api. + * + * @param appDesciption the app desciption + * @param appVersion the app version + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { + + return new OpenAPI() + .info(new Info() + .title("sample application API") + .version(appVersion) + .description(appDesciption) + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/ErrorMessage.java new file mode 100644 index 000000000..3d38bb18f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/ErrorMessage.java @@ -0,0 +1,94 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app111; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +/** + * The type Error message. + */ +class ErrorMessage { + + /** + * The Errors. + */ + private List errors; + + /** + * Instantiates a new Error message. + */ + public ErrorMessage() { + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(List errors) { + this.errors = errors; + } + + /** + * Instantiates a new Error message. + * + * @param error the error + */ + public ErrorMessage(String error) { + this(Collections.singletonList(error)); + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(String... errors) { + this(Arrays.asList(errors)); + } + + /** + * Gets errors. + * + * @return the errors + */ + public List getErrors() { + return errors; + } + + /** + * Sets errors. + * + * @param errors the errors + */ + public void setErrors(List errors) { + this.errors = errors; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/GlobalControllerAdvice.java new file mode 100644 index 000000000..88fd3dc62 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/GlobalControllerAdvice.java @@ -0,0 +1,192 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app111; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.FieldError; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +/** + * The type Global controller advice. + */ +@ControllerAdvice(basePackages = "test.org.springdoc.api.appzzz") +class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +{ + /** + * Note use base class if you wish to leverage its handling. + * Some code will need changing. + */ + private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); + + /** + * Problem response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler(Throwable.class) + @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity problem(final Throwable e) { + String message = "Problem occured"; + UUID uuid = UUID.randomUUID(); + String logRef = uuid.toString(); + logger.error("logRef=" + logRef, message, e); + return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); + } + + + /** + * Handle method argument not valid response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex + ) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + List globalErrors = ex.getBindingResult().getGlobalErrors(); + List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); + String error; + for (FieldError fieldError : fieldErrors) { + error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); + errors.add(error); + } + for (ObjectError objectError : globalErrors) { + error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); + errors.add(error); + } + ErrorMessage errorMessage = new ErrorMessage(errors); + + //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle constraint violated exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex + ) { + Set> constraintViolations = ex.getConstraintViolations(); + + + List errors = new ArrayList<>(constraintViolations.size()); + String error; + for (ConstraintViolation constraintViolation : constraintViolations) { + + error = constraintViolation.getMessage(); + errors.add(error); + } + + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle missing servlet request parameter exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex + ) { + + List errors = new ArrayList<>(); + String error = ex.getParameterName() + ", " + ex.getMessage(); + errors.add(error); + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + + /** + * Handle http media type not supported response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMediaTypeNotSupportedException.class) + @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) + public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex + ) { + String unsupported = "Unsupported content type: " + ex.getContentType(); + String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); + ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); + return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); + } + + /** + * Handle http message not readable response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { + Throwable mostSpecificCause = ex.getMostSpecificCause(); + ErrorMessage errorMessage; + if (mostSpecificCause != null) { + String exceptionName = mostSpecificCause.getClass().getName(); + String message = mostSpecificCause.getMessage(); + errorMessage = new ErrorMessage(exceptionName, message); + } + else { + errorMessage = new ErrorMessage(ex.getMessage()); + } + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/Person.java new file mode 100644 index 000000000..1e2e1cb0f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/Person.java @@ -0,0 +1,212 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app111; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import org.hibernate.validator.constraints.CreditCardNumber; + + +/** + * The type Person. + */ +class Person { + /** + * The Id. + */ + private long id; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + @NotNull + @NotBlank + @Size(max = 10) + private String lastName; + + /** + * The Email. + */ + @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") + private String email; + + /** + * The Email 1. + */ + @Email() + private String email1; + + /** + * The Age. + */ + @Min(18) + @Max(30) + private int age; + + /** + * The Credit card number. + */ + @CreditCardNumber + private String creditCardNumber; + + /** + * Gets credit card number. + * + * @return the credit card number + */ + public String getCreditCardNumber() { + return creditCardNumber; + } + + /** + * Sets credit card number. + * + * @param creditCardNumber the credit card number + */ + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } + + /** + * Gets email 1. + * + * @return the email 1 + */ + public String getEmail1() { + return email1; + } + + /** + * Sets email 1. + * + * @param email1 the email 1 + */ + public void setEmail1(String email1) { + this.email1 = email1; + } + + /** + * Gets first name. + * + * @return the first name + */ + @Size(min = 2) + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Gets age. + * + * @return the age + */ + public int getAge() { + return age; + } + + /** + * Sets age. + * + * @param age the age + */ + public void setAge(int age) { + this.age = age; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/PersonController.java new file mode 100644 index 000000000..c0f489c55 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/PersonController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app111; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller. + */ +@RestController +@Validated +class PersonController { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/PersonController2.java new file mode 100644 index 000000000..bde6f8b4e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/PersonController2.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app111; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller 2. + */ +@RestController +@Validated +class PersonController2 { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person2", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/Problem.java new file mode 100644 index 000000000..367112b14 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/Problem.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app111; + +/** + * The type Problem. + */ +class Problem { + + /** + * The Log ref. + */ + private String logRef; + + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Problem. + * + * @param logRef the log ref + * @param message the message + */ + public Problem(String logRef, String message) { + super(); + this.logRef = logRef; + this.message = message; + } + + /** + * Instantiates a new Problem. + */ + public Problem() { + super(); + + } + + /** + * Gets log ref. + * + * @return the log ref + */ + public String getLogRef() { + return logRef; + } + + /** + * Sets log ref. + * + * @param logRef the log ref + */ + public void setLogRef(String logRef) { + this.logRef = logRef; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/SpringDocApp111Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/SpringDocApp111Test.java new file mode 100644 index 000000000..d15a8d576 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app111/SpringDocApp111Test.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app111; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 111 test. + */ +@TestPropertySource(properties = { + "application-description=description", + "application-version=v1" }) +class SpringDocApp111Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + + /** + * Custom open api open api. + * + * @param appDesciption the app desciption + * @param appVersion the app version + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { + return new OpenAPI() + .info(new Info() + .title("sample application API") + .version(appVersion) + .description(appDesciption) + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/ErrorMessage.java new file mode 100644 index 000000000..d4d6a2493 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/ErrorMessage.java @@ -0,0 +1,94 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app112; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +/** + * The type Error message. + */ +class ErrorMessage { + + /** + * The Errors. + */ + private List errors; + + /** + * Instantiates a new Error message. + */ + public ErrorMessage() { + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(List errors) { + this.errors = errors; + } + + /** + * Instantiates a new Error message. + * + * @param error the error + */ + public ErrorMessage(String error) { + this(Collections.singletonList(error)); + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(String... errors) { + this(Arrays.asList(errors)); + } + + /** + * Gets errors. + * + * @return the errors + */ + public List getErrors() { + return errors; + } + + /** + * Sets errors. + * + * @param errors the errors + */ + public void setErrors(List errors) { + this.errors = errors; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/GlobalControllerAdvice.java new file mode 100644 index 000000000..2fab5b148 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/GlobalControllerAdvice.java @@ -0,0 +1,192 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app112; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.FieldError; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +/** + * The type Global controller advice. + */ +@ControllerAdvice(basePackages = "test.org.springdoc.api.v30.app112.sample") +class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +{ + /** + * Note use base class if you wish to leverage its handling. + * Some code will need changing. + */ + private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); + + /** + * Problem response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler(Throwable.class) + @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity problem(final Throwable e) { + String message = "Problem occured"; + UUID uuid = UUID.randomUUID(); + String logRef = uuid.toString(); + logger.error("logRef=" + logRef, message, e); + return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); + } + + + /** + * Handle method argument not valid response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex + ) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + List globalErrors = ex.getBindingResult().getGlobalErrors(); + List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); + String error; + for (FieldError fieldError : fieldErrors) { + error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); + errors.add(error); + } + for (ObjectError objectError : globalErrors) { + error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); + errors.add(error); + } + ErrorMessage errorMessage = new ErrorMessage(errors); + + //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle constraint violated exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex + ) { + Set> constraintViolations = ex.getConstraintViolations(); + + + List errors = new ArrayList<>(constraintViolations.size()); + String error; + for (ConstraintViolation constraintViolation : constraintViolations) { + + error = constraintViolation.getMessage(); + errors.add(error); + } + + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle missing servlet request parameter exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex + ) { + + List errors = new ArrayList<>(); + String error = ex.getParameterName() + ", " + ex.getMessage(); + errors.add(error); + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + + /** + * Handle http media type not supported response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMediaTypeNotSupportedException.class) + @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) + public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex + ) { + String unsupported = "Unsupported content type: " + ex.getContentType(); + String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); + ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); + return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); + } + + /** + * Handle http message not readable response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { + Throwable mostSpecificCause = ex.getMostSpecificCause(); + ErrorMessage errorMessage; + if (mostSpecificCause != null) { + String exceptionName = mostSpecificCause.getClass().getName(); + String message = mostSpecificCause.getMessage(); + errorMessage = new ErrorMessage(exceptionName, message); + } + else { + errorMessage = new ErrorMessage(ex.getMessage()); + } + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/Person.java new file mode 100644 index 000000000..e60ad3ab5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/Person.java @@ -0,0 +1,212 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app112; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import org.hibernate.validator.constraints.CreditCardNumber; + + +/** + * The type Person. + */ +public class Person { + /** + * The Id. + */ + private long id; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + @NotNull + @NotBlank + @Size(max = 10) + private String lastName; + + /** + * The Email. + */ + @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") + private String email; + + /** + * The Email 1. + */ + @Email() + private String email1; + + /** + * The Age. + */ + @Min(18) + @Max(30) + private int age; + + /** + * The Credit card number. + */ + @CreditCardNumber + private String creditCardNumber; + + /** + * Gets credit card number. + * + * @return the credit card number + */ + public String getCreditCardNumber() { + return creditCardNumber; + } + + /** + * Sets credit card number. + * + * @param creditCardNumber the credit card number + */ + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } + + /** + * Gets email 1. + * + * @return the email 1 + */ + public String getEmail1() { + return email1; + } + + /** + * Sets email 1. + * + * @param email1 the email 1 + */ + public void setEmail1(String email1) { + this.email1 = email1; + } + + /** + * Gets first name. + * + * @return the first name + */ + @Size(min = 2) + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Gets age. + * + * @return the age + */ + public int getAge() { + return age; + } + + /** + * Sets age. + * + * @param age the age + */ + public void setAge(int age) { + this.age = age; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/PersonController.java new file mode 100644 index 000000000..207725f6d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/PersonController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app112; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller. + */ +@RestController +@Validated +class PersonController { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/Problem.java new file mode 100644 index 000000000..db231b4ac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/Problem.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app112; + +/** + * The type Problem. + */ +class Problem { + + /** + * The Log ref. + */ + private String logRef; + + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Problem. + * + * @param logRef the log ref + * @param message the message + */ + public Problem(String logRef, String message) { + super(); + this.logRef = logRef; + this.message = message; + } + + /** + * Instantiates a new Problem. + */ + public Problem() { + super(); + + } + + /** + * Gets log ref. + * + * @return the log ref + */ + public String getLogRef() { + return logRef; + } + + /** + * Sets log ref. + * + * @param logRef the log ref + */ + public void setLogRef(String logRef) { + this.logRef = logRef; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/SpringDocApp112Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/SpringDocApp112Test.java new file mode 100644 index 000000000..3b9019c72 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/SpringDocApp112Test.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app112; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 112 test. + */ +@TestPropertySource(properties = { + "application-description=description", + "application-version=v1" }) +class SpringDocApp112Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + + /** + * Custom open api open api. + * + * @param appDesciption the app desciption + * @param appVersion the app version + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { + return new OpenAPI() + .info(new Info() + .title("sample application API") + .version(appVersion) + .description(appDesciption) + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/sample/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/sample/PersonController2.java new file mode 100644 index 000000000..c3db8f1ec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app112/sample/PersonController2.java @@ -0,0 +1,97 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app112.sample; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import test.org.springdoc.api.v30.app112.Person; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller 2. + */ +@RestController +@Validated +class PersonController2 { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person2", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) throws HttpMediaTypeNotSupportedException { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) throws HttpMediaTypeNotSupportedException { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app113/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app113/HelloController.java new file mode 100644 index 000000000..486593c47 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app113/HelloController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app113; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param body the body + */ + @PostMapping("/lol") + public void test(@RequestBody(required = false) Body body) { + } + + /** + * Test 2. + * + * @param body the body + */ + @PostMapping("/lol2") + public void test2(@RequestBody Optional body) { + } + + /** + * The type Body. + */ + class Body { + /** + * The Field. + */ + public String field; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app113/SpringDocApp113Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app113/SpringDocApp113Test.java new file mode 100644 index 000000000..a5b645bbb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app113/SpringDocApp113Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app113; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 113 test. + */ +class SpringDocApp113Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app114/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app114/HelloController.java new file mode 100644 index 000000000..27ff46f0b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app114/HelloController.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app114; + +import javax.money.MonetaryAmount; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets currency. + * + * @param carDTO the car dto + * @return the currency + */ + @PostMapping(value = "/foos1", consumes = MediaType.APPLICATION_JSON_VALUE) + MonetaryAmount getCurrency(@RequestBody CarDTO carDTO) { + return carDTO.price; + } + + /** + * The type Car dto. + */ + class CarDTO { + /** + * The Price. + */ + @JsonProperty("price") + MonetaryAmount price; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app114/SpringDocApp114Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app114/SpringDocApp114Test.java new file mode 100644 index 000000000..e9ce9538c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app114/SpringDocApp114Test.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app114; + +import javax.money.MonetaryAmount; + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 114 test. + */ +class SpringDocApp114Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().replaceWithClass(MonetaryAmount.class, org.springdoc.core.converters.models.MonetaryAmount.class); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/HelloController.java new file mode 100644 index 000000000..9630be358 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app115; + +import java.time.Duration; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Timeouts duration. + * + * @return the duration + */ + @GetMapping(value = "/api/v2/timeout", + consumes = { MediaType.ALL_VALUE }, + produces = { MediaType.APPLICATION_JSON_VALUE }) + public Duration timeouts() { + return Duration.ofSeconds(5); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java new file mode 100644 index 000000000..95b38bea7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app115; + +import java.time.Duration; +import java.util.Map; + +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.Schema; +import org.springdoc.core.customizers.OperationCustomizer; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; + +/** + * The type Java time operation customizer. + */ +@Component +class JavaTimeOperationCustomizer implements OperationCustomizer { + /** + * Customize operation. + * + * @param operation the operation + * @param handlerMethod the handler method + * @return the operation + */ + @Override + public Operation customize(Operation operation, HandlerMethod handlerMethod) { + if (handlerMethod.getReturnType().getParameterType().isAssignableFrom(Duration.class)) { + for (Map.Entry entry : operation.getResponses().entrySet()) { + io.swagger.v3.oas.models.responses.ApiResponse response = entry.getValue(); + Content content = response.getContent(); + if (content.containsKey(MediaType.APPLICATION_JSON_VALUE)) { + Schema schema = content.get(MediaType.APPLICATION_JSON_VALUE).getSchema(); + schema.getProperties().clear(); + schema.setType("string"); + } + } + } + return operation; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java new file mode 100644 index 000000000..49347f219 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app115; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 115 test. + */ +class SpringDocApp115Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/FooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/FooErrorHandler.java new file mode 100644 index 000000000..f82f1df68 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/FooErrorHandler.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app116; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +/** + * The type Foo error handler. + */ +@ControllerAdvice(assignableTypes = HelloController.class) +class FooErrorHandler { + + /** + * Store assignment publishing error response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler + public ResponseEntity storeAssignmentPublishingError(Exception e) { + return new ResponseEntity<>("foo", HttpStatus.INTERNAL_SERVER_ERROR); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/HelloController.java new file mode 100644 index 000000000..e883e84f3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app116; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) +class HelloController { + + /** + * Create string. + * + * @param foo the foo + * @return the string + */ + @PostMapping("/foo") + public String create(@RequestBody String foo) { + return "foo"; + } +} + + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/SpringDocApp116Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/SpringDocApp116Test.java new file mode 100644 index 000000000..b810d3fe7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app116/SpringDocApp116Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app116; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 116 test. + */ +class SpringDocApp116Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app117/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app117/HelloApplication.java new file mode 100644 index 000000000..e757a9093 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app117/HelloApplication.java @@ -0,0 +1,304 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app117; + +import java.io.IOException; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import jakarta.servlet.FilterChain; +import jakarta.servlet.GenericFilter; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.ServerRequest; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Hello application. + */ +@Configuration +class HelloApplication { + + /** + * Routes router function. + * + * @param ph the ph + * @return the router function + */ + @Bean + @RouterOperations({ @RouterOperation(path = "/people", method = RequestMethod.GET, beanClass = PersonService.class, beanMethod = "all"), + @RouterOperation(path = "/people/{id}", beanClass = PersonService.class, beanMethod = "byId"), + @RouterOperation(path = "/people", method = RequestMethod.POST, beanClass = PersonService.class, beanMethod = "save") }) + RouterFunction routes(PersonHandler ph) { + String root = ""; + return route() + .GET(root + "/people", ph::handleGetAllPeople) + .GET(root + "/people/{id}", ph::handleGetPersonById) + .POST(root + "/people", ph::handlePostPerson) + .filter((serverRequest, handlerFunction) -> { + return handlerFunction.handle(serverRequest); + }) + .build(); + } +} + +/** + * The type Simple filter. + */ +@Component +class SimpleFilter extends GenericFilter { + + /** + * Do filter. + * + * @param req the req + * @param res the res + * @param filterChain the filter chain + * @throws IOException the io exception + * @throws ServletException the servlet exception + */ + @Override + public void doFilter(ServletRequest req, ServletResponse res, + FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(req, res); + } +} + +/** + * The type Person handler. + */ +@Component +class PersonHandler { + + /** + * The Person service. + */ + private final PersonService personService; + + /** + * Instantiates a new Person handler. + * + * @param personService the person service + */ + PersonHandler(PersonService personService) { + this.personService = personService; + } + + /** + * Handle get all people server response. + * + * @param serverRequest the server request + * @return the server response + */ + ServerResponse handleGetAllPeople(ServerRequest serverRequest) { + return ok().body(personService.all()); + } + + /** + * Handle post person server response. + * + * @param r the r + * @return the server response + * @throws ServletException the servlet exception + * @throws IOException the io exception + */ + ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { + Person result = personService.save(new Person(null, r.body(Person.class).getName())); + URI uri = URI.create("/people/" + result.getId()); + return ServerResponse.created(uri).body(result); + } + + /** + * Handle get person by id server response. + * + * @param r the r + * @return the server response + */ + ServerResponse handleGetPersonById(ServerRequest r) { + return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); + } +} + +/** + * The type Greetings rest controller. + */ +@RestController +class GreetingsRestController { + + /** + * Greet string. + * + * @param name the name + * @return the string + */ + @GetMapping("/greet/{name}") + String greet(@PathVariable String name) { + return "hello " + name + "!"; + } +} + +/** + * The type Person service. + */ +@Service +class PersonService { + + /** + * The Counter. + */ + private final AtomicLong counter = new AtomicLong(); + + /** + * The People. + */ + private final Set people = Stream.of( + new Person(counter.incrementAndGet(), "Jane"), + new Person(counter.incrementAndGet(), "Josh"), + new Person(counter.incrementAndGet(), "Gordon")) + .collect(Collectors.toCollection(HashSet::new)); + + + /** + * Save person. + * + * @param p the p + * @return the person + */ + Person save(Person p) { + Person person = new Person(counter.incrementAndGet(), p.getName()); + this.people.add(person); + return person; + } + + /** + * All set. + * + * @return the set + */ + Set all() { + return this.people; + } + + /** + * By id person. + * + * @param id the id + * @return the person + */ + Person byId(@Parameter(in = ParameterIn.PATH) Long id) { + return this.people.stream() + .filter(p -> p.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); + } + +} + +/** + * The type Person. + */ +class Person { + + /** + * The Id. + */ + private Long id; + + /** + * The Name. + */ + private String name; + + /** + * Instantiates a new Person. + * + * @param id the id + * @param name the name + */ + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + + /** + * Gets id. + * + * @return the id + */ + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app117/SpringDocApp117Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app117/SpringDocApp117Test.java new file mode 100644 index 000000000..6ebd6ee2e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app117/SpringDocApp117Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app117; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 117 test. + */ +class SpringDocApp117Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/AbstractParent.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/AbstractParent.java new file mode 100644 index 000000000..b743b09f0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/AbstractParent.java @@ -0,0 +1,121 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app118; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +/** + * The type Abstract parent. + */ +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildOfAbstract1.class), + @Type(ChildOfAbstract2.class) +}) +public abstract class AbstractParent { + /** + * The Id. + */ + private int id; + + /** + * Gets id. + * + * @return the id + */ + public int getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(int id) { + this.id = id; + } +} + +/** + * The type Child of abstract 1. + */ +class ChildOfAbstract1 extends AbstractParent { + /** + * The Abstrach child 1 param. + */ + private String abstrachChild1Param; + + /** + * Gets abstrach child 1 param. + * + * @return the abstrach child 1 param + */ + public String getAbstrachChild1Param() { + return abstrachChild1Param; + } + + /** + * Sets abstrach child 1 param. + * + * @param abstrachChild1Param the abstrach child 1 param + */ + public void setAbstrachChild1Param(String abstrachChild1Param) { + this.abstrachChild1Param = abstrachChild1Param; + } +} + +/** + * The type Child of abstract 2. + */ +class ChildOfAbstract2 extends AbstractParent { + /** + * The Abstract child 2 param. + */ + private String abstractChild2Param; + + /** + * Gets abstract child 2 param. + * + * @return the abstract child 2 param + */ + public String getAbstractChild2Param() { + return abstractChild2Param; + } + + /** + * Sets abstract child 2 param. + * + * @param abstractChild2Param the abstract child 2 param + */ + public void setAbstractChild2Param(String abstractChild2Param) { + this.abstractChild2Param = abstractChild2Param; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/ConcreteParent.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/ConcreteParent.java new file mode 100644 index 000000000..a4ff5a45c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/ConcreteParent.java @@ -0,0 +1,121 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app118; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +/** + * The type Concrete parent. + */ +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildOfConcrete1.class), + @Type(ChildOfConcrete2.class) +}) +class ConcreteParent { + /** + * The Id. + */ + private int id; + + /** + * Gets id. + * + * @return the id + */ + public int getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(int id) { + this.id = id; + } +} + +/** + * The type Child of concrete 1. + */ +class ChildOfConcrete1 extends ConcreteParent { + /** + * The Concrete child 1 param. + */ + private String concreteChild1Param; + + /** + * Gets concrete child 1 param. + * + * @return the concrete child 1 param + */ + public String getConcreteChild1Param() { + return concreteChild1Param; + } + + /** + * Sets concrete child 1 param. + * + * @param concreteChild1Param the concrete child 1 param + */ + public void setConcreteChild1Param(String concreteChild1Param) { + this.concreteChild1Param = concreteChild1Param; + } +} + +/** + * The type Child of concrete 2. + */ +class ChildOfConcrete2 extends ConcreteParent { + /** + * The Concrete child 2 param. + */ + private String concreteChild2Param; + + /** + * Gets concrete child 2 param. + * + * @return the concrete child 2 param + */ + public String getConcreteChild2Param() { + return concreteChild2Param; + } + + /** + * Sets concrete child 2 param. + * + * @param concreteChild2Param the concrete child 2 param + */ + public void setConcreteChild2Param(String concreteChild2Param) { + this.concreteChild2Param = concreteChild2Param; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/Controller.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/Controller.java new file mode 100644 index 000000000..029111a1b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/Controller.java @@ -0,0 +1,114 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app118; + +import java.util.List; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Controller. + */ +@RestController +@RequestMapping("class-hierarchy") +class Controller { + /** + * Abstract parent response. + * + * @param payload the payload + * @return the response + */ + @PostMapping("abstract-parent") + public Response abstractParent(@RequestBody AbstractParent payload) { + return null; + } + + /** + * Concrete parent response. + * + * @param payload the payload + * @return the response + */ + @PostMapping("concrete-parent") + public Response concreteParent(@RequestBody ConcreteParent payload) { + return null; + } +} + +/** + * The type Response. + */ +class Response { + /** + * The Abstract parent. + */ + AbstractParent abstractParent; + + /** + * The Concrete parents. + */ + List concreteParents; + + /** + * Gets abstract parent. + * + * @return the abstract parent + */ + public AbstractParent getAbstractParent() { + return abstractParent; + } + + /** + * Sets abstract parent. + * + * @param abstractParent the abstract parent + */ + public void setAbstractParent(AbstractParent abstractParent) { + this.abstractParent = abstractParent; + } + + /** + * Gets concrete parents. + * + * @return the concrete parents + */ + public List getConcreteParents() { + return concreteParents; + } + + /** + * Sets concrete parents. + * + * @param concreteParents the concrete parents + */ + public void setConcreteParents(List concreteParents) { + this.concreteParents = concreteParents; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/SpringDocApp118Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/SpringDocApp118Test.java new file mode 100644 index 000000000..5ccae9c57 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app118/SpringDocApp118Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app118; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 118 test. + */ +class SpringDocApp118Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java new file mode 100644 index 000000000..5cf238164 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/HelloController.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app119; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Multi files in multi part string. + * + * @param jsonRequest the json request + * @param file1 the file 1 + * @param file2 the file 2 + * @return the string + */ + @Operation(summary = "Multiple files and JSON payloads as multi part request") + @PostMapping( + value = "multi", + consumes = MediaType.MULTIPART_FORM_DATA_VALUE, + produces = MediaType.TEXT_PLAIN_VALUE) + public String multiFilesInMultiPart( + @RequestPart("params") + @Parameter( + description = "This is the configuration", + content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)) final JsonRequest jsonRequest, + @RequestPart(value = "file1", required = false) @Parameter(description = "This is file1") final MultipartFile file1, + @RequestPart(value = "file2", required = false) @Parameter(description = "This is file2") final MultipartFile file2) { + return "Hello World " + jsonRequest.getName(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/JsonRequest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/JsonRequest.java new file mode 100644 index 000000000..1035fa3e5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/JsonRequest.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app119; + +/** + * The type Json request. + */ +class JsonRequest { + + /** + * The Name. + */ + private String name; + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/SpringDocApp119Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/SpringDocApp119Test.java new file mode 100644 index 000000000..d8817f321 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app119/SpringDocApp119Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app119; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 119 test. + */ +class SpringDocApp119Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java new file mode 100644 index 000000000..7cf3dc686 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app12; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping(value = "/persons") + @Operation(parameters = { + @Parameter(name = "name", in = ParameterIn.QUERY, schema = @Schema(implementation = String.class)) }) + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java new file mode 100644 index 000000000..5f09e4fc9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app12; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 12 test. + */ +class SpringDocApp12Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/AccountId.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/AccountId.java new file mode 100644 index 000000000..7a033e132 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/AccountId.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app120; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.core.annotation.AliasFor; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +/** + * The interface Account id. + */ +@Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Parameter(description = "non alias description") +public @interface AccountId { + + /** + * Name string. + * + * @return the string + */ + @AliasFor(annotation = Parameter.class, value = "name") + String name() default ""; + + /** + * Example string. + * + * @return the string + */ + @AliasFor(annotation = Parameter.class, value = "example") + String example() default "123456"; + + /** + * In parameter in. + * + * @return the parameter in + */ + @AliasFor(annotation = Parameter.class, value = "in") + ParameterIn in() default ParameterIn.DEFAULT; + + /** + * Schema schema. + * + * @return the schema + */ + @AliasFor(annotation = Parameter.class, value = "schema") + Schema schema() default @Schema(); +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/MetaAnnotationController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/MetaAnnotationController.java similarity index 88% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/MetaAnnotationController.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/MetaAnnotationController.java index 811b21f62..ae3d50648 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app120/MetaAnnotationController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/MetaAnnotationController.java @@ -1,21 +1,29 @@ /* * - * * Copyright 2019-2020 the original author or authors. * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * + * */ -package test.org.springdoc.api.app120; +package test.org.springdoc.api.v30.app120; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/SpringDocApp120Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/SpringDocApp120Test.java new file mode 100644 index 000000000..66a1bdc49 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app120/SpringDocApp120Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app120; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp120Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/InheritedRequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/InheritedRequestParams.java new file mode 100644 index 000000000..e1e9ef1c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/InheritedRequestParams.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app121; + +import jakarta.validation.constraints.NotBlank; + +/** + * The type Inherited request params. + */ +class InheritedRequestParams extends RequestParams { + + /** + * parameter from child of RequestParams + */ + @NotBlank + private String childParam; + + /** + * Gets child param. + * + * @return the child param + */ + public String getChildParam() { + return childParam; + } + + /** + * Sets child param. + * + * @param childParam the child param + */ + public void setChildParam(String childParam) { + this.childParam = childParam; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/RequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/RequestParams.java new file mode 100644 index 000000000..eb02770ce --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/RequestParams.java @@ -0,0 +1,281 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app121; + +import java.math.BigInteger; +import java.util.List; +import java.util.Optional; + +import io.swagger.v3.oas.annotations.Parameter; + + +/** + * The type Request params. + */ +class RequestParams { + + /** + * The String param. + */ + @Parameter(description = "string parameter") + private String stringParam; + + /** + * The String param 1. + */ + @Deprecated + private String stringParam1; + + /** + * The String param 2. + */ + @Parameter(description = "string parameter2", required = true) + private String stringParam2; + + /** + * The Int param. + */ + @Parameter(description = "int parameter") + private int intParam; + + /** + * The Int param 2. + */ + private Optional intParam2; + + /** + * The Int param 3. + */ + private String intParam3; + + /** + * The Nested. + */ + private Nested nested; + + /** + * The Nested list. + */ + private List nestedList; + + /** + * Gets string param. + * + * @return the string param + */ + public String getStringParam() { + return stringParam; + } + + /** + * Sets string param. + * + * @param stringParam the string param + */ + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + /** + * Gets int param. + * + * @return the int param + */ + public int getIntParam() { + return intParam; + } + + /** + * Sets int param. + * + * @param intParam the int param + */ + public void setIntParam(int intParam) { + this.intParam = intParam; + } + + /** + * Gets int param 2. + * + * @return the int param 2 + */ + public Optional getIntParam2() { + return intParam2; + } + + /** + * Sets int param 2. + * + * @param intParam2 the int param 2 + */ + public void setIntParam2(Optional intParam2) { + this.intParam2 = intParam2; + } + + /** + * Gets int param 3. + * + * @return the int param 3 + */ + public String getIntParam3() { + return intParam3; + } + + /** + * Sets int param 3. + * + * @param intParam3 the int param 3 + */ + public void setIntParam3(String intParam3) { + this.intParam3 = intParam3; + } + + /** + * Gets string param 1. + * + * @return the string param 1 + */ + public String getStringParam1() { + return stringParam1; + } + + /** + * Sets string param 1. + * + * @param stringParam1 the string param 1 + */ + public void setStringParam1(String stringParam1) { + this.stringParam1 = stringParam1; + } + + /** + * Gets string param 2. + * + * @return the string param 2 + */ + public String getStringParam2() { + return stringParam2; + } + + /** + * Sets string param 2. + * + * @param stringParam2 the string param 2 + */ + public void setStringParam2(String stringParam2) { + this.stringParam2 = stringParam2; + } + + /** + * Gets nested. + * + * @return the nested + */ + public Nested getNested() { + return nested; + } + + /** + * Sets nested. + * + * @param nested the nested + */ + public void setNested(Nested nested) { + this.nested = nested; + } + + /** + * Gets nested list. + * + * @return the nested list + */ + public List getNestedList() { + return nestedList; + } + + /** + * Sets nested list. + * + * @param nestedList the nested list + */ + public void setNestedList(List nestedList) { + this.nestedList = nestedList; + } + + /** + * The type Nested. + */ + public static class Nested { + /** + * The Param 1. + */ + private String param1; + + /** + * The Param 2. + */ + private BigInteger param2; + + /** + * Gets param 1. + * + * @return the param 1 + */ + @Parameter(description = "nested string parameter") + public String getParam1() { + return param1; + } + + /** + * Sets param 1. + * + * @param param1 the param 1 + */ + public void setParam1(String param1) { + this.param1 = param1; + } + + /** + * Gets param 2. + * + * @return the param 2 + */ + @Parameter(description = "nested BigInteger parameter") + public BigInteger getParam2() { + return param2; + } + + /** + * Sets param 2. + * + * @param param2 the param 2 + */ + public void setParam2(BigInteger param2) { + this.param2 = param2; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/SpringDocApp121Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/SpringDocApp121Test.java new file mode 100644 index 000000000..450aa34ec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/SpringDocApp121Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app121; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp121Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/TestController.java new file mode 100644 index 000000000..b02ab3f72 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app121/TestController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app121; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Test controller. + */ +@RestController +class TestController { + + /** + * Gets test. + * + * @param param the param + * @param requestParams the request params + * @return the test + */ + @PostMapping("test") + public InheritedRequestParams getTest(@RequestParam String param, @ParameterObject InheritedRequestParams requestParams) { + return requestParams; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/BaseController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/BaseController.java new file mode 100644 index 000000000..515a3552b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/BaseController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app122; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Base controller. + * + * @param the type parameter + */ +@RestController +public abstract class BaseController { + + /** + * Create response entity. + * + * @param payload the payload + * @return the response entity + */ + @PostMapping + @Operation(summary = "create") + public ResponseEntity create(@RequestBody Wrapper payload) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/BaseObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/BaseObject.java new file mode 100644 index 000000000..da1c562da --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/BaseObject.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app122; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Base object. + */ +class BaseObject { + + /** + * The Base str. + */ + @JsonProperty("baseStr") + private String baseStr; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/CustomerDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/CustomerDto.java new file mode 100644 index 000000000..d042236bf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/CustomerDto.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app122; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Customer dto. + */ +class CustomerDto extends BaseObject { + + /** + * The Customer name. + */ + @JsonProperty("customerName") + private String customerName; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/FirstController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/FirstController.java new file mode 100644 index 000000000..3187d72a2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/FirstController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app122; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.RestController; + +/** + * The type First controller. + */ +@RestController +@Tag(name = "example") +class FirstController extends BaseController { + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/SpringDocApp122Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/SpringDocApp122Test.java new file mode 100644 index 000000000..2c7ccd1a3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/SpringDocApp122Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app122; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp122Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/Wrapper.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/Wrapper.java new file mode 100644 index 000000000..ddddd1e8f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app122/Wrapper.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app122; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Wrapper. + * + * @param the type parameter + */ +class Wrapper { + + + /** + * The Wrapper. + */ + @JsonProperty("wrapper") + private String wrapper; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/HelloController.java new file mode 100644 index 000000000..12f9c8fb6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app123; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + /** + * Index t. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the t + */ + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/MyExceptionHandler.java new file mode 100644 index 000000000..fec1616b0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/MyExceptionHandler.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app123; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * The type My exception handler. + */ +@RestControllerAdvice +class MyExceptionHandler { + + /** + * Bad. + * + * @param e the e + */ + @ExceptionHandler(IllegalArgumentException.class) + @ApiResponse(responseCode = "404", description = "Not here", content = @Content) + @ResponseStatus(HttpStatus.NOT_FOUND) + public void bad(IllegalArgumentException e) { + + } + + /** + * Gateway object. + * + * @param e the e + * @return the object + */ + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/SpringDocApp123Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/SpringDocApp123Test.java new file mode 100644 index 000000000..15165d794 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app123/SpringDocApp123Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app123; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp123Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/HelloController.java new file mode 100644 index 000000000..c43bb6b70 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/HelloController.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app124; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + /** + * Bad. + * + * @param e the e + */ + @ExceptionHandler(IllegalArgumentException.class) + @ApiResponse(responseCode = "404", description = "Not here", content = @Content) + @ResponseStatus(HttpStatus.NOT_FOUND) + public void bad(IllegalArgumentException e) { + + } + + /** + * Index t. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the t + */ + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + throw new IllegalArgumentException(); + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/MyExceptionHandler.java new file mode 100644 index 000000000..f16e08bb9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/MyExceptionHandler.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app124; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * The type My exception handler. + */ +@RestControllerAdvice +class MyExceptionHandler { + + /** + * Gateway object. + * + * @param e the e + * @return the object + */ + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/SpringDocApp124Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/SpringDocApp124Test.java new file mode 100644 index 000000000..358871337 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app124/SpringDocApp124Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app124; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp124Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/DeprecatedEntity.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/DeprecatedEntity.java new file mode 100644 index 000000000..493ed26ea --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/DeprecatedEntity.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app125; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Deprecated entity. + * @author bnasslahsen + */ +class DeprecatedEntity { + /** + * The My non deprecated field. + */ + @Schema(deprecated = false) + private String myNonDeprecatedField; + + /** + * The Mydeprecated field. + */ + @Schema(deprecated = true) + private String mydeprecatedField; + + /** + * Gets my non deprecated field. + * + * @return the my non deprecated field + */ + public String getMyNonDeprecatedField() { + return myNonDeprecatedField; + } + + /** + * Sets my non deprecated field. + * + * @param myNonDeprecatedField the my non deprecated field + * @return the my non deprecated field + */ + @Deprecated + public DeprecatedEntity setMyNonDeprecatedField(String myNonDeprecatedField) { + this.myNonDeprecatedField = myNonDeprecatedField; + return this; + } + + /** + * Gets mydeprecated field. + * + * @return the mydeprecated field + */ + public String getMydeprecatedField() { + return mydeprecatedField; + } + + /** + * Sets mydeprecated field. + * + * @param mydeprecatedField the mydeprecated field + */ + public void setMydeprecatedField(String mydeprecatedField) { + this.mydeprecatedField = mydeprecatedField; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/HelloController.java new file mode 100644 index 000000000..b2a0042ea --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app125; + +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * @author bnasslahsen + */ +@RestController +class HelloController { + + /** + * Gets all pets. + * + * @param toto the toto + * @return the all pets + */ + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public DeprecatedEntity getAllPets(@NotNull String toto) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/SpringDocApp125Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/SpringDocApp125Test.java new file mode 100644 index 000000000..4babed24f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app125/SpringDocApp125Test.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app125; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = "springdoc.model-converters.deprecating-converter.enabled=false") +class SpringDocApp125Test extends AbstractSpringDocTest { + + static { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/HelloController.java new file mode 100644 index 000000000..602d5a8ec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/HelloController.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app126; + +import java.util.ArrayList; +import java.util.Collection; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.ResponseEntity.ok; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +@ApiResponses(value = { + @ApiResponse(responseCode = "401", ref = SecurityProblemResponsesConfiguration.UNAUTHORIZED_401_NO_TOKEN_RESPONSE_REF), + @ApiResponse(responseCode = "401", ref = SecurityProblemResponsesConfiguration.UNAUTHORIZED_401_BAD_TOKEN_RESPONSE_REF), + @ApiResponse(responseCode = "403", ref = SecurityProblemResponsesConfiguration.FORBIDDEN_403_RESPONSE_REF) }) +//@ApiResponses(value = { +// @ApiResponse(responseCode = "401", description = "Invalid authentication.", content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), +// @ApiResponse(responseCode = "401", description = "Invalid authentication.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), +// @ApiResponse(responseCode = "403", description = "Missing authorities.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}) }) +class HelloController { + + /** + * The constant CURRENCIES. + */ + private static final Collection CURRENCIES = new ArrayList<>(); + + static { + CURRENCIES.add("EUR"); + CURRENCIES.add("USD"); + } + + /** + * Gets all currencies. + * + * @return the all currencies + */ + @GetMapping + @Operation(description = "Get all currencies", summary = "getAllCurrencies") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "All currencies returned") }) + public ResponseEntity> getAllCurrencies() { + return ok(CURRENCIES); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/Problem.java new file mode 100644 index 000000000..bbd682e8d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/Problem.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app126; + +import java.net.URI; +import java.util.Collections; +import java.util.Map; + +/** + * The interface Problem. + */ +public interface Problem { + + /** + * The constant DEFAULT_TYPE. + */ + URI DEFAULT_TYPE = URI.create("about:blank"); + + /** + * An absolute URI that identifies the problem type. When dereferenced, + * it SHOULD provide human-readable documentation for the problem type + * (e.g., using HTML). When this member is not present, its value is + * assumed to be "about:blank". + * + * @return an absolute URI that identifies this problem's type + */ + default URI getType() { + return DEFAULT_TYPE; + } + + /** + * A short, human-readable summary of the problem type. It SHOULD NOT + * change from occurrence to occurrence of the problem, except for + * purposes of localisation. + * + * @return a short, human-readable summary of this problem + */ + default String getTitle() { + return null; + } + + /** + * The HTTP status code generated by the origin server for this + * occurrence of the problem. + * + * @return the HTTP status code + */ + default Integer getStatus() { + return null; + } + + /** + * A human readable explanation specific to this occurrence of the problem. + * + * @return A human readable explaination of this problem + */ + default String getDetail() { + return null; + } + + /** + * An absolute URI that identifies the specific occurrence of the problem. + * It may or may not yield further information if dereferenced. + * + * @return an absolute URI that identifies this specific problem + */ + default URI getInstance() { + return null; + } + + /** + * Optional, additional attributes of the problem. Implementations can choose to ignore this in favor of concrete, + * typed fields. + * + * @return additional parameters + */ + default Map getParameters() { + return Collections.emptyMap(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SecurityProblemResponsesConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/SecurityProblemResponsesConfiguration.java similarity index 75% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SecurityProblemResponsesConfiguration.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/SecurityProblemResponsesConfiguration.java index da9a2a38c..ee41e82af 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app126/SecurityProblemResponsesConfiguration.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/SecurityProblemResponsesConfiguration.java @@ -1,4 +1,30 @@ -package test.org.springdoc.api.app126; +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app126; import java.io.IOException; import java.util.AbstractMap; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/SpringDocApp126Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/SpringDocApp126Test.java new file mode 100644 index 000000000..04883012b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app126/SpringDocApp126Test.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app126; + +import java.util.List; +import java.util.Map; + +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverters; +import io.swagger.v3.core.converter.ResolvedSchema; +import io.swagger.v3.oas.models.responses.ApiResponse; +import org.springdoc.core.customizers.OpenApiCustomizer; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp126Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + + /** + * Response registration customizer open api customiser. + * + * @param responsesToRegister the responses to register + * @return the open api customiser + */ + @Bean + public OpenApiCustomizer responseRegistrationCustomizer(List> responsesToRegister) { + ResolvedSchema resolvedSchema = ModelConverters.getInstance() + .resolveAsResolvedSchema(new AnnotatedType(Problem.class)); + return openApi -> { + openApi.getComponents().addSchemas("Problem", resolvedSchema.schema); + responsesToRegister.forEach(entry -> openApi.getComponents().addResponses(entry.getKey(), entry.getValue())); + }; + } + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/AbstractObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/AbstractObject.java new file mode 100644 index 000000000..22b6ae542 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/AbstractObject.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app127; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** + * The type Abstract object. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "type", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ConcreteObjectA.class, name = "Type A") +}) +public abstract class AbstractObject { + + /** + * The Type. + */ + private final ConcreteType type; + + /** + * The Name. + */ + private final String name; + + /** + * Instantiates a new Abstract object. + * + * @param type the type + * @param name the name + */ + protected AbstractObject(ConcreteType type, String name) { + this.type = type; + this.name = name; + } + + /** + * Gets type. + * + * @return the type + */ + public ConcreteType getType() { + return type; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/ConcreteObjectA.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/ConcreteObjectA.java new file mode 100644 index 000000000..9edecf656 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/ConcreteObjectA.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app127; + +/** + * The type Concrete object a. + */ +class ConcreteObjectA extends AbstractObject { + + /** + * The Description. + */ + private final String description; + + /** + * Instantiates a new Concrete object a. + * + * @param name the name + * @param description the description + */ + public ConcreteObjectA(String name, String description) { + super(ConcreteType.TYPE_A, name); + this.description = description; + } + + /** + * Gets description. + * + * @return the description + */ + public String getDescription() { + return description; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/ConcreteType.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/ConcreteType.java new file mode 100644 index 000000000..523129008 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/ConcreteType.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app127; + +/** + * The enum Concrete type. + */ +public enum ConcreteType { + /** + * The Type a. + */ + TYPE_A("Type A"), + /** + * The Type b. + */ + TYPE_B("Type B"); + + /** + * The Name. + */ + private final String name; + + /** + * Instantiates a new Concrete type. + * + * @param name the name + */ + ConcreteType(String name) { + this.name = name; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/Controller.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/Controller.java new file mode 100644 index 000000000..ffb95b6c7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/Controller.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app127; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Controller. + */ +@RestController +class Controller { + + /** + * Bug umbrella. + * + * @return the umbrella + */ + @Operation(summary = "Test Bug", responses = { + @ApiResponse(responseCode = "200", description = "OK", + content = @Content( + schema = @Schema(implementation = Umbrella.class), + examples = @ExampleObject(ref = "#/components/examples/umbrellaExample", name = "Example with weird YAML tag") + ) + ) + }) + @GetMapping(value = "/bug", produces = MediaType.APPLICATION_JSON_VALUE) + public Umbrella bug() { + return new Umbrella(new ConcreteObjectA("a", "b")); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/SpringDocApp127Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/SpringDocApp127Test.java new file mode 100644 index 000000000..c604724b2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/SpringDocApp127Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app127; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.web.servlet.MvcResult; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp127Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + ".yaml")).andExpect(status().isOk()).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Assertions.assertTrue(!result.contains("!")); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/Umbrella.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/Umbrella.java new file mode 100644 index 000000000..26e71caa7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app127/Umbrella.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app127; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Umbrella. + */ +class Umbrella { + + /** + * The Object. + */ + @Schema(description = "This reference to abstract class causes weird YAML tag to be added", anyOf = ConcreteObjectA.class) + private final AbstractObject object; + + /** + * Instantiates a new Umbrella. + * + * @param object the object + */ + public Umbrella(AbstractObject object) { + this.object = object; + } + + /** + * Gets object. + * + * @return the object + */ + public AbstractObject getObject() { + return object; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/ActualReturnedEntity.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/ActualReturnedEntity.java new file mode 100644 index 000000000..868c443ab --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/ActualReturnedEntity.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app129; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Actual returned entity. + */ +class ActualReturnedEntity { + + /** + * The Result. + */ + @JsonProperty + String result; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/HelloController.java new file mode 100644 index 000000000..655b9a1bb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app129; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.request.async.DeferredResult; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping(path = "/api", headers = { "userId", "registrationId" }) +class HelloController { + + /** + * Update deferred result. + * + * @param entity the entity + * @return the deferred result + * @throws Exception the exception + */ + @PostMapping("/test") + @ApiResponses({ @ApiResponse(responseCode = "200") }) + public DeferredResult> update( + @RequestBody ActualReturnedEntity entity) throws Exception { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/OperationResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/OperationResponse.java new file mode 100644 index 000000000..302a84818 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/OperationResponse.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app129; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Operation response. + * + * @param the type parameter + */ +class OperationResponse { + + /** + * The Operation result. + */ + @JsonProperty + String operationResult; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/SpringDocApp129Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/SpringDocApp129Test.java new file mode 100644 index 000000000..91f0e1020 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app129/SpringDocApp129Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app129; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp129Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java new file mode 100644 index 000000000..337197b9c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app13; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param dto the dto + * @return the string + */ + @GetMapping(value = "/persons") + public String persons(final PersonDTO dto) { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java new file mode 100644 index 000000000..5d318b4b2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/PersonDTO.java @@ -0,0 +1,124 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app13; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; + +/** + * The type Person dto. + */ +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java new file mode 100644 index 000000000..e930103d3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app13/SpringDocApp13Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app13; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 13 test. + */ +class SpringDocApp13Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/HelloController.java new file mode 100644 index 000000000..b4d9d0fdd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/HelloController.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app130; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List tracker data. + * + * @param toto the toto + * @return the tracker data + */ + @PostMapping(value = "/values/data") + TrackerData list(TrackerData toto) { + return toto; + } + + /** + * Get tracker data. + * + * @param toto the toto + * @return the tracker data + */ + @GetMapping(value = "/values/datakk") + TrackerData get(TrackerData toto) { + return toto; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/SpringDocApp130Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/SpringDocApp130Test.java new file mode 100644 index 000000000..887f9fc25 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/SpringDocApp130Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app130; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp130Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/TrackerData.java new file mode 100644 index 000000000..3f78002e8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app130/TrackerData.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app130; + +import java.time.Instant; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tracker data. + */ +@Hidden +class TrackerData { + + /** + * The Tracker id. + */ + @JsonProperty("trackerId") + String trackerId; + + /** + * The Timestamp. + */ + @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") + @JsonProperty("timestamp") + Instant timestamp; + + /** + * The Value. + */ + @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") + @JsonProperty("value") + Double value; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/HelloController.java new file mode 100644 index 000000000..889c8a91b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app131; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + + /** + * Create organization. + * + * @param organization the organization + */ + @Operation(summary = "Create the organization", description = "Create the organization") + @ApiResponses( + value = { + @ApiResponse( + responseCode = "204", + description = "The organization was created successfully"), + @ApiResponse( + responseCode = "400", + description = "Invalid argument", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "409", + description = "An organization with the specified ID already exists", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "500", + description = + "An error has occurred and the request could not be processed at this time", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))) + }) + @RequestMapping( + value = "/organizations", + method = RequestMethod.POST, + produces = "application/json") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void createOrganization( + @Parameter(name = "organization", required = true) + @RequestBody + Organization organization) { + + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/Organization.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/Organization.java new file mode 100644 index 000000000..711d470d8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/Organization.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app131; + + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Organization. + */ +@Schema(description = + "This is the description being overwritten") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "id", "name" }) +class Organization { + + /** + * The Id. + */ + @Schema( + description = + "The Universally Unique Identifier (UUID) uniquely identifying the organization", + required = true) + @JsonProperty(required = true) + private UUID id; + + /** + * The Name. + */ + @Schema(description = "The name of the organization", required = true) + @JsonProperty(required = true) + private String name; + + /** + * Instantiates a new Organization. + */ + public Organization() { + } + + /** + * Gets id. + * + * @return the id + */ + public UUID getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(UUID id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/RestControllerError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/RestControllerError.java new file mode 100644 index 000000000..ba37d7029 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/RestControllerError.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app131; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Rest controller error. + */ +class RestControllerError { + + /** + * The Id. + */ + @JsonProperty + private String id; + + /** + * The Message. + */ + @JsonProperty + private String message; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/SpringDocApp131Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/SpringDocApp131Test.java new file mode 100644 index 000000000..91fbad6fe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app131/SpringDocApp131Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app131; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp131Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/HelloController.java new file mode 100644 index 000000000..534f34cc3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app132; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + + /** + * Create organization. + * + * @param organization the organization + */ + @Operation(summary = "Create the organization", description = "Create the organization") + @ApiResponses( + value = { + @ApiResponse( + responseCode = "204", + description = "The organization was created successfully"), + @ApiResponse( + responseCode = "400", + description = "Invalid argument", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "409", + description = "An organization with the specified ID already exists", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "500", + description = + "An error has occurred and the request could not be processed at this time", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))) + }) + @RequestMapping( + value = "/organizations", + method = RequestMethod.POST, + produces = "application/json") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void createOrganization( + @Parameter(name = "organization", description = "i want to override the description of this object", required = true) + @RequestBody + Organization organization) { + + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/Organization.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/Organization.java new file mode 100644 index 000000000..99d40d7a9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/Organization.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app132; + + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Organization. + */ +@Schema(description = + "This is the description being overwritten") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "id", "name" }) +class Organization { + + /** + * The Id. + */ + @Schema( + description = + "The Universally Unique Identifier (UUID) uniquely identifying the organization", + required = true) + @JsonProperty(required = true) + private UUID id; + + /** + * The Name. + */ + @Schema(description = "The name of the organization", required = true) + @JsonProperty(required = true) + private String name; + + /** + * Instantiates a new Organization. + */ + public Organization() { + } + + /** + * Gets id. + * + * @return the id + */ + public UUID getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(UUID id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/RestControllerError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/RestControllerError.java new file mode 100644 index 000000000..d688524e2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/RestControllerError.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app132; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Rest controller error. + */ +class RestControllerError { + + /** + * The Id. + */ + @JsonProperty + private String id; + + /** + * The Message. + */ + @JsonProperty + private String message; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/SpringDocApp132Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/SpringDocApp132Test.java new file mode 100644 index 000000000..53f278f4f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app132/SpringDocApp132Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app132; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp132Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app133/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app133/HelloController.java new file mode 100644 index 000000000..58a735433 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app133/HelloController.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app133; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets message from header 1. + * + * @param header the header + * @return the message from header 1 + */ + @GetMapping(path = "/test1", headers = { "myHeader" }) + public String getMessageFromHeader1( + @Parameter(name = "myHeader", description = "A header", schema = @Schema(allowableValues = { "foo", "bar" })) + @RequestHeader("myHeader") String header + ) { + return "bar " + header; + } + + /** + * Gets message from header 2. + * + * @param header the header + * @return the message from header 2 + */ + @GetMapping("/test2") + public String getMessageFromHeader2( + @Parameter(name = "myHeader", description = "A header", schema = @Schema(type = "integer")) + @RequestHeader("myHeader") Integer header + ) { + return "bar " + header; + } + + /** + * Gets message from header 3. + * + * @param header the header + * @return the message from header 3 + */ + @GetMapping(path = "/test3", headers = { "myHeader" }) + public String getMessageFromHeader3( + @Parameter(name = "myHeader", description = "A header", schema = @Schema(type = "integer")) + @RequestHeader("myHeader") Integer header + ) { + return "bar " + header; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app133/SpringDocApp133Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app133/SpringDocApp133Test.java new file mode 100644 index 000000000..f7734a8b8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app133/SpringDocApp133Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app133; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp133Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/HelloController.java new file mode 100644 index 000000000..fc365013c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/HelloController.java @@ -0,0 +1,228 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app134; + +import java.util.Collections; +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@SpringBootApplication +@RestController +@Tag(name = "The sample resource") +class HelloController { + + // ----------------------------------------------------------------------------------------------------------------- + + /** + * The constant VERSION_1. + */ + public static final String VERSION_1 = "application/vnd.samples.v1+json"; + + /** + * The constant VERSION_2. + */ + public static final String VERSION_2 = "application/vnd.samples.v2+json"; + + /** + * The constant HEADER_1. + */ + public static final String HEADER_1 = "X-API-VERSION=1"; + + /** + * The constant HEADER_2. + */ + public static final String HEADER_2 = "Accept-version=v2"; + + /** + * Gets sample v 1. + * + * @param id the id + * @return the sample v 1 + */ + @GetMapping(value = "/{id}", produces = VERSION_1, headers = HEADER_1) + @ResponseStatus(HttpStatus.OK) + @Operation(operationId = "getSampleV1", deprecated = true, description = "Get the sample by its id." + ) + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = SampleV1.class))) + public SampleV1 getSampleV1(@Parameter(description = "The sample's id", required = true) + @PathVariable final String id) { + return new SampleV1(id); + } + + /** + * Gets sample v 2. + * + * @param id the id + * @return the sample v 2 + */ + @GetMapping(value = "/{id}", produces = VERSION_2, headers = { HEADER_2, HEADER_1 }) + @ResponseStatus(HttpStatus.OK) + @Operation(operationId = "getSampleV2", description = "Get the sample by its id. This represents V2.") + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = SampleV1.class))) + public SampleV2 getSampleV2(@Parameter(description = "The sample's id", required = true) + @PathVariable final Long id) { + return new SampleV2(id); + } + + /** + * Search samples list. + * + * @param searchRequest the search request + * @return the list + */ + @PostMapping(path = "/search", consumes = VERSION_2, produces = VERSION_2) + @Operation(description = "Searches for sample objects using the given search request.") + @ApiResponse(responseCode = "200", + content = @Content(array = @ArraySchema(schema = @Schema(implementation = SampleV2.class)))) + public List searchSamples(@RequestBody final SampleSearchRequest searchRequest) { + return Collections.singletonList(new SampleV2(searchRequest.getId())); + } + + + /** + * The type Sample v 1. + */ + private class SampleV1 { + + /** + * The Id. + */ + private String id; + + /** + * Instantiates a new Sample v 1. + * + * @param id the id + */ + public SampleV1(String id) { + this.id = id; + } + + /** + * Gets id. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + } + + /** + * The type Sample v 2. + */ + private class SampleV2 { + /** + * The Id. + */ + private long id; + + /** + * Instantiates a new Sample v 2. + * + * @param id the id + */ + public SampleV2(long id) { + this.id = id; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } + } + + /** + * The type Sample search request. + */ + private class SampleSearchRequest { + /** + * The Id. + */ + private final long id; + + /** + * Instantiates a new Sample search request. + * + * @param id the id + */ + public SampleSearchRequest(long id) { + this.id = id; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/OpenApiConfig.java new file mode 100644 index 000000000..36368c352 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/OpenApiConfig.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app134; + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * The type Open api config. + */ +@Configuration +class OpenApiConfig { + + /** + * Group v 1 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV1OpenApi() { + return GroupedOpenApi.builder() + .group("v1-group").producesToMatch(HelloController.VERSION_1) + .build(); + } + + /** + * Group v 2 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV2OpenApi() { + return GroupedOpenApi.builder() + .group("v2-group").producesToMatch(HelloController.VERSION_2) + .build(); + } + + /** + * Group v 3 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV3OpenApi() { + return GroupedOpenApi.builder() + .group("v2-consumes-group").consumesToMatch(HelloController.VERSION_2) + .build(); + } + + /** + * Group v 4 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV4OpenApi() { + return GroupedOpenApi.builder() + .group("v1-headers-group").headersToMatch(HelloController.HEADER_1) + .build(); + } + + /** + * Group v 5 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV5OpenApi() { + return GroupedOpenApi.builder() + .group("v1-v2-headers-group").headersToMatch(HelloController.HEADER_1, HelloController.HEADER_2) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/SpringDocApp134Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/SpringDocApp134Test.java new file mode 100644 index 000000000..45a01232f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app134/SpringDocApp134Test.java @@ -0,0 +1,116 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app134; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp134Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app134-1.json"), true)); + } + + /** + * Test app 2. + * + * @throws Exception the exception + */ + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app134-2.json"), true)); + } + + /** + * Test app 3. + * + * @throws Exception the exception + */ + @Test + void testApp3() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-headers-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app134-3.json"), true)); + } + + /** + * Test app 4. + * + * @throws Exception the exception + */ + @Test + void testApp4() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-v2-headers-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app134-4.json"), true)); + } + + /** + * Test app 5. + * + * @throws Exception the exception + */ + @Test + void testApp5() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-consumes-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(content().json(getContent("results/3.0.1/app134-5.json"), true)); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/Book.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/Book.java new file mode 100644 index 000000000..c85b5f537 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/Book.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app135; + +/** + * The type Book. + */ +class Book { + + /** + * The Id. + */ + private String id; + + /** + * The Title. + */ + private String title; + + /** + * The Author. + */ + private String author; + + /** + * Instantiates a new Book. + * + * @param id the id + * @param title the title + * @param author the author + */ + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + /** + * Gets id. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + + /** + * Gets title. + * + * @return the title + */ + public String getTitle() { + return title; + } + + /** + * Sets title. + * + * @param title the title + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * Gets author. + * + * @return the author + */ + public String getAuthor() { + return author; + } + + /** + * Sets author. + * + * @param author the author + */ + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/BookRepository.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/BookRepository.java new file mode 100644 index 000000000..bbb48969d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/BookRepository.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app135; + +import java.util.Arrays; +import java.util.List; + +import org.springframework.stereotype.Component; + +/** + * The type Book repository. + */ +@Component +class BookRepository { + + /** + * Find by author list. + * + * @param author the author + * @return the list + */ + List findByAuthor(String author) { + Book[] books = { new Book("1", "title1", "author1") }; + return Arrays.asList(books); + } + + /** + * Find all list. + * + * @return the list + */ + List findAll() { + Book[] books = { new Book("2", "title2", "author2") }; + return Arrays.asList(books); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/BookRouter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/BookRouter.java new file mode 100644 index 000000000..7b368cb3c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/BookRouter.java @@ -0,0 +1,140 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app135; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.servlet.function.RequestPredicates; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.RouterFunctions; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springframework.web.servlet.function.RouterFunctions.nest; +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Book router. + */ +@Configuration +class BookRouter { + + /** + * Routes router function. + * + * @param br the br + * @return the router function + */ + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes(BookRepository br) { + return + RouterFunctions.nest(RequestPredicates.path("/greeter").and(RequestPredicates.path("/greeter2")), + RouterFunctions.route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author"))))); + } + + /** + * Routes 1 router function. + * + * @param br the br + * @return the router function + */ + @Bean + @RouterOperations({ + @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes1(BookRepository br) { + return + RouterFunctions.nest(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + RouterFunctions.route(RequestPredicates.GET("/books"), req -> ServerResponse.ok().body(br.findAll())) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ServerResponse.ok().body(br.findByAuthor(req.pathVariable("author"))))); + } + + /** + * Routes 3 router function. + * + * @param br the br + * @return the router function + */ + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes3(BookRepository br) { + return + nest(RequestPredicates.path("/greeter").or(RequestPredicates.path("/greeter2")), + route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author"))))); + } + + /** + * Routes 4 router function. + * + * @param br the br + * @return the router function + */ + @Bean + @RouterOperations({ + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes4(BookRepository br) { + return + nest(RequestPredicates.path("/test"), + nest(RequestPredicates.path("/greeter").and(RequestPredicates.path("/greeter2")), + route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/SpringDocApp135Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/SpringDocApp135Test.java new file mode 100644 index 000000000..f8a6bfa83 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app135/SpringDocApp135Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app135; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp135Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/HelloController.java new file mode 100644 index 000000000..f3d9f38eb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app137; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@SecurityRequirement(name = "security_auth") +class HelloController { + + /** + * Test. + * + * @param hello the hello + */ + @GetMapping("/test") + public void test(String hello) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/OpenApiConfig.java new file mode 100644 index 000000000..f90dffeff --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/OpenApiConfig.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app137; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.servers.Server; + +/** + * The type Open api config. + */ +@OpenAPIDefinition(servers = @Server(url = "${test.server}", description = "${test.desc}"), info = @Info(title = "My App", + description = "Some long and useful description", version = "v1")) +@SecurityScheme(name = "security_auth", type = SecuritySchemeType.OAUTH2, + flows = @OAuthFlows(authorizationCode = @OAuthFlow( + authorizationUrl = "http://authorization.url" + , tokenUrl = "http://token.url", scopes = {}))) +class OpenApiConfig {} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/SpringDocApp137Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/SpringDocApp137Test.java new file mode 100644 index 000000000..362368f00 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app137/SpringDocApp137Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app137; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = { "test.server=http://test.toto.com", "test.desc=toto desc" }) +class SpringDocApp137Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app138/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app138/HelloController.java new file mode 100644 index 000000000..90bf11f4f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app138/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app138; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test a. + * + * @param hello the hello + */ + @GetMapping("/testA") + public void testA(String hello) { + } + + /** + * Test b. + * + * @param hello the hello + */ + @GetMapping("/testB") + public void testB(String hello) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app138/SpringDocApp138Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app138/SpringDocApp138Test.java new file mode 100644 index 000000000..c3363de18 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app138/SpringDocApp138Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app138; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = "springdoc.writer-with-order-by-keys=true") +class SpringDocApp138Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app139/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app139/HelloController.java new file mode 100644 index 000000000..68aa09885 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app139/HelloController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app139; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Echo 1 string. + * + * @param text the text + * @return the string + */ + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test1") + public String echo1(@RequestParam(name = "${test.name}", defaultValue = "${test.default-value}") String text) { + return text; + } + + /** + * Echo 2 string. + * + * @param text the text + * @return the string + */ + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test2") + public String echo2(@RequestParam(value = "${test.value}", defaultValue = "${test.default-value}") String text) { + return text; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app139/SpringDocApp139Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app139/SpringDocApp139Test.java new file mode 100644 index 000000000..d3f2b1173 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app139/SpringDocApp139Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app139; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = { "test.name=text", "test.value=text", "test.default-value=default-text" }) +class SpringDocApp139Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java new file mode 100644 index 000000000..489d31c1f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app14/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app14; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.http.HttpEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping("/persons") + public void persons(@Valid @NotBlank String name) { + + } + + /** + * Demo 2 http entity. + * + * @return the http entity + */ + @GetMapping("/test") + public HttpEntity demo2() { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java new file mode 100644 index 000000000..60f25e133 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app14/SpringDocApp14Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app14; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 14 test. + */ +class SpringDocApp14Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app140/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app140/HelloApplication.java new file mode 100644 index 000000000..95d57eae5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app140/HelloApplication.java @@ -0,0 +1,314 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app140; + +import java.io.IOException; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import jakarta.servlet.FilterChain; +import jakarta.servlet.GenericFilter; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.function.HandlerFunction; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.ServerRequest; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Hello application. + */ +@Configuration +class HelloApplication { + + /** + * Filter server response. + * + * @param serverRequest the server request + * @param handlerFunction the handler function + * @return the server response + * @throws Exception the exception + */ + private static ServerResponse filter(ServerRequest serverRequest, HandlerFunction handlerFunction) throws Exception { + return handlerFunction.handle(serverRequest); + } + + /** + * Routes router function. + * + * @param ph the ph + * @return the router function + */ + @Bean + RouterFunction routes(PersonHandler ph) { + String root = ""; + return route() + .GET(root + "/people", ph::handleGetAllPeople) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("all")) + .GET(root + "/people/{id}", ph::handleGetPersonById) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("byId")) + .POST(root + "/people", ph::handlePostPerson) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("save")) + .filter(HelloApplication::filter) + .build(); + } +} + +/** + * The type Simple filter. + */ +@Component +class SimpleFilter extends GenericFilter { + + /** + * Do filter. + * + * @param req the req + * @param res the res + * @param filterChain the filter chain + * @throws IOException the io exception + * @throws ServletException the servlet exception + */ + @Override + public void doFilter(ServletRequest req, ServletResponse res, + FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(req, res); + } +} + +/** + * The type Person handler. + */ +@Component +class PersonHandler { + + /** + * The Person service. + */ + private final PersonService personService; + + /** + * Instantiates a new Person handler. + * + * @param personService the person service + */ + PersonHandler(PersonService personService) { + this.personService = personService; + } + + /** + * Handle get all people server response. + * + * @param serverRequest the server request + * @return the server response + */ + ServerResponse handleGetAllPeople(ServerRequest serverRequest) { + return ok().body(personService.all()); + } + + /** + * Handle post person server response. + * + * @param r the r + * @return the server response + * @throws ServletException the servlet exception + * @throws IOException the io exception + */ + ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { + Person result = personService.save(new Person(null, r.body(Person.class).getName())); + URI uri = URI.create("/people/" + result.getId()); + return ServerResponse.created(uri).body(result); + } + + /** + * Handle get person by id server response. + * + * @param r the r + * @return the server response + */ + ServerResponse handleGetPersonById(ServerRequest r) { + return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); + } +} + +/** + * The type Greetings rest controller. + */ +@RestController +class GreetingsRestController { + + /** + * Greet string. + * + * @param name the name + * @return the string + */ + @GetMapping("/greet/{name}") + String greet(@PathVariable String name) { + return "hello " + name + "!"; + } +} + +/** + * The type Person service. + */ +@Service +class PersonService { + + /** + * The Counter. + */ + private final AtomicLong counter = new AtomicLong(); + + /** + * The People. + */ + private final Set people = Stream.of( + new Person(counter.incrementAndGet(), "Jane"), + new Person(counter.incrementAndGet(), "Josh"), + new Person(counter.incrementAndGet(), "Gordon")) + .collect(Collectors.toCollection(HashSet::new)); + + + /** + * Save person. + * + * @param p the p + * @return the person + */ + Person save(Person p) { + Person person = new Person(counter.incrementAndGet(), p.getName()); + this.people.add(person); + return person; + } + + /** + * All set. + * + * @return the set + */ + Set all() { + return this.people; + } + + /** + * By id person. + * + * @param id the id + * @return the person + */ + Person byId(@Parameter(in = ParameterIn.PATH) Long id) { + return this.people.stream() + .filter(p -> p.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); + } + +} + +/** + * The type Person. + */ +class Person { + + /** + * The Id. + */ + private Long id; + + /** + * The Name. + */ + private String name; + + /** + * Instantiates a new Person. + * + * @param id the id + * @param name the name + */ + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + + /** + * Gets id. + * + * @return the id + */ + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app140/SpringDocApp140Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app140/SpringDocApp140Test.java new file mode 100644 index 000000000..8d69d9202 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app140/SpringDocApp140Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app140; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 140 test. + */ +class SpringDocApp140Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/Book.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/Book.java new file mode 100644 index 000000000..b62163cad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/Book.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app141; + +/** + * The type Book. + */ +class Book { + + /** + * The Id. + */ + private String id; + + /** + * The Title. + */ + private String title; + + /** + * The Author. + */ + private String author; + + /** + * Instantiates a new Book. + * + * @param id the id + * @param title the title + * @param author the author + */ + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + /** + * Gets id. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + + /** + * Gets title. + * + * @return the title + */ + public String getTitle() { + return title; + } + + /** + * Sets title. + * + * @param title the title + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * Gets author. + * + * @return the author + */ + public String getAuthor() { + return author; + } + + /** + * Sets author. + * + * @param author the author + */ + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/BookRepository.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/BookRepository.java new file mode 100644 index 000000000..12d55beb4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/BookRepository.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app141; + +import java.util.Arrays; +import java.util.List; + +import org.springframework.stereotype.Component; + +/** + * The type Book repository. + */ +@Component +class BookRepository { + + /** + * Find by author list. + * + * @param author the author + * @return the list + */ + List findByAuthor(String author) { + Book[] books = { new Book("1", "title1", "author1") }; + return Arrays.asList(books); + } + + /** + * Find all list. + * + * @return the list + */ + List findAll() { + Book[] books = { new Book("2", "title2", "author2") }; + return Arrays.asList(books); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/BookRouter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/BookRouter.java new file mode 100644 index 000000000..bed051c1b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/BookRouter.java @@ -0,0 +1,135 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app141; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.servlet.function.RouterFunction; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.servlet.function.RequestPredicates.GET; +import static org.springframework.web.servlet.function.RequestPredicates.accept; +import static org.springframework.web.servlet.function.RequestPredicates.path; +import static org.springframework.web.servlet.function.RouterFunctions.nest; +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Book router. + */ +@Configuration +class BookRouter { + + + /** + * Routes router function. + * + * @param br the br + * @return the router function + */ + @Bean + RouterFunction routes(BookRepository br) { + return nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"))) + ); + } + + /** + * Routes 1 router function. + * + * @param br the br + * @return the router function + */ + @Bean + RouterFunction routes1(BookRepository br) { + return nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + route(GET("/books"), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor")))); + } + + /** + * Routes 3 router function. + * + * @param br the br + * @return the router function + */ + @Bean + RouterFunction routes3(BookRepository br) { + return nest(path("/greeter").or(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor")))); + } + + /** + * Routes 4 router function. + * + * @param br the br + * @return the router function + */ + @Bean + RouterFunction routes4(BookRepository br) { + return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"))))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/SpringDocApp141Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/SpringDocApp141Test.java new file mode 100644 index 000000000..4258ec311 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app141/SpringDocApp141Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app141; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp141Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app142/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app142/HelloApplication.java new file mode 100644 index 000000000..9f9755355 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app142/HelloApplication.java @@ -0,0 +1,296 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app142; + +import java.io.IOException; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import jakarta.servlet.FilterChain; +import jakarta.servlet.GenericFilter; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import org.springdoc.webmvc.core.fn.SpringdocRouteBuilder; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.ServerRequest; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Hello application. + */ +@Configuration +class HelloApplication { + + + /** + * Routes router function. + * + * @param ph the ph + * @return the router function + */ + @Bean + RouterFunction routes(PersonHandler ph) { + String root = ""; + return SpringdocRouteBuilder.route() + .GET(root + "/people", ph::handleGetAllPeople, ops -> ops.beanClass(PersonService.class).beanMethod("all")) + .GET(root + "/people/{id}", ph::handleGetPersonById, ops -> ops.beanClass(PersonService.class).beanMethod("byId")) + .POST(root + "/people", ph::handlePostPerson, ops -> ops.beanClass(PersonService.class).beanMethod("save")).build(); + } + +} + +/** + * The type Simple filter. + */ +@Component +class SimpleFilter extends GenericFilter { + + /** + * Do filter. + * + * @param req the req + * @param res the res + * @param filterChain the filter chain + * @throws IOException the io exception + * @throws ServletException the servlet exception + */ + @Override + public void doFilter(ServletRequest req, ServletResponse res, + FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(req, res); + } +} + +/** + * The type Person handler. + */ +@Component +class PersonHandler { + + /** + * The Person service. + */ + private final PersonService personService; + + /** + * Instantiates a new Person handler. + * + * @param personService the person service + */ + PersonHandler(PersonService personService) { + this.personService = personService; + } + + /** + * Handle get all people server response. + * + * @param serverRequest the server request + * @return the server response + */ + ServerResponse handleGetAllPeople(ServerRequest serverRequest) { + return ok().body(personService.all()); + } + + /** + * Handle post person server response. + * + * @param r the r + * @return the server response + * @throws ServletException the servlet exception + * @throws IOException the io exception + */ + ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { + Person result = personService.save(new Person(null, r.body(Person.class).getName())); + URI uri = URI.create("/people/" + result.getId()); + return ServerResponse.created(uri).body(result); + } + + /** + * Handle get person by id server response. + * + * @param r the r + * @return the server response + */ + ServerResponse handleGetPersonById(ServerRequest r) { + return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); + } +} + +/** + * The type Greetings rest controller. + */ +@RestController +class GreetingsRestController { + + /** + * Greet string. + * + * @param name the name + * @return the string + */ + @GetMapping("/greet/{name}") + String greet(@PathVariable String name) { + return "hello " + name + "!"; + } +} + +/** + * The type Person service. + */ +@Service +class PersonService { + + /** + * The Counter. + */ + private final AtomicLong counter = new AtomicLong(); + + /** + * The People. + */ + private final Set people = Stream.of( + new Person(counter.incrementAndGet(), "Jane"), + new Person(counter.incrementAndGet(), "Josh"), + new Person(counter.incrementAndGet(), "Gordon")) + .collect(Collectors.toCollection(HashSet::new)); + + + /** + * Save person. + * + * @param p the p + * @return the person + */ + Person save(Person p) { + Person person = new Person(counter.incrementAndGet(), p.getName()); + this.people.add(person); + return person; + } + + /** + * All set. + * + * @return the set + */ + Set all() { + return this.people; + } + + /** + * By id person. + * + * @param id the id + * @return the person + */ + Person byId(@Parameter(in = ParameterIn.PATH) Long id) { + return this.people.stream() + .filter(p -> p.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); + } + +} + +/** + * The type Person. + */ +class Person { + + /** + * The Id. + */ + private Long id; + + /** + * The Name. + */ + private String name; + + /** + * Instantiates a new Person. + * + * @param id the id + * @param name the name + */ + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + + /** + * Gets id. + * + * @return the id + */ + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app142/SpringDocApp142Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app142/SpringDocApp142Test.java new file mode 100644 index 000000000..3826b1462 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app142/SpringDocApp142Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app142; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 142 test. + */ +class SpringDocApp142Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java new file mode 100644 index 000000000..b14431f63 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/HelloController.java @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app149; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +/** + * To test the case a user does not use @RestController but puts @Operation on handler methods + * and wants these methods to be exposed. + * + * @author Azige + */ +@Controller +class HelloController { + + /** + * Hello string. + * + * @return the string + */ + @GetMapping("/hello") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public String hello() { + return "forward:/message"; + } + + /** + * Message hello message. + * + * @return the hello message + */ + @GetMapping("/message") + @Operation + @ResponseBody + public HelloMessage message() { + return new HelloMessage("Lucky numbers!", 777); + } + + /** + * Hello model and view model and view. + * + * @return the model and view + */ + @GetMapping("/helloModelAndView") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public ModelAndView helloModelAndView() { + ModelAndView mav = new ModelAndView(); + mav.setViewName("forward:/message"); + return mav; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java new file mode 100644 index 000000000..4acda09a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/HelloMessage.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app149; + +/** + * The type Hello message. + */ +class HelloMessage { + /** + * The Text. + */ + public String text; + + /** + * The Number. + */ + public int number; + + /** + * Instantiates a new Hello message. + * + * @param text the text + * @param number the number + */ + public HelloMessage(String text, int number) { + this.text = text; + this.number = number; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java new file mode 100644 index 000000000..7a50ca415 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app149/SpringDocApp149Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app149; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 149 test. + */ +@TestPropertySource(properties = "springdoc.model-and-view-allowed=true") +class SpringDocApp149Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java new file mode 100644 index 000000000..90e01758f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app15/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app15; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.json.JSONObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons json object. + * + * @return the json object + */ + @GetMapping(value = "/persons") + @Operation(description = "${springdoc.operation-descriptions.myOperation}", responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(hidden = true)))) + public JSONObject persons() { + return new JSONObject(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java new file mode 100644 index 000000000..25fbf4c03 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app15/SpringDocApp15Test.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app15; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Contact; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 15 test. + */ +@TestPropertySource(properties = { + "springdoc.operation-descriptions.myOperation=My Desc", + "springdoc.openapidefinition.info.title=My title", + "springdoc.openapidefinition.info.desc=My description", + "springdoc.openapidefinition.info.version=My version", + "springdoc.openapidefinition.info.terms=My terms", + "springdoc.openapidefinition.info.license.name=My license name", + "springdoc.openapidefinition.info.license.url=My license url", + "springdoc.openapidefinition.info.contact.name=My contact name", + "springdoc.openapidefinition.info.contact.email=My contact email", + "springdoc.openapidefinition.info.contact.url=My contact url" +}) +class SpringDocApp15Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + @OpenAPIDefinition(info = @Info( + title = "${springdoc.openapidefinition.info.title}", + description = "${springdoc.openapidefinition.info.desc}", + version = "${springdoc.openapidefinition.info.version}", + termsOfService = "${springdoc.openapidefinition.info.terms}", + license = @License( + name = "${springdoc.openapidefinition.info.license.name}", + url = "${springdoc.openapidefinition.info.license.url}" + ), + contact = @Contact( + name = "${springdoc.openapidefinition.info.contact.name}", + email = "${springdoc.openapidefinition.info.contact.email}", + url = "${springdoc.openapidefinition.info.contact.url}" + ) + )) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app150/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app150/HelloController.java new file mode 100644 index 000000000..e468b3c8f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app150/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app150; + +import java.time.LocalDate; +import java.util.List; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.format.annotation.DateTimeFormat.ISO.DATE; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param toto the toto + */ + @GetMapping("/test/") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test(@RequestParam(defaultValue = "1") Integer toto) { + + } + + /** + * Test 1. + * + * @param toto the toto + */ + @GetMapping("/test1") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test1(@RequestParam @Parameter(schema = @Schema(defaultValue = "false", type = "boolean")) boolean toto) { + + } + + /** + * Test 3. + * + * @param toto the toto + */ + @GetMapping("/test3") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test3(@RequestParam(defaultValue = "users,123") List toto) { + + } + + /** + * Test 4. + * + * @param localDate the local date + */ + @GetMapping("/test4") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test4(@DateTimeFormat(iso = DATE) @RequestParam(defaultValue = "2021-03-08") LocalDate localDate) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java new file mode 100644 index 000000000..47afbcaf0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app150/SpringDocApp150Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app150; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp150Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app151/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app151/HelloController.java new file mode 100644 index 000000000..f0a38d220 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app151/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app151; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/test") +class HelloController { + + /** + * Test int. + * + * @return the int + */ + @GetMapping("") + /** + * A test endpoint mounted under `/test` + * @return 0 + */ + public int test() { + return 0; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java new file mode 100644 index 000000000..f4ea0be20 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app151/SpringDocApp151Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app151; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp151Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java new file mode 100644 index 000000000..1c83adb6b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app152/HelloController.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app152; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.util.pattern.PathPatternParser; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Hello world string. + * + * @return the string + */ + @GetMapping + public String helloWorld() { + return "ok"; + } + + /** + * The type Web config. + */ + @Configuration + class WebConfig implements WebMvcConfigurer { + + /** + * Configure path match. + * + * @param configurer the configurer + */ + @Override + public void configurePathMatch(PathMatchConfigurer configurer) { + configurer.setPatternParser(new PathPatternParser()); + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java new file mode 100644 index 000000000..8dbd6a524 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app152/SpringDocApp152Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app152; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp152Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/OrderState.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/OrderState.java new file mode 100644 index 000000000..a4034d84a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/OrderState.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app153; + +import io.swagger.v3.oas.annotations.media.Schema; + + +/** + * The enum Order state. + */ +@Schema(type = "string", allowableValues = { "finished", "new" }) +public enum OrderState { + /** + *Finished order state. + */ + FINISHED("finished"), + /** + *New order state. + */ + NEW("new"); + + /** + * The Value. + */ + private final String value; + + /** + * Instantiates a new Order state. + * + * @param value the value + */ + OrderState(String value) { + this.value = value; + } + + /** + * Gets value. + * + * @return the value + */ + public String getValue() { + return value; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/OrderStateMapper.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/OrderStateMapper.java new file mode 100644 index 000000000..c1e26d8a3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/OrderStateMapper.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app153; + +import java.beans.PropertyEditorSupport; +import java.util.Arrays; + +import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; + +/** + * The type Order state mapper. + */ +class OrderStateMapper extends PropertyEditorSupport { + + /** + * Sets as text. + * + * @param text the text + */ + @Override + public void setAsText(String text) { + setValue( + Arrays.stream(OrderState.class.getEnumConstants()) + .filter(e -> e.getValue().equals(text)) + .findFirst() + .orElseThrow(() -> new MethodArgumentTypeMismatchException( + text, OrderState.class, "orderState", null, null))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java new file mode 100644 index 000000000..6c0c71983 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/SpringDocApp153Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app153; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp153Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/TestController.java new file mode 100644 index 000000000..742239b89 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app153/TestController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app153; + +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.InitBinder; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Test controller. + */ +@RestController +class TestController { + + /** + * Init binder. + * + * @param dataBinder the data binder + */ + @InitBinder + public void initBinder(WebDataBinder dataBinder) { + dataBinder.registerCustomEditor(OrderState.class, new OrderStateMapper()); + } + + /** + * Method object. + * + * @param orderState the order state + * @return the object + */ + @GetMapping(value = { "/orders" }) + public Object method( + @RequestParam(value = "state", defaultValue = "finished") OrderState orderState) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/HelloController.java new file mode 100644 index 000000000..f9ac10cfc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/HelloController.java @@ -0,0 +1,97 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app154; + +import java.time.Instant; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Hello string. + * + * @return the string + */ + @GetMapping(path = "/") + public String hello() { + return "Hello world at " + Instant.now().toString(); + } + + /** + * Create. + * + * @param id the id + * @param o the o + */ + @PostMapping(value = "/persons") + public void create(@ParameterObject Long id, @RequestBody Object o) { + + } + + /** + * Createone. + * + * @param id the id + * @param o the o + */ + @PostMapping(value = "/personsone") + public void createone(Long id, @RequestBody Object o) { + + } + + /** + * Createtwo. + * + * @param id the id + */ + @PostMapping(value = "/createtwo") + public void createtwo(int id) { + + } + + /** + * Createthree. + * + * @param id the id + */ + @PostMapping(value = "/createthree") + public void createthree(Integer id) { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/OpenApiConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/OpenApiConfiguration.java new file mode 100644 index 000000000..0c4ff3658 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/OpenApiConfiguration.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app154; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.security.SecuritySchemes; + +/** + * The type Open api configuration. + */ +@OpenAPIDefinition(info = @Info(title = "toto", version = "1.0"), + security = { @SecurityRequirement(name = "basicAuth"), @SecurityRequirement(name = "bearerToken") } +) +@SecuritySchemes({ + @SecurityScheme( + name = "basicAuth", + type = SecuritySchemeType.HTTP, + scheme = "basic" + ), + @SecurityScheme( + name = "bearerToken", + type = SecuritySchemeType.HTTP, + scheme = "bearer", + bearerFormat = "JWT" + ) +}) +class OpenApiConfiguration { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java new file mode 100644 index 000000000..089299b23 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app154/SpringDocApp154Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app154; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp154Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/AbstractIntParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/AbstractIntParameterObject.java new file mode 100644 index 000000000..76bc5207c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/AbstractIntParameterObject.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app155; + +/** + * The type Abstract int parameter object. + * + * @param the type parameter + */ +class AbstractIntParameterObject { + + /** + * The Primitive base field. + */ + int primitiveBaseField; + + /** + * The Generic field. + */ + T genericField; + + /** + * Gets primitive base field. + * + * @return the primitive base field + */ + public int getPrimitiveBaseField() { + return primitiveBaseField; + } + + /** + * Sets primitive base field. + * + * @param primitiveBaseField the primitive base field + */ + public void setPrimitiveBaseField(int primitiveBaseField) { + this.primitiveBaseField = primitiveBaseField; + } + + /** + * Gets generic field. + * + * @return the generic field + */ + public T getGenericField() { + return genericField; + } + + /** + * Sets generic field. + * + * @param genericField the generic field + */ + public void setGenericField(T genericField) { + this.genericField = genericField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/AbstractParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/AbstractParameterObject.java new file mode 100644 index 000000000..37e7e27da --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/AbstractParameterObject.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app155; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Abstract parameter object. + * + * @param the type parameter + */ +class AbstractParameterObject> { + + /** + * The Primitive base field. + */ + int primitiveBaseField; + + /** + * The Generic field. + */ + @Parameter(schema = @Schema(type = "string", allowableValues = { "ONE", "TWO" })) + T genericField; + + /** + * Gets primitive base field. + * + * @return the primitive base field + */ + public int getPrimitiveBaseField() { + return primitiveBaseField; + } + + /** + * Sets primitive base field. + * + * @param primitiveBaseField the primitive base field + */ + public void setPrimitiveBaseField(int primitiveBaseField) { + this.primitiveBaseField = primitiveBaseField; + } + + /** + * Gets generic field. + * + * @return the generic field + */ + public T getGenericField() { + return genericField; + } + + /** + * Sets generic field. + * + * @param genericField the generic field + */ + public void setGenericField(T genericField) { + this.genericField = genericField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteEnum.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteEnum.java new file mode 100644 index 000000000..97cfc60e9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteEnum.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app155; + + +/** + * The enum Concrete enum. + */ +enum ConcreteEnum { + /** + *One concrete enum. + */ + ONE, + /** + *Two concrete enum. + */ + TWO + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteIntParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteIntParameterObject.java new file mode 100644 index 000000000..57a0822b4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteIntParameterObject.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app155; + +/** + * The type Concrete int parameter object. + */ +class ConcreteIntParameterObject extends AbstractIntParameterObject { + + /** + * The Primitive concrete field. + */ + int primitiveConcreteField; + + /** + * Gets primitive concrete field. + * + * @return the primitive concrete field + */ + public int getPrimitiveConcreteField() { + return primitiveConcreteField; + } + + /** + * Sets primitive concrete field. + * + * @param primitiveConcreteField the primitive concrete field + */ + public void setPrimitiveConcreteField(int primitiveConcreteField) { + this.primitiveConcreteField = primitiveConcreteField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteParameterObject.java new file mode 100644 index 000000000..11f5a59c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/ConcreteParameterObject.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app155; + +/** + * The type Concrete parameter object. + */ +class ConcreteParameterObject extends AbstractParameterObject { + + /** + * The Primitive concrete field. + */ + int primitiveConcreteField; + + /** + * Gets primitive concrete field. + * + * @return the primitive concrete field + */ + public int getPrimitiveConcreteField() { + return primitiveConcreteField; + } + + /** + * Sets primitive concrete field. + * + * @param primitiveConcreteField the primitive concrete field + */ + public void setPrimitiveConcreteField(int primitiveConcreteField) { + this.primitiveConcreteField = primitiveConcreteField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/HelloController.java new file mode 100644 index 000000000..7c6431c60 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/HelloController.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app155; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Say hello response entity. + * + * @param test the test + * @return the response entity + */ + @GetMapping("/test1") + public ResponseEntity sayHello(@ParameterObject final ConcreteParameterObject test) { + System.out.println("Field B = " + test); + return new ResponseEntity("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + + /** + * Say hello response entity. + * + * @param test the test + * @return the response entity + */ + @GetMapping("/test2") + public ResponseEntity sayHello(@ParameterObject final ConcreteIntParameterObject test) { + System.out.println("Field B = " + test); + return new ResponseEntity("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/SpringDocApp155Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/SpringDocApp155Test.java new file mode 100644 index 000000000..bf3487dfd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app155/SpringDocApp155Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app155; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp155Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/HelloController.java new file mode 100644 index 000000000..a2daa3652 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/HelloController.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app156; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + /** + * Hello string. + * + * @param user the user + * @return the string + */ + @GetMapping("/hello") + @Parameter(name = "someEnums", in = QUERY, description = "SomeEum decs", + array = @ArraySchema(schema = @Schema(implementation = SomeEnum.class))) + @Parameter(name = "textSet", in = QUERY, description = "First decs", + array = @ArraySchema(schema = @Schema(implementation = String.class))) + @Parameter(name = "someText", in = QUERY, description = "Second decs", + schema = @Schema(type = "string")) + public String hello(@Parameter(hidden = true) User user) { + String forReturn = "Hello "; + StringBuilder stringBuilder = new StringBuilder(forReturn); + + if (user.getSomeEnums() != null) { + for (SomeEnum some : user.getSomeEnums()) { + stringBuilder.append(some); + stringBuilder.append(" "); + } + } + + if (user.getSomeText() != null) { + for (String text : user.getTextSet()) { + stringBuilder.append(text); + stringBuilder.append(" "); + } + } + + if (user.getSomeText() != null) { + stringBuilder.append(user.getSomeText()); + } + + return stringBuilder.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/SomeEnum.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/SomeEnum.java new file mode 100644 index 000000000..7737cbe33 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/SomeEnum.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app156; + +/** + * The enum Some enum. + */ +public enum SomeEnum { + /** + *First some enum. + */ + FIRST, + /** + *Second some enum. + */ + SECOND +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/SpringDocApp156Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/SpringDocApp156Test.java new file mode 100644 index 000000000..7052cea34 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/SpringDocApp156Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app156; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp156Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/User.java new file mode 100644 index 000000000..5e1fd9837 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app156/User.java @@ -0,0 +1,103 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app156; + +import java.util.Set; + +/** + * The type User. + */ +class User { + /** + * The Some text. + */ + private String someText; + + /** + * The Text set. + */ + private Set textSet; + + /** + * The Some enums. + */ + private Set someEnums; + + /** + * Gets some text. + * + * @return the some text + */ + public String getSomeText() { + return someText; + } + + /** + * Sets some text. + * + * @param someText the some text + */ + public void setSomeText(String someText) { + this.someText = someText; + } + + /** + * Gets text set. + * + * @return the text set + */ + public Set getTextSet() { + return textSet; + } + + /** + * Sets text set. + * + * @param textSet the text set + */ + public void setTextSet(Set textSet) { + this.textSet = textSet; + } + + /** + * Gets some enums. + * + * @return the some enums + */ + public Set getSomeEnums() { + return someEnums; + } + + /** + * Sets some enums. + * + * @param someEnums the some enums + */ + public void setSomeEnums(Set someEnums) { + this.someEnums = someEnums; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/Bar.java new file mode 100644 index 000000000..95afc897e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/Bar.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app157; + +/** + * A class without a String in it + */ +class Bar { + /** + * The Child. + */ + private Object child; + + /** + * Gets child. + * + * @return the child + */ + public Object getChild() { + return this.child; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/Foo.java new file mode 100644 index 000000000..ad636dba6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/Foo.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app157; + +/** + * A class with a String in it + */ +class Foo { + /** + * The Child. + */ + private String child; + + /** + * Gets child. + * + * @return the child + */ + public String getChild() { + return this.child; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/HelloController.java new file mode 100644 index 000000000..411392f28 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app157; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Put Foo and Bar in the schema's components, make sure there is an ignored wrapper + * ({@code ResponseEntity}). + */ +@RestController +class HelloController { + + /** + * Gets foo. + * + * @return the foo + */ + @GetMapping("/foo") + public ResponseEntity getFoo() { + return new ResponseEntity(HttpStatus.OK); + } + + /** + * Gets bar. + * + * @return the bar + */ + @GetMapping("/bar") + public ResponseEntity getBar() { + return new ResponseEntity(HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/SpringDocApp157Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/SpringDocApp157Test.java new file mode 100644 index 000000000..9aa716151 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/SpringDocApp157Test.java @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app157; + +import java.util.ArrayList; + +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * This test is to make sure that a new model converter can access the parent of a type, even if + * the type is enclosed in an ignored wrapper. We test this by setting up a model converter which + * adds "stringy" to the "required" property of a schema's parent, when the sub schema is a String. + */ +class SpringDocApp157Test extends AbstractSpringDocTest { + + /** + * The Converters. + */ + private final ModelConverters converters = ModelConverters.getInstance(); + + @Autowired + private StringyConverter stringyConverter; + + /** + * Unregister converter. + */ + @AfterEach + public void unregisterConverter() { + converters.removeConverter(stringyConverter); + } + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(jsonPath("$.components.schemas.Foo.required", is(new ArrayList() {{ + add("stringy"); + }}))) + .andExpect(jsonPath("$.components.schemas.Bar", not(hasProperty("required")))); + } + + /** + * The type Spring boot app. + */ + @SpringBootApplication + static class SpringBootApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/StringyConverter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/StringyConverter.java new file mode 100644 index 000000000..ac74ead63 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app157/StringyConverter.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app157; + +import java.util.Iterator; + +import com.fasterxml.jackson.databind.JavaType; +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverterContext; +import io.swagger.v3.oas.models.media.Schema; +import org.springdoc.core.providers.ObjectMapperProvider; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + + +@Component +class StringyConverter implements ModelConverter { + + @Autowired + ObjectMapperProvider objectMapperProvider; + + public StringyConverter(ObjectMapperProvider objectMapperProvider) { + this.objectMapperProvider = objectMapperProvider; + } + + + @Override + public Schema resolve(AnnotatedType type, ModelConverterContext context, + Iterator chain) { + + JavaType javaType = objectMapperProvider.jsonMapper().constructType(type.getType()); + + if (javaType.getRawClass().equals(String.class)) { + type.getParent().addRequiredItem("stringy"); + } + return chain.next().resolve(type, context, chain); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/CommonFooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/CommonFooErrorHandler.java new file mode 100644 index 000000000..83e286b46 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/CommonFooErrorHandler.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app158; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * The type Common foo error handler. + */ +class CommonFooErrorHandler { + + /** + * On exception error dto. + * + * @param e the e + * @return the error dto + */ + @ExceptionHandler + @ResponseStatus(HttpStatus.CONFLICT) + public ErrorDTO onException(Exception e) { + return new ErrorDTO("Something wrong has happened"); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/ErrorDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/ErrorDTO.java new file mode 100644 index 000000000..5b9b24be9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/ErrorDTO.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app158; + +/** + * The type Error dto. + */ +class ErrorDTO { + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Error dto. + */ + public ErrorDTO() { + } + + /** + * Instantiates a new Error dto. + * + * @param message the message + */ + public ErrorDTO(String message) { + this.message = message; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/HelloController.java new file mode 100644 index 000000000..1fe6051dd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app158; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) +class HelloController { + + /** + * Hello simple dto. + * + * @return the simple dto + */ + @GetMapping("/foo") + public SimpleDTO hello() { + return new SimpleDTO("foo"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SimpleDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SimpleDTO.java new file mode 100644 index 000000000..5180b27a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SimpleDTO.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app158; + +/** + * The type Simple dto. + */ +class SimpleDTO { + + /** + * The Payload. + */ + private String payload; + + /** + * Instantiates a new Simple dto. + */ + public SimpleDTO() { + } + + /** + * Instantiates a new Simple dto. + * + * @param payload the payload + */ + public SimpleDTO(String payload) { + this.payload = payload; + } + + /** + * Gets payload. + * + * @return the payload + */ + public String getPayload() { + return payload; + } + + /** + * Sets payload. + * + * @param payload the payload + */ + public void setPayload(String payload) { + this.payload = payload; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SpecificFooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SpecificFooErrorHandler.java new file mode 100644 index 000000000..5ed6c035f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SpecificFooErrorHandler.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app158; + +import org.springframework.web.bind.annotation.ControllerAdvice; + +/** + * The type Specific foo error handler. + */ +@ControllerAdvice(assignableTypes = HelloController.class) +class SpecificFooErrorHandler extends CommonFooErrorHandler { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SpringDocApp158Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SpringDocApp158Test.java new file mode 100644 index 000000000..26a839caf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app158/SpringDocApp158Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app158; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 158 test. + */ +class SpringDocApp158Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/CustomException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/CustomException.java new file mode 100644 index 000000000..12398844a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/CustomException.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app159; + +/** + * The type Custom exception. + */ +class CustomException extends RuntimeException { + /** + * Instantiates a new Custom exception. + * + * @param message the message + */ + public CustomException(String message) { + super(message); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/FooBean.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/FooBean.java new file mode 100644 index 000000000..51d744f05 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/FooBean.java @@ -0,0 +1,93 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app159; + +import com.fasterxml.jackson.annotation.JsonView; + +/** + * The type Foo bean. + */ +class FooBean { + /** + * The Message. + */ + @JsonView(Views.View2.class) + private String message; + + /** + * The Code. + */ + @JsonView(Views.View1.class) + private int code; + + /** + * Instantiates a new Foo bean. + * + * @param message the message + * @param code the code + */ + public FooBean(String message, int code) { + this.message = message; + this.code = code; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * Gets code. + * + * @return the code + */ + public int getCode() { + return code; + } + + /** + * Sets code. + * + * @param code the code + */ + public void setCode(int code) { + this.code = code; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/FooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/FooErrorHandler.java new file mode 100644 index 000000000..a7460696f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/FooErrorHandler.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app159; + +import com.fasterxml.jackson.annotation.JsonView; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * The type Foo error handler. + */ +@ControllerAdvice(assignableTypes = HelloController.class) +class FooErrorHandler { + + /** + * Store assignment publishing error response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler + @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR) + @JsonView(Views.View1.class) + public ResponseEntity storeAssignmentPublishingError(Exception e) { + return new ResponseEntity<>(new FooBean("INTERNAL_SERVER_ERROR", 500), HttpStatus.INTERNAL_SERVER_ERROR); + } + + /** + * Store assignment publishing error response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler + @ResponseStatus(value = HttpStatus.BAD_REQUEST) + @JsonView(Views.View2.class) + public ResponseEntity storeAssignmentPublishingError(CustomException e) { + return new ResponseEntity<>(new FooBean("BAD Request", 400), HttpStatus.BAD_REQUEST); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/HelloController.java new file mode 100644 index 000000000..a4845e0be --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app159; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) +class HelloController { + + /** + * Create string. + * + * @param foo the foo + * @return the string + */ + @PostMapping("/foo") + public String create(@RequestBody String foo) { + return "foo"; + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/SpringDocApp159Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/SpringDocApp159Test.java new file mode 100644 index 000000000..ce831d4f5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/SpringDocApp159Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app159; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 159 test. + */ +class SpringDocApp159Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/Views.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/Views.java new file mode 100644 index 000000000..758d652a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app159/Views.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app159; + +/** + * The type Views. + */ +class Views { + /** + * The type View 1. + */ + public static class View1 { + } + + /** + * The type View 2. + */ + public static class View2 extends View1 { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app16/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app16/HelloController.java new file mode 100644 index 000000000..e717e6bf9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app16/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app16; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java new file mode 100644 index 000000000..557a3ff56 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app16/SpringDocApp16Test.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app16; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.test.context.TestPropertySource; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 16 test. + */ +@TestPropertySource(properties = "springdoc.api-docs.enabled=false") +class SpringDocApp16Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isNotFound()); + } + + /** + * The type Spring doc test app. + */ + @SpringBootConfiguration + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app160/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app160/HelloController.java new file mode 100644 index 000000000..5a62e821e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app160/HelloController.java @@ -0,0 +1,111 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app160; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Do something interesting error response. + * + * @return the error response + */ + @PostMapping("test") + public ErrorResponse doSomethingInteresting() { + return null; + } + + /** + * Bundle api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi bundleApi() { + return GroupedOpenApi.builder() + .group("test") + .pathsToMatch("/**") + .build(); + } + + /** + * Translator resource bundle message source. + * + * @return the resource bundle message source + */ + @Bean + public ResourceBundleMessageSource translator() { + ResourceBundleMessageSource source = new ResourceBundleMessageSource(); + source.setBasenames("swagger-message-160"); + source.setUseCodeAsDefaultMessage(true); + source.setDefaultEncoding("utf-8"); + return source; + } + + /** + * The type Swagger message. + */ + @PropertySource("classpath:swagger-message-160.properties") + @Configuration + class SwaggerMessage {} + + /** + * The type Error response. + */ + @Schema(description = "${ErrorResponse}") + class ErrorResponse { + + /** + * The Error code. + */ + @Schema(description = "${ErrorCode}", required = true) + @JsonProperty + private Integer errorCode; + + /** + * The Error message. + */ + @Schema(description = "${ErrorMessage}") + @JsonProperty + private String errorMessage; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app160/SpringDocApp160Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app160/SpringDocApp160Test.java new file mode 100644 index 000000000..047f9948a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app160/SpringDocApp160Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app160; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 160 test. + */ +@TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") +class SpringDocApp160Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app161/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app161/HelloController.java new file mode 100644 index 000000000..6f71e0ce2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app161/HelloController.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app161; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Add response entity. + * + * @param content the content + * @return the response entity + * @throws Exception the exception + */ + @Operation(summary = "add") + @PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ResponseEntity add(@Parameter(description = "content") @RequestPart(value = "content") String content) throws Exception { + return null; + } + + + /** + * Add 2 response entity. + * + * @param content the content + * @param type the type + * @return the response entity + */ + @Operation(summary = "add2") + @PostMapping(value = "/add2", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ResponseEntity add2( + @Parameter(description = "content") @RequestPart(value = "content") String content, + @RequestPart(value = "type") String type + ) { + return null; + } + + /** + * Test. + * + * @param strValue the str value + * @param intValue the int value + */ + @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Operation(summary = "test") + public void test(@RequestPart("strValue") String strValue, + @RequestPart("intValue") Integer intValue) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app161/SpringDocApp161Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app161/SpringDocApp161Test.java new file mode 100644 index 000000000..79db3addb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app161/SpringDocApp161Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app161; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 161 test. + */ +class SpringDocApp161Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/SpringDocApp162Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/SpringDocApp162Test.java new file mode 100644 index 000000000..6b0548936 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/SpringDocApp162Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app162; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 162 test. + */ +@TestPropertySource(properties = "springdoc.override-with-generic-response=true") +class SpringDocApp162Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("SpringShop API") + .version("v1") + .description("The description of the api")); + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/exception/NoResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/exception/NoResultException.java new file mode 100644 index 000000000..00c94c4d5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/exception/NoResultException.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app162.exception; + +public class NoResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/exception/NonUniqueResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/exception/NonUniqueResultException.java new file mode 100644 index 000000000..1a24d02a5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/exception/NonUniqueResultException.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app162.exception; + +/** + * Multiple results found instead of a unique result. + */ +public class NonUniqueResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/JavadocOnlyRestController.java similarity index 76% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/JavadocOnlyRestController.java index 18df12bde..5994516f5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/JavadocOnlyRestController.java @@ -1,10 +1,36 @@ -package test.org.springdoc.api.app162.rest; +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app162.rest; import java.util.List; -import test.org.springdoc.api.app162.exception.NoResultException; -import test.org.springdoc.api.app162.exception.NonUniqueResultException; -import test.org.springdoc.api.app162.rest.dto.JavadocOnlyRestDto; +import test.org.springdoc.api.v30.app162.exception.NoResultException; +import test.org.springdoc.api.v30.app162.exception.NonUniqueResultException; +import test.org.springdoc.api.v30.app162.rest.dto.JavadocOnlyRestDto; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/dto/JavadocOnlyRestDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/dto/JavadocOnlyRestDto.java new file mode 100644 index 000000000..c972ca1f5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/dto/JavadocOnlyRestDto.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app162.rest.dto; + +/** + * This is the {@code JavadocOnlyRestDto} class javadoc. + */ +public class JavadocOnlyRestDto { + /** + * This is the private {@code #guid} field's javadoc. + */ + private String guid; + + /** + * This is the private {@code #inner} field's javadoc. + * + * This javadoc description is ignored by the REST documentation: + * the {@code $ref} can't have a description as any sibling elements of a $ref are ignored. + */ + private JavadocOnlyStaticInnerRestDto inner; + + public JavadocOnlyRestDto() { + } + + public String getGuid() { + return guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public JavadocOnlyStaticInnerRestDto getInner() { + return inner; + } + + public void setInner(JavadocOnlyStaticInnerRestDto inner) { + this.inner = inner; + } + + /** + * This is the {@code JavadocOnlyStaticInnerRestDto} class javadoc. + */ + public static class JavadocOnlyStaticInnerRestDto { + /** + * This is the private {@code #content} field's javadoc. + */ + private String content; + + public JavadocOnlyStaticInnerRestDto() { + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/util/RestExceptionHandler.java new file mode 100644 index 000000000..bf46ebfe7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app162/rest/util/RestExceptionHandler.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app162.rest.util; + +import test.org.springdoc.api.v30.app162.exception.NoResultException; +import test.org.springdoc.api.v30.app162.exception.NonUniqueResultException; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * REST exception handlers. + * + * This javadoc description is ignored by the REST documentation. + */ +@RestControllerAdvice +class RestExceptionHandler { + /** + * REST exception handler for {@code NoResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method + */ + @ExceptionHandler(NoResultException.class) + @ResponseStatus(code = HttpStatus.NOT_FOUND) + public ResponseEntity handleNotFoundException(NoResultException exception) { + return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); + } + + /** + * REST exception handler for {@code NonUniqueResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method + */ + @ExceptionHandler(NonUniqueResultException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { + return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/SpringDocApp163Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/SpringDocApp163Test.java new file mode 100644 index 000000000..b2017462d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/SpringDocApp163Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app163; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 163 test. + */ +@TestPropertySource(properties = "springdoc.override-with-generic-response=true") +class SpringDocApp163Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("SpringShop API") + .version("v1") + .description("The description of the api")); + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/exception/NoResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/exception/NoResultException.java new file mode 100644 index 000000000..7e7236dc7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/exception/NoResultException.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app163.exception; + +public class NoResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/exception/NonUniqueResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/exception/NonUniqueResultException.java new file mode 100644 index 000000000..a9c5521ab --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/exception/NonUniqueResultException.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app163.exception; + +/** + * Multiple results found instead of a unique result. + */ +public class NonUniqueResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/AnnotationOverrideForJavadocRestController.java similarity index 78% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/AnnotationOverrideForJavadocRestController.java index ebdce97de..e84986430 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/AnnotationOverrideForJavadocRestController.java @@ -1,12 +1,38 @@ -package test.org.springdoc.api.app163.rest; +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app163.rest; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; -import test.org.springdoc.api.app163.exception.NoResultException; -import test.org.springdoc.api.app163.exception.NonUniqueResultException; -import test.org.springdoc.api.app163.rest.dto.AnnotationOverrideForJavadocRestDto; +import test.org.springdoc.api.v30.app163.exception.NoResultException; +import test.org.springdoc.api.v30.app163.exception.NonUniqueResultException; +import test.org.springdoc.api.v30.app163.rest.dto.AnnotationOverrideForJavadocRestDto; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java new file mode 100644 index 000000000..13ca7ae39 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app163.rest.dto; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * This is the {@code AnnotationOverrideForJavadocRestDto} class javadoc. + */ +@Schema( + title = "annotation-override-dto", + description = "Description for the tag." +) +public class AnnotationOverrideForJavadocRestDto { + /** + * This is the private {@code #guid} field's javadoc. + */ + @Schema(description = "Description for the #guid field") + private String guid; + + /** + * This is the private {@code #inner} field's javadoc. + *

+ * This javadoc description is ignored by the REST documentation: + * the {@code $ref} can't have a description as any sibling elements of a $ref are ignored. + */ + private AnnotationOverrideForJavadocStaticInnerRestDto inner; + + public String getGuid() { + return guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public AnnotationOverrideForJavadocStaticInnerRestDto getInner() { + return inner; + } + + public void setInner(AnnotationOverrideForJavadocStaticInnerRestDto inner) { + this.inner = inner; + } + + /** + * This is the {@code AnnotationOverrideForJavadocStaticInnerRestDto} class javadoc. + */ + public static class AnnotationOverrideForJavadocStaticInnerRestDto { + /** + * This is the private {@code #content} field's javadoc. + */ + private String content; + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java new file mode 100644 index 000000000..886d36aa5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app163.rest.dto; + +/** + * This is the {@code AnnotationOverrideForJavadocRestDto2} class javadoc. + */ +class AnnotationOverrideForJavadocRestDto2 { + /** + * This is the private {@code #guid3} field's javadoc. + */ + private String guid3; + + public String getGuid3() { + return guid3; + } + + public void setGuid3(String guid3) { + this.guid3 = guid3; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java new file mode 100644 index 000000000..ff558a2e1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app163.rest.dto; + +/** + * This is the {@code AnnotationOverrideForJavadocRestDto3} class javadoc. + */ +class AnnotationOverrideForJavadocRestDto3 { + /** + * This is the private {@code #guid4} field's javadoc. + */ + private String guid4; + + public String getGuid4() { + return guid4; + } + + public void setGuid4(String guid4) { + this.guid4 = guid4; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/util/RestExceptionHandler.java new file mode 100644 index 000000000..b17fef094 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app163/rest/util/RestExceptionHandler.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app163.rest.util; + +import test.org.springdoc.api.v30.app163.exception.NoResultException; +import test.org.springdoc.api.v30.app163.exception.NonUniqueResultException; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * REST exception handlers. + * + * This javadoc description is ignored by the REST documentation. + */ +@RestControllerAdvice +class RestExceptionHandler { + /** + * REST exception handler for {@code NoResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method + */ + @ExceptionHandler(NoResultException.class) + @ResponseStatus(code = HttpStatus.NOT_FOUND) + public ResponseEntity handleNotFoundException(NoResultException exception) { + return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); + } + + /** + * REST exception handler for {@code NonUniqueResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method + */ + @ExceptionHandler(NonUniqueResultException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { + return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/SpringDocApp164Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/SpringDocApp164Test.java new file mode 100644 index 000000000..dc9f9122e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/SpringDocApp164Test.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app164; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc app 164 test. + */ +class SpringDocApp164Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("SpringShop API") + .version("v1") + .description("The description of the api")); + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/SpringDocJavadocProviderTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/SpringDocJavadocProviderTest.java new file mode 100644 index 000000000..316d07972 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/SpringDocJavadocProviderTest.java @@ -0,0 +1,87 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app164; + +import java.util.stream.Stream; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.springdoc.core.providers.JavadocProvider; +import org.springdoc.core.providers.SpringDocJavadocProvider; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +class SpringDocJavadocProviderTest { + private JavadocProvider javadocProvider; + + static Stream getFirstSentence() { + return Stream.of( + arguments(null, null), + arguments("", ""), + arguments("A b c. D e f", "A b c."), + arguments("A b c", "A b c"), + arguments("A b c

D e f", "A b c"), + arguments("A b c. D

e f", "A b c"), + arguments("A b c

D. e f", "A b c"), + arguments("

A b c

D e f", "A b c"), + arguments("

A b c. D

e f", "A b c"), + arguments("A b c.d e f", "A b c.d e f") + ); + } + + /** + * Edge cases not handled by the implementation. + */ + static Stream getFirstSentenceNotHandled() { + return Stream.of( + arguments("

A b c

d e f

", "A b c") + ); + } + + @BeforeEach + public void setup() { + javadocProvider = new SpringDocJavadocProvider(); + } + + @ParameterizedTest + @MethodSource + public void getFirstSentence(String javadoc, String expectedFirstSentence) { + assertThat(javadocProvider.getFirstSentence(javadoc)) + .isEqualTo(expectedFirstSentence); + } + + @ParameterizedTest + @MethodSource + public void getFirstSentenceNotHandled(String javadoc, String correctFirstSentence) { + assertThat(javadocProvider.getFirstSentence(javadoc)) + .isNotEqualTo(correctFirstSentence); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/exception/NoResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/exception/NoResultException.java new file mode 100644 index 000000000..cf9169219 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/exception/NoResultException.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app164.exception; + +public class NoResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/exception/NonUniqueResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/exception/NonUniqueResultException.java new file mode 100644 index 000000000..b5ab92305 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/exception/NonUniqueResultException.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app164.exception; + +/** + * Multiple results found instead of a unique result. + */ +public class NonUniqueResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/rest/NoGenericOverrideRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/rest/NoGenericOverrideRestController.java new file mode 100644 index 000000000..61aae0169 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/rest/NoGenericOverrideRestController.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app164.rest; + +import test.org.springdoc.api.v30.app164.exception.NoResultException; +import test.org.springdoc.api.v30.app164.exception.NonUniqueResultException; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * This is the {@code JavadocOnlyRestController} class javadoc. + */ +@RestController +@RequestMapping("/no-generic-override") +class NoGenericOverrideRestController { + /** + * This is the create method's javadoc. + * The method's signature: {@code #create(JavadocOnlyRestDto)} + * + * @param input the {@code @param input} javadoc for the {@code #create(JavadocOnlyRestDto)} method + * @return the {@code @return} javadoc for the {@code #create(JavadocOnlyRestDto)} method + */ + @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.CREATED) + public ResponseEntity create(@RequestBody String input) { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the findStartsBy method's javadoc. + * The method's signature: {@code #findStartsBy(String)} + * + * @param prefix the {@code @param prefix} javadoc for the {@code #findStartsBy(String)} method + * @return the {@code @return} javadoc for the {@code #findStartsBy(String)} method + * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #findStartsBy(String)} method + * @throws NonUniqueResultException the {@code @throws NonUniqueResultException} javadoc for the {@code #findStartsBy(String)} method + */ + @GetMapping(path = "startsBy/{prefix}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findStartsBy(@PathVariable String prefix) throws NoResultException, NonUniqueResultException { + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/rest/util/RestExceptionHandler.java new file mode 100644 index 000000000..0d53703df --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app164/rest/util/RestExceptionHandler.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app164.rest.util; + +import test.org.springdoc.api.v30.app164.exception.NoResultException; +import test.org.springdoc.api.v30.app164.exception.NonUniqueResultException; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * REST exception handlers. + * + * This javadoc description is ignored by the REST documentation. + */ +@RestControllerAdvice +class RestExceptionHandler { + /** + * REST exception handler for {@code NoResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method + */ + @ExceptionHandler(NoResultException.class) + @ResponseStatus(code = HttpStatus.NOT_FOUND) + public ResponseEntity handleNotFoundException(NoResultException exception) { + return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); + } + + /** + * REST exception handler for {@code NonUniqueResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method + */ + @ExceptionHandler(NonUniqueResultException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { + return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/ConcreteSubclassFromGeneric.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/ConcreteSubclassFromGeneric.java new file mode 100644 index 000000000..98ac4ad72 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/ConcreteSubclassFromGeneric.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app166; + +class ConcreteSubclassFromGeneric extends SimpleGeneric { + + /** + * Return the top name + */ + private String topName; + + public String getTopName() { + return topName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/HelloController.java new file mode 100644 index 000000000..837ce9ce2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app166; + + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +class HelloController { + @GetMapping("/nested") + public ResponseEntity nested(@ParameterObject final SimpleOuterClass filter) { + return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + + @GetMapping("/nestedTypeErasureGeneric") + public ResponseEntity nestedTypeErasureGeneric(@ParameterObject final SimpleGeneric filter) { + return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + + @GetMapping("/nestedReifiableGeneric") + public ResponseEntity nestedReifiableGeneric(@ParameterObject final ConcreteSubclassFromGeneric filter) { + return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/MyData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/MyData.java new file mode 100644 index 000000000..9479fabec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/MyData.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app166; + +class MyData { + + /** + * Returns the first name + */ + private String firstName; + + /** + * Returns the max number + */ + private Integer maxNumber; + + public Integer getMaxNumber() { + return maxNumber; + } + + public String getFirstName() { + return firstName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleGeneric.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleGeneric.java new file mode 100644 index 000000000..7fe3657f8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleGeneric.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app166; + +class SimpleGeneric { + + /** + * Returns name + */ + private String name; + + /** + * Returns the generic child + */ + private T child; + + public T getChild() { + return child; + } + + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleInnerClass.java new file mode 100644 index 000000000..bb4674085 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleInnerClass.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app166; + +class SimpleInnerClass { + + /** + * Returns the inner inner class + */ + private SimpleInnerInnerClass innerInnerClass; + + /** + * Returns the boolean name + */ + private Boolean name; + + /** + * Returns the max number + */ + private Integer maxNumber; + + public Integer getMaxNumber() { + return maxNumber; + } + + public Boolean getName() { + return name; + } + + public SimpleInnerInnerClass getInnerInnerClass() { + return innerInnerClass; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleInnerInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleInnerInnerClass.java new file mode 100644 index 000000000..9f9d922a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleInnerInnerClass.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app166; + +class SimpleInnerInnerClass { + /** + * Returns the name of the inner inner class + */ + Boolean name; + + /** + * Returns the maxNumber of the inner inner class + */ + private Integer maxNumber; + + public Integer getMaxNumber() { + return maxNumber; + } + + public Boolean getName() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleOuterClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleOuterClass.java new file mode 100644 index 000000000..cbe7fa343 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SimpleOuterClass.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app166; + +class SimpleOuterClass { + + /** + * Returns the name of the outer class + */ + private String name; + + /** + * Returns the inner class + */ + private SimpleInnerClass innerClass; + + public String getName() { + return name; + } + + public SimpleInnerClass getInnerClass() { + return innerClass; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SpringDocApp166Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SpringDocApp166Test.java new file mode 100644 index 000000000..90bf83540 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app166/SpringDocApp166Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app166; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 165 test. + */ +class SpringDocApp166Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app167/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app167/HelloController.java new file mode 100644 index 000000000..d913705b5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app167/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app167; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + @RequestMapping("/process") + public void process() { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app167/SpringDocApp167Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app167/SpringDocApp167Test.java new file mode 100644 index 000000000..b99885767 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app167/SpringDocApp167Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app167; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 167 test. + */ +class SpringDocApp167Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/DescriptionFieldInRequestBodyIsNullController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/DescriptionFieldInRequestBodyIsNullController.java new file mode 100644 index 000000000..60d917abb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/DescriptionFieldInRequestBodyIsNullController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app168; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * If the RequestBody description field is null, get the description from the javadoc. + */ +@RestController +@RequestMapping("description-in-requestbody-is-null") +class DescriptionFieldInRequestBodyIsNullController { + + /** + * Person person. + * + * @param person the person + */ + @PostMapping + public void person( + @io.swagger.v3.oas.annotations.parameters.RequestBody(content = @Content(schema = @Schema(implementation = Person.class))) @RequestBody Person person) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/Person.java new file mode 100644 index 000000000..7369d2897 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/Person.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app168; + +/** + * The type Person. + */ +class Person { + /** + * The Id. + */ + private long id; + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/SpringDocApp168Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/SpringDocApp168Test.java new file mode 100644 index 000000000..bd7ccd819 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app168/SpringDocApp168Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app168; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 168 test. + */ +class SpringDocApp168Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/RecordController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/RecordController.java new file mode 100644 index 000000000..e4c9fd29a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/RecordController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app169; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("record") +class RecordController { + @GetMapping + public SimpleOuterClass index(@ParameterObject SimpleOuterClass filter) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SimpleInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SimpleInnerClass.java new file mode 100644 index 000000000..8fc3f0217 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SimpleInnerClass.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app169; + +/** + * simple inner class + * + * @param name the boolean name + * @param maxNumber the max number + */ +public record SimpleInnerClass(Boolean name, Integer maxNumber) { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SimpleOuterClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SimpleOuterClass.java new file mode 100644 index 000000000..f1364bf77 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SimpleOuterClass.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app169; + +/** + * simple outer class + * + * @param name the name of the outer class + * @param simpleInnerClass the inner class + */ +public record SimpleOuterClass(String name, SimpleInnerClass simpleInnerClass) { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SpringDocApp169Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SpringDocApp169Test.java new file mode 100644 index 000000000..c80a28009 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app169/SpringDocApp169Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app169; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 169 test. + */ +class SpringDocApp169Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app17/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app17/HelloController.java new file mode 100644 index 000000000..471be5f5a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app17/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app17; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping(value = "/persons") + public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java new file mode 100644 index 000000000..7bff2dd29 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app17/SpringDocApp17Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app17; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 17 test. + */ +class SpringDocApp17Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Animal.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Animal.java new file mode 100644 index 000000000..b94bf7500 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Animal.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app170; + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Interface of the Animal. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "dog"), + @JsonSubTypes.Type(value = Cat.class, name = "cat"), +}) +@Schema(description = "Represents an Animal class.") +public interface Animal {} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/BasicController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/BasicController.java new file mode 100644 index 000000000..260faed8c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/BasicController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app170; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(path = "/") +class BasicController { + + @GetMapping("/test1") + @Operation(summary = "get1", description = "Provides an animal.") + public Animal get1() { + + return new Dog("Foo", 12); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Cat.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Cat.java new file mode 100644 index 000000000..4a116dab6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Cat.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app170; + + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +class Cat implements Animal { + + private Integer speed; + + public Cat(Integer speed) { + this.speed = speed; + } + + public Integer getSpeed() { + return speed; + } + + public void setSpeed(Integer speed) { + this.speed = speed; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Dog.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Dog.java new file mode 100644 index 000000000..892480ceb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/Dog.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app170; + + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "Represents a Dog class.") +class Dog implements Animal { + + private String name; + + private Integer age; + + public Dog(String name, Integer age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/SpringDocApp170Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/SpringDocApp170Test.java new file mode 100644 index 000000000..17faafdc3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app170/SpringDocApp170Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app170; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 193 test. + */ +class SpringDocApp170Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/HelloController.java new file mode 100644 index 000000000..5eeef9437 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app171; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * PersonProjection interface. + * + * @return the PersonProjection + */ + @GetMapping(value = "/persons") + public PersonProjection persons() { + return new PersonDTO(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/PersonDTO.java new file mode 100644 index 000000000..8ebe74abf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/PersonDTO.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app171; + +/** + * Simulate a dynamically generated class that implements the PersonProjection interface. + */ +class PersonDTO implements PersonProjection { + private String email; + + private String firstName; + + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/PersonProjection.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/PersonProjection.java new file mode 100644 index 000000000..ea663dbe5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/PersonProjection.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app171; + +/** + * The type PersonProjection dto interface. + */ +public interface PersonProjection { + /** + * The Email. + * + */ + String getEmail(); + + /** + * The First name. + * + */ + String getFirstName(); + + /** + * The Last name. + * + */ + String getLastName(); +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/SpringDocApp171Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/SpringDocApp171Test.java new file mode 100644 index 000000000..691922268 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app171/SpringDocApp171Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app171; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 193 test. + */ +class SpringDocApp171Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app172/JavadocPropertyCustomizerTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app172/JavadocPropertyCustomizerTest.java similarity index 82% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app172/JavadocPropertyCustomizerTest.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app172/JavadocPropertyCustomizerTest.java index 568353766..03dbafc78 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app172/JavadocPropertyCustomizerTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app172/JavadocPropertyCustomizerTest.java @@ -2,25 +2,29 @@ * * * * * * - * * * * Copyright 2019-2023 the original author or authors. * * * * - * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * you may not use this file except in compliance with the License. - * * * * You may obtain a copy of the License at + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * * * * * - * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * - * * * * Unless required by applicable law or agreed to in writing, software - * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * See the License for the specific language governing permissions and - * * * * limitations under the License. * * * * * - * + * */ -package test.org.springdoc.api.app172; +package test.org.springdoc.api.v30.app172; import java.beans.IntrospectionException; import java.beans.Introspector; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/Example.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/Example.java new file mode 100644 index 000000000..46d6b944c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/Example.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app173; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The Example object + */ +@Schema +class Example { + + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/ExampleController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/ExampleController.java new file mode 100644 index 000000000..b6950a013 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/ExampleController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app173; + +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.HttpStatus.OK; + +/** + * The Example Controller + */ +@RestController +class ExampleController { + + @PostMapping("/example") + @Operation(summary = "insert example", description = "Allows to insert an example") + public ResponseEntity postExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "${example.description}") @RequestBody Example example) { + return new ResponseEntity<>(UUID.randomUUID(), OK); + } + + @PutMapping("/example") + @Operation(summary = "update example", description = "Allows to update an example") + public ResponseEntity putExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "${example2.description:Default description for example}") @RequestBody Example example) { + return new ResponseEntity<>(UUID.randomUUID(), OK); + } + + @PatchMapping("/example") + @Operation(summary = "patch example", description = "Allows to patch an example") + public ResponseEntity patchExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Description without the use of variables") @RequestBody Example example) { + return new ResponseEntity<>(UUID.randomUUID(), OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/SpringDocApp173Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/SpringDocApp173Test.java new file mode 100644 index 000000000..4fa2ec170 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app173/SpringDocApp173Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app173; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 173 test. + */ +@TestPropertySource(properties = "example.description=The example object") +class SpringDocApp173Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/ExampleController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/ExampleController.java new file mode 100644 index 000000000..f437ca0d0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/ExampleController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app174; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The Example Controller + */ +@RestController +class ExampleController { + + @PostMapping + public Test post(){ + return null; + } + +} + + + + + + + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/Question.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/Question.java new file mode 100644 index 000000000..3b63c1ea8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/Question.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app174; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** + * The type Question. + * + * @author bnasslahsen base class for all questions in test with polymorphism + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = TestQuestion.class, name = "test"), + @JsonSubTypes.Type(value = TextQuestion.class, name = "text") +}) +public abstract class Question { + private final String question; + private final String type; + + public Question(String question, String type) { + this.question = question; + this.type = type; + } + + public String getQuestion() { + return question; + } + + public String getType() { + return type; + } + + @Override + public String toString() { + return "Question{" + + "question='" + question + '\'' + + ", type='" + type + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/SpringDocApp174Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/SpringDocApp174Test.java new file mode 100644 index 000000000..84246cce2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/SpringDocApp174Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app174; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 174 test. + */ +class SpringDocApp174Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/Test.java new file mode 100644 index 000000000..85cda2fd0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/Test.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app174; + +import java.io.Serializable; +import java.util.List; + +/** + * The type Test. + * + * @author bnasslahsen + */ + +class Test implements Serializable { + + private static final long serialVersionUID = 1L; // Recommended for Serializable classes + + private List questions; + + // No-argument constructor + public Test() { + } + + // Constructor with arguments + public Test(List questions) { + this.questions = questions; + } + + // Getter method for 'questions' + public List getQuestions() { + return questions; + } + + // Setter method for 'questions' + public void setQuestions(List questions) { + this.questions = questions; + } + + // Optionally, you can override toString, hashCode, equals, etc. + @Override + public String toString() { + return "Test{" + + "questions=" + questions + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/TestQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/TestQuestion.java new file mode 100644 index 000000000..21073cc9c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/TestQuestion.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app174; + +import java.util.List; + +/** + * The type Test question. + * + * @author bnasslahsen test question + */ +class TestQuestion extends Question { + /** + * list of variants + */ + private final List variants; + /** + * correct answer + */ + private final int answer; + + public TestQuestion(String question, String type, List variants, int answer) { + super(question, type); + this.variants = variants; + this.answer = answer; + } + + public List getVariants() { + return variants; + } + + public int getAnswer() { + return answer; + } + + @Override + public String toString() { + return "TestQuestion{" + + "question='" + getQuestion() + '\'' + + ", variants=" + variants + + ", answer=" + answer + + '}'; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/TextQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/TextQuestion.java new file mode 100644 index 000000000..2a537732b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app174/TextQuestion.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app174; + +/** + * The type Text question. + * + * @author bnasslahsen + */ +class TextQuestion extends Question { + private final String answer; + + public TextQuestion(String question, String type, String answer) { + super(question, type); + this.answer = answer; + } + + public String getAnswer() { + return answer; + } + + @Override + public String toString() { + return "TextQuestion{" + + "question='" + getQuestion() + '\'' + + ", type='" + getType() + '\'' + + ", answer='" + answer + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java new file mode 100644 index 000000000..8a567878e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app18/HelloController.java @@ -0,0 +1,111 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app18; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NegativeOrZero; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.PositiveOrZero; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/persons") + public String persons(@NotBlank String name) { + return "OK"; + } + + /** + * Persons 2 string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/persons2") + public String persons2(@NotBlank @Parameter(description = "persons name") String name) { + return "OK"; + } + + /** + * Persons 3 string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/persons3") + public String persons3(@NotBlank @Parameter(description = "persons name") @RequestParam String name) { + return "OK"; + } + + /** + * Persons 4 string. + * + * @param age the age + * @return the string + */ + @GetMapping(value = "/persons4") + public String persons4(@PositiveOrZero int age) { + return "OK"; + } + + /** + * Persons 5 string. + * + * @param age the age + * @return the string + */ + @GetMapping(value = "/persons5") + public String persons5(@NegativeOrZero int age) { + return "OK"; + } + + /** + * Persons 6 string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/persons6") + public String persons6(@NotEmpty @Parameter(description = "persons name") String name) { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java new file mode 100644 index 000000000..0a78466d8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app18/SpringDocApp18Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app18; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 18 test. + */ +@TestPropertySource(properties = "springdoc.pre-loading-enabled=true") +class SpringDocApp18Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app19/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app19/HelloController.java new file mode 100644 index 000000000..9c934de7a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app19/HelloController.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app19; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param name the name + * @return the string + */ + @PostMapping(value = "/persons") + public String persons(@RequestBody(description = "requestBody description as parameter") String name) { + return "OK"; + } + + /** + * Persons 2 string. + * + * @param name the name + * @return the string + */ + @RequestBody(description = "requestBody description outside") + @PostMapping(value = "/persons2") + public String persons2(String name) { + return "OK"; + } + + /** + * Persons 3 string. + * + * @param name the name + * @return the string + */ + @Operation(requestBody = @RequestBody(description = "requestBody inside operation annotation")) + @PostMapping(value = "/persons3") + public String persons3(@NotBlank String name) { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java new file mode 100644 index 000000000..575afa798 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app19/SpringDocApp19Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app19; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 19 test. + */ +class SpringDocApp19Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..b890eb8b4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc app 2 test. + */ +class SpringDocApp2Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/ApiUtil.java new file mode 100644 index 000000000..aae08d565 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/ApiUtil.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import java.io.IOException; + +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.server.ResponseStatusException; + +/** + * The type Api util. + */ +class ApiUtil { + + /** + * Sets example response. + * + * @param req the req + * @param contentType the content type + * @param example the example + */ + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); + req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Check api key. + * + * @param req the req + */ + public static void checkApiKey(NativeWebRequest req) { + if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { + throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/ExceptionTranslator.java new file mode 100644 index 000000000..a79041463 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/ExceptionTranslator.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import java.util.Map; + +import jakarta.validation.ConstraintViolationException; + +import org.springframework.boot.web.error.ErrorAttributeOptions; +import org.springframework.boot.web.servlet.error.ErrorAttributes; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.WebRequest; + +/** + * The type Exception translator. + */ +@RestControllerAdvice +class ExceptionTranslator { + + /** + * The Error attributes. + */ + private final ErrorAttributes errorAttributes; + + /** + * Instantiates a new Exception translator. + * + * @param errorAttributes the error attributes + */ + public ExceptionTranslator(ErrorAttributes errorAttributes) { + this.errorAttributes = errorAttributes; + } + + /** + * Process constraint violation exception map. + * + * @param request the request + * @return the map + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Map processConstraintViolationException(WebRequest request) { + request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); + return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/HomeController.java new file mode 100644 index 000000000..6bc9fc4fe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/HomeController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; +import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; + +/** + * Home redirection to swagger api documentation + */ +@Controller +class HomeController { + + /** + * The Swagger ui path. + */ + @Value(SWAGGER_UI_PATH) + private String swaggerUiPath; + + /** + * Index string. + * + * @return the string + */ + @GetMapping(DEFAULT_PATH_SEPARATOR) + public String index() { + return REDIRECT_URL_PREFIX + swaggerUiPath; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApi.java new file mode 100644 index 000000000..47142103d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApi.java @@ -0,0 +1,229 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v30.app2.api; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v30.app2.model.ModelApiResponse; +import test.org.springdoc.api.v30.app2.model.Pet; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; + +/** + * The interface Pet api. + */ +@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { + @OAuthScope(name = "write:pets", description = "modify pets in your account"), + @OAuthScope(name = "read:pets", description = "read your pets") }))) +@Tag(name = "pet", description = "the pet API") +@ResponseBody +public interface PetApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default PetApiDelegate getDelegate() { + return new PetApiDelegate() { + }; + } + + /** + * Add pet. + * + * @param pet the pet + */ + @Operation(summary = "Add a new pet to the store", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default void addPet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + // return getDelegate().addPet(pet); + } + + /** + * Delete pet response entity. + * + * @param petId the pet id + * @param apiKey the api key + * @return the response entity + */ + @Operation(summary = "Deletes a pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @DeleteMapping(value = "/pet/{petId}") + default ResponseEntity deletePet( + @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + return getDelegate().deletePet(petId, apiKey); + } + + /** + * Find pets by status response entity. + * + * @param status the status + * @return the response entity + */ + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid status value") }) + @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByStatus( + @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { + return getDelegate().findPetsByStatus(status); + } + + /** + * Find pets by tags response entity. + * + * @param tags the tags + * @return the response entity + */ + @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid tag value") }) + @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByTags( + @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + return getDelegate().findPetsByTags(tags); + } + + /** + * Gets pet by id. + * + * @param petId the pet id + * @return the pet by id + */ + @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { + @SecurityRequirement(name = "api_key") }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getPetById( + @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + return getDelegate().getPetById(petId); + } + + /** + * Update pet response entity. + * + * @param pet the pet + * @return the response entity + */ + @Operation(summary = "Update an existing pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") }) + @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default ResponseEntity updatePet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + return getDelegate().updatePet(pet); + } + + /** + * Update pet with form response entity. + * + * @param petId the pet id + * @param name the name + * @param status the status + * @return the response entity + */ + @Operation(summary = "Updates a pet in the store with form data", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) + default ResponseEntity updatePetWithForm( + @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, + @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { + return getDelegate().updatePetWithForm(petId, name, status); + } + + /** + * Upload file response entity. + * + * @param petId the pet id + * @param additionalMetadata the additional metadata + * @param file the file + * @return the response entity + */ + @Operation(summary = "uploads an image", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) + @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { + "multipart/form-data" }) + default ResponseEntity uploadFile( + @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { + return getDelegate().uploadFile(petId, additionalMetadata, file); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiController.java new file mode 100644 index 000000000..224b691f2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import java.util.Optional; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * The type Pet api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class PetApiController implements PetApi { + + /** + * The Delegate. + */ + private final PetApiDelegate delegate; + + /** + * Instantiates a new Pet api controller. + * + * @param delegate the delegate + */ + public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public PetApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegate.java new file mode 100644 index 000000000..9cd0e4201 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegate.java @@ -0,0 +1,192 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import java.util.List; +import java.util.Optional; + +import jakarta.validation.Valid; +import test.org.springdoc.api.v30.app2.model.ModelApiResponse; +import test.org.springdoc.api.v30.app2.model.Pet; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface PetApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Add pet. + * + * @param pet the pet + * @see PetApi#addPet PetApi#addPet + */ + default void addPet(Pet pet) { + + } + + /** + * Delete pet response entity. + * + * @param petId the pet id + * @param apiKey the api key + * @return the response entity + * @see PetApi#deletePet PetApi#deletePet + */ + default ResponseEntity deletePet(Long petId, + String apiKey) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Find pets by status response entity. + * + * @param status the status + * @return the response entity + * @see PetApi#findPetsByStatus PetApi#findPetsByStatus + */ + default ResponseEntity> findPetsByStatus(List status) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Extract. + */ + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + break; + } + } + }); + } + + /** + * Find pets by tags response entity. + * + * @param tags the tags + * @return the response entity + * @see PetApi#findPetsByTags PetApi#findPetsByTags + */ + default ResponseEntity> findPetsByTags(List tags) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets pet by id. + * + * @param petId the pet id + * @return the pet by id + * @see PetApi#getPetById PetApi#getPetById + */ + default ResponseEntity getPetById(Long petId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update pet response entity. + * + * @param pet the pet + * @return the response entity + * @see PetApi#updatePet PetApi#updatePet + */ + default ResponseEntity updatePet(Pet pet) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update pet with form response entity. + * + * @param petId the pet id + * @param name the name + * @param status the status + * @return the response entity + * @see PetApi#updatePetWithForm PetApi#updatePetWithForm + */ + default ResponseEntity updatePetWithForm(Long petId, + String name, + String status) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Upload file response entity. + * + * @param petId the pet id + * @param additionalMetadata the additional metadata + * @param file the file + * @return the response entity + * @see PetApi#uploadFile PetApi#uploadFile + */ + default ResponseEntity uploadFile(Long petId, + String additionalMetadata, + @Valid MultipartFile file) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegateImpl.java new file mode 100644 index 000000000..e2771a869 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/PetApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import org.springframework.stereotype.Service; + +/** + * The type Pet api delegate. + */ +@Service +class PetApiDelegateImpl implements PetApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApi.java new file mode 100644 index 000000000..0f92f20d1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApi.java @@ -0,0 +1,143 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v30.app2.api; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import test.org.springdoc.api.v30.app2.model.Order; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * The interface Store api. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() { + }; + } + + /** + * Delete order response entity. + * + * @param orderId the order id + * @return the response entity + */ + @Operation(summary = "Delete purchase order by ID", tags = { "store" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @DeleteMapping(value = "/store/order/{orderId}") + @ResponseBody + default ResponseEntity deleteOrder( + @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { + return getDelegate().deleteOrder(orderId); + } + + /** + * Gets inventory. + * + * @return the inventory + */ + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { + @SecurityRequirement(name = "api_key") }, tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) + @GetMapping(value = "/store/inventory", produces = { "application/json" }) + @ResponseBody + default ResponseEntity> getInventory() { + return getDelegate().getInventory(); + } + + /** + * Gets order by id. + * + * @param orderId the order id + * @return the order by id + */ + @Operation(summary = "Find purchase order by ID", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) + @ResponseBody + default ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { + return getDelegate().getOrderById(orderId); + } + + /** + * Place order response entity. + * + * @param order the order + * @return the response entity + */ + @Operation(summary = "Place an order for a pet", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid Order") }) + @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { + "application/json" }) + @ResponseBody + default ResponseEntity placeOrder( + @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { + return getDelegate().placeOrder(order); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiController.java new file mode 100644 index 000000000..5f0204831 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import java.util.Optional; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * The type Store api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class StoreApiController implements StoreApi { + + /** + * The Delegate. + */ + private final StoreApiDelegate delegate; + + /** + * Instantiates a new Store api controller. + * + * @param delegate the delegate + */ + public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public StoreApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegate.java new file mode 100644 index 000000000..59cafb2b2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegate.java @@ -0,0 +1,123 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import java.util.Map; +import java.util.Optional; + +import test.org.springdoc.api.v30.app2.model.Order; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface StoreApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Delete order response entity. + * + * @param orderId the order id + * @return the response entity + * @see StoreApi#deleteOrder StoreApi#deleteOrder + */ + default ResponseEntity deleteOrder(String orderId) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets inventory. + * + * @return the inventory + * @see StoreApi#getInventory StoreApi#getInventory + */ + default ResponseEntity> getInventory() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets order by id. + * + * @param orderId the order id + * @return the order by id + * @see StoreApi#getOrderById StoreApi#getOrderById + */ + default ResponseEntity getOrderById(Long orderId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Extract. + */ + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + break; + } + } + }); + } + + /** + * Place order response entity. + * + * @param order the order + * @return the response entity + * @see StoreApi#placeOrder StoreApi#placeOrder + */ + default ResponseEntity placeOrder(Order order) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegateImpl.java new file mode 100644 index 000000000..d7bc3e5c0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/StoreApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import org.springframework.stereotype.Service; + +/** + * The type Store api delegate. + */ +@Service +class StoreApiDelegateImpl implements StoreApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApi.java new file mode 100644 index 000000000..d69daa354 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApi.java @@ -0,0 +1,197 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v30.app2.api; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v30.app2.model.User; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * The interface User api. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "user", description = "the user API") +public interface UserApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default UserApiDelegate getDelegate() { + return new UserApiDelegate() { + }; + } + + /** + * Create user response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Create user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user", consumes = { "application/json" }) + default ResponseEntity createUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { + return getDelegate().createUser(user); + } + + /** + * Create users with array input response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) + default ResponseEntity createUsersWithArrayInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithArrayInput(user); + } + + /** + * Create users with list input response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) + default ResponseEntity createUsersWithListInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithListInput(user); + } + + /** + * Delete user response entity. + * + * @param username the username + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @DeleteMapping(value = "/user/{username}") + default ResponseEntity deleteUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + return getDelegate().deleteUser(username); + } + + /** + * Gets user by name. + * + * @param username the username + * @return the user by name + */ + @Operation(summary = "Get user by user name", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + + @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) + default ResponseEntity getUserByName( + @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + return getDelegate().getUserByName(username); + } + + /** + * Login user response entity. + * + * @param username the username + * @param password the password + * @return the response entity + */ + @Operation(summary = "Logs user into the system", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) + @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) + default ResponseEntity loginUser( + @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + return getDelegate().loginUser(username, password); + } + + /** + * Logout user response entity. + * + * @return the response entity + */ + @Operation(summary = "Logs out current logged in user session", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @GetMapping(value = "/user/logout") + default ResponseEntity logoutUser() { + return getDelegate().logoutUser(); + } + + /** + * Update user response entity. + * + * @param username the username + * @param user the user + * @return the response entity + */ + @Operation(summary = "Updated user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + @PutMapping(value = "/user/{username}", consumes = { "application/json" }) + default ResponseEntity updateUser( + @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { + return getDelegate().updateUser(username, user); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiController.java new file mode 100644 index 000000000..1bf19064b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiController.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import java.util.Optional; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * The type User api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Controller +@ResponseBody +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class UserApiController implements UserApi { + + /** + * The Delegate. + */ + private final UserApiDelegate delegate; + + /** + * Instantiates a new User api controller. + * + * @param delegate the delegate + */ + public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public UserApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegate.java new file mode 100644 index 000000000..00a3666c8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegate.java @@ -0,0 +1,167 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import java.util.List; +import java.util.Optional; + +import test.org.springdoc.api.v30.app2.model.User; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface UserApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Create user response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUser UserApi#createUser + */ + default ResponseEntity createUser(User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Create users with array input response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUsersWithArrayInput UserApi#createUsersWithArrayInput + */ + default ResponseEntity createUsersWithArrayInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Create users with list input response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUsersWithListInput UserApi#createUsersWithListInput + */ + default ResponseEntity createUsersWithListInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Delete user response entity. + * + * @param username the username + * @return the response entity + * @see UserApi#deleteUser UserApi#deleteUser + */ + default ResponseEntity deleteUser(String username) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets user by name. + * + * @param username the username + * @return the user by name + * @see UserApi#getUserByName UserApi#getUserByName + */ + default ResponseEntity getUserByName(String username) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Login user response entity. + * + * @param username the username + * @param password the password + * @return the response entity + * @see UserApi#loginUser UserApi#loginUser + */ + default ResponseEntity loginUser(String username, + String password) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Logout user response entity. + * + * @return the response entity + * @see UserApi#logoutUser UserApi#logoutUser + */ + default ResponseEntity logoutUser() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update user response entity. + * + * @param username the username + * @param user the user + * @return the response entity + * @see UserApi#updateUser UserApi#updateUser + */ + default ResponseEntity updateUser(String username, + User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegateImpl.java new file mode 100644 index 000000000..0362cb087 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/api/UserApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.api; + +import org.springframework.stereotype.Service; + +/** + * The type User api delegate. + */ +@Service +class UserApiDelegateImpl implements UserApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Category.java new file mode 100644 index 000000000..25acbb51a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Category.java @@ -0,0 +1,134 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Category. + */ +class Category { + + /** + * The Id. + */ + private Long id = null; + + /** + * The Name. + */ + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id category. + * + * @param id the id + * @return the category + */ + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name category. + * + * @param name the name + * @return the category + */ + public Category name(String name) { + this.name = name; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/ModelApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/ModelApiResponse.java new file mode 100644 index 000000000..f9dd5efeb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/ModelApiResponse.java @@ -0,0 +1,170 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Model api response. + */ +public class ModelApiResponse { + + /** + * The Code. + */ + private Integer code = null; + + /** + * The Type. + */ + private String type = null; + + /** + * The Message. + */ + private String message = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get code + * + * @return code code + */ + @JsonProperty("code") + public Integer getCode() { + return code; + } + + /** + * Sets code. + * + * @param code the code + */ + public void setCode(Integer code) { + this.code = code; + } + + /** + * Code model api response. + * + * @param code the code + * @return the model api response + */ + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * + * @return type type + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * Sets type. + * + * @param type the type + */ + public void setType(String type) { + this.type = type; + } + + /** + * Type model api response. + * + * @param type the type + * @return the model api response + */ + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * + * @return message message + */ + @JsonProperty("message") + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * Message model api response. + * + * @param message the message + * @return the model api response + */ + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Order.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Order.java new file mode 100644 index 000000000..8ca543cae --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Order.java @@ -0,0 +1,360 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.model; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Order. + */ +public class Order { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Pet id. + */ + @Schema(description = "") + private Long petId = null; + + /** + * The Quantity. + */ + @Schema(description = "") + private Integer quantity = null; + + /** + * The Ship date. + */ + @Schema(description = "") + private Date shipDate = null; + + /** + * Order Status + */ + private StatusEnum status = null; + + /** + * The Complete. + */ + @Schema(description = "") + private Boolean complete = false; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id order. + * + * @param id the id + * @return the order + */ + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * + * @return petId pet id + */ + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + + /** + * Sets pet id. + * + * @param petId the pet id + */ + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + * Pet id order. + * + * @param petId the pet id + * @return the order + */ + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * + * @return quantity quantity + */ + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + + /** + * Sets quantity. + * + * @param quantity the quantity + */ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + * Quantity order. + * + * @param quantity the quantity + * @return the order + */ + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * + * @return shipDate ship date + */ + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + + /** + * Sets ship date. + * + * @param shipDate the ship date + */ + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Ship date order. + * + * @param shipDate the ship date + * @return the order + */ + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * + * @return status status + */ + @JsonProperty("status") + public String getStatus() { + if (status == null) { + return null; + } + return status.getValue(); + } + + /** + * Sets status. + * + * @param status the status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Status order. + * + * @param status the status + * @return the order + */ + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * + * @return complete boolean + */ + @JsonProperty("complete") + public Boolean isisComplete() { + return complete; + } + + /** + * Sets complete. + * + * @param complete the complete + */ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + /** + * Complete order. + * + * @param complete the complete + * @return the order + */ + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * The enum Status enum. + */ + public enum StatusEnum { + /** + *Placed status enum. + */ + PLACED("placed"), + /** + *Approved status enum. + */ + APPROVED("approved"), + /** + *Delivered status enum. + */ + DELIVERED("delivered"); + + /** + * The Value. + */ + private String value; + + /** + * Instantiates a new Status enum. + * + * @param value the value + */ + StatusEnum(String value) { + this.value = value; + } + + /** + * From value status enum. + * + * @param text the text + * @return the status enum + */ + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + /** + * Gets value. + * + * @return the value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Pet.java new file mode 100644 index 000000000..57064373d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Pet.java @@ -0,0 +1,392 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.model; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +/** + * The type Pet. + */ +public class Pet { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Category. + */ + @Schema(description = "") + private Category category = null; + + /** + * The Name. + */ + @Schema(example = "doggie", required = true, description = "") + private String name = null; + + /** + * The Photo urls. + */ + @Schema(required = true, description = "") + private List photoUrls = new ArrayList(); + + /** + * The Tags. + */ + @Schema(description = "") + private List tags = null; + + /** + * The Status. + */ + @Schema(description = "pet status in the store") + /** + * pet status in the store + **/ + private StatusEnum status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id pet. + * + * @param id the id + * @return the pet + */ + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * + * @return category category + */ + @JsonProperty("category") + public Category getCategory() { + return category; + } + + /** + * Sets category. + * + * @param category the category + */ + public void setCategory(Category category) { + this.category = category; + } + + /** + * Category pet. + * + * @param category the category + * @return the pet + */ + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name pet. + * + * @param name the name + * @return the pet + */ + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * + * @return photoUrls photo urls + */ + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + /** + * Sets photo urls. + * + * @param photoUrls the photo urls + */ + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + * Photo urls pet. + * + * @param photoUrls the photo urls + * @return the pet + */ + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + /** + * Add photo urls item pet. + * + * @param photoUrlsItem the photo urls item + * @return the pet + */ + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * + * @return tags tags + */ + @JsonProperty("tags") + public List getTags() { + return tags; + } + + /** + * Sets tags. + * + * @param tags the tags + */ + public void setTags(List tags) { + this.tags = tags; + } + + /** + * Tags pet. + * + * @param tags the tags + * @return the pet + */ + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + /** + * Add tags item pet. + * + * @param tagsItem the tags item + * @return the pet + */ + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * + * @return status status + */ + @JsonProperty("status") + public StatusEnum getStatus() { + if (status == null) { + return null; + } + return status; + } + + /** + * Sets status. + * + * @param status the status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Status pet. + * + * @param status the status + * @return the pet + */ + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * The enum Status enum. + */ + public enum StatusEnum { + /** + *Available status enum. + */ + AVAILABLE("available"), + /** + *Pending status enum. + */ + PENDING("pending"), + /** + *Sold status enum. + */ + SOLD("sold"); + + /** + * The Value. + */ + private String value; + + /** + * Instantiates a new Status enum. + * + * @param value the value + */ + StatusEnum(String value) { + this.value = value; + } + + /** + * From value status enum. + * + * @param text the text + * @return the status enum + */ + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + /** + * Gets value. + * + * @return the value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Tag.java new file mode 100644 index 000000000..c2f1a11a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/Tag.java @@ -0,0 +1,137 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tag. + */ +class Tag { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Name. + */ + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id tag. + * + * @param id the id + * @return the tag + */ + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name tag. + * + * @param name the name + * @return the tag + */ + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/User.java new file mode 100644 index 000000000..9248a9036 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app2/model/User.java @@ -0,0 +1,358 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type User. + */ +public class User { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Username. + */ + @Schema(description = "") + private String username = null; + + /** + * The First name. + */ + @Schema(description = "") + private String firstName = null; + + /** + * The Last name. + */ + @Schema(description = "") + private String lastName = null; + + /** + * The Email. + */ + @Schema(description = "") + private String email = null; + + /** + * The Password. + */ + @Schema(description = "") + private String password = null; + + /** + * The Phone. + */ + @Schema(description = "") + private String phone = null; + + /** + * User Status + */ + private Integer userStatus = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id user. + * + * @param id the id + * @return the user + */ + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * + * @return username username + */ + @JsonProperty("username") + public String getUsername() { + return username; + } + + /** + * Sets username. + * + * @param username the username + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * Username user. + * + * @param username the username + * @return the user + */ + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * + * @return firstName first name + */ + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * First name user. + * + * @param firstName the first name + * @return the user + */ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * + * @return lastName last name + */ + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Last name user. + * + * @param lastName the last name + * @return the user + */ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * + * @return email email + */ + @JsonProperty("email") + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Email user. + * + * @param email the email + * @return the user + */ + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * + * @return password password + */ + @JsonProperty("password") + public String getPassword() { + return password; + } + + /** + * Sets password. + * + * @param password the password + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * Password user. + * + * @param password the password + * @return the user + */ + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * + * @return phone phone + */ + @JsonProperty("phone") + public String getPhone() { + return phone; + } + + /** + * Sets phone. + * + * @param phone the phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * Phone user. + * + * @param phone the phone + * @return the user + */ + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * + * @return userStatus user status + */ + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + + /** + * Sets user status. + * + * @param userStatus the user status + */ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + /** + * User status user. + * + * @param userStatus the user status + * @return the user + */ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app20/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app20/HelloController.java new file mode 100644 index 000000000..3e899721e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app20/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app20; + +import io.swagger.v3.oas.annotations.Hidden; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping(value = "/persons") + @Hidden + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java new file mode 100644 index 000000000..1d4fecbcd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app20/SpringDocApp20Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app20; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 20 test. + */ +class SpringDocApp20Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java new file mode 100644 index 000000000..7a6e67727 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app21; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@SecurityScheme(name = "personstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "${springdoc.oAuthFlow.authorizationUrl}", scopes = { + @OAuthScope(name = "write:persons", description = "modify persons in your account"), + @OAuthScope(name = "read:persons", description = "read your persons") }))) +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @Operation(summary = "Add a new person to the store", description = "", security = { + @SecurityRequirement(name = "personstore_auth", scopes = { "write:persons", "read:persons" }) }, tags = { + "person" }) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java new file mode 100644 index 000000000..17cd76363 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app21; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 21 test. + */ +@TestPropertySource(properties = "springdoc.oAuthFlow.authorizationUrl=http://personstore.swagger.io/oauth/dialog") +class SpringDocApp21Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/HelloController.java new file mode 100644 index 000000000..8098c0d31 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app22; + +import java.util.List; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Do get response entity. + * + * @return the response entity + */ + @GetMapping(value = "/persons") + public ResponseEntity>> doGet() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonDTO.java new file mode 100644 index 000000000..4045bacc0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app22; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java new file mode 100644 index 000000000..b041e7144 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app22/SpringDocApp22Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app22; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 22 test. + */ +class SpringDocApp22Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app23/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app23/HelloController.java new file mode 100644 index 000000000..7da8708d2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app23/HelloController.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app23; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", paramName = "JWT", description = "A core-auth Bearer token") +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @Operation(summary = "Add a new person to the store", description = "", security = { + @SecurityRequirement(name = "Authorization") }) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java new file mode 100644 index 000000000..5bce0629d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app23/SpringDocApp23Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app23; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 23 test. + */ +class SpringDocApp23Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/HelloController.java new file mode 100644 index 000000000..bc254a5fc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/HelloController.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app24; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", description = "A core-auth Bearer token") +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @Operation(summary = "Add a new person to the store", description = "", security = { + @SecurityRequirement(name = "Authorization") }) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java new file mode 100644 index 000000000..d4051f6be --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocApp24Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app24; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +/** + * The type Spring doc app 24 test. + */ +class SpringDocApp24Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocTestApp.java new file mode 100644 index 000000000..2b94d5432 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app24/SpringDocTestApp.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app24; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.headers.Header; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The entry point of application. + * + * @param args the input arguments + */ + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components() + .addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic")) + .addParameters("myHeader1", + new Parameter().in("header").schema(new StringSchema()).name("myHeader1")) + .addHeaders("myHeader2", + new Header().description("myHeader2 header").schema(new StringSchema()))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app25/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app25/HelloController.java new file mode 100644 index 000000000..f2999f6e3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app25/HelloController.java @@ -0,0 +1,109 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25; + +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Check. + */ + @GetMapping(value = "/check") + @ResponseStatus(HttpStatus.OK) + void check() { + } + + /** + * List. + * + * @param trackerId the tracker id + * @param startDate the start date + * @param endDate the end date + */ + @GetMapping(value = "/list/{trackerId}") + void list( + + @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")) @PathVariable String trackerId, + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, + @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")) @RequestParam(value = "end", required = false) Instant endDate) { + } + + /** + * Secondlist. + * + * @param trackerId the tracker id + * @param startDate the start date + * @param endDate the end date + */ + @GetMapping(value = "/secondlist/{trackerId}") + void secondlist( + @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")) @PathVariable String trackerId, + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, + @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")) @RequestParam(value = "end", required = false) Instant endDate) { + + } + + /** + * Third list. + * + * @param trackerId the tracker id + * @param start the start + * @param end the end + * @param limit the limit + */ + @Operation(description = "Get last data from a tracker", parameters = { + @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")), + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")), + @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")), + @Parameter(name = "limit", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "number", required = false, example = "10")) }, responses = { + @ApiResponse(responseCode = "200") }) + + @GetMapping(value = "/values/{trackerId}/data") + void thirdList(@PathVariable String trackerId, @RequestParam(value = "start", required = false) Instant start, + @RequestParam(value = "end", required = false) Instant end, + @RequestParam(value = "limit", required = false) Integer limit) { + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java new file mode 100644 index 000000000..acfba1b74 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app25/SpringDocApp25Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app25; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 25 test. + */ +class SpringDocApp25Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/Bar.java new file mode 100644 index 000000000..05348a36b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/Bar.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app26; + +/** + * The type Bar. + */ +class Bar { + /** + * The Bar. + */ + private String bar; + + /** + * Gets bar. + * + * @return the bar + */ + public String getBar() { + return bar; + } + + /** + * Sets bar. + * + * @param bar the bar + */ + public void setBar(String bar) { + this.bar = bar; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/Foo.java new file mode 100644 index 000000000..6422501c6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/Foo.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app26; + +/** + * The type Foo. + */ +class Foo { + + /** + * The Foo. + */ + private String foo; + + /** + * Gets foo. + * + * @return the foo + */ + public String getFoo() { + return foo; + } + + /** + * Sets foo. + * + * @param foo the foo + */ + public void setFoo(String foo) { + this.foo = foo; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/HelloController.java new file mode 100644 index 000000000..b3fa71199 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app26; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons my model. + * + * @param myModel the my model + * @return the my model + */ + @PostMapping(value = "/persons") + public MyModel persons(MyModel myModel) { + return new MyModel(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/MyModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/MyModel.java new file mode 100644 index 000000000..0bb4e9424 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/MyModel.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app26; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type My model. + */ +class MyModel { + + /** + * The Thing. + */ + @Schema(description = "Hello", type = "object", oneOf = { Foo.class, Bar.class }) + private Object thing; + + /** + * Gets thing. + * + * @return the thing + */ + public Object getThing() { + return thing; + } + + /** + * Sets thing. + * + * @param thing the thing + */ + public void setThing(Object thing) { + this.thing = thing; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java new file mode 100644 index 000000000..676e1211d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app26/SpringDocApp26Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app26; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 26 test. + */ +class SpringDocApp26Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Advice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Advice.java new file mode 100644 index 000000000..d5800a0c5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Advice.java @@ -0,0 +1,82 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app27; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.WebRequest; + +/** + * The type Advice. + */ +@RestControllerAdvice +class Advice { + + /** + * Handle exception foo. + * + * @param ex the ex + * @param request the request + * @return the foo + */ + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + public Foo handleException(Exception ex, WebRequest request) { + return new Foo(); + } + + /** + * Handle my exception bar. + * + * @param ex the ex + * @param request the request + * @return the bar + */ + @ExceptionHandler(MyException.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + public Bar handleMyException(MyException ex, WebRequest request) { + return new Bar(); + } + + /** + * Handle my exception 2 bar. + * + * @param ex the ex + * @param request the request + * @return the bar + */ + @Hidden + @ExceptionHandler(Throwable.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public Bar handleMyException2(MyException ex, WebRequest request) { + return new Bar(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Bar.java new file mode 100644 index 000000000..232eb2b14 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Bar.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app27; + +/** + * The type Bar. + */ +class Bar { + /** + * The Bar. + */ + public String bar = "bar"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Foo.java new file mode 100644 index 000000000..14d650eb7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/Foo.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app27; + +/** + * The type Foo. + */ +class Foo { + /** + * The Foo. + */ + public String foo = "foo"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java new file mode 100644 index 000000000..1fd75f436 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/HelloController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app27; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * The Flag. + */ + private boolean flag = false; + + /** + * Index string. + * + * @return the string + */ + @RequestMapping("/") + public String index() { + return ""; + } + + /** + * Test string. + * + * @return the string + */ + @GetMapping("/test") + public String test() { + flag = !flag; + throw flag ? new MyException() : new RuntimeException(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/MyException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/MyException.java new file mode 100644 index 000000000..1a7451889 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/MyException.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app27; + +/** + * The type My exception. + */ +class MyException extends RuntimeException { + + /** + * The constant serialVersionUID. + */ + private static final long serialVersionUID = 1L; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java new file mode 100644 index 000000000..7131c9db4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app27/SpringDocApp27Test.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app27; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 27 test. + */ +class SpringDocApp27Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/Bar", + "#/components/schemas/Foo"))); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java new file mode 100644 index 000000000..59b4a0d93 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app28/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app28; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Upload 2 string. + * + * @param one the one + * @param two the two + * @return the string + */ + @PostMapping(value = "/upload2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String upload2(@RequestPart("one") MultipartFile one, @RequestPart("two") MultipartFile two) { + return "Ok"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java new file mode 100644 index 000000000..eda40b964 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app28/SpringDocApp28Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app28; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 28 test. + */ +class SpringDocApp28Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/HelloController.java new file mode 100644 index 000000000..9d0e6dd28 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/HelloController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app29; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Post entity list. + * + * @param postEntity the post entity + * @return the list + */ + @PostMapping(value = "/post-entity") + @Operation(description = "Post entity", + requestBody = @RequestBody(content = @Content(mediaType = "application/json", schema = @Schema(implementation = TrackerData.class))), + responses = + { @ApiResponse(responseCode = "200", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = TrackerData.class)))) }) + List postEntity(@RequestBody TrackerData postEntity) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java new file mode 100644 index 000000000..24f07d2d2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/SpringDocApp29Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app29; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 29 test. + */ +class SpringDocApp29Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/TrackerData.java new file mode 100644 index 000000000..d05f6c62b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app29/TrackerData.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app29; + +import java.time.Instant; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tracker data. + */ +@Schema(name = "TrackerData") +class TrackerData { + + /** + * The Tracker id. + */ + @Schema(name = "trackerId", type = "string", required = true, example = "the-tracker-id") + @JsonProperty("trackerId") + String trackerId; + + /** + * The Timestamp. + */ + @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") + @JsonProperty("timestamp") + Instant timestamp; + + /** + * The Value. + */ + @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") + @JsonProperty("value") + Double value; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/HelloController.java new file mode 100644 index 000000000..436d62124 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Echo playing card. + * + * @param card the card baby + * @param toto the toto baby + * @return the playing card baby + */ + @PostMapping + public PersonDTO echo(@RequestBody PlayingCard card, @RequestParam String toto) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/PersonDTO.java new file mode 100644 index 000000000..8b930f831 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/PersonDTO.java @@ -0,0 +1,121 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +/** + * The type Person dto. + */ +class PersonDTO { + + /** + * The email + */ + private String email; + + /** + * The firstName + */ + private String firstName; + + /** + * The lastName + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/PlayingCard.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/PlayingCard.java new file mode 100644 index 000000000..6575be910 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/PlayingCard.java @@ -0,0 +1,151 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The type Playing card. + */ +class PlayingCard { + /** + * The Suit. + */ + private Suit suit; + + /** + * The Value. + */ + private Integer value; + + /** + * The Toto. + */ + private Date toto; + + /** + * Gets toto. + * + * @return the toto + */ + public Date getToto() { + return toto; + } + + /** + * Sets toto. + * + * @param toto the toto + */ + public void setToto(Date toto) { + this.toto = toto; + } + + /** + * Gets suit. + * + * @return the suit + */ + public Suit getSuit() { + return suit; + } + + /** + * Sets suit. + * + * @param suit the suit + */ + public void setSuit(Suit suit) { + this.suit = suit; + } + + /** + * Gets value. + * + * @return the value + */ + public Integer getValue() { + return value; + } + + /** + * Sets value. + * + * @param value the value + */ + public void setValue(Integer value) { + this.value = value; + } + + /** + * The enum Suit. + */ + public enum Suit { + /** + *Hearts suit. + */ + HEARTS("Hearts"), + /** + *Diamonds suit. + */ + DIAMONDS("Diamonds"), + /** + *Clubs suit. + */ + CLUBS("Clubs"), + /** + *Spades suit. + */ + SPADES("Spades"); + + /** + * The Json value. + */ + private final String jsonValue; + + /** + * Instantiates a new Suit. + * + * @param jsonValue the json value + */ + Suit(String jsonValue) { + this.jsonValue = jsonValue; + } + + /** + * Gets json value. + * + * @return the json value + */ + @JsonValue + public String getJsonValue() { + return jsonValue; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java new file mode 100644 index 000000000..293b12b37 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringDocApp3Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 3 test. + */ +class SpringDocApp3Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java new file mode 100644 index 000000000..bd35f10a7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app30/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app30; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Echo string. + * + * @param text the text + * @return the string + */ + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test") + public String echo(@RequestParam(name = "text", defaultValue = "Hello, World!") String text) { + return text; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java new file mode 100644 index 000000000..3968b0316 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app30/SpringDocApp30Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app30; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 30 test. + */ +class SpringDocApp30Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java new file mode 100644 index 000000000..2e8d6b126 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app31/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app31; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.callbacks.Callback; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Subscribe subscription response. + * + * @param token the token + * @param url the url + * @return the subscription response + */ + @PostMapping("/test") + @Callback(callbackUrlExpression = "http://$request.query.url", name = "subscription", operation = { + @Operation(method = "post", description = "payload data will be sent", parameters = { + @Parameter(in = ParameterIn.PATH, name = "subscriptionId", required = true, schema = @Schema(type = "string", format = "uuid", description = "the generated UUID", accessMode = Schema.AccessMode.READ_ONLY)) }, responses = { + @ApiResponse(responseCode = "200", description = "Return this code if the callback was received and processed successfully"), + @ApiResponse(responseCode = "205", description = "Return this code to unsubscribe from future data updates"), + @ApiResponse(responseCode = "default", description = "All other response codes will disable this callback subscription") }) }) + @Operation(description = "subscribes a client to updates relevant to the requestor's account, as " + + "identified by the input token. The supplied url will be used as the delivery address for response payloads") + public SubscriptionResponse subscribe(@Schema(required = true, description = "the authentication token " + + "provided after initially authenticating to the application") @RequestHeader("x-auth-token") String token, + @Schema(required = true, description = "the URL to call with response " + + "data") @RequestParam("url") String url) { + return null; + } + + /** + * The type Subscription response. + */ + static class SubscriptionResponse { + /** + * The Subscription uuid. + */ + private String subscriptionUuid; + + /** + * Gets subscription uuid. + * + * @return the subscription uuid + */ + public String getSubscriptionUuid() { + return subscriptionUuid; + } + + /** + * Sets subscription uuid. + * + * @param subscriptionUuid the subscription uuid + */ + public void setSubscriptionUuid(String subscriptionUuid) { + this.subscriptionUuid = subscriptionUuid; + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java new file mode 100644 index 000000000..0364650ca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app31/SpringDocApp31Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app31; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 31 test. + */ +class SpringDocApp31Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java new file mode 100644 index 000000000..201f11499 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app32/HelloController.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app32; + +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Filter post string. + * + * @param filter the filter + * @return the string + */ + @RequestMapping(value = "/filter", method = RequestMethod.POST) + @ResponseStatus(value = HttpStatus.OK) + public String filterPost(@RequestBody final MyTestDto filter) { + return "OK"; + } + + /** + * The type My test dto. + */ + class MyTestDto { + /** + * The Object 1. + */ + public String object1; + + /** + * The Object 2. + */ + public String object2; + + /** + * The Object 3. + */ + public String object3; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java new file mode 100644 index 000000000..f845e714b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app32/SpringDocApp32Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app32; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 32 test. + */ +class SpringDocApp32Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java new file mode 100644 index 000000000..1a060e058 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app33/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app33; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + /** + * Index t. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the t + */ + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java new file mode 100644 index 000000000..fb5c63a63 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app33/SpringDocApp33Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app33; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 33 test. + */ +class SpringDocApp33Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/HelloController.java new file mode 100644 index 000000000..24483ad61 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + /** + * Index t. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the t + */ + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/MyExceptionHandler.java new file mode 100644 index 000000000..757eab474 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/MyExceptionHandler.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; + +/** + * The type My exception handler. + */ +@RestControllerAdvice +@Hidden +class MyExceptionHandler extends ResponseEntityExceptionHandler { + /** + * Bad object. + * + * @param e the e + * @return the object + */ + @ExceptionHandler(IllegalArgumentException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Object bad(IllegalArgumentException e) { + return null; + } + + /** + * Gateway object. + * + * @param e the e + * @return the object + */ + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java new file mode 100644 index 000000000..b25bed593 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app34/SpringDocApp34Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app34; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 34 test. + */ +class SpringDocApp34Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app35/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app35/HelloController.java new file mode 100644 index 000000000..8023984ad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app35/HelloController.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app35; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +/** + * The type Hello controller. + */ +@Controller +@RequestMapping("/api/v1/poc/") +class HelloController { + + /** + * Testme response entity. + * + * @return the response entity + */ + @Operation(summary = "Get thing", responses = { + @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "404", description = "Not found", content = @Content), + @ApiResponse(responseCode = "401", description = "Authentication Failure", content = @Content(schema = @Schema(hidden = true))) }) + @RequestMapping(path = "/testme", method = RequestMethod.GET) + ResponseEntity testme() { + return ResponseEntity.ok("Hello"); + } + + /** + * Test response entity. + * + * @return the response entity + */ + @Operation(summary = "Get thing", responses = { + @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "404", description = "Not found", content = @Content(schema = @Schema(hidden = true))), + @ApiResponse(responseCode = "401", description = "Authentication Failure", content = @Content(schema = @Schema(hidden = true))) }) + @RequestMapping(path = "/test", method = RequestMethod.GET) + ResponseEntity test() { + return ResponseEntity.ok("Hello"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java new file mode 100644 index 000000000..102d0c163 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app35/SpringDocApp35Test.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app35; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.springdoc.core.utils.SpringDocUtils.getConfig; + +/** + * The type Spring doc app 35 test. + */ +class SpringDocApp35Test extends AbstractSpringDocTest { + + static { + getConfig().addRestControllers(HelloController.class); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Bar.java new file mode 100644 index 000000000..54516162e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Bar.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +/** + * The type Bar. + */ +class Bar { + /** + * The Bar. + */ + public String bar = "bar"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Car.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Car.java new file mode 100644 index 000000000..d557c4abb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Car.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +/** + * The type Car. + */ +class Car { + /** + * The Car. + */ + public String car = "car"; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Foo.java new file mode 100644 index 000000000..90f94ebd6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Foo.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +/** + * The type Foo. + */ +class Foo { + /** + * The Foo. + */ + public String foo = "foo"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/HelloController.java new file mode 100644 index 000000000..5126211ad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import jakarta.validation.Valid; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Process foo. + * + * @param a the a + * @return the foo + */ + @PostMapping(path = "/bar/baz", consumes = "application/x.a+json", produces = MediaType.TEXT_PLAIN_VALUE) + public Foo process(@RequestBody Foo a) { + return a; + } + + /** + * Process bar. + * + * @param b the b + * @return the bar + */ + @PostMapping(path = "/bar/baz", consumes = "application/x.b+json", produces = MediaType.TEXT_PLAIN_VALUE) + public Bar process(@RequestBody Bar b) { + return b; + } + + /** + * Process car. + * + * @param c the c + * @return the car + */ + @PostMapping(path = "/bar/baz", consumes = "application/x.c+json", produces = MediaType.APPLICATION_JSON_VALUE) + public Car process(@RequestBody Car c) { + return c; + } + + + /** + * Pets post response entity. + * + * @param pet the pet + * @return the response entity + */ + @PostMapping(value = "/pets1", consumes = "text/plain") + public ResponseEntity petsPost1(@Valid @RequestBody String pet) { + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } + + /** + * Pets post response entity. + * + * @param pet the pet + * @return the response entity + */ + @PostMapping(value = "/pets2", consumes = "application/json") + public ResponseEntity petsPost2(@Valid @RequestBody Pet pet) { + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Pet.java new file mode 100644 index 000000000..4ebad7d77 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/Pet.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +/** + * The type Pet. + */ +class Pet { + /** + * The Pet. + */ + public String pet = "pet"; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java new file mode 100644 index 000000000..1019d24f1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app37/SpringDocApp37Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app37; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 37 test. + */ +class SpringDocApp37Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app38/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app38/HelloController.java new file mode 100644 index 000000000..1a20a7ff5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app38/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app38; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Gets model resource. + * + * @return the model resource + */ + @RequestMapping(value = "/npe_error", method = RequestMethod.GET) + public ResponseEntity getModelResource() { + return new ResponseEntity<>(new byte[0], HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java new file mode 100644 index 000000000..26e02e666 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app38/SpringDocApp38Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app38; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 38 test. + */ +class SpringDocApp38Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java new file mode 100644 index 000000000..0f6e2b8b4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/HelloController.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app39; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Search employee. + * + * @param test the test + */ + @Operation(summary = "test Request") + @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) + @PostMapping("/test") + public void searchEmployee(String test) { + } + + /** + * Hello string. + * + * @return the string + */ + @GetMapping("/hello") + public String hello() { + return "hello"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java new file mode 100644 index 000000000..c1fc8b815 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/SpringDocApp39Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app39; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +/** + * The type Spring doc app 39 test. + */ +class SpringDocApp39Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java new file mode 100644 index 000000000..8af3b7043 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app39/SpringDocTestApp.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app39; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.HeaderParameter; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The entry point of application. + * + * @param args the input arguments + */ + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + StringSchema schema = new StringSchema(); + return new OpenAPI() + .components(new Components().addParameters("myGlobalHeader", new HeaderParameter().required(true).name("My-Global-Header").description("My Global Header").schema(schema))); + } + + /** + * Customer global header open api customiser open api customiser. + * + * @return the open api customiser + */ + @Bean + public OpenApiCustomizer customerGlobalHeaderOpenApiCustomizer() { + return openApi -> openApi.getPaths().values().stream().flatMap(pathItem -> pathItem.readOperations().stream()) + .forEach(operation -> operation.addParametersItem(new HeaderParameter().$ref("#/components/parameters/myGlobalHeader"))); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java new file mode 100644 index 000000000..46c19fdd2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List tracker data. + * + * @param toto the toto + * @return the tracker data + */ + @PostMapping(value = "/values/data") + TrackerData list(TrackerData toto) { + return toto; + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java new file mode 100644 index 000000000..f81ae0c11 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/SpringDocApp4Test.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import io.swagger.v3.core.jackson.TypeNameResolver; +import org.junit.jupiter.api.AfterAll; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 4 test. + */ +@TestPropertySource(properties = "springdoc.use-fqn=true") +class SpringDocApp4Test extends AbstractSpringDocTest { + + /** + * Restore. + */ + @AfterAll + static void restore() { + TypeNameResolver.std.setUseFqn(false); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/TrackerData.java new file mode 100644 index 000000000..cfa99ec6c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app4/TrackerData.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app4; + +import java.time.Instant; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tracker data. + */ +class TrackerData { + + /** + * The Tracker id. + */ + @Schema(name = "trackerId", type = "string", required = true, example = "the-tracker-id") + @JsonProperty("trackerId") + String trackerId; + + /** + * The Timestamp. + */ + @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") + @JsonProperty("timestamp") + Instant timestamp; + + /** + * The Value. + */ + @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") + @JsonProperty("value") + Double value; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app40/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app40/HelloController.java new file mode 100644 index 000000000..e8ef58a7d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app40/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app40; + +import com.fasterxml.jackson.databind.node.ObjectNode; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Gets start form properties. + * + * @return the start form properties + */ + @RequestMapping(value = "/iae_error", method = RequestMethod.GET) + public ObjectNode getStartFormProperties() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app40/SpringDocApp40Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app40/SpringDocApp40Test.java new file mode 100644 index 000000000..5a0c6b75d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app40/SpringDocApp40Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app40; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 40 test. + */ +class SpringDocApp40Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/HelloController.java new file mode 100644 index 000000000..e85122053 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/HelloController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app41; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Gets file. + * + * @param path the path + * @return the file + */ + @Operation(description = "Download file") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "File resource", content = @Content(schema = @Schema(implementation = java.io.File.class))), + @ApiResponse(responseCode = "400", description = "Wrong request", content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) }) + @GetMapping(value = "/file", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity getFile( + @NotNull @Parameter(description = "File path", required = true) @Valid @RequestParam(value = "path") String path) { + return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp411Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp411Test.java new file mode 100644 index 000000000..c4c34d1cb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp411Test.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app41; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 411 test. + */ +class SpringDocApp411Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + // Test result consistency + mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.0.1/app41.json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, false); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp41Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp41Test.java new file mode 100644 index 000000000..258a6c9d6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app41/SpringDocApp41Test.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app41; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 41 test. + */ +@TestPropertySource(properties = "springdoc.cache.disabled=true") +class SpringDocApp41Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + // Test result consistency + mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.0.1/app" + testNumber + ".json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, false); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/HelloController.java new file mode 100644 index 000000000..59ee9c8f2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app42; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Tweets. + * + * @param id the id + */ + @GetMapping(value = "/tweets/{id}") + public void tweets(@PathVariable TweetId id) { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/SpringDocApp42Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/SpringDocApp42Test.java new file mode 100644 index 000000000..64f06b051 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/SpringDocApp42Test.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app42; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.StringSchema; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc app 42 test. + */ +class SpringDocApp42Test extends AbstractSpringDocTest { + + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI().components(new Components().addSchemas("TweetId", new StringSchema())); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/TweetId.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/TweetId.java new file mode 100644 index 000000000..ded1a4b3d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app42/TweetId.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app42; + +/** + * The type Tweet id. + */ +class TweetId { + /** + * The Value. + */ + private final String value; + + /** + * Instantiates a new Tweet id. + * + * @param value the value + */ + public TweetId(String value) { + this.value = value; + } + + /** + * Gets value. + * + * @return the value + */ + public String getValue() { + return value; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app43/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app43/HelloController.java new file mode 100644 index 000000000..5717612e9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app43/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app43; + +import java.util.List; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Upload documents response entity. + * + * @param multipartFiles the multipart files + * @return the response entity + */ + @PostMapping(path = "/documents", consumes = "multipart/form-data") + public ResponseEntity uploadDocuments(@RequestPart("doc") List multipartFiles) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app43/SpringDocApp43Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app43/SpringDocApp43Test.java new file mode 100644 index 000000000..67e8ff37f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app43/SpringDocApp43Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app43; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 43 test. + */ +class SpringDocApp43Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app44/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app44/HelloController.java new file mode 100644 index 000000000..8758ad533 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app44/HelloController.java @@ -0,0 +1,234 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app44; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Hello response entity. + * + * @param request the request + * @return the response entity + */ + @PostMapping(value = "/helloworld", produces = "application/json", consumes = "application/vnd.v1+json") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "Successful operation", content = @Content(schema = @Schema(implementation = HelloDTO1.class))), + @ApiResponse(responseCode = "400", description = "Bad name", content = @Content(schema = @Schema(implementation = ErrorDTO.class))) }) + public ResponseEntity hello(@RequestBody RequestV1 request) { + final String name = request.getNameV1(); + if ("error".equalsIgnoreCase(name)) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ErrorDTO("invalid name: " + name)); + } + return ResponseEntity.ok(new HelloDTO1("Greetings from Spring Boot v1! " + name)); + } + + /** + * Hello response entity. + * + * @param request the request + * @return the response entity + */ + @PostMapping(value = "/helloworld", produces = "application/json", consumes = "application/vnd.v2+json") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "Successful operation", content = @Content(schema = @Schema(implementation = HelloDTO2.class))), + @ApiResponse(responseCode = "400", description = "Bad name", content = @Content(schema = @Schema(implementation = ErrorDTO.class))) }) + public ResponseEntity hello(@RequestBody RequestV2 request) { + final String name = request.getNameV2(); + if ("error".equalsIgnoreCase(name)) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ErrorDTO("invalid name: " + name)); + } + return ResponseEntity.ok(new HelloDTO2("Greetings from Spring Boot v2! " + name)); + } + + /** + * The type Request v 1. + */ + static class RequestV1 { + /** + * The Name v 1. + */ + private String nameV1; + + /** + * Instantiates a new Request v 1. + */ + public RequestV1() { + } + + /** + * Gets name v 1. + * + * @return the name v 1 + */ + public String getNameV1() { + return nameV1; + } + + /** + * Sets name v 1. + * + * @param nameV1 the name v 1 + */ + public void setNameV1(String nameV1) { + this.nameV1 = nameV1; + } + } + + /** + * The type Request v 2. + */ + static class RequestV2 { + /** + * The Name v 2. + */ + private String nameV2; + + /** + * Instantiates a new Request v 2. + */ + public RequestV2() { + } + + /** + * Gets name v 2. + * + * @return the name v 2 + */ + public String getNameV2() { + return nameV2; + } + + /** + * Sets name v 2. + * + * @param nameV2 the name v 2 + */ + public void setNameV2(String nameV2) { + this.nameV2 = nameV2; + } + } + + /** + * The type Hello dto 1. + */ + class HelloDTO1 { + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Hello dto 1. + * + * @param message the message + */ + public HelloDTO1(String message) { + this.message = message; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + } + + /** + * The type Hello dto 2. + */ + class HelloDTO2 { + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Hello dto 2. + * + * @param message the message + */ + public HelloDTO2(String message) { + this.message = message; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + } + + /** + * The type Error dto. + */ + class ErrorDTO { + /** + * The Error message. + */ + private String errorMessage; + + /** + * Instantiates a new Error dto. + * + * @param errorMessage the error message + */ + public ErrorDTO(String errorMessage) { + this.errorMessage = errorMessage; + } + + /** + * Gets error message. + * + * @return the error message + */ + public String getErrorMessage() { + return errorMessage; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app44/SpringDocApp44Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app44/SpringDocApp44Test.java new file mode 100644 index 000000000..c2c9c52a5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app44/SpringDocApp44Test.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app44; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 44 test. + */ +class SpringDocApp44Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/HelloDTO2", + "#/components/schemas/HelloDTO1"))) + .andExpect(jsonPath("$.paths./helloworld.post.requestBody.content.['application/vnd.v1+json'].schema.$ref", is("#/components/schemas/RequestV1"))) + .andExpect(jsonPath("$.paths./helloworld.post.requestBody.content.['application/vnd.v2+json'].schema.$ref", is("#/components/schemas/RequestV2"))) + .andExpect(jsonPath("$.paths./helloworld.post.responses.400.content.['application/json'].schema.$ref", is("#/components/schemas/ErrorDTO"))); + + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/HelloController.java new file mode 100644 index 000000000..01f3f23a5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/HelloController.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app45; + +import java.util.Collections; +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@Tag(name = "People", description = "Use this resource to serve all requests and initiate all operations related to people") +@RestController +@RequestMapping(value = "/v1/people") +class HelloController { + + + /** + * List list. + * + * @return the list + */ + @Operation(description = "List all persons") + @SecurityRequirement(name = "bearer") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/list", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List list() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + + /** + * List two list. + * + * @return the list + */ + @Operation(description = "List all persons") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/listTwo", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List listTwo() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/HelloController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/HelloController2.java new file mode 100644 index 000000000..4d9ec2913 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/HelloController2.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app45; + +import java.util.Collections; +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller 2. + */ +@Tag(name = "People", description = "Use this resource to serve all requests and initiate all operations related to people") +@SecurityRequirement(name = "bearer") +@RestController +@RequestMapping(value = "/v1/people2") +class HelloController2 { + + + /** + * List list. + * + * @return the list + */ + @Operation(description = "List all persons") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/list", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List list() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + + /** + * List two list. + * + * @return the list + */ + @Operation(description = "List all persons") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/listTwo", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List listTwo() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/OpenApiConfig.java new file mode 100644 index 000000000..b1d5d3752 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/OpenApiConfig.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app45; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.security.SecurityScheme; + +/** + * The type Open api config. + */ +@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) +@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") +class OpenApiConfig { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/PersonDTO.java new file mode 100644 index 000000000..3600f7d80 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app45; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/SpringDocApp45Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/SpringDocApp45Test.java new file mode 100644 index 000000000..8f605d577 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app45/SpringDocApp45Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app45; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 45 test. + */ +class SpringDocApp45Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app46/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app46/HelloController.java new file mode 100644 index 000000000..d67822c5a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app46/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app46; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param subscriptionId the subscription id + * @return the string + */ + @GetMapping("/persons/{subscriptionId}") + @Operation(operationId = "operationId", summary = "Operation Summary", description = "Operation Description", tags = { + "Example Tag" }, externalDocs = @ExternalDocumentation(description = "External documentation description", url = "http://url.com"), parameters = { + @Parameter(in = ParameterIn.PATH, name = "subscriptionId", required = true, description = "parameter description", allowEmptyValue = true, allowReserved = true, schema = @Schema(type = "string", format = "uuid", description = "the generated UUID", accessMode = Schema.AccessMode.READ_ONLY)) }, responses = { + @ApiResponse(responseCode = "200", description = "voila!", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) }) + public String persons(String subscriptionId) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app46/SpringDocApp46Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app46/SpringDocApp46Test.java new file mode 100644 index 000000000..1fc002c08 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app46/SpringDocApp46Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app46; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 46 test. + */ +class SpringDocApp46Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app47/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app47/HelloController.java new file mode 100644 index 000000000..db5b688ae --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app47/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app47; + +import java.util.Locale; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + /** + * Gets documents with locale. + * + * @param locale the locale + * @return the documents with locale + */ + @GetMapping(path = "/documents/{locale}") + public ResponseEntity getDocumentsWithLocale( + @Parameter(schema = @Schema(type = "string")) @PathVariable("locale") Locale locale) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app47/SpringDocApp47Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app47/SpringDocApp47Test.java new file mode 100644 index 000000000..c571f0437 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app47/SpringDocApp47Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app47; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 47 test. + */ +class SpringDocApp47Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/AbstractHelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/AbstractHelloController.java new file mode 100644 index 000000000..79bbe1aa6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/AbstractHelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app48; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; + +/** + * The type Abstract hello controller. + */ +@ApiResponse(responseCode = "410") +@ApiResponses({ + @ApiResponse(responseCode = "411") +}) +class AbstractHelloController { + + /** + * Gets documents. + * + * @return the documents + */ + @GetMapping(path = "/documents/{locale}") + @ApiResponse(responseCode = "412") + @ApiResponses({ + @ApiResponse(responseCode = "413") + }) + public ResponseEntity getDocuments() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/HelloController.java new file mode 100644 index 000000000..2d8d1d394 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app48; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController + +@ApiResponse(responseCode = "400") +@ApiResponses({ + @ApiResponse(responseCode = "401") +}) +class HelloController extends AbstractHelloController { + + /** + * Gets documents. + * + * @return the documents + */ + @Override + @GetMapping(path = "/documents/{locale}") + @ApiResponse(responseCode = "402") + @ApiResponses({ + @ApiResponse(responseCode = "403") + }) + public ResponseEntity getDocuments() { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/SpringDocApp48Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/SpringDocApp48Test.java new file mode 100644 index 000000000..f173d2df1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app48/SpringDocApp48Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app48; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 48 test. + */ +class SpringDocApp48Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/HelloController.java new file mode 100644 index 000000000..99c2959af --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app49; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List list. + * + * @return the list + */ + @Operation(description = "Obtain the list of services available in the system") + @ApiResponses({ @ApiResponse(responseCode = "401", ref = "Unauthorized") }) + @GetMapping(value = "/hello", produces = MediaType.APPLICATION_JSON_VALUE) + List list() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/SpringDocApp49Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/SpringDocApp49Test.java new file mode 100644 index 000000000..4047cc135 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/SpringDocApp49Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app49; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +/** + * The type Spring doc app 49 test. + */ +class SpringDocApp49Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/SpringDocTestApp.java new file mode 100644 index 000000000..711f49f78 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app49/SpringDocTestApp.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app49; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.responses.ApiResponse; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The entry point of application. + * + * @param args the input arguments + */ + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + /** + * Define open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI defineOpenApi() { + OpenAPI api = new OpenAPI(); + api.components(new Components().addResponses("Unauthorized", + new ApiResponse().description("Unauthorized") + .content(new Content().addMediaType(MediaType.APPLICATION_JSON_VALUE, + new io.swagger.v3.oas.models.media.MediaType().schema(new StringSchema()))))); + return api; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/CustomOpenAPIConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/CustomOpenAPIConfig.java new file mode 100644 index 000000000..18c2c5c8a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/CustomOpenAPIConfig.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.tags.Tag; + +import org.springframework.context.annotation.Bean; + +/** + * The type Custom open api config. + */ +public class CustomOpenAPIConfig { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components()) + .info(new Info().title("Custom API").version("100")).addTagsItem(new Tag().name("mytag")); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java similarity index 84% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java index f5500c3d7..8e3124f43 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java @@ -1,22 +1,30 @@ /* * - * * Copyright 2019-2020 the original author or authors. * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * + * */ -package test.org.springdoc.api.app5.sample; +package test.org.springdoc.api.v30.app5.sample; import java.util.ArrayList; @@ -28,7 +36,7 @@ import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; import org.junit.jupiter.api.Test; -import test.org.springdoc.api.AbstractSpringDocTest; +import test.org.springdoc.api.v30.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.TestConfiguration; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceCustomConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceCustomConfigurationTest.java new file mode 100644 index 000000000..3763326b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceCustomConfigurationTest.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5.sample; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v30.AbstractSpringDocTest; +import test.org.springdoc.api.v30.app5.CustomOpenAPIConfig; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Import; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Open api resource custom configuration test. + */ +@Import(CustomOpenAPIConfig.class) +@TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") +class OpenApiResourceCustomConfigurationTest extends AbstractSpringDocTest { + + /** + * givenNoConfiguration_whenGetApiJson_returnsDefaultEmptyDocs - should return + * {"openapi":"3.0.1","info":{"title":"Custom API","version":"100"},"paths":{},"components":{}} + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc + .perform(get("/api-docs")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(jsonPath("$.info.title", is("Custom API"))) + .andExpect(jsonPath("$.info.version", is("100"))) + .andExpect(jsonPath("$.paths").isEmpty()) + .andExpect(jsonPath("$.components").isEmpty()) + .andExpect(jsonPath("$.tags").isNotEmpty()) + .andExpect(jsonPath("$.tags[0].name", is("mytag"))); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceNoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceNoConfigurationTest.java new file mode 100644 index 000000000..1b42a913d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app5/sample/OpenApiResourceNoConfigurationTest.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5.sample; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Open api resource no configuration test. + */ +@TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") +class OpenApiResourceNoConfigurationTest extends AbstractSpringDocTest { + + /** + * givenNoConfiguration_whenGetApiJson_returnsDefaultEmptyDocs - should return + * {"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"paths":{},"components":{}} + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc + .perform(get("/api-docs")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(jsonPath("$.info.title", is("OpenAPI definition"))) + .andExpect(jsonPath("$.info.version", is("v0"))) + .andExpect(jsonPath("$.paths").isEmpty()) + .andExpect(jsonPath("$.components").isEmpty()); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/HelloController.java new file mode 100644 index 000000000..65a7bfa90 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app50; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List list. + * + * @return the list + */ + @Operation(description = "Some operation", responses = { @ApiResponse(responseCode = "401") }) + //@ApiResponse(responseCode = "401", content = @Content()) + @GetMapping(value = "/hello", produces = MediaType.APPLICATION_JSON_VALUE) + List list() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/SpringDocApp50Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/SpringDocApp50Test.java new file mode 100644 index 000000000..935a662b6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/SpringDocApp50Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app50; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +/** + * The type Spring doc app 50 test. + */ +class SpringDocApp50Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/SpringDocTestApp.java new file mode 100644 index 000000000..5c0e07b52 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app50/SpringDocTestApp.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app50; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.responses.ApiResponse; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The entry point of application. + * + * @param args the input arguments + */ + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + /** + * Define open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI defineOpenApi() { + OpenAPI api = new OpenAPI(); + api.components(new Components().addResponses("Unauthorized", + new ApiResponse().description("Unauthorized") + .content(new Content().addMediaType(MediaType.APPLICATION_JSON_VALUE, + new io.swagger.v3.oas.models.media.MediaType().schema(new StringSchema()))))); + return api; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app51/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app51/HelloController.java new file mode 100644 index 000000000..c290c3f2d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app51/HelloController.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app51; + +import java.util.HashMap; +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test 1 string. + * + * @return the string + */ + @Operation(parameters = { + @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")) }) + @GetMapping("/test1") + public String test1() { + return "test"; + } + + /** + * Test 2 string. + * + * @param param1 the param 1 + * @return the string + */ + @Operation(parameters = { + @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")) }) + @GetMapping("/test2") + public String test2(@RequestParam(name = "param1") String param1) { + return "test"; + } + + /** + * Test 3 string. + * + * @param param1 the param 1 + * @return the string + */ + @Operation(parameters = { + @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")), + @Parameter(description = "desc1", in = ParameterIn.QUERY, name = "param1", required = true, schema = @Schema(type = "string", example = "something")) }) + @GetMapping("/test3") + public String test3( + @RequestParam(name = "param1") @Parameter(description = "desc2", in = ParameterIn.QUERY) String param1) { + return "test"; + } + + /** + * Get string. + * + * @param path the path + * @param params the params + * @return the string + */ + @GetMapping("/test/{path}") + public String get( + @PathVariable String path, + @RequestParam(required = false) Map params) { + return null; + } + + /** + * Hello response entity. + * + * @param map the map + * @return the response entity + */ + @PostMapping + public ResponseEntity> hello(@RequestBody HashMap map) { + return ResponseEntity.ok(map); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app51/SpringDocApp51Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app51/SpringDocApp51Test.java new file mode 100644 index 000000000..9ca3c390b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app51/SpringDocApp51Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app51; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 51 test. + */ +class SpringDocApp51Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app52/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app52/HelloController.java new file mode 100644 index 000000000..26c219e90 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app52/HelloController.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app52; + +import java.util.List; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Create test 1 string. + * + * @param username the username + * @param test the test + * @param imageFile the image file + * @return the string + */ + @PostMapping(value = "/test1/{username}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String createTest1(@PathVariable String username, @RequestPart("test") MyTestDto test, + @RequestPart("image") MultipartFile imageFile) { + return null; + } + + /** + * Create test 2 string. + * + * @param username the username + * @param imageFile the image file + * @param test the test + * @return the string + */ + @PostMapping(value = "/test2/{username}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String createTest2(@PathVariable String username, @RequestPart("image") MultipartFile imageFile, + @RequestPart("test") MyTestDto test) { + return null; + } + + /** + * Create test 3 string. + * + * @param test the test + * @param multipartFiles the multipart files + * @return the string + */ + @PostMapping(value = "/test3", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String createTest3(@RequestPart("test") MyTestDto test, + @RequestPart("doc") List multipartFiles) { + return null; + } + + /** + * The type My test dto. + */ + class MyTestDto { + /** + * The Object 1. + */ + public String object1; + + /** + * The Object 2. + */ + public String object2; + + /** + * The Object 3. + */ + public String object3; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app52/SpringDocApp52Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app52/SpringDocApp52Test.java new file mode 100644 index 000000000..aef9dfa1d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app52/SpringDocApp52Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app52; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 52 test. + */ +class SpringDocApp52Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/HelloController.java new file mode 100644 index 000000000..8b8d694a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/HelloController.java @@ -0,0 +1,155 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app53; + + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List with no api response list. + * + * @return the list + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello1", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithNoApiResponse() { + return null; + } + + /** + * List with empty api response list. + * + * @return the list + */ + @Operation(description = "Some operation") + @ApiResponse + @GetMapping(value = "/hello2", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithEmptyApiResponse() { + return null; + } + + /** + * List with explicit response status list. + * + * @return the list + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello3", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.NO_CONTENT) + List listWithExplicitResponseStatus() { + return null; + } + + /** + * Gets dto with explicit response status. + * + * @return the dto with explicit response status + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello4", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.NO_CONTENT) + HelloDTO1 getDTOWithExplicitResponseStatus() { + return null; + } + + /** + * List with default response status list. + * + * @return the list + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello5", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithDefaultResponseStatus() { + return null; + } + + /** + * Gets dto with default response status. + * + * @return the dto with default response status + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello6", produces = MediaType.APPLICATION_JSON_VALUE) + HelloDTO1 getDTOWithDefaultResponseStatus() { + return null; + } + + /** + * Gets nested dto with default response status. + * + * @return the nested dto with default response status + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello7", produces = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity getNestedDTOWithDefaultResponseStatus() { + return null; + } + + /** + * The type Hello dto 1. + */ + static class HelloDTO1 { + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Hello dto 1. + * + * @param message the message + */ + public HelloDTO1(String message) { + this.message = message; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/HelloControllerWithGlobalApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/HelloControllerWithGlobalApiResponse.java new file mode 100644 index 000000000..8999fbd28 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/HelloControllerWithGlobalApiResponse.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app53; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller with global api response. + */ +@RestController +@RequestMapping(path = "/global") +class HelloControllerWithGlobalApiResponse { + + /** + * List with no api response list. + * + * @return the list + */ + @Operation(description = "Some operation", responses = { + @ApiResponse(responseCode = "204", description = "Explicit description for this response") }) + @ResponseStatus(HttpStatus.NO_CONTENT) + @GetMapping(value = "/hello1", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithNoApiResponse() { + return null; + } + + /** + * List with default response status list. + * + * @return the list + */ + @Operation(description = "Some operation") + @ApiResponse(responseCode = "200", description = "Explicit description for this response") + @GetMapping(value = "/hello2", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithDefaultResponseStatus() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/SpringDocApp53Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/SpringDocApp53Test.java new file mode 100644 index 000000000..952e2319a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app53/SpringDocApp53Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app53; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 53 test. + */ +class SpringDocApp53Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/HelloController.java new file mode 100644 index 000000000..17e4e4390 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/HelloController.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app54; + +import com.fasterxml.jackson.annotation.JsonView; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets meal party. + * + * @param mealPartyId the meal party id + * @return the meal party + */ + @GetMapping(value = "/parties/{id}") + @JsonView(Views.Public.class) + @Operation(summary = "Gets meal party details [Meal party admin restricted]") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Successfully retrieved the meal party") }) + public MealParty getMealParty(@PathVariable("id") long mealPartyId) { + return null; + } + + /** + * Save meal party response entity. + * + * @param p the p + * @return the response entity + */ + @JsonView(Views.MealPartyAdmin.class) + @PostMapping(value = "/parties") + public ResponseEntity saveMealParty(@JsonView(Views.Public.class) @RequestBody MealParty p) { + return null; + } + + /** + * Save meal new party response entity. + * + * @param p the p + * @return the response entity + */ + @JsonView(Views.MealPartyAdmin.class) + @PostMapping(value = "/new-parties") + public ResponseEntity saveMealNewParty(@JsonView(Views.Public.class) @org.springframework.web.bind.annotation.RequestBody MealParty p) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/MealParty.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/MealParty.java new file mode 100644 index 000000000..ac1291fc7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/MealParty.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app54; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonView; + +/** + * The type Meal party. + */ +class MealParty { + /** + * The Name. + */ + @JsonView(Views.Public.class) + private String name; + + /** + * The Members. + */ + @JsonView(Views.MealPartyAdmin.class) + private List members = new ArrayList<>(); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/SpringDocApp54Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/SpringDocApp54Test.java new file mode 100644 index 000000000..07632de24 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/SpringDocApp54Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app54; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 54 test. + */ +class SpringDocApp54Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/Views.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/Views.java new file mode 100644 index 000000000..a48628620 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app54/Views.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app54; + +/** + * The interface Views. + */ +public interface Views { + /** + * The interface Public. + */ + public interface Public { + } + + /** + * The interface Meal party admin. + */ + public interface MealPartyAdmin extends Public { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app55/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app55/HelloController.java new file mode 100644 index 000000000..f35b32f8b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app55/HelloController.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app55; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * The type Hello controller. + */ +@Controller +@Tag(name = "health") +class HelloController { + + /** + * Ping endpoint used for health checks. + * @return the boolean + */ + @RequestMapping(value = "/ping", method = RequestMethod.GET) + @Operation(summary = "Simple health check") + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) + @ResponseBody + @ResponseStatus(HttpStatus.OK) + public Boolean ping() { + return true; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app55/SpringDocApp55Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app55/SpringDocApp55Test.java new file mode 100644 index 000000000..9f5d45444 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app55/SpringDocApp55Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app55; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 55 test. + */ +class SpringDocApp55Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/GlobalExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/GlobalExceptionHandler.java new file mode 100644 index 000000000..f1ba375c9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/GlobalExceptionHandler.java @@ -0,0 +1,90 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app56; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * The type Global exception handler. + */ +@RestControllerAdvice +class GlobalExceptionHandler { + /** + * Handle unhandled error error dto. + * + * @return the error dto + */ + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ApiResponse( + responseCode = "500", + description = "Internal server error", + content = @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ErrorDTO.class) + ) + ) + ErrorDTO handleUnhandledError() { + return new ErrorDTO("internal error: "); + } + + /** + * The type Error dto. + */ + class ErrorDTO { + /** + * The Error message. + */ + private String errorMessage; + + /** + * Instantiates a new Error dto. + * + * @param errorMessage the error message + */ + ErrorDTO(String errorMessage) { + this.errorMessage = errorMessage; + } + + /** + * Gets error message. + * + * @return the error message + */ + public String getErrorMessage() { + return errorMessage; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/HelloController.java new file mode 100644 index 000000000..0e4464166 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app56; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/SpringDocApp56Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/SpringDocApp56Test.java new file mode 100644 index 000000000..9dcbcd8f3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app56/SpringDocApp56Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app56; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 56 test. + */ +class SpringDocApp56Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app57/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app57/HelloController.java new file mode 100644 index 000000000..d7ead7493 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app57/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app57; + +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets text. + * + * @param name the name + * @return the text + */ + @GetMapping("/{name:.+}") + public ResponseEntity getText(@Parameter(description = "desc", required = true) @PathVariable String name) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app57/SpringDocApp57Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app57/SpringDocApp57Test.java new file mode 100644 index 000000000..3511822c8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app57/SpringDocApp57Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app57; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 57 test. + */ +class SpringDocApp57Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app58/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app58/HelloController.java new file mode 100644 index 000000000..cf782375f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app58/HelloController.java @@ -0,0 +1,183 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app58; + +import com.fasterxml.jackson.databind.JsonNode; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Example object. + * + * @param json the json + * @return the object + */ + @PostMapping("/examplePost") + @Operation(summary = "schema example") + public Object example(@Parameter(schema = @Schema(hidden = true)) JsonNode json) { + return null; + } + + /** + * Test. + * + * @param json the json + */ + @GetMapping("/example") + public void test(@Parameter(schema = @Schema(hidden = true)) JsonNode json) { + } + + /** + * Foobar. + * + * @param bar the bar + */ + @GetMapping(value = "/foo") + public void foobar(@Parameter(description = "User", name = "user", + schema = @Schema(implementation = PersonDTO.class)) @RequestParam("bar") String bar) { + + } + + /** + * Foobar 1. + * + * @param bar the bar + */ + @GetMapping(value = "/foo1") + public void foobar1(@Parameter(description = "User", name = "user", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PersonDTO.class))) @RequestParam("bar") String bar) { + + } + + /** + * The type Person dto. + */ + class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app58/SpringDocApp58Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app58/SpringDocApp58Test.java new file mode 100644 index 000000000..4f05365a9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app58/SpringDocApp58Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app58; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 58 test. + */ +class SpringDocApp58Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app59/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app59/HelloController.java new file mode 100644 index 000000000..9cec571c8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app59/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app59; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + /** + * Test. + */ + @Deprecated + @GetMapping("/example") + public void test() { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app59/SpringDocApp59Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app59/SpringDocApp59Test.java new file mode 100644 index 000000000..429381cb8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app59/SpringDocApp59Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app59; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 59 test. + */ +class SpringDocApp59Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app6/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app6/HelloController.java new file mode 100644 index 000000000..e5c7af757 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app6/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Say hello response entity. + * + * @return the response entity + */ + @Operation(summary = "Get Something by key", responses = { + @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(oneOf = { + String.class, Integer.class }), examples = { + @ExampleObject(name = "The String example", value = "urgheiurgheirghieurg"), + @ExampleObject(name = "The Integer example", value = "311414") })), + @ApiResponse(responseCode = "404", description = "Thing not found"), + @ApiResponse(responseCode = "401", description = "Authentication Failure") }) + @GetMapping(value = "/hello") + ResponseEntity sayHello() { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java new file mode 100644 index 000000000..01cb8c177 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 6 test. + */ +class SpringDocApp6Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/HelloController.java new file mode 100644 index 000000000..2540f06c5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/HelloController.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app60; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List 1 list. + * + * @param page the page + * @param size the size + * @return the list + */ + @GetMapping("/hello1") + @Operation(summary = "summary1") + @Parameters({ + @Parameter(name = "page", description = "The page"), + @Parameter(name = "size", description = "The size") + }) + public List list1(String page, String size) { + return null; + } + + /** + * List 2 list. + * + * @param page the page + * @param size the size + * @param sort the sort + * @return the list + */ + @GetMapping("/hello2") + @Operation(summary = "summary2") + @QuerySort + @QueryPaging + public List list2(String page, String size, String sort) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/QueryPaging.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/QueryPaging.java new file mode 100644 index 000000000..6a161b7fa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/QueryPaging.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app60; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; + +/** + * The interface Query paging. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.METHOD }) +@Parameters({ + @Parameter(name = "page", description = "desc page from Annotated interface"), + @Parameter(name = "size", description = "desc page from Annotated interface") +}) +public @interface QueryPaging { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/QuerySort.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/QuerySort.java new file mode 100644 index 000000000..4d8739dee --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/QuerySort.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app60; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; + +/** + * The interface Query sort. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.METHOD }) +@Parameter(name = "sort", description = "desc sort from Annotated interface") +public @interface QuerySort { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/SpringDocApp60Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/SpringDocApp60Test.java new file mode 100644 index 000000000..45d3b2fbf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app60/SpringDocApp60Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app60; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 60 test. + */ +class SpringDocApp60Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app61/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app61/HelloController.java new file mode 100644 index 000000000..040410960 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app61/HelloController.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app61; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Persons string. + * + * @param name the name + * @param phone the phone + * @param createdFrom the created from + * @param createdRange the created range + * @return the string + */ + @Operation(description = "List", parameters = { + @Parameter(description = "Name", name = "name", in = ParameterIn.QUERY), + @Parameter(description = "Phone", name = "phone", in = ParameterIn.QUERY), + @Parameter(description = "createdFrom", name = "createdFrom", in = ParameterIn.QUERY, content = @Content(array = @ArraySchema(schema = @Schema(type = "string")))), + @Parameter(description = "createdRange", name = "createdRange", in = ParameterIn.QUERY, array = @ArraySchema(schema = @Schema(type = "string", format = "date"), minItems = 2, maxItems = 2)) + }) + @GetMapping(value = "/persons-with-user") + public String persons(String name, String phone, String createdFrom, String createdRange) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app61/SpringDocApp61Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app61/SpringDocApp61Test.java new file mode 100644 index 000000000..c0632a6a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app61/SpringDocApp61Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app61; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 61 test. + */ +class SpringDocApp61Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/BaseController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/BaseController.java new file mode 100644 index 000000000..672120f2e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/BaseController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app62; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The interface Base controller. + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@RestController +@RequestMapping +public @interface BaseController { + /** + * Value string [ ]. + * + * @return the string [ ] + */ + @AliasFor(annotation = RequestMapping.class) + String[] value() default {}; + + /** + * Produces string [ ]. + * + * @return the string [ ] + */ + @AliasFor(annotation = RequestMapping.class) + String[] produces() default { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/SpringDocApp62Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/SpringDocApp62Test.java new file mode 100644 index 000000000..c2c58df37 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/SpringDocApp62Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app62; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 62 test. + */ +class SpringDocApp62Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/TestController.java new file mode 100644 index 000000000..11e4e920f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app62/TestController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app62; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +/** + * The type Test controller. + */ +@BaseController +@Tag(name = "Test Controller") +class TestController { + + /** + * Test string. + * + * @param accept the accept + * @return the string + */ + @RequestMapping(value = "/test", method = RequestMethod.GET) + @Operation(summary = "This is the test endpoint") + public String test(@RequestHeader("Accept") String accept) { + return "This is a test"; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java new file mode 100644 index 000000000..168c96215 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app63/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app63; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param header the header + * @param request the request + * @param response the response + * @param locale the locale + * @param hello the hello + */ + @GetMapping("/test") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java new file mode 100644 index 000000000..6c5ef5552 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app63/SpringDocApp63Test.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app63; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * The type Spring doc app 63 test. + */ +@TestPropertySource(properties = { + "springdoc.packagesToScan=hell,hello1, hello.me", + "springdoc.packagesToExclude=test.org.springdoc.api.app63.65" }) +class SpringDocApp63Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java new file mode 100644 index 000000000..b3bd2447e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app64/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app64; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test 1. + * + * @param hello the hello + */ + @GetMapping("/v1/test") + public void test1(String hello) { + } + + /** + * Test 2 string. + * + * @param from the from + * @return the string + */ + @GetMapping(value = "/api/balance/abcd") + @Operation(summary = "This is the test endpoint") + public String test2(String from) { + return "This is a fake test"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java new file mode 100644 index 000000000..a867eddb8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app64/SpringDocApp64Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app64; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 64 test. + */ +@TestPropertySource(properties = "springdoc.paths-to-match=/v1, /api/**") +class SpringDocApp64Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java new file mode 100644 index 000000000..e8402c1a7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app65/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app65; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@Tag(name = "Health", description = "Health check / ping API") +@RestController +class HelloController { + + /** + * Ping response entity. + * + * @return the response entity + */ + @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") + @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) + public ResponseEntity ping() { + return ResponseEntity.ok("Healthy"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java new file mode 100644 index 000000000..9af63f98b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app65/SpringDocApp65Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app65; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 65 test. + */ +class SpringDocApp65Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/DefaultHealthCheckApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/DefaultHealthCheckApi.java new file mode 100644 index 000000000..42c3ee8d0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/DefaultHealthCheckApi.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66; + +import java.time.LocalDate; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Default health check api. + */ +@RestController +@Hidden +class DefaultHealthCheckApi { + + /** + * Test date echo string. + * + * @param date the date + * @return the string + */ + @GetMapping("/test/date/echo/{date}") + public String testDateEcho(@DateTimeFormat(pattern = "yyyyMMdd") @PathVariable LocalDate date) { + return date.toString(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/HelloController.java new file mode 100644 index 000000000..85104d338 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@Tag(name = "Health", description = "Health check / ping API") +@RestController +class HelloController { + + /** + * Ping response entity. + * + * @param possiblyInjectedByAspect the possibly injected by aspect + * @return the response entity + */ + @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") + @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) + public ResponseEntity ping(UndocumentedClass possiblyInjectedByAspect) { + return ResponseEntity.ok("Healthy"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java new file mode 100644 index 000000000..1ff1c5b44 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/SpringDocApp66Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 66 test. + */ +class SpringDocApp66Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/UndocumentedClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/UndocumentedClass.java new file mode 100644 index 000000000..949bfc690 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app66/UndocumentedClass.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app66; + +import io.swagger.v3.oas.annotations.Hidden; + +/** + * The type Undocumented class. + */ +@Hidden +class UndocumentedClass { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java new file mode 100644 index 000000000..e0715d068 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app67/HelloController.java @@ -0,0 +1,141 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app67; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping(path = "/demo", + produces = MediaType.TEXT_PLAIN_VALUE) +class HelloController { + + /** + * Operation 1 string. + * + * @return the string + */ + @GetMapping("operation1") + @Operation(summary = "Operation 1 (expected result - no parameters)") + public String operation1() { + return "operation1"; + } + + /** + * Operation 2 string. + * + * @return the string + */ + @GetMapping("operation2") + @Operation(summary = "Operation 2 (expected result - 3 parameters)", parameters = { + @Parameter(name = "pageNumber", description = "page number", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "pageSize", description = "page size", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "sort", description = "sort specification", + in = ParameterIn.QUERY, schema = @Schema(type = "string")) + }) + public String operation2() { + return "operation2"; + } + + /** + * Operation 3 string. + * + * @return the string + */ + @GetMapping("operation3") + @Operation(summary = "Operation 3 (expected result - 3 parameters)") + @Parameters({ + @Parameter(name = "pageNumber", description = "page number", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "pageSize", description = "page size", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "sort", description = "sort specification", + in = ParameterIn.QUERY, schema = @Schema(type = "string")) + }) + public String operation3() { + return "operation3"; + } + + /** + * Operation 4 string. + * + * @return the string + */ + @GetMapping("operation4") + @Operation(summary = "Operation 4 (expected result - 3 parameters)") + @QueryPaging + @QuerySort + public String operation4() { + return "operation4"; + } + + /** + * The interface Query paging. + */ + @Retention(RetentionPolicy.RUNTIME) + @Target({ ElementType.METHOD }) + @Parameters({ + @Parameter(name = "pageNumber", description = "page number", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "pageSize", description = "page size", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")) + }) + public @interface QueryPaging { + + } + + /** + * The interface Query sort. + */ + @Retention(RetentionPolicy.RUNTIME) + @Target({ ElementType.METHOD }) + @Parameters({ + @Parameter(name = "sort", description = "sort specification", + in = ParameterIn.QUERY, schema = @Schema(type = "string")) + }) + public @interface QuerySort { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java new file mode 100644 index 000000000..dca46fd91 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app67/SpringDocApp67Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app67; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 67 test. + */ +class SpringDocApp67Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/HelloController.java new file mode 100644 index 000000000..a4890693d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app69; + +import java.util.concurrent.Callable; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets tasks. + * + * @param str the str + * @return the tasks + */ + @RequestMapping(value = "/tasks", method = RequestMethod.GET) + private Callable> getTasks(String str) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/PersonDTO.java new file mode 100644 index 000000000..017406145 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app69; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java new file mode 100644 index 000000000..7700a90a4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app69/SpringDocApp69Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app69; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 69 test. + */ +class SpringDocApp69Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java new file mode 100644 index 000000000..30975a6f4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Search employee. + * + * @param test the test + */ + @Operation(summary = "test Request") + @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) + @PostMapping("/test") + public void searchEmployee(String test) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java new file mode 100644 index 000000000..4cbd4373b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 7 test. + */ +class SpringDocApp7Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/HelloController.java new file mode 100644 index 000000000..91559c0e5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import test.org.springdoc.api.v30.app70.customizer.CustomizedOperation; +import test.org.springdoc.api.v30.app70.customizer.CustomizedParameter; +import test.org.springdoc.api.v30.app70.model.ApiType; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test api type. + * + * @param test the test + * @return the api type + */ + @CustomizedOperation + @Operation(description = "Some operation") + @GetMapping("/example/{test}") + public ApiType test(@PathVariable @CustomizedParameter @Parameter(description = "Parameter description") String test) { + return new ApiType(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java new file mode 100644 index 000000000..29de676fe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/SpringDocApp70Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 70 test. + */ +class SpringDocApp70Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedOperation.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedOperation.java new file mode 100644 index 000000000..43d2df3d2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedOperation.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70.customizer; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * The interface Customized operation. + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedOperation { + /** + * Addition string. + * + * @return the string + */ + String addition() default "customized operation!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedParameter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedParameter.java new file mode 100644 index 000000000..bcbb8590d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedParameter.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70.customizer; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * The interface Customized parameter. + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedParameter { + /** + * Addition string. + * + * @return the string + */ + String addition() default "customized parameter!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedProperty.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedProperty.java new file mode 100644 index 000000000..6722f8387 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/CustomizedProperty.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70.customizer; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * The interface Customized property. + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedProperty { + /** + * Addition string. + * + * @return the string + */ + String addition() default "customized property!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/OperationCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/OperationCustomizer.java new file mode 100644 index 000000000..46aba35a4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/OperationCustomizer.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70.customizer; + +import io.swagger.v3.oas.models.Operation; + +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; + +/** + * The type Operation customizer. + */ +@Component +class OperationCustomizer implements org.springdoc.core.customizers.OperationCustomizer { + /** + * Customize operation. + * + * @param operation the operation + * @param handlerMethod the handler method + * @return the operation + */ + @Override + public Operation customize(Operation operation, HandlerMethod handlerMethod) { + CustomizedOperation annotation = handlerMethod.getMethodAnnotation(CustomizedOperation.class); + if (annotation != null) { + operation.description(operation.getDescription() + ", " + annotation.addition()); + } + return operation; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/ParameterCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/ParameterCustomizer.java new file mode 100644 index 000000000..b0c8e99f7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/ParameterCustomizer.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70.customizer; + +import io.swagger.v3.oas.models.parameters.Parameter; + +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; + +/** + * The type Parameter customizer. + */ +@Component +class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { + /** + * Customize parameter. + * + * @param parameterModel the parameter model + * @param methodParameter the method parameter + * @return the parameter + */ + @Override + public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { + CustomizedParameter annotation = methodParameter.getParameterAnnotation(CustomizedParameter.class); + if (annotation != null) { + parameterModel.description(parameterModel.getDescription() + ", " + annotation.addition()); + } + return parameterModel; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/PropertyCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/PropertyCustomizer.java new file mode 100644 index 000000000..a09a3292e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/customizer/PropertyCustomizer.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70.customizer; + +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.Collections; +import java.util.Optional; +import java.util.stream.Stream; + +import com.fasterxml.jackson.databind.JavaType; +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; +import org.springdoc.core.providers.ObjectMapperProvider; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * The type Property customizer. + */ +@Component +class PropertyCustomizer implements org.springdoc.core.customizers.PropertyCustomizer { + + @Autowired + ObjectMapperProvider objectMapperProvider; + + /** + * Customize schema. + * + * @param property the property + * @param type the type + * @return the schema + */ + @Override + public Schema customize(Schema property, AnnotatedType type) { + Annotation[] ctxAnnotations = type.getCtxAnnotations(); + if (ctxAnnotations == null) { + return property; + } + + Optional propertyAnnotation = Stream.of(ctxAnnotations) + .filter(CustomizedProperty.class::isInstance) + .findFirst() + .map(CustomizedProperty.class::cast); + + JavaType javaType = objectMapperProvider.jsonMapper().constructType(type.getType()); + if (javaType.getRawClass().equals(Duration.class)) { + property = new StringSchema().format("duration").properties(Collections.emptyMap()); + } + return property; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/model/ApiType.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/model/ApiType.java new file mode 100644 index 000000000..5a6f86a9e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app70/model/ApiType.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app70.model; + +import java.time.Duration; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import test.org.springdoc.api.v30.app70.customizer.CustomizedProperty; + +/** + * The type Api type. + */ +public class ApiType { + /** + * The Some property. + */ + @CustomizedProperty + @Schema(description = "Test description") + @JsonProperty("someProperty") + private Duration someProperty; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/Dog.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/Dog.java new file mode 100644 index 000000000..e7a5e9b24 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/Dog.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app71; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + + +/** + * The type Dog. + */ +@Schema(name = "Dog") +class Dog { + + /** + * The Display name. + */ + @JsonProperty("display_name") + @Schema( + name = "display_name", + description = "A name given to the Dog", + example = "Fido" + ) + String displayName; + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/HelloController.java new file mode 100644 index 000000000..03c21171b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app71; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param dog the dog + * @return the string + */ + @PostMapping("/persons") + public String persons(Dog dog) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java new file mode 100644 index 000000000..9e35bf5e2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app71/SpringDocApp71Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app71; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 71 test. + */ +class SpringDocApp71Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java new file mode 100644 index 000000000..e1c284b74 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/BlockingAutoConfigurationTest.java @@ -0,0 +1,130 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.FilteredClassLoader; +import org.springframework.boot.test.context.runner.ApplicationContextRunner; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * The type Blocking auto configuration test. + */ +class BlockingAutoConfigurationTest { + + /** + * The Context runner. + */ + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + + /** + * Configurations not loaded when application is not web. + */ + @Test + void configurations_not_loaded_when_application_is_not_web() { + new ApplicationContextRunner() + .withUserConfiguration(TestApp.class) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Actuator configuration not loaded when not enabled explicitly. + */ + @Test + void actuator_configuration_not_loaded_when_not_enabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("actuatorPprrovider") + .hasBean("multipleOpenApiResource") + ); + } + + /** + * Configurations not loaded when disabled. + */ + @Test + void configurations_not_loaded_when_disabled() { + contextRunner + .withPropertyValues("springdoc.api-docs.enabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Configurations not loaded when mvc is not on class path. + */ + @Test + void configurations_not_loaded_when_mvc_is_not_on_class_path() { + contextRunner + .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + + } + + /** + * The type Test app. + */ + @SpringBootApplication + static class TestApp { + /** + * Test grouped open api grouped open api. + * + * @return the grouped open api + */ + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java new file mode 100644 index 000000000..d7aca3501 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/CacheAutoConfigurationTest1.java @@ -0,0 +1,114 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72; + +import org.junit.jupiter.api.Test; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * The type Cache auto configuration test 1. + */ +class CacheAutoConfigurationTest1 { + + /** + * The Context runner. + */ + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + /** + * Cache configuration loaded when not disabled explicitly. + */ + @Test + void cache_configuration_loaded_when_not_disabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Cache configuration loaded when disabled explicitly. + */ + @Test + void cache_configuration_loaded_when_disabled_explicitly() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Cache configurations successfully disabled. + */ + @Test + void cache_configurations_successfully_disabled() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=true") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Group configuration loaded. + */ + @Test + void group_configuration_loaded() { + contextRunner + .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("multipleOpenApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + ); + } + + + /** + * The type Test app. + */ + @EnableAutoConfiguration + static class TestApp { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java new file mode 100644 index 000000000..1c4ef5862 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app72/GroupAutoConfigurationTest.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * The type Group auto configuration test. + */ +class GroupAutoConfigurationTest { + + /** + * The Context runner. + */ + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + /** + * Group configuration loaded. + */ + @Test + void group_configuration_loaded() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .hasBean("multipleOpenApiResource") + ); + } + + /** + * The type Test app. + */ + @EnableAutoConfiguration + static class TestApp { + /** + * Test grouped open api grouped open api. + * + * @return the grouped open api + */ + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app73/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app73/HelloController.java new file mode 100644 index 000000000..a909b0fe3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app73/HelloController.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app73; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping({ "/{country_code}/persons/", "/persons" }) +class HelloController { + + /** + * Delete. + * + * @param countryCode the country code + * @param id the id + */ + @DeleteMapping("/{id}") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void delete(@Parameter(name = "country_code", in = ParameterIn.QUERY) String countryCode, @PathVariable("id") String id) { + + } + + /** + * Get string. + * + * @param countryCode the country code + * @param id the id + * @return the string + */ + @GetMapping("/{id}") + public String get(@Parameter(name = "country_code", in = ParameterIn.QUERY) String countryCode, @PathVariable("id") String id) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java new file mode 100644 index 000000000..1d7d8fc88 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app73/SpringDocApp73Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app73; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 73 test. + */ +class SpringDocApp73Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app74/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app74/HelloController.java new file mode 100644 index 000000000..35b32bd1a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app74/HelloController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app74; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Post my request body string. + * + * @param myRequestBody the my request body + * @return the string + */ + @PostMapping("/test") + @RequestBody( + content = @Content( + examples = @ExampleObject( + value = "sample" + ) + ) + ) + public String postMyRequestBody( + String myRequestBody) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java new file mode 100644 index 000000000..169cbf8cd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app74/SpringDocApp74Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app74; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 74 test. + */ +class SpringDocApp74Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/HelloController.java new file mode 100644 index 000000000..da686a248 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/HelloController.java @@ -0,0 +1,127 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app75; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Post my request body 1 string. + * + * @return the string + */ + @PostMapping("/test1/{uuid}") + @Operation(summary = "Example api that realize an ECHO operation", + description = "The result of the echo is the input value of the api", + parameters = { @Parameter(in = ParameterIn.PATH, + name = "uuid", + required = true, + description = "Is the identification of the document", + schema = @Schema(type = "string", + example = "uuid")) } + + + ) + @ApiResponses(value = { + @ApiResponse(description = "Successful Operation", + responseCode = "200", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PersonDTO.class))), + @ApiResponse(responseCode = "201", + description = "other possible response") + }) + public String postMyRequestBody1() { + return null; + } + + /** + * Post my request body 2 string. + * + * @return the string + */ + @PostMapping("/test2/{uuid}") + @Operation(summary = "Example api that realize an ECHO operation", + description = "The result of the echo is the input value of the api", + responses = { + @ApiResponse(description = "Successful Operation", + responseCode = "200", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PersonDTO.class))), + @ApiResponse(responseCode = "201", + description = "other possible response") + }, + parameters = { @Parameter(in = ParameterIn.PATH, + name = "uuid", + required = true, + description = "Is the identification of the document", + schema = @Schema(type = "string", + example = "uuid")) } + + + ) + public String postMyRequestBody2() { + return null; + } + + /** + * Post my request body 3 string. + * + * @return the string + */ + @PostMapping("/test3/{uuid}") + @Operation(summary = "Example api that realize an ECHO operation", + description = "The result of the echo is the input value of the api", + parameters = { @Parameter(in = ParameterIn.PATH, + name = "uuid", + required = true, + description = "Is the identification of the document", + schema = @Schema(type = "string", + example = "uuid")) } + + + ) + @ApiResponse(responseCode = "201", + description = "other possible response") + public String postMyRequestBody3() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/PersonDTO.java new file mode 100644 index 000000000..53feafd13 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app75; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/RestResponseEntityExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/RestResponseEntityExceptionHandler.java new file mode 100644 index 000000000..01dfc2d68 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/RestResponseEntityExceptionHandler.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app75; + +import java.util.List; + +import jakarta.servlet.http.HttpServletRequest; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; + +/** + * The type Rest response entity exception handler. + */ +@ControllerAdvice +class RestResponseEntityExceptionHandler + extends ResponseEntityExceptionHandler { + /** + * Bad request response entity. + * + * @param req the req + * @param exception the exception + * @return the response entity + */ + @ResponseStatus(value = HttpStatus.OK) + @ExceptionHandler({ Exception.class }) + public ResponseEntity> badRequest(HttpServletRequest req, Exception exception) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java new file mode 100644 index 000000000..b43ab18c1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app75/SpringDocApp75Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app75; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 75 test. + */ +class SpringDocApp75Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java new file mode 100644 index 000000000..2685c3dcf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app76/HelloController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app76; + +import io.swagger.v3.oas.annotations.security.SecurityRequirements; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Secured string. + * + * @return the string + */ + @GetMapping("/secure") + @ResponseBody + public String secured() { + return "It works!"; + } + + /** + * Open string. + * + * @return the string + */ + @GetMapping("/open") + @ResponseBody + @SecurityRequirements + public String open() { + return "It works!"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java new file mode 100644 index 000000000..2e37f74b5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app76/SpringDocApp76Test.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app76; + +import java.util.Arrays; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc app 76 test. + */ +class SpringDocApp76Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI openAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("bearer-jwt", + new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT")) + ) + .addSecurityItem( + new SecurityRequirement().addList("bearer-jwt", Arrays.asList("read", "write"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app77/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app77/HelloController.java new file mode 100644 index 000000000..7a30804b3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app77/HelloController.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app77; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.extensions.Extension; +import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import org.hibernate.validator.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @ApiResponse(content = @Content(schema = @Schema(type = "string")), extensions = @Extension(properties = @ExtensionProperty(name = "x-is-file", value = "true"))) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + + + /** + * Persons 2. + * + * @param name the name + */ + @Operation(responses = @ApiResponse(content = @Content(schema = @Schema(type = "string")), extensions = @Extension(properties = @ExtensionProperty(name = "x-is-file", value = "true")))) + @GetMapping(value = "/persons2") + public void persons2(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app77/SpringDocApp77Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app77/SpringDocApp77Test.java new file mode 100644 index 000000000..46f805d5b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app77/SpringDocApp77Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app77; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 77 test. + */ +class SpringDocApp77Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java new file mode 100644 index 000000000..001a4367b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/HelloController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app78; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets person 1. + * + * @param str the str + * @return the person 1 + */ + @RequestMapping(value = "/person1", method = RequestMethod.GET) + private CompletionStage> getPerson1(String str) { + return null; + } + + /** + * Gets person 2. + * + * @param str the str + * @return the person 2 + */ + @RequestMapping(value = "/person2", method = RequestMethod.GET) + private CompletableFuture getPerson2(String str) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/PersonDTO.java new file mode 100644 index 000000000..0ffb34f70 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app78; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java new file mode 100644 index 000000000..f6e6360fd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app78/SpringDocApp78Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app78; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 78 test. + */ +class SpringDocApp78Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app79/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app79/HelloController.java new file mode 100644 index 000000000..297f66ea2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app79/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app79; + +import java.util.Optional; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Echo string. + * + * @param text the text + * @return the string + */ + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test") + public String echo(@RequestParam Optional text) { + return text.orElse("not-specified"); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java new file mode 100644 index 000000000..ece32eeee --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app79/SpringDocApp79Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app79; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 79 test. + */ +class SpringDocApp79Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app8/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app8/HelloController.java new file mode 100644 index 000000000..72994c474 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app8/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app8; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param hello the hello + */ + @GetMapping("/test") + public void test(String hello) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java new file mode 100644 index 000000000..261a1bef3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app8; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * The type Spring doc app 8 test. + */ +class SpringDocApp8Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get("/myapp" + Constants.DEFAULT_API_DOCS_URL).contextPath("/myapp")) + .andExpect(status().isOk()); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/HelloController.java new file mode 100644 index 000000000..4a70e5ecf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/HelloController.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app80; + +import java.net.URISyntaxException; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + + /** + * Testpost 1 response entity. + * + * @param dto the dto + * @return the response entity + * @throws URISyntaxException the uri syntax exception + */ + @RequestMapping(value = "/testpost1", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity testpost1(@RequestBody TestObject dto) throws URISyntaxException { + return ResponseEntity.ok(dto); + } + + /** + * Testpost 2 response entity. + * + * @param dto the dto + * @return the response entity + * @throws URISyntaxException the uri syntax exception + */ + @RequestMapping(value = "/testpost2", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity testpost2(@RequestBody TestObject dto) throws URISyntaxException { + return ResponseEntity.ok(dto); + } + + /** + * Hello response entity. + * + * @return the response entity + * @throws URISyntaxException the uri syntax exception + */ + @RequestMapping(value = "/hello", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity hello() throws URISyntaxException { + return ResponseEntity.ok("Hello World"); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java new file mode 100644 index 000000000..d696b7f07 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/SpringDocApp80Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app80; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +/** + * The type Spring doc app 80 test. + */ +@ActiveProfiles("80") +class SpringDocApp80Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/TestObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/TestObject.java new file mode 100644 index 000000000..58c957f54 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app80/TestObject.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app80; + +import java.time.LocalDateTime; + +/** + * The type Test object. + */ +class TestObject { + /** + * The String value. + */ + public String stringValue; + + /** + * The Local date time. + */ + public LocalDateTime localDateTime; + + /** + * Gets string value. + * + * @return the string value + */ + public String getStringValue() { + return stringValue; + } + + /** + * Sets string value. + * + * @param stringValue the string value + */ + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + /** + * Gets local date time. + * + * @return the local date time + */ + public LocalDateTime getLocalDateTime() { + return localDateTime; + } + + /** + * Sets local date time. + * + * @param localDateTime the local date time + */ + public void setLocalDateTime(LocalDateTime localDateTime) { + this.localDateTime = localDateTime; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app81/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app81/HelloController.java new file mode 100644 index 000000000..add396316 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app81/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app81; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Test string. + * + * @return the string + */ + @RequestMapping + public String test() { + return "ok"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java new file mode 100644 index 000000000..6ce67cf8c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app81/SpringDocApp81Test.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app81; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.startsWith; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 81 test. + */ +class SpringDocApp81Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andExpect(jsonPath("$.paths./api.get.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.get.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.get.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.post.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.post.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.post.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.put.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.put.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.put.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.patch.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.patch.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.patch.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.delete.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.delete.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.delete.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.options.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.options.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.options.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.head.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.head.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.head.responses.200.content.['*/*'].schema.type", is("string"))); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/HelloController.java new file mode 100644 index 000000000..beed630e7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app82; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Put response entity. + * + * @param configuration the configuration + * @param second the second + * @param personDTO the person dto + * @return the response entity + */ + @PutMapping(value = "/test") + public ResponseEntity put( + String configuration, + String second, PersonDTO personDTO) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/PersonDTO.java new file mode 100644 index 000000000..5e4818438 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app82; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java new file mode 100644 index 000000000..9ea40348b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app82/SpringDocApp82Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app82; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 82 test. + */ +class SpringDocApp82Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/HelloController.java new file mode 100644 index 000000000..898a92105 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/HelloController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app83; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Put response entity. + * + * @param config the config + * @param configuration the configuration + * @param aFile the a file + * @return the response entity + */ + @RequestMapping(value = "/{config}", + method = RequestMethod.PUT, + consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }, + produces = { MediaType.APPLICATION_JSON_VALUE } + ) + public ResponseEntity put( + @PathVariable("config") final String config, + @Parameter(name = "configuration", schema = @Schema(name = "configuration", type = "string", format = "binary")) @RequestPart(value = "configuration") final PersonDTO configuration, + @RequestPart(value = "file") final MultipartFile aFile) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/PersonDTO.java new file mode 100644 index 000000000..cca50b971 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app83; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java new file mode 100644 index 000000000..07ad1db4d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app83/SpringDocApp83Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app83; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 83 test. + */ +class SpringDocApp83Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app84/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app84/HelloController.java new file mode 100644 index 000000000..3f8aaa020 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app84/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app84; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + /** + * Persons string. + * + * @param toto the toto + * @return the string + */ + @GetMapping("/persons1") + public String persons(String toto) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java new file mode 100644 index 000000000..6b305a50c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app84/SpringDocApp84Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app84; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 84 test. + */ +class SpringDocApp84Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app85/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app85/HelloController.java new file mode 100644 index 000000000..c96c2c93a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app85/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Testme. + * + * @param id the id + */ + @PostMapping("/test/{id}") + @Operation( + parameters = { + @Parameter(ref = "#/components/parameters/paramA"), + @Parameter(ref = "#/components/parameters/paramB") + } + ) + public void testme(@PathVariable("id") String id) { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java new file mode 100644 index 000000000..52b9f6d52 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app85/SpringDocApp85Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app85; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 85 test. + */ +class SpringDocApp85Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/HelloController.java new file mode 100644 index 000000000..ca37fb711 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app86; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param header the header + * @param request the request + * @param response the response + * @param locale the locale + * @param hello the hello + */ + @GetMapping("/test") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java new file mode 100644 index 000000000..d42da0ad2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/SpringDocApp86Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app86; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 86 test. + */ +@TestPropertySource(properties = { + "springdoc.packagesToScan=test.org.springdoc.api.v30.app86", + "springdoc.packagesToExclude=test.org.springdoc.api.v30.app86.test" }) +class SpringDocApp86Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/test/HelloController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/test/HelloController2.java new file mode 100644 index 000000000..887022a44 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app86/test/HelloController2.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app86.test; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller 2. + */ +@RestController +class HelloController2 { + + /** + * Test. + * + * @param header the header + * @param request the request + * @param response the response + * @param locale the locale + * @param hello the hello + */ + @GetMapping("/test2") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app87/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app87/HelloController.java new file mode 100644 index 000000000..af460d82d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app87/HelloController.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app87; + +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController("cookie") +class HelloController { + + /** + * Put item response entity. + * + * @param cookie the cookie + * @param itemId the item id + * @param item the item + * @return the response entity + */ + @PutMapping("/{itemId}") + @Operation + public ResponseEntity putItem( + @CookieValue( + name = "cookie" + ) String cookie, + @PathVariable UUID itemId, + @RequestBody Item item + ) { + return ResponseEntity.ok(item); + } + + /** + * The type Item. + */ + public static class Item { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java new file mode 100644 index 000000000..8a148885c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app87/SpringDocApp87Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app87; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 87 test. + */ +class SpringDocApp87Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app88/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app88/HelloController.java new file mode 100644 index 000000000..972684e93 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app88/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app88; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping(value = "/persons") + public String persons() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java new file mode 100644 index 000000000..dc5bd3618 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app88/SpringDocApp88Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app88; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 88 test. + */ +@TestPropertySource(properties = "springdoc.auto-tag-classes=false") +class SpringDocApp88Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app89/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app89/HelloController.java new file mode 100644 index 000000000..6434aa907 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app89/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app89; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets address. + * + * @param id the id + * @return the address + */ + @Operation(summary = "Get Status") + @GetMapping(value = "/status/{id}", produces = MediaType.TEXT_HTML_VALUE) + public ModelAndView getAddress(@PathVariable String id) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java new file mode 100644 index 000000000..1ae41bca4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app89/SpringDocApp89Test.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app89; + + +import io.swagger.v3.oas.models.media.ObjectSchema; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.servlet.ModelAndView; + +import static org.springdoc.core.utils.SpringDocUtils.getConfig; + +/** + * The type Spring doc app 89 test. + */ +@TestPropertySource(properties = "springdoc.model-and-view-allowed=true") +class SpringDocApp89Test extends AbstractSpringDocTest { + + static { + getConfig().replaceWithSchema(ModelAndView.class, new ObjectSchema()); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/MyApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/MyApi.java new file mode 100644 index 000000000..b0e7ed46e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/MyApi.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * The interface My api. + */ +@RequestMapping("/myapi") +public interface MyApi { + + /** + * Get string. + * + * @param language the language + * @return the string + */ + @Operation(description = "Annotations from interfaces test") + @GetMapping + String get( + @Parameter(hidden = true, in = ParameterIn.HEADER, name = HttpHeaders.ACCEPT_LANGUAGE) @RequestHeader(value = HttpHeaders.ACCEPT_LANGUAGE, required = false) String language); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/MyApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/MyApiController.java new file mode 100644 index 000000000..bc0c835a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/MyApiController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type My api controller. + */ +@RestController +class MyApiController implements MyApi { + /** + * Get string. + * + * @param language the language + * @return the string + */ + public String get(String language) { + return language; + } + + + /** + * Gets code. + * + * @param code the code + * @return the code + */ + @Operation(description = "Annotations from class with hidden parameter code") + @GetMapping("/getCode") + public String getCode(@Parameter(hidden = true) String code) { + return code; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..e2268f485 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 9 test. + */ +class SpringDocApp9Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/HelloController.java new file mode 100644 index 000000000..d8a5d7479 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/HelloController.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test 1. + * + * @param hello the hello + */ + @GetMapping("/test") + @ApiResponses(value = { @ApiResponse(description = "successful operation", content = { @Content(examples = @ExampleObject(name = "500", ref = "#/components/examples/http500Example"), mediaType = "application/json", schema = @Schema(implementation = User.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)) }) }) + public void test1(String hello) { + } + + /** + * Test 2. + * + * @param hello the hello + */ + @PostMapping("/test2") + @RequestBody( + description = "Details of the Item to be created", + required = true, + content = @Content( + schema = @Schema(implementation = User.class), + mediaType = MediaType.APPLICATION_JSON_VALUE, + examples = { + @ExampleObject( + name = "An example request with the minimum required fields to create.", + value = "min", + summary = "Minimal request"), + @ExampleObject( + name = "An example request with all fields provided with example values.", + value = "full", + summary = "Full request") })) + public void test2(String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java new file mode 100644 index 000000000..f9cefdf96 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/SpringDocApp90Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +/** + * The type Spring doc app 90 test. + */ +class SpringDocApp90Test extends AbstractSpringDocTest { + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/SpringDocTestApp.java new file mode 100644 index 000000000..039ab29a7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/SpringDocTestApp.java @@ -0,0 +1,103 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.util.AbstractMap; +import java.util.Collection; +import java.util.Map.Entry; + +import io.swagger.v3.oas.models.examples.Example; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.core.io.Resource; +import org.springframework.util.FileCopyUtils; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The Http 500 example resource. + */ + @Value("classpath:/500-90.txt") + private Resource http500ExampleResource; + + /** + * As string string. + * + * @param resource the resource + * @return the string + */ + public static String asString(Resource resource) { + try (Reader reader = new InputStreamReader(resource.getInputStream())) { + return FileCopyUtils.copyToString(reader); + } + catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + /** + * Open api customiser open api customiser. + * + * @param examples the examples + * @return the open api customiser + */ + @Bean + public OpenApiCustomizer openApiCustomizer(Collection> examples) { + return openAPI -> { + examples.forEach(example -> { + openAPI.getComponents().addExamples(example.getKey(), example.getValue()); + }); + }; + } + + /** + * Http 500 example entry. + * + * @return the entry + */ + @Bean + public Entry http500Example() { + Example http500Example = new Example(); + Entry entry = new AbstractMap.SimpleEntry("http500Example", http500Example); + http500Example.setSummary("HTTP 500 JSON Body response example"); + http500Example.setDescription( + "An example of HTTP response in case an error occurs on server side. instance attribute reference a traceId to ease server side analysis."); + http500Example.setValue(asString(http500ExampleResource)); + return entry; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/User.java new file mode 100644 index 000000000..d378af816 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app90/User.java @@ -0,0 +1,448 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app90; + +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * User + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-11-30T09:49:26.034469-01:00[Atlantic/Azores]") + + +class User { + + /** + * The Id. + */ + @JsonProperty("id") + + private Long id; + + + /** + * The Username. + */ + @JsonProperty("username") + + private String username; + + + /** + * The First name. + */ + @JsonProperty("firstName") + + private String firstName; + + + /** + * The Last name. + */ + @JsonProperty("lastName") + + private String lastName; + + + /** + * The Email. + */ + @JsonProperty("email") + + private String email; + + + /** + * The Password. + */ + @JsonProperty("password") + + private String password; + + + /** + * The Phone. + */ + @JsonProperty("phone") + + private String phone; + + + /** + * The User status. + */ + @JsonProperty("userStatus") + + private Integer userStatus; + + + /** + * Id user. + * + * @param id the id + * @return the user + */ + public User id(Long id) { + this.id = id; + return this; + } + + + /** + * Get id + * + * @return id id + */ + @Schema(example = "10", description = "") + + + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + + /** + * Username user. + * + * @param username the username + * @return the user + */ + public User username(String username) { + this.username = username; + return this; + } + + + /** + * Get username + * + * @return username username + */ + @Schema(example = "theUser", description = "") + + + public String getUsername() { + return username; + } + + /** + * Sets username. + * + * @param username the username + */ + public void setUsername(String username) { + this.username = username; + } + + + /** + * First name user. + * + * @param firstName the first name + * @return the user + */ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + /** + * Get firstName + * + * @return firstName first name + */ + @Schema(example = "John", description = "") + + + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + /** + * Last name user. + * + * @param lastName the last name + * @return the user + */ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + + /** + * Get lastName + * + * @return lastName last name + */ + @Schema(example = "James", description = "") + + + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + /** + * Email user. + * + * @param email the email + * @return the user + */ + public User email(String email) { + this.email = email; + return this; + } + + + /** + * Get email + * + * @return email email + */ + @Schema(example = "john@email.com", description = "") + + + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + + /** + * Password user. + * + * @param password the password + * @return the user + */ + public User password(String password) { + this.password = password; + return this; + } + + + /** + * Get password + * + * @return password password + */ + @Schema(example = "12345", description = "") + + + public String getPassword() { + return password; + } + + /** + * Sets password. + * + * @param password the password + */ + public void setPassword(String password) { + this.password = password; + } + + + /** + * Phone user. + * + * @param phone the phone + * @return the user + */ + public User phone(String phone) { + this.phone = phone; + return this; + } + + + /** + * Get phone + * + * @return phone phone + */ + @Schema(example = "12345", description = "") + + + public String getPhone() { + return phone; + } + + /** + * Sets phone. + * + * @param phone the phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + + + /** + * User status user. + * + * @param userStatus the user status + * @return the user + */ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + /** + * User Status + * + * @return userStatus user status + */ + @Schema(example = "1", description = "User Status") + + + public Integer getUserStatus() { + return userStatus; + } + + /** + * Sets user status. + * + * @param userStatus the user status + */ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + /** + * Equals boolean. + * + * @param o the o + * @return the boolean + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + /** + * Hash code int. + * + * @return the int + */ + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/Advice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/Advice.java new file mode 100644 index 000000000..d49dc80b3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/Advice.java @@ -0,0 +1,110 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app91; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.servlet.http.HttpServletRequest; + +import org.springframework.beans.TypeMismatchException; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * The type Advice. + */ +@RestControllerAdvice +class Advice { + + /** + * Bad request response entity. + * + * @param req the req + * @param exception the exception + * @return the response entity + */ + @ExceptionHandler(TypeMismatchException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ApiResponse( + responseCode = "400", + description = "Bad Request", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ApiError.class), + examples = { + @ExampleObject( + name = "Service-400", + summary = "400 from the service directly", + value = + "{\"status\": 400," + + "\"errorCode\": \"ERROR_001\"," + + "\"message\": \"An example message...\"" + + "}") + })) + public ResponseEntity badRequest(HttpServletRequest req, Exception exception) { + ApiError erroObj = new ApiError(400, "A code", "A message"); + return new ResponseEntity<>(erroObj, HttpStatus.BAD_REQUEST); + } + + /** + * Internal server error response entity. + * + * @param req the req + * @param exception the exception + * @return the response entity + */ + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ApiResponse( + responseCode = "500", + description = "Internal Server Error", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ApiError.class), + examples = { + @ExampleObject( + name = "Service-500", + summary = "500 from the service directly", + value = + "{\"status\": 500," + + "\"errorCode\": \"ERROR_002\"," + + "\"message\": \"Another example message...\"" + + "}") + })) + public ResponseEntity internalServerError(HttpServletRequest req, Exception exception) { + ApiError erroObj = new ApiError(500, "A different code", "A different message"); + return new ResponseEntity<>(erroObj, HttpStatus.INTERNAL_SERVER_ERROR); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/ApiError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/ApiError.java new file mode 100644 index 000000000..8e02bb9e7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/ApiError.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app91; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Api error. + */ +@Schema( + type = "object", + name = "ApiError", + title = "ApiError", + description = "A consistent response object for sending errors over the wire.") +class ApiError { + + /** + * The Status. + */ + @Schema(name = "status", description = "The Http Status value", type = "int", nullable = true) + @JsonProperty("status") + private int status; + + /** + * The Error code. + */ + @Schema( + name = "errorCode", + description = "An Error Code which can help with identifying issues.", + type = "string", + nullable = true) + @JsonProperty("errorCode") + private String errorCode; + + /** + * The Message. + */ + @Schema(name = "message", description = "The Error Message.", type = "string", nullable = false) + @JsonProperty("message") + private String message; + + /** + * Instantiates a new Api error. + * + * @param status the status + * @param errorCode the error code + * @param message the message + */ + public ApiError(int status, String errorCode, String message) { + this.status = status; + this.errorCode = errorCode; + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/Greeting.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/Greeting.java new file mode 100644 index 000000000..74de2eb62 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/Greeting.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app91; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Greeting. + */ +@Schema( + type = "object", + name = "Greeting", + title = "Greeting", + description = "An object containing a greeting message") +class Greeting { + + + /** + * The Payload. + */ + @Schema( + name = "payload", + description = "The greeting value", + type = "string", + nullable = false, + example = "sdfsdfs") + @JsonProperty("payload") + private String payload; + + /** + * Instantiates a new Greeting. + * + * @param payload the payload + */ + public Greeting(String payload) { + this.payload = payload; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/GreetingController.java new file mode 100644 index 000000000..744d4832f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/GreetingController.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app91; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.apache.commons.lang3.RandomStringUtils; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; + +/** + * The type Greeting controller. + */ +@RestController +@Tag(name = "Demo", description = "The Demo API") +class GreetingController { + + /** + * Say hello response entity. + * + * @return the response entity + */ + @GetMapping(produces = APPLICATION_JSON_VALUE) + @Operation(summary = "This API will return a random greeting.") + public ResponseEntity sayHello() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + + /** + * Say hello 2 response entity. + * + * @return the response entity + */ + @GetMapping("/test") + @ApiResponses(value = { @ApiResponse(responseCode = "201", description = "item created"), + @ApiResponse(responseCode = "400", description = "invalid input, object invalid"), + @ApiResponse(responseCode = "409", description = "an existing item already exists") }) + public ResponseEntity sayHello2() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/SpringDocApp91Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/SpringDocApp91Test.java new file mode 100644 index 000000000..53292a5a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app91/SpringDocApp91Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app91; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 91 test. + */ +@TestPropertySource(properties = "springdoc.override-with-generic-response=false") +class SpringDocApp91Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/HelloController.java new file mode 100644 index 000000000..5f814955a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app92; + +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/test") +class HelloController { + + /** + * Index string. + * + * @param test the test + * @return the string + */ + @GetMapping + String index(@NotNull String test) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/ParameterCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/ParameterCustomizer.java new file mode 100644 index 000000000..617c2befd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/ParameterCustomizer.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app92; + +import io.swagger.v3.oas.models.parameters.Parameter; +import jakarta.validation.constraints.NotNull; + +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; + +/** + * The type Parameter customizer. + */ +@Component +class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { + /** + * Customize parameter. + * + * @param parameterModel the parameter model + * @param methodParameter the method parameter + * @return the parameter + */ + @Override + public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { + NotNull annotation = methodParameter.getParameterAnnotation(NotNull.class); + if (annotation != null) { + parameterModel.required(false); + } + return parameterModel; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/SpringDocApp92Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/SpringDocApp92Test.java new file mode 100644 index 000000000..5a8839d36 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app92/SpringDocApp92Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app92; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 92 test. + */ +class SpringDocApp92Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/BaseClientModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/BaseClientModel.java new file mode 100644 index 000000000..bfca1bbc1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/BaseClientModel.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app93; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Base client model. + */ +public abstract class BaseClientModel { + /** + * The Id. + */ + @JsonProperty("id") + int id; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/BaseController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/BaseController.java new file mode 100644 index 000000000..70bf8fc7e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/BaseController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app93; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; + +/** + * The type Base controller. + * + * @param the type parameter + */ +public abstract class BaseController { + /** + * Get t client model. + * + * @param param the param + * @return the t client model + */ + @Operation + @GetMapping + TClientModel get(TClientModel param) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpecificClientModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpecificClientModel.java new file mode 100644 index 000000000..301a05524 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpecificClientModel.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app93; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Specific client model. + */ +class SpecificClientModel extends BaseClientModel { + /** + * The Name. + */ + @JsonProperty("name") + String name; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpecificController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpecificController.java new file mode 100644 index 000000000..729eaaddd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpecificController.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app93; + +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Specific controller. + */ +@RestController +class SpecificController extends BaseController {} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpringDocApp93Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpringDocApp93Test.java new file mode 100644 index 000000000..8fae2b218 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app93/SpringDocApp93Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app93; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 93 test. + */ +class SpringDocApp93Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app94/Greeting.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app94/Greeting.java new file mode 100644 index 000000000..3acdad822 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app94/Greeting.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app94; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Greeting. + */ +@Schema( + type = "object", + name = "Greeting", + title = "Greeting", + description = "An object containing a greeting message") +class Greeting { + + + /** + * The Payload. + */ + @Schema( + name = "payload", + description = "The greeting value", + type = "string", + nullable = false, + example = "sdfsdfs") + @JsonProperty("payload") + private String payload; + + /** + * Instantiates a new Greeting. + * + * @param payload the payload + */ + public Greeting(String payload) { + this.payload = payload; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/SpringDocApp94Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app94/SpringDocApp94Test.java similarity index 86% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/SpringDocApp94Test.java rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app94/SpringDocApp94Test.java index dad845771..4ce7f653d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app94/SpringDocApp94Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app94/SpringDocApp94Test.java @@ -1,23 +1,31 @@ -package test.org.springdoc.api.app94; - /* * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at * * - * * https://www.apache.org/licenses/LICENSE-2.0 + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * + * */ +package test.org.springdoc.api.v30.app94; + import java.util.Collections; import io.swagger.v3.oas.annotations.Operation; @@ -34,7 +42,7 @@ import org.springdoc.core.service.OpenAPIService; import org.springdoc.core.service.OperationService; import org.springdoc.webmvc.api.OpenApiWebMvcResource; -import test.org.springdoc.api.AbstractSpringDocTest; +import test.org.springdoc.api.v30.AbstractSpringDocTest; import org.springframework.beans.BeansException; import org.springframework.beans.factory.ObjectFactory; diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app95/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app95/HelloController.java new file mode 100644 index 000000000..645a1ded4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app95/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app95; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/persons") +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping + @Operation(summary = "${test.app95.operation.persons.summary}", + description = "${test.app95.operation.persons.description}") + public void persons(@Parameter(description = "${test.app95.param.name.description}") String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app95/SpringDocApp95Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app95/SpringDocApp95Test.java new file mode 100644 index 000000000..5825c21ae --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app95/SpringDocApp95Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app95; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +/** + * The type Spring doc app 95 test. + */ +@ActiveProfiles("95") +class SpringDocApp95Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app96/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app96/HelloController.java new file mode 100644 index 000000000..5a1e98c5b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app96/HelloController.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app96; + +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Test 1 string. + * + * @param test the test + * @return the string + */ + @PostMapping("/api1") + String test1(@RequestBody @Min(2) int test) { + return null; + } + + /** + * Test 2 string. + * + * @param test the test + * @return the string + */ + @PostMapping("/api2") + String test2(@RequestBody String test) { + return null; + } + + /** + * Test 3 string. + * + * @param test the test + * @return the string + */ + @PostMapping("/api3") + String test3(@NotNull String test) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app96/SpringDocApp96Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app96/SpringDocApp96Test.java new file mode 100644 index 000000000..4047322f7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app96/SpringDocApp96Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app96; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 96 test. + */ +class SpringDocApp96Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/HelloController.java new file mode 100644 index 000000000..96656d538 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/HelloController.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app97; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Header v 1 student v 1. + * + * @return the student v 1 + */ + @GetMapping(value = "/student/header1", headers = "X-API-VERSION=1") + public StudentV1 headerV1() { + return new StudentV1("Bob Charlie"); + } + + /** + * Header v 2 student v 2. + * + * @return the student v 2 + */ + @GetMapping(value = "/student/header2", headers = "X-API-VERSION=2") + public StudentV2 headerV2() { + return new StudentV2("Charlie"); + } + + /** + * Header v 3 student v 3. + * + * @return the student v 3 + */ + @GetMapping(value = "/student/header3", headers = "X-API-VERSION") + public StudentV3 headerV3() { + return new StudentV3("Tom Charlie"); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/SpringDocApp97Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/SpringDocApp97Test.java new file mode 100644 index 000000000..ef92e1ecd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/SpringDocApp97Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app97; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 97 test. + */ +class SpringDocApp97Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV1.java new file mode 100644 index 000000000..19df77966 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV1.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app97; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Student v 1. + */ +class StudentV1 { + + /** + * The Name. + */ + @JsonProperty("name") + private String name; + + /** + * Instantiates a new Student v 1. + * + * @param name the name + */ + public StudentV1(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV2.java new file mode 100644 index 000000000..424465428 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV2.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app97; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Student v 2. + */ +class StudentV2 { + + /** + * The Name. + */ + @JsonProperty("bb") + private String name; + + /** + * Instantiates a new Student v 2. + * + * @param name the name + */ + public StudentV2(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV3.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV3.java new file mode 100644 index 000000000..5ed3c6859 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app97/StudentV3.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app97; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Student v 3. + */ +class StudentV3 { + + /** + * The Name. + */ + @JsonProperty("name") + private String name; + + /** + * Instantiates a new Student v 3. + * + * @param name the name + */ + public StudentV3(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/HelloController.java new file mode 100644 index 000000000..187887983 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app98; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping("/persons") + public void persons(@IgnoredAnnotationParameter String name) { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/IgnoredAnnotationParameter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/IgnoredAnnotationParameter.java new file mode 100644 index 000000000..43d67d01c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/IgnoredAnnotationParameter.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app98; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * The interface Ignored annotation parameter. + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface IgnoredAnnotationParameter { + /** + * Addition string. + * + * @return the string + */ + String addition() default "customized parameter!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/SpringDocApp98Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/SpringDocApp98Test.java new file mode 100644 index 000000000..904f44bda --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app98/SpringDocApp98Test.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app98; + + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 98 test. + */ +class SpringDocApp98Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().addAnnotationsToIgnore(IgnoredAnnotationParameter.class); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app99/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app99/HelloController.java new file mode 100644 index 000000000..1d7974240 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app99/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app99; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/persons") +class HelloController { + + /** + * Persons. + */ + @GetMapping + @ApiResponses({ + @ApiResponse(responseCode = "202", description = "${test.app99.operation.persons.response.202.description}") + }) + public void persons() { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app99/SpringDocApp99Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app99/SpringDocApp99Test.java new file mode 100644 index 000000000..09403cf14 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app99/SpringDocApp99Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app99; + + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +/** + * The type Spring doc app 99 test. + */ +@ActiveProfiles("99") +class SpringDocApp99Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app1.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app10.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app10.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app10.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app10.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app100.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app100.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app100.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app100.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app101.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app101.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app101.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app101.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app102.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app102.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app102.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app102.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app103.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app103.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app103.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app103.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app104.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app104.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app104.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app104.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-1.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-1.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-2.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-2.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-3.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-3.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-3.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-4.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-4.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app105-4.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-4.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app106.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app106.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app106.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app106.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app107.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app107.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app107.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app107.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app108.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app108.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app108.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app108.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app109.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app109.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app109.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app109.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app11.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app11.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app11.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app110.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app110.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app110.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app110.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app111.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app111.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app111.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app111.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app112.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app112.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app112.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app112.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app113.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app113.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app113.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app113.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app114.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app114.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app114.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app114.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app115.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app115.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app115.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app115.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app116.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app116.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app116.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app116.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app117.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app117.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app117.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app117.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app118.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app118.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app118.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app118.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app119.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app119.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app119.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app119.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app12.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app12.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app12.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app12.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app120.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app120.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app120.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app120.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app121.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app121.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app121.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app121.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app122.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app122.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app122.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app122.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app123.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app123.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app123.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app123.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app124.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app124.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app124.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app124.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app125.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app125.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app125.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app125.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app126.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app126.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app126.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app126.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app129.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app129.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app129.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app129.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app13.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app13.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app13.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app13.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app130.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app130.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app130.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app130.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app131.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app131.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app131.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app131.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app132.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app132.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app132.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app132.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app133.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app133.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app133.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app133.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-1.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-1.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-2.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-2.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-3.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-3.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-3.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-3.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-4.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-4.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-4.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-4.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-5.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-5.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app134-5.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app134-5.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app135.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app135.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app135.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app135.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app137.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app137.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app137.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app137.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app138.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app138.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app138.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app138.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app139.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app139.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app139.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app139.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app14.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app14.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app14.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app14.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app140.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app140.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app140.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app140.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app141.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app141.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app141.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app141.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app142.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app142.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app142.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app142.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app149.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app149.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app149.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app149.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app15.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app15.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app15.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app15.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app150.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app150.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app150.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app150.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app151.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app151.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app151.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app151.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app152.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app152.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app152.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app152.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app153.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app153.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app153.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app153.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app154.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app154.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app154.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app154.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app155.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app155.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app155.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app155.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app156.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app156.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app156.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app156.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app157.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app157.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app157.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app157.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app158.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app158.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app158.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app158.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app159.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app159.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app159.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app159.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app160.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app160.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app160.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app160.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app161.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app161.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app161.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app161.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app162.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app162.json new file mode 100644 index 000000000..1c58b6a4c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app162.json @@ -0,0 +1,342 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "SpringShop API", + "description": "The description of the api", + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "javadoc-only-rest-controller", + "description": "This is the JavadocOnlyRestController class javadoc." + } + ], + "paths": { + "/javadoc-only/{guid}": { + "get": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the find method's javadoc.", + "description": "This is the find method's javadoc.\n The method's signature: #find(String)", + "operationId": "find", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "the @param guid javadoc for the #find(String) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "the @throws NoResultException javadoc for the #find(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #find(String) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + }, + "put": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the update method's javadoc.", + "description": "This is the update method's javadoc.\n The method's signature: #update(String, JavadocOnlyRestDto)", + "operationId": "update", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "the @param input javadoc for the #update(String, JavadocOnlyRestDto) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #update(String, JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + }, + "/javadoc-only": { + "get": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the list method's javadoc.", + "description": "This is the list method's javadoc.\n The method's signature: #list()", + "operationId": "list", + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #list() method", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the create method's javadoc.", + "description": "This is the create method's javadoc.\n The method's signature: #create(JavadocOnlyRestDto)", + "operationId": "create", + "requestBody": { + "description": "the @param input javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NonUniqueResultException" + ] + }, + "201": { + "description": "the @return javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + }, + "/javadoc-only/startsBy/{prefix}": { + "get": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the findStartsBy method's javadoc.", + "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", + "operationId": "findStartsBy", + "parameters": [ + { + "name": "prefix", + "in": "path", + "description": "the @param prefix javadoc for the #findStartsBy(String) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "the @throws NoResultException javadoc for the #findStartsBy(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the @throws NonUniqueResultException javadoc for the #findStartsBy(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app162.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #findStartsBy(String) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "JavadocOnlyRestDto": { + "type": "object", + "properties": { + "guid": { + "type": "string", + "description": "This is the private #guid field's javadoc." + }, + "inner": { + "$ref": "#/components/schemas/JavadocOnlyStaticInnerRestDto" + } + }, + "description": "This is the JavadocOnlyRestDto class javadoc." + }, + "JavadocOnlyStaticInnerRestDto": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "This is the private #content field's javadoc." + } + }, + "description": "This is the JavadocOnlyStaticInnerRestDto class javadoc." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app163.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app163.json new file mode 100644 index 000000000..16f1598e1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app163.json @@ -0,0 +1,227 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "SpringShop API", + "description": "The description of the api", + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "annotation-override", + "description": "Description for the tag." + } + ], + "paths": { + "/annotation-override/{guid}": { + "put": { + "tags": [ + "annotation-override" + ], + "summary": "Summary for #update(String, AnnotationOverrideForJavadocRestDto)", + "description": "This is the update method's javadoc.\n The method's signature: #update(String, AnnotationOverrideForJavadocRestDto)", + "operationId": "update", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "the @param input javadoc for the #update(String, AnnotationOverrideForJavadocRestDto) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app163.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app163.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #update(String, AnnotationOverrideForJavadocRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + } + } + } + } + }, + "/annotation-override": { + "post": { + "tags": [ + "annotation-override" + ], + "summary": "Summary for #create(AnnotationOverrideForJavadocRestDto)", + "description": "Description for #create(AnnotationOverrideForJavadocRestDto)", + "operationId": "create", + "requestBody": { + "description": "Request body for #create(AnnotationOverrideForJavadocRestDto)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app163.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app163.exception.NonUniqueResultException" + ] + }, + "default": { + "description": "API Response 201 for #create(AnnotationOverrideForJavadocRestDto)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + } + } + } + } + }, + "/annotation-override/startsBy/{prefix}": { + "get": { + "tags": [ + "annotation-override" + ], + "summary": "This is the findStartsBy method's javadoc.", + "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", + "operationId": "findStartsBy", + "parameters": [ + { + "name": "prefix", + "in": "path", + "description": "Parameter prefix", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "the @throws NoResultException javadoc for the #findStartsBy(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v30.app163.exception.NoResultException" + ] + }, + "400": { + "description": "API Response 400 for #findStartsBy(prefix)" + }, + "200": { + "description": "API Response 200 for #findStartsBy(prefix)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AnnotationOverrideForJavadocRestDto": { + "title": "annotation-override-dto", + "type": "object", + "properties": { + "guid": { + "type": "string", + "description": "Description for the #guid field" + }, + "inner": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocStaticInnerRestDto" + } + }, + "description": "Description for the tag." + }, + "AnnotationOverrideForJavadocStaticInnerRestDto": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "This is the private #content field's javadoc." + } + }, + "description": "This is the AnnotationOverrideForJavadocStaticInnerRestDto class javadoc." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app164.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app164.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app164.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app164.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app166.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app166.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app166.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app166.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app167.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app167.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app167.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app167.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app168.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app168.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app168.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app168.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app169.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app169.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app169.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app169.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app17.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app17.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app17.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app17.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app170.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app170.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app170.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app170.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app171.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app171.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app171.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app171.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app173.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app173.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app173.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app173.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app174.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app174.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app174.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app174.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app18.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app18.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app18.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app18.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app19.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app19.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app19.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app19.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app2.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app20.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app20.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app20.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app20.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app21.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app21.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app21.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app21.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app22.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app22.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app22.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app22.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app23.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app23.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app23.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app23.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app24.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app24.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app24.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app24.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app25.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app25.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app25.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app25.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app26.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app26.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app26.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app26.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app27.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app27.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app27.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app27.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app28.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app28.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app28.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app28.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app29.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app29.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app29.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app29.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app3.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app3.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app3.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app3.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app30.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app30.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app30.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app30.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app31.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app31.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app31.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app31.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app32.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app32.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app32.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app32.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app33.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app33.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app33.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app33.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app34.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app34.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app34.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app34.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app35.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app35.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app35.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app35.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app37.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app37.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app37.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app37.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app38.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app38.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app38.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app38.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app39.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app39.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app39.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app39.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app4.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app4.json new file mode 100644 index 000000000..7f4405791 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app4.json @@ -0,0 +1,86 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/values/data": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "List tracker data.", + "description": "List tracker data.", + "operationId": "list", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": true, + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v30.app4.TrackerData" + } + } + ], + "responses": { + "200": { + "description": "the tracker data", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v30.app4.TrackerData" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "test.org.springdoc.api.v30.app4.TrackerData": { + "required": [ + "timestamp", + "trackerId", + "value" + ], + "type": "object", + "properties": { + "trackerId": { + "type": "string", + "description": "The Tracker id.", + "example": "the-tracker-id" + }, + "timestamp": { + "type": "string", + "description": "The Timestamp.", + "format": "date-time", + "example": "2018-01-01T00:00:00Z" + }, + "value": { + "type": "number", + "description": "The data value", + "format": "double", + "example": 19.0 + } + }, + "description": "The type Tracker data." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app40.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app40.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app40.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app40.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app41.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app41.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app41.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app41.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app42.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app42.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app42.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app42.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app43.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app43.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app43.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app43.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app44.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app44.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app44.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app44.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app45.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app45.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app45.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app45.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app46.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app46.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app46.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app46.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app47.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app47.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app47.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app47.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app48.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app48.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app48.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app48.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app49.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app49.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app49.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app49.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app50.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app50.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app50.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app50.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app51.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app51.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app51.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app51.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app52.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app52.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app52.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app52.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app53.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app53.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app53.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app53.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app54.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app54.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app54.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app54.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app55.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app55.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app55.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app55.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app56.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app56.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app56.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app56.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app57.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app57.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app57.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app57.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app58.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app58.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app58.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app58.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app59.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app59.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app59.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app59.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app6.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app6.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app6.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app6.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app60.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app60.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app60.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app60.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app61.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app61.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app61.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app61.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app62.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app62.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app62.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app62.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app63.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app63.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app63.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app63.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app64.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app64.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app64.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app64.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app65.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app65.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app65.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app65.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app66.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app66.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app66.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app66.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app67.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app67.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app67.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app67.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app69.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app69.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app69.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app69.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app7.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app7.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app7.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app7.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app70.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app70.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app70.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app70.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app71.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app71.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app71.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app71.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app73.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app73.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app73.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app73.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app74.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app74.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app74.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app74.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app75.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app75.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app75.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app75.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app76.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app76.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app76.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app76.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app77.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app77.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app77.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app77.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app78.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app78.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app78.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app78.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app79.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app79.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app79.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app79.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app8.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app8.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app8.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app8.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app80.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app80.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app80.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app80.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app82.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app82.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app82.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app82.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app83.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app83.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app83.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app83.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app84.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app84.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app84.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app84.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app85.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app85.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app85.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app85.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app86.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app86.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app86.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app86.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app87.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app87.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app87.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app87.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app88.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app88.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app88.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app88.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app89.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app89.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app89.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app89.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app9.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app9.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app9.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app9.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app90.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app90.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app90.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app90.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app91.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app91.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app91.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app91.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app92.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app92.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app92.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app92.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app93.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app93.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app93.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app93.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app94.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app94.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app94.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app94.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app95.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app95.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app95.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app95.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app96.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app96.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app96.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app96.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app97.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app97.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app97.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app97.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app98.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app98.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app98.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app98.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app99.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app99.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app99.json rename to springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app99.json diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app1.json new file mode 100644 index 000000000..b7f2e8bfa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app1.json @@ -0,0 +1,682 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "SpringShop API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{email}": { + "get": { + "tags": [ + "people" + ], + "description": "Find person by e-mail", + "operationId": "findPerson", + "parameters": [ + { + "name": "email", + "in": "path", + "description": "E-Mail address to lookup for", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "500": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "the person dto", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + }, + "404": { + "description": "Person with such e-mail doesn't exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "post": { + "tags": [ + "people" + ], + "description": "Create new person", + "operationId": "addPerson", + "parameters": [ + { + "name": "email", + "in": "path", + "description": "E-Mail", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "First Name" + }, + "lastName": { + "type": "string", + "description": "Last Name" + } + }, + "required": [ + "firstName", + "lastName" + ] + } + } + } + }, + "responses": { + "500": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "201": { + "description": "the response entity", + "headers": { + "Location": { + "style": "simple", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + }, + "409": { + "description": "Person with such e-mail already exists", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "people" + ], + "description": "Delete existing person", + "operationId": "deletePerson", + "parameters": [ + { + "name": "email", + "in": "path", + "description": "E-Mail address to lookup for", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "500": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "204": { + "description": "Person has been deleted", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Person with such e-mail doesn't exists", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/items": { + "get": { + "tags": [ + "items" + ], + "summary": "Show items list.", + "description": "Show items list.", + "operationId": "showItems", + "parameters": [ + { + "name": "cusID", + "in": "query", + "description": "the customer id", + "required": true, + "schema": { + "type": "string", + "maxLength": 6, + "minLength": 4 + } + }, + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": true, + "schema": { + "type": "integer", + "format": "int32", + "maximum": 6, + "minimum": 4 + } + }, + { + "name": "start", + "in": "query", + "description": "the start date", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:00:00.000Z" + } + }, + { + "name": "filterIds", + "in": "query", + "description": "the filter ids", + "required": false, + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "500": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemDTO" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "items" + ], + "summary": "Add item response entity.", + "description": "Add item response entity.", + "operationId": "addItem", + "requestBody": { + "description": "the item dto", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ItemLightDTO" + } + } + }, + "required": true + }, + "responses": { + "500": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "uri" + } + } + } + } + } + } + }, + "/inventory": { + "get": { + "tags": [ + "developers", + "inventory" + ], + "summary": "By passing in the appropriate options, you can search for available inventory in the system ", + "description": "searches inventory", + "operationId": "searchInventory", + "parameters": [ + { + "name": "searchString", + "in": "query", + "description": "pass an optional search string for looking up inventory", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "skip", + "in": "query", + "description": "number of records to skip for pagination", + "required": true, + "schema": { + "type": "integer", + "format": "int32", + "minimum": 0 + } + }, + { + "name": "limit", + "in": "query", + "description": "maximum number of records to return", + "required": true, + "schema": { + "type": "integer", + "format": "int32", + "maximum": 50, + "minimum": 0 + } + } + ], + "responses": { + "500": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "search results matching criteria", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryItem" + } + } + } + } + }, + "400": { + "description": "bad input parameter", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryItem" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "inventory", + "admins" + ], + "summary": "Adds an item to the system", + "description": "adds an inventory item", + "operationId": "addInventory", + "requestBody": { + "description": "Inventory item to add", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InventoryItem" + } + } + }, + "required": true + }, + "responses": { + "500": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "201": { + "description": "item created" + }, + "400": { + "description": "invalid input, object invalid" + }, + "409": { + "description": "an existing item already exists" + } + } + } + }, + "/people": { + "get": { + "tags": [ + "people" + ], + "description": "List all people", + "operationId": "getPeople", + "responses": { + "500": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "the people", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "/hello/{numTelco}": { + "get": { + "tags": [ + "tea" + ], + "summary": "Index string.", + "description": "Index string.", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "description": "the num tel", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "description": "the adresse", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "500": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "418": { + "description": "the string", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorMessage": { + "type": "object", + "description": "The type Error message.", + "properties": { + "id": { + "type": "string", + "description": "The Id." + }, + "message": { + "type": "string", + "description": "The Message." + } + } + }, + "PersonDTO": { + "type": "object", + "description": "The type Person dto.", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + } + } + }, + "ItemLightDTO": { + "type": "object", + "description": "The type Item light dto.", + "properties": { + "description": { + "type": "string", + "description": "description of type String" + }, + "price": { + "type": "integer", + "format": "int32", + "description": "price of type int" + }, + "deprecatedPrice": { + "type": "integer", + "format": "int32", + "deprecated": true, + "description": "The Deprecated price." + } + } + }, + "InventoryItem": { + "type": "object", + "description": "InventoryItem", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The Id.", + "example": "d290f1ee-6c54-4b01-90e6-d701748f0851" + }, + "name": { + "type": "string", + "description": "The Name.", + "example": "Widget Adapter" + }, + "releaseDate": { + "type": "string", + "description": "The Release date.", + "example": "2016-08-29T09:12:33.001Z" + }, + "manufacturer": { + "$ref": "#/components/schemas/Manufacturer", + "description": "The Manufacturer." + } + }, + "required": [ + "id", + "manufacturer", + "name", + "releaseDate" + ] + }, + "Manufacturer": { + "type": "object", + "description": "Manufacturer", + "properties": { + "name": { + "type": "string", + "description": "The Name.", + "example": "ACME Corporation" + }, + "homePage": { + "type": "string", + "description": "The Home page.", + "example": "https://www.acme-corp.com" + }, + "phone": { + "type": "string", + "description": "The Phone.", + "example": "408-867-5309" + } + }, + "required": [ + "name" + ] + }, + "ItemDTO": { + "type": "object", + "description": "The type Item dto.", + "properties": { + "itemID": { + "type": "string", + "description": "itemID of type String" + }, + "description": { + "type": "string", + "description": "description of type String" + }, + "price": { + "type": "integer", + "format": "int32", + "description": "price of type int" + }, + "deprecatedPrice": { + "type": "integer", + "format": "int32", + "deprecated": true, + "description": "The Deprecated price." + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app10.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app10.json new file mode 100644 index 000000000..3996702e3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app10.json @@ -0,0 +1,74 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/testreq": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test request attribute.", + "description": "Test request attribute.", + "operationId": "testRequestAttribute", + "parameters": [ + { + "name": "s", + "in": "query", + "description": "the s", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test.", + "description": "Test.", + "operationId": "test", + "parameters": [ + { + "name": "hello", + "in": "query", + "description": "the hello", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app100.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app100.json new file mode 100644 index 000000000..df63f44a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app100.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-ap1", + "hello-ap2" + ], + "summary": "Gets all pets.", + "description": "Gets all pets.", + "operationId": "getAllPets", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the all pets", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + } + }, + "description": "The type Person dto." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app101.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app101.json new file mode 100644 index 000000000..0dd8e1248 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app101.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Hello hello dto.", + "description": "Hello hello dto.", + "operationId": "hello", + "responses": { + "default": { + "description": "the hello dto", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloDTO", + "description": "${test.app101.operation.hello.response.schema.description}" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloDTO": { + "type": "object", + "description": "Description of schema of hello entity", + "properties": { + "id": { + "type": "string", + "description": "Description of schema of param id for api hello" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app102.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app102.json new file mode 100644 index 000000000..c5b2139dd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app102.json @@ -0,0 +1,160 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "test-controller", + "description": "The type Test controller." + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "test-controller" + ], + "summary": "Gets test.", + "description": "Gets test.", + "operationId": "getTest", + "parameters": [ + { + "name": "param", + "in": "query", + "description": "the param", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "childParam", + "in": "query", + "description": "parameter from child of RequestParams", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam", + "in": "query", + "description": "string parameter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam1", + "in": "query", + "description": "The String param 1.", + "required": false, + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam2", + "in": "query", + "description": "string parameter2", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "intParam", + "in": "query", + "description": "int parameter", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "intParam2", + "in": "query", + "description": "The Int param 2.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "intParam3", + "in": "query", + "description": "The Int param 3.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param1", + "in": "query", + "description": "nested string parameter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param2", + "in": "query", + "description": "nested BigInteger parameter", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "nestedList", + "in": "query", + "description": "The Nested list.", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Nested" + } + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Nested": { + "type": "object", + "properties": { + "param1": { + "type": "string", + "description": "The Param 1." + }, + "param2": { + "type": "integer", + "description": "The Param 2." + } + }, + "description": "The type Nested." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app103.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app103.json new file mode 100644 index 000000000..6cd36e208 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app103.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test/103": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Post my request body string.", + "description": "Post my request body string.", + "operationId": "postMyRequestBody", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "body": { + "$ref": "#/components/schemas/ExampleBody", + "description": "the body" + }, + "file": { + "type": "string", + "format": "binary", + "description": "the file" + } + }, + "required": [ + "body", + "file" + ] + }, + "encoding": { + "body": { + "contentType": "application/json" + } + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ExampleBody": { + "type": "object", + "description": "The type Example body.", + "properties": { + "stringParam": { + "type": "string", + "description": "The String param." + }, + "intParam": { + "type": "integer", + "format": "int32", + "description": "The Int param." + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app104.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app104.json new file mode 100644 index 000000000..bed3c58af --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app104.json @@ -0,0 +1,80 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/design": { + "get": { + "tags": [ + "design" + ], + "description": "Receive a list of objects", + "operationId": "list", + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Design" + } + } + } + } + } + } + } + }, + "/design/{id}": { + "get": { + "tags": [ + "design" + ], + "description": "Get single object", + "operationId": "get", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The id to get.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "the t", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Design" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Design": { + "type": "object", + "description": "The type Design." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-1.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-1.json new file mode 100644 index 000000000..d120cbc8f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-1.json @@ -0,0 +1,283 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "store", + "description": "the store API" + } + ], + "paths": { + "/store/inventory": { + "get": { + "tags": [ + "store" + ], + "summary": "Returns pet inventories by status", + "description": "Returns a map of status codes to quantities", + "operationId": "getInventory", + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + }, + "security": [ + { + "api_key": [] + } + ] + } + }, + "/store/order": { + "post": { + "tags": [ + "store" + ], + "summary": "Place an order for a pet", + "description": "Place order response entity.", + "operationId": "placeOrder", + "requestBody": { + "description": "the order", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + }, + "400": { + "description": "Invalid Order", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + }, + "/store/order/{orderId}": { + "get": { + "tags": [ + "store" + ], + "summary": "Find purchase order by ID", + "description": "Gets order by id.", + "operationId": "getOrderById", + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of pet that needs to be fetched", + "required": true, + "schema": { + "maximum": 5, + "minimum": 1, + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + }, + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Order not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + } + } + }, + "delete": { + "tags": [ + "store" + ], + "summary": "Delete purchase order by ID", + "description": "Delete order response entity.", + "operationId": "deleteOrder", + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of the order that needs to be deleted", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Order not found" + } + } + } + } + }, + "components": { + "schemas": { + "Order": { + "type": "object", + "properties": { + "complete": { + "type": "boolean", + "description": "The Complete." + }, + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + }, + "petId": { + "type": "integer", + "description": "The Pet id.", + "format": "int64" + }, + "quantity": { + "type": "integer", + "description": "The Quantity.", + "format": "int32" + }, + "shipDate": { + "type": "string", + "description": "The Ship date.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order Status" + } + }, + "description": "The type Order." + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "read:pets": "read your pets", + "write:pets": "modify pets in your account" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-2.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-2.json new file mode 100644 index 000000000..3cf9b92a9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-2.json @@ -0,0 +1,451 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "user", + "description": "the user API" + } + ], + "paths": { + "/user": { + "post": { + "tags": [ + "user" + ], + "summary": "Create user", + "description": "Create user response entity.", + "operationId": "createUser", + "requestBody": { + "description": "Created user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "successful operation" + }, + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + }, + "/user/createWithArray": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "description": "Create users with array input response entity.", + "operationId": "createUsersWithArrayInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "successful operation" + }, + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + }, + "/user/createWithList": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "description": "Create users with list input response entity.", + "operationId": "createUsersWithListInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "successful operation" + }, + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + }, + "/user/login": { + "get": { + "tags": [ + "user" + ], + "summary": "Logs user into the system", + "description": "Login user response entity.", + "operationId": "loginUser", + "parameters": [ + { + "name": "username", + "in": "query", + "description": "The user name for login", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "password", + "in": "query", + "description": "The password for login in clear text", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/xml": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Invalid username/password supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + }, + "/user/logout": { + "get": { + "tags": [ + "user" + ], + "summary": "Logs out current logged in user session", + "description": "Logout user response entity.", + "operationId": "logoutUser", + "responses": { + "200": { + "description": "successful operation" + }, + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + }, + "/user/{username}": { + "get": { + "tags": [ + "user" + ], + "summary": "Get user by user name", + "description": "Gets user by name.", + "operationId": "getUserByName", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "The name that needs to be fetched. Use user1 for testing.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "400": { + "description": "Invalid username supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "User not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + }, + "put": { + "tags": [ + "user" + ], + "summary": "Updated user", + "description": "Update user response entity.", + "operationId": "updateUser", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "name that need to be deleted", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Updated user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid user supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "User not found" + } + } + }, + "delete": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "description": "Delete user response entity.", + "operationId": "deleteUser", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "the username", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + }, + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + }, + "lastName": { + "type": "string", + "description": "The Last name." + }, + "password": { + "type": "string", + "description": "The Password." + }, + "phone": { + "type": "string", + "description": "The Phone." + }, + "userStatus": { + "type": "integer", + "description": "User Status", + "format": "int32" + }, + "username": { + "type": "string", + "description": "The Username." + } + }, + "description": "The type User." + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "read:pets": "read your pets", + "write:pets": "modify pets in your account" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-3.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-3.json new file mode 100644 index 000000000..9b86c0375 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-3.json @@ -0,0 +1,661 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "pet", + "description": "the pet API" + } + ], + "paths": { + "/pet": { + "put": { + "tags": [ + "pet" + ], + "summary": "Update an existing pet", + "description": "Update pet response entity.", + "operationId": "updatePet", + "requestBody": { + "description": "Pet object that needs to be added to the store", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Pet not found" + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + }, + "post": { + "tags": [ + "pet" + ], + "summary": "Add a new pet to the store", + "description": "Add pet.", + "operationId": "addPet", + "requestBody": { + "description": "Pet object that needs to be added to the store", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/{petId}": { + "get": { + "tags": [ + "pet" + ], + "summary": "Find pet by ID", + "description": "Returns a single pet", + "operationId": "getPetById", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to return", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Pet not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "post": { + "tags": [ + "pet" + ], + "summary": "Updates a pet in the store with form data", + "description": "Update pet with form response entity.", + "operationId": "updatePetWithForm", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet that needs to be updated", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + }, + "delete": { + "tags": [ + "pet" + ], + "summary": "Deletes a pet", + "description": "Delete pet response entity.", + "operationId": "deletePet", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "Pet id to delete", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "api_key", + "in": "header", + "description": "the api key", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Pet not found" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/{petId}/uploadImage": { + "post": { + "tags": [ + "pet" + ], + "summary": "uploads an image", + "description": "Upload file response entity.", + "operationId": "uploadFile", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to update", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "additionalMetadata", + "in": "query", + "description": "Additional data to pass to server", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "file detail" + } + }, + "required": [ + "file" + ] + } + } + } + }, + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModelApiResponse" + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByTags": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by tags", + "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId": "findPetsByTags", + "parameters": [ + { + "name": "tags", + "in": "query", + "description": "Tags to filter by", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "400": { + "description": "Invalid tag value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByStatus": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by status", + "description": "Multiple status values can be provided with comma separated strings", + "operationId": "findPetsByStatus", + "parameters": [ + { + "name": "status", + "in": "query", + "description": "Status values that need to be considered for filter", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "400": { + "description": "Invalid status value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "description": "The type Category.", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The Id." + }, + "name": { + "type": "string", + "description": "The Name." + } + } + }, + "Pet": { + "type": "object", + "description": "The type Pet.", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The Id." + }, + "category": { + "$ref": "#/components/schemas/Category", + "description": "The Category." + }, + "name": { + "type": "string", + "description": "The Name.", + "example": "doggie" + }, + "photoUrls": { + "type": "array", + "description": "The Photo urls.", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "description": "The Tags.", + "items": { + "$ref": "#/components/schemas/Tag" + } + }, + "status": { + "type": "string", + "description": "pet status in the store", + "enum": [ + "available", + "pending", + "sold" + ] + } + }, + "required": [ + "name", + "photoUrls" + ] + }, + "Tag": { + "type": "object", + "description": "The type Tag.", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The Id." + }, + "name": { + "type": "string", + "description": "The Name." + } + } + }, + "ModelApiResponse": { + "type": "object", + "description": "The type Model api response.", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "The Code." + }, + "type": { + "type": "string", + "description": "The Type." + }, + "message": { + "type": "string", + "description": "The Message." + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-4.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-4.json new file mode 100644 index 000000000..c5a35a361 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-4.json @@ -0,0 +1,86 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "store", + "description": "the store API" + } + ], + "paths": { + "/v1/stores": { + "get": { + "tags": [ + "store" + ], + "summary": "Stores.", + "description": "Stores.", + "operationId": "stores", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "read:pets": "read your pets", + "write:pets": "modify pets in your account" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app106.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app106.json new file mode 100644 index 000000000..7fa6d0fb2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app106.json @@ -0,0 +1,57 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "find-articles", + "description": "Find articles response entity.", + "operationId": "findArticles", + "parameters": [ + { + "name": "If-Modified-Since", + "in": "header", + "description": "DateTime", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + }, + "example": "2020-01-01T00:00:00.000Z" + } + ], + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app107.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app107.json new file mode 100644 index 000000000..2f3ee9268 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app107.json @@ -0,0 +1,83 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/entity-b": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets entity b.", + "description": "Gets entity b.", + "operationId": "getEntityB", + "responses": { + "200": { + "description": "the entity b", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityB" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/EntityB" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "EntityA": { + "type": "object", + "description": "The type Entity a.", + "properties": { + "fieldA": { + "type": "string", + "description": "The Field a." + } + }, + "required": [ + "fieldA" + ] + }, + "EntityB": { + "type": "object", + "description": "The type Entity b.", + "properties": { + "entityA": { + "$ref": "#/components/schemas/EntityA", + "description": "The Entity a." + }, + "fieldB": { + "type": "string", + "description": "The Field b." + } + }, + "required": [ + "entityA", + "fieldB" + ] + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app108.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app108.json new file mode 100644 index 000000000..7d44281a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app108.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Update action result.", + "description": "Update action result.", + "operationId": "update", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the action result", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ActionResultVoid" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ActionResultVoid": { + "type": "object", + "properties": { + "errorCode": { + "type": "string", + "description": "The Error code." + }, + "errorValue": { + "type": "object", + "description": "The Error value." + }, + "message": { + "type": "string", + "description": "The Message." + }, + "success": { + "type": "boolean", + "description": "The Success." + }, + "targetUrl": { + "type": "string", + "description": "The Target url." + }, + "value": { + "type": "object", + "description": "The Value." + } + }, + "description": "The type Action result." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app109.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app109.json new file mode 100644 index 000000000..3a7f0f942 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app109.json @@ -0,0 +1,68 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/v1/resource": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets resource.", + "description": "Gets resource.", + "operationId": "getResource", + "responses": { + "200": { + "description": "the resource", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/api/v1/bytearray": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get byte array byte [ ].", + "description": "Get byte array byte [ ].", + "operationId": "getByteArray", + "responses": { + "default": { + "description": "the byte [ ]", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app11.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app11.json new file mode 100644 index 000000000..a41395c23 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app11.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/documents": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Upload documents response entity.", + "description": "Upload documents response entity.", + "operationId": "uploadDocuments", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "doc" + ], + "type": "object", + "properties": { + "doc": { + "type": "array", + "description": "the multipart files", + "items": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/tracks": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Post track string.", + "description": "Post track string.", + "operationId": "postTrack", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "file" + ], + "type": "object", + "properties": { + "file": { + "type": "string", + "description": "the file", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app110.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app110.json new file mode 100644 index 000000000..4c8e48984 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app110.json @@ -0,0 +1,310 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "sample application API", + "description": "description", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "person-controller", + "description": "The type Person controller." + }, + { + "name": "person-controller-2", + "description": "The type Person controller 2." + } + ], + "paths": { + "/person": { + "post": { + "tags": [ + "person-controller" + ], + "summary": "Person person.", + "description": "Person person.", + "operationId": "person", + "requestBody": { + "description": "the person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "500": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "400": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "415": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/person2": { + "post": { + "tags": [ + "person-controller-2" + ], + "summary": "Person person.", + "description": "Person person.", + "operationId": "person_1", + "requestBody": { + "description": "the person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/personByLastName": { + "get": { + "tags": [ + "person-controller" + ], + "summary": "Find by last name list.", + "description": "Find by last name list.", + "operationId": "findByLastName", + "parameters": [ + { + "name": "lastName", + "in": "query", + "description": "the last name", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "500": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "400": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "415": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/personByLastName2": { + "get": { + "tags": [ + "person-controller-2" + ], + "summary": "Find by last name list.", + "description": "Find by last name list.", + "operationId": "findByLastName_1", + "parameters": [ + { + "name": "lastName", + "in": "query", + "description": "the last name", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Problem": { + "type": "object", + "properties": { + "logRef": { + "type": "string", + "description": "The Log ref." + }, + "message": { + "type": "string", + "description": "The Message." + } + }, + "description": "The type Problem." + }, + "ErrorMessage": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "The Errors.", + "items": { + "type": "string" + } + } + }, + "description": "The type Error message." + }, + "Person": { + "required": [ + "lastName" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + }, + "firstName": { + "maxLength": 2147483647, + "minLength": 2, + "type": "string", + "description": "The First name." + }, + "lastName": { + "maxLength": 10, + "minLength": 0, + "type": "string", + "description": "The Last name." + }, + "email": { + "pattern": ".+@.+\\..+", + "type": "string", + "description": "The Email." + }, + "email1": { + "type": "string", + "description": "The Email 1." + }, + "age": { + "maximum": 30, + "minimum": 18, + "type": "integer", + "description": "The Age.", + "format": "int32" + }, + "creditCardNumber": { + "type": "string", + "description": "The Credit card number." + } + }, + "description": "The type Person." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app111.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app111.json new file mode 100644 index 000000000..f55f690ec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app111.json @@ -0,0 +1,223 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "sample application API", + "description": "description", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "person-controller", + "description": "The type Person controller." + }, + { + "name": "person-controller-2", + "description": "The type Person controller 2." + } + ], + "paths": { + "/person": { + "post": { + "tags": [ + "person-controller" + ], + "summary": "Person person.", + "description": "Person person.", + "operationId": "person", + "requestBody": { + "description": "the person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/person2": { + "post": { + "tags": [ + "person-controller-2" + ], + "summary": "Person person.", + "description": "Person person.", + "operationId": "person_1", + "requestBody": { + "description": "the person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/personByLastName": { + "get": { + "tags": [ + "person-controller" + ], + "summary": "Find by last name list.", + "description": "Find by last name list.", + "operationId": "findByLastName", + "parameters": [ + { + "name": "lastName", + "in": "query", + "description": "the last name", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/personByLastName2": { + "get": { + "tags": [ + "person-controller-2" + ], + "summary": "Find by last name list.", + "description": "Find by last name list.", + "operationId": "findByLastName_1", + "parameters": [ + { + "name": "lastName", + "in": "query", + "description": "the last name", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "required": [ + "lastName" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + }, + "firstName": { + "maxLength": 2147483647, + "minLength": 2, + "type": "string", + "description": "The First name." + }, + "lastName": { + "maxLength": 10, + "minLength": 0, + "type": "string", + "description": "The Last name." + }, + "email": { + "pattern": ".+@.+\\..+", + "type": "string", + "description": "The Email." + }, + "email1": { + "type": "string", + "description": "The Email 1." + }, + "age": { + "maximum": 30, + "minimum": 18, + "type": "integer", + "description": "The Age.", + "format": "int32" + }, + "creditCardNumber": { + "type": "string", + "description": "The Credit card number." + } + }, + "description": "The type Person." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app112.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app112.json new file mode 100644 index 000000000..a14264c5e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app112.json @@ -0,0 +1,310 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "sample application API", + "description": "description", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "person-controller", + "description": "The type Person controller." + }, + { + "name": "person-controller-2", + "description": "The type Person controller 2." + } + ], + "paths": { + "/person": { + "post": { + "tags": [ + "person-controller" + ], + "summary": "Person person.", + "description": "Person person.", + "operationId": "person", + "requestBody": { + "description": "the person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/person2": { + "post": { + "tags": [ + "person-controller-2" + ], + "summary": "Person person.", + "description": "Person person.", + "operationId": "person_1", + "requestBody": { + "description": "the person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "500": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "400": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "415": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/personByLastName": { + "get": { + "tags": [ + "person-controller" + ], + "summary": "Find by last name list.", + "description": "Find by last name list.", + "operationId": "findByLastName", + "parameters": [ + { + "name": "lastName", + "in": "query", + "description": "the last name", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "/personByLastName2": { + "get": { + "tags": [ + "person-controller-2" + ], + "summary": "Find by last name list.", + "description": "Find by last name list.", + "operationId": "findByLastName_1", + "parameters": [ + { + "name": "lastName", + "in": "query", + "description": "the last name", + "required": true, + "schema": { + "maxLength": 10, + "minLength": 0, + "type": "string" + } + } + ], + "responses": { + "500": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "400": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "415": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorMessage" + } + } + } + }, + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Problem": { + "type": "object", + "properties": { + "logRef": { + "type": "string", + "description": "The Log ref." + }, + "message": { + "type": "string", + "description": "The Message." + } + }, + "description": "The type Problem." + }, + "ErrorMessage": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "The Errors.", + "items": { + "type": "string" + } + } + }, + "description": "The type Error message." + }, + "Person": { + "required": [ + "lastName" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + }, + "firstName": { + "maxLength": 2147483647, + "minLength": 2, + "type": "string", + "description": "The First name." + }, + "lastName": { + "maxLength": 10, + "minLength": 0, + "type": "string", + "description": "The Last name." + }, + "email": { + "pattern": ".+@.+\\..+", + "type": "string", + "description": "The Email." + }, + "email1": { + "type": "string", + "description": "The Email 1." + }, + "age": { + "maximum": 30, + "minimum": 18, + "type": "integer", + "description": "The Age.", + "format": "int32" + }, + "creditCardNumber": { + "type": "string", + "description": "The Credit card number." + } + }, + "description": "The type Person." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app113.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app113.json new file mode 100644 index 000000000..d0630c655 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app113.json @@ -0,0 +1,85 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/lol": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Test.", + "description": "Test.", + "operationId": "test", + "requestBody": { + "description": "the body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/lol2": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Test 2.", + "description": "Test 2.", + "operationId": "test2", + "requestBody": { + "description": "the body", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Body": { + "type": "object", + "properties": { + "field": { + "type": "string", + "description": "The Field." + } + }, + "description": "The type Body." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app114.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app114.json new file mode 100644 index 000000000..6055c1cb2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app114.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/foos1": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Gets currency.", + "description": "Gets currency.", + "operationId": "getCurrency", + "requestBody": { + "description": "the car dto", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CarDTO" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the currency", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MonetaryAmount" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CarDTO": { + "type": "object", + "description": "The type Car dto.", + "properties": { + "price": { + "$ref": "#/components/schemas/MonetaryAmount", + "description": "The Price." + } + } + }, + "MonetaryAmount": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "example": 99.96 + }, + "currency": { + "type": "string", + "example": "USD" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app115.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app115.json new file mode 100644 index 000000000..052562581 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app115.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/v2/timeout": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Timeouts duration.", + "description": "Timeouts duration.", + "operationId": "timeouts", + "responses": { + "200": { + "description": "the duration", + "content": { + "application/json": { + "schema": { + "type": "string", + "properties": {} + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app116.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app116.json new file mode 100644 index 000000000..31d873938 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app116.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "API Examples", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Operations" + }, + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/foo": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create string.", + "description": "Create string.", + "operationId": "create", + "requestBody": { + "description": "the foo", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app117.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app117.json new file mode 100644 index 000000000..9b3eb4e37 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app117.json @@ -0,0 +1,168 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "greetings-rest-controller", + "description": "The type Greetings rest controller." + }, + { + "name": "person-service", + "description": "The type Person service." + } + ], + "paths": { + "/greet/{name}": { + "get": { + "tags": [ + "greetings-rest-controller" + ], + "summary": "Greet string.", + "description": "Greet string.", + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/people": { + "get": { + "tags": [ + "person-service" + ], + "summary": "All set.", + "description": "All set.", + "operationId": "all", + "responses": { + "200": { + "description": "the set", + "content": { + "*/*": { + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "person-service" + ], + "summary": "Save person.", + "description": "Save person.", + "operationId": "save", + "parameters": [ + { + "name": "p", + "in": "query", + "description": "the p", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/people/{id}": { + "get": { + "tags": [ + "person-service" + ], + "summary": "By id person.", + "description": "By id person.", + "operationId": "byId", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The Name." + } + }, + "description": "The type Person." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app118.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app118.json new file mode 100644 index 000000000..fd1f31a21 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app118.json @@ -0,0 +1,270 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "controller", + "description": "The type Controller." + } + ], + "paths": { + "/class-hierarchy/concrete-parent": { + "post": { + "tags": [ + "controller" + ], + "summary": "Concrete parent response.", + "description": "Concrete parent response.", + "operationId": "concreteParent", + "requestBody": { + "description": "the payload", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete1" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the response", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + }, + "/class-hierarchy/abstract-parent": { + "post": { + "tags": [ + "controller" + ], + "summary": "Abstract parent response.", + "description": "Abstract parent response.", + "operationId": "abstractParent", + "requestBody": { + "description": "the payload", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildOfAbstract1" + }, + { + "$ref": "#/components/schemas/ChildOfAbstract2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the response", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ChildOfConcrete1": { + "allOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The Id." + }, + "concreteChild1Param": { + "type": "string", + "description": "The Concrete child 1 param." + } + } + } + ], + "description": "The type Child of concrete 1." + }, + "ChildOfConcrete2": { + "allOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The Id." + }, + "concreteChild2Param": { + "type": "string", + "description": "The Concrete child 2 param." + } + } + } + ], + "description": "The type Child of concrete 2." + }, + "ConcreteParent": { + "type": "object", + "description": "The type Concrete parent.", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The Id." + }, + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + "AbstractParent": { + "type": "object", + "description": "The type Abstract parent.", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The Id." + }, + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + "ChildOfAbstract1": { + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The Id." + }, + "abstrachChild1Param": { + "type": "string", + "description": "The Abstrach child 1 param." + } + } + } + ], + "description": "The type Child of abstract 1." + }, + "ChildOfAbstract2": { + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The Id." + }, + "abstractChild2Param": { + "type": "string", + "description": "The Abstract child 2 param." + } + } + } + ], + "description": "The type Child of abstract 2." + }, + "Response": { + "type": "object", + "description": "The type Response.", + "properties": { + "abstractParent": { + "description": "The Abstract parent.", + "oneOf": [ + { + "$ref": "#/components/schemas/ChildOfAbstract1" + }, + { + "$ref": "#/components/schemas/ChildOfAbstract2" + } + ] + }, + "concreteParents": { + "type": "array", + "description": "The Concrete parents.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete1" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete2" + } + ] + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app119.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app119.json new file mode 100644 index 000000000..063cfb38f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app119.json @@ -0,0 +1,85 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/multi": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Multiple files and JSON payloads as multi part request", + "description": "Multi files in multi part string.", + "operationId": "multiFilesInMultiPart", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "params": { + "$ref": "#/components/schemas/JsonRequest", + "description": "the json request" + }, + "file1": { + "type": "string", + "format": "binary", + "description": "This is file1" + }, + "file2": { + "type": "string", + "format": "binary", + "description": "This is file2" + } + }, + "required": [ + "params" + ] + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "JsonRequest": { + "type": "object", + "description": "This is the configuration", + "properties": { + "name": { + "type": "string", + "description": "The Name." + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app12.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app12.json new file mode 100644 index 000000000..644c4d966 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app12.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons string.", + "description": "Persons string.", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app120.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app120.json new file mode 100644 index 000000000..ba7fbdb7f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app120.json @@ -0,0 +1,279 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "meta-annotation-controller", + "description": "The type Meta annotation controller." + } + ], + "paths": { + "/testTopLevelParamAnnotationOverrides/{id}": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "summary": "When there is a top level @Parameter annotation it has precedence over the meta-annotation\n So the id parameter should have all the defaults, with a name of \"id\"", + "description": "When there is a top level @Parameter annotation it has precedence over the meta-annotation\n So the id parameter should have all the defaults, with a name of \"id\"", + "operationId": "testTopLevelParamAnnotationOverrides", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "the account id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testQueryParam": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "summary": "Test query param string.", + "description": "Test query param string.", + "operationId": "testQueryParam", + "parameters": [ + { + "name": "accountId", + "in": "query", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": 123456 + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testNoAliasFors/": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "summary": "Test no alias fors string.", + "description": "Test no alias fors string.", + "operationId": "testNoAliasFors", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "desc", + "required": true, + "deprecated": true, + "allowEmptyValue": true, + "style": "deepObject", + "explode": true, + "allowReserved": true, + "schema": { + "type": "boolean" + }, + "example": 1234 + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testMetaMetaAnnotation/{accountId}": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "summary": "Test meta meta annotation string.", + "description": "Test meta meta annotation string.", + "operationId": "testMetaMetaAnnotation", + "parameters": [ + { + "name": "queryAccountId", + "in": "query", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": 123456 + }, + { + "name": "accountId", + "in": "path", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": 123456 + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testAllAttributesAsAlias/": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "summary": "Test all attributes as alias string.", + "description": "Test all attributes as alias string.", + "operationId": "testAllAttributesAsAlias", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "desc", + "required": true, + "deprecated": true, + "allowEmptyValue": true, + "style": "deepObject", + "explode": true, + "allowReserved": true, + "schema": { + "type": "boolean" + }, + "example": 1234 + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/testAliasFor": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "summary": "@AliasFor in the @AccountId annotation allows us to override the default it provides.", + "description": "@AliasFor in the @AccountId annotation allows us to override the default it provides.", + "operationId": "testAliasFor", + "parameters": [ + { + "name": "accountId", + "in": "query", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": "OVERRIDDEN EXAMPLE" + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/simpleTest/{accountId}": { + "get": { + "tags": [ + "meta-annotation-controller" + ], + "summary": "Simple test string.", + "description": "Simple test string.", + "operationId": "simpleTest", + "parameters": [ + { + "name": "accountId", + "in": "path", + "description": "non alias description", + "required": true, + "schema": { + "type": "string" + }, + "example": 123456 + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app121.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app121.json new file mode 100644 index 000000000..ee3fc16e2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app121.json @@ -0,0 +1,217 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "test-controller", + "description": "The type Test controller." + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "test-controller" + ], + "summary": "Gets test.", + "description": "Gets test.", + "operationId": "getTest", + "parameters": [ + { + "name": "param", + "in": "query", + "description": "the param", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "childParam", + "in": "query", + "description": "parameter from child of RequestParams", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam", + "in": "query", + "description": "string parameter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam1", + "in": "query", + "description": "The String param 1.", + "required": false, + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "stringParam2", + "in": "query", + "description": "string parameter2", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "intParam", + "in": "query", + "description": "int parameter", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "intParam2", + "in": "query", + "description": "The Int param 2.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "intParam3", + "in": "query", + "description": "The Int param 3.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param1", + "in": "query", + "description": "nested string parameter", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "nested.param2", + "in": "query", + "description": "nested BigInteger parameter", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "nestedList", + "in": "query", + "description": "The Nested list.", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Nested" + } + } + } + ], + "responses": { + "200": { + "description": "the test", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/InheritedRequestParams" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "InheritedRequestParams": { + "type": "object", + "description": "The type Inherited request params.", + "properties": { + "childParam": { + "type": "string", + "description": "parameter from child of RequestParams" + }, + "intParam": { + "type": "integer", + "format": "int32", + "description": "The Int param." + }, + "intParam2": { + "type": "string", + "description": "The Int param 2." + }, + "intParam3": { + "type": "string", + "description": "The Int param 3." + }, + "nested": { + "$ref": "#/components/schemas/Nested", + "description": "The Nested." + }, + "nestedList": { + "type": "array", + "description": "The Nested list.", + "items": { + "$ref": "#/components/schemas/Nested" + } + }, + "stringParam": { + "type": "string", + "description": "The String param." + }, + "stringParam1": { + "type": "string", + "deprecated": true, + "description": "The String param 1." + }, + "stringParam2": { + "type": "string", + "description": "The String param 2." + } + }, + "required": [ + "childParam" + ] + }, + "Nested": { + "type": "object", + "description": "The type Nested.", + "properties": { + "param1": { + "type": "string", + "description": "The Param 1." + }, + "param2": { + "type": "integer", + "description": "The Param 2." + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app122.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app122.json new file mode 100644 index 000000000..c1649f202 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app122.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "example" + ], + "summary": "create", + "description": "Create response entity.", + "operationId": "create", + "requestBody": { + "description": "the payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WrapperCustomerDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/CustomerDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "CustomerDto": { + "type": "object", + "properties": { + "baseStr": { + "type": "string", + "description": "The Base str." + }, + "customerName": { + "type": "string", + "description": "The Customer name." + } + }, + "description": "The type Customer dto." + }, + "WrapperCustomerDto": { + "type": "object", + "properties": { + "wrapper": { + "type": "string", + "description": "The Wrapper." + } + }, + "description": "The type Wrapper." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app123.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app123.json new file mode 100644 index 000000000..22949db49 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app123.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello/{numTelco}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GET Persons", + "description": "Index t.", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "description": "the num tel", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "description": "the adresse", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "Not here" + }, + "502": { + "description": "the object", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + }, + "418": { + "description": "the t", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app124.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app124.json new file mode 100644 index 000000000..2fb7bf72d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app124.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello/{numTelco}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GET Persons", + "description": "Index t.", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "description": "the num tel", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "description": "the adresse", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "502": { + "description": "the object", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not here" + }, + "418": { + "description": "the t", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app125.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app125.json new file mode 100644 index 000000000..4e5912444 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app125.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/search": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets all pets.", + "description": "Gets all pets.", + "operationId": "getAllPets", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the all pets", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeprecatedEntity" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/DeprecatedEntity" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "DeprecatedEntity": { + "type": "object", + "properties": { + "myNonDeprecatedField": { + "type": "string", + "description": "The My non deprecated field." + }, + "mydeprecatedField": { + "type": "string", + "description": "The Mydeprecated field.", + "deprecated": true + } + }, + "description": "The type Deprecated entity." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app126.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app126.json new file mode 100644 index 000000000..074f383aa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app126.json @@ -0,0 +1,124 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "getAllCurrencies", + "description": "Get all currencies", + "operationId": "getAllCurrencies", + "responses": { + "401": { + "$ref": "#/components/responses/http401NoToken" + }, + "403": { + "$ref": "#/components/responses/http403" + }, + "200": { + "description": "All currencies returned", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Problem": { + "type": "object", + "properties": { + "instance": { + "type": "string", + "description": "An absolute URI that identifies the specific occurrence of the problem.\n It may or may not yield further information if dereferenced.", + "format": "uri" + }, + "type": { + "type": "string", + "description": "An absolute URI that identifies the problem type. When dereferenced,\n it SHOULD provide human-readable documentation for the problem type\n (e.g., using HTML). When this member is not present, its value is\n assumed to be \"about:blank\".", + "format": "uri" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "description": "Optional, additional attributes of the problem. Implementations can choose to ignore this in favor of concrete,\n typed fields." + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem type. It SHOULD NOT\n change from occurrence to occurrence of the problem, except for\n purposes of localisation." + }, + "detail": { + "type": "string", + "description": "A human readable explanation specific to this occurrence of the problem." + }, + "status": { + "type": "integer", + "description": "The HTTP status code generated by the origin server for this\n occurrence of the problem.", + "format": "int32" + } + }, + "description": "The interface Problem." + } + }, + "responses": { + "http401NoToken": { + "description": "Invalid authentication.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "http401BadToken": { + "description": "Invalid authentication.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "http403": { + "description": "Missing authorities.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app129.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app129.json new file mode 100644 index 000000000..5a15e9a9c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app129.json @@ -0,0 +1,94 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/test": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Update deferred result.", + "description": "Update deferred result.", + "operationId": "update", + "parameters": [ + { + "name": "userId", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "registrationId", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "the entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActualReturnedEntity" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the deferred result", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/OperationResponseActualReturnedEntity" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ActualReturnedEntity": { + "type": "object", + "properties": { + "result": { + "type": "string", + "description": "The Result." + } + }, + "description": "The type Actual returned entity." + }, + "OperationResponseActualReturnedEntity": { + "type": "object", + "properties": { + "operationResult": { + "type": "string", + "description": "The Operation result." + } + }, + "description": "The type Operation response." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app13.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app13.json new file mode 100644 index 000000000..f3326e31e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app13.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons string.", + "description": "Persons string.", + "operationId": "persons", + "parameters": [ + { + "name": "dto", + "in": "query", + "description": "the dto", + "required": true, + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "first_name": { + "type": "string", + "description": "The First name." + }, + "last_name": { + "type": "string", + "description": "The Last name." + } + }, + "description": "The type Person dto." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app130.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app130.json new file mode 100644 index 000000000..bf95352ef --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app130.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/values/data": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "List tracker data.", + "description": "List tracker data.", + "operationId": "list", + "responses": { + "200": { + "description": "the tracker data", + "content": {} + } + } + } + }, + "/values/datakk": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get tracker data.", + "description": "Get tracker data.", + "operationId": "get", + "responses": { + "200": { + "description": "the tracker data", + "content": {} + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app131.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app131.json new file mode 100644 index 000000000..400b31edc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app131.json @@ -0,0 +1,114 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/organizations": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create the organization", + "description": "Create the organization", + "operationId": "createOrganization", + "requestBody": { + "description": "the organization", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid argument", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + }, + "500": { + "description": "An error has occurred and the request could not be processed at this time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + }, + "409": { + "description": "An organization with the specified ID already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + }, + "204": { + "description": "The organization was created successfully" + } + } + } + } + }, + "components": { + "schemas": { + "Organization": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Universally Unique Identifier (UUID) uniquely identifying the organization", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "The name of the organization" + } + }, + "description": "This is the description being overwritten" + }, + "RestControllerError": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Id." + }, + "message": { + "type": "string", + "description": "The Message." + } + }, + "description": "The type Rest controller error." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app132.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app132.json new file mode 100644 index 000000000..89b68d8b3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app132.json @@ -0,0 +1,114 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/organizations": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create the organization", + "description": "Create the organization", + "operationId": "createOrganization", + "requestBody": { + "description": "the organization", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid argument", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + }, + "409": { + "description": "An organization with the specified ID already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + }, + "204": { + "description": "The organization was created successfully" + }, + "500": { + "description": "An error has occurred and the request could not be processed at this time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestControllerError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Organization": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Universally Unique Identifier (UUID) uniquely identifying the organization", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "The name of the organization" + } + }, + "description": "i want to override the description of this object" + }, + "RestControllerError": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Id." + }, + "message": { + "type": "string", + "description": "The Message." + } + }, + "description": "The type Rest controller error." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app133.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app133.json new file mode 100644 index 000000000..40a919757 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app133.json @@ -0,0 +1,125 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets message from header 1.", + "description": "Gets message from header 1.", + "operationId": "getMessageFromHeader1", + "parameters": [ + { + "name": "myHeader", + "in": "header", + "description": "A header", + "required": true, + "schema": { + "type": "string", + "enum": [ + "foo", + "bar" + ] + } + } + ], + "responses": { + "200": { + "description": "the message from header 1", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets message from header 2.", + "description": "Gets message from header 2.", + "operationId": "getMessageFromHeader2", + "parameters": [ + { + "name": "myHeader", + "in": "header", + "description": "A header", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "the message from header 2", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets message from header 3.", + "description": "Gets message from header 3.", + "operationId": "getMessageFromHeader3", + "parameters": [ + { + "name": "myHeader", + "in": "header", + "description": "A header", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "the message from header 3", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-1.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-1.json new file mode 100644 index 000000000..bf940a24a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-1.json @@ -0,0 +1,72 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{id}": { + "get": { + "tags": [ + "The sample resource" + ], + "description": "Get the sample by its id.", + "operationId": "getSampleV1", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The sample's id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "the sample v 1", + "content": { + "application/vnd.samples.v1+json": { + "schema": { + "$ref": "#/components/schemas/SampleV1" + } + } + } + } + }, + "deprecated": true + } + } + }, + "components": { + "schemas": { + "SampleV1": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Id." + } + }, + "description": "The type Sample v 1." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-2.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-2.json new file mode 100644 index 000000000..0c4158920 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-2.json @@ -0,0 +1,139 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "post": { + "tags": [ + "The sample resource" + ], + "description": "Searches for sample objects using the given search request.", + "operationId": "searchSamples", + "requestBody": { + "description": "the search request", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "$ref": "#/components/schemas/SampleSearchRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the list", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SampleV2" + } + } + } + } + } + } + } + }, + "/{id}": { + "get": { + "tags": [ + "The sample resource" + ], + "description": "Get the sample by its id. This represents V2.", + "operationId": "getSampleV2", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The sample's id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "Accept-version", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "v2" + ] + } + }, + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "the sample v 2", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "$ref": "#/components/schemas/SampleV1" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SampleSearchRequest": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + } + }, + "description": "The type Sample search request." + }, + "SampleV2": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + } + }, + "description": "The type Sample v 2." + }, + "SampleV1": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Id." + } + }, + "description": "The type Sample v 1." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-3.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-3.json new file mode 100644 index 000000000..bf940a24a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-3.json @@ -0,0 +1,72 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{id}": { + "get": { + "tags": [ + "The sample resource" + ], + "description": "Get the sample by its id.", + "operationId": "getSampleV1", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The sample's id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "the sample v 1", + "content": { + "application/vnd.samples.v1+json": { + "schema": { + "$ref": "#/components/schemas/SampleV1" + } + } + } + } + }, + "deprecated": true + } + } + }, + "components": { + "schemas": { + "SampleV1": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Id." + } + }, + "description": "The type Sample v 1." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-4.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-4.json new file mode 100644 index 000000000..94eb50ce5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-4.json @@ -0,0 +1,82 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/{id}": { + "get": { + "tags": [ + "The sample resource" + ], + "description": "Get the sample by its id. This represents V2.", + "operationId": "getSampleV2", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The sample's id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "Accept-version", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "v2" + ] + } + }, + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "the sample v 2", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "$ref": "#/components/schemas/SampleV1" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SampleV1": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Id." + } + }, + "description": "The type Sample v 1." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-5.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-5.json new file mode 100644 index 000000000..4fb26c92f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app134-5.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/search": { + "post": { + "tags": [ + "The sample resource" + ], + "description": "Searches for sample objects using the given search request.", + "operationId": "searchSamples", + "requestBody": { + "description": "the search request", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "$ref": "#/components/schemas/SampleSearchRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the list", + "content": { + "application/vnd.samples.v2+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SampleV2" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SampleSearchRequest": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + } + }, + "description": "The type Sample search request." + }, + "SampleV2": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + } + }, + "description": "The type Sample v 2." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app135.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app135.json new file mode 100644 index 000000000..5670536e4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app135.json @@ -0,0 +1,428 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "book-repository", + "description": "The type Book repository." + } + ], + "paths": { + "/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll_3", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor_3", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll_1", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor_1", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll_4", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor_4", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll_2", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor_2", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "properties": { + "author": { + "type": "string", + "description": "The Author." + }, + "id": { + "type": "string", + "description": "The Id." + }, + "title": { + "type": "string", + "description": "The Title." + } + }, + "description": "The type Book." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app137.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app137.json new file mode 100644 index 000000000..26dcfbd38 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app137.json @@ -0,0 +1,67 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "My App", + "description": "Some long and useful description", + "version": "v1" + }, + "servers": [ + { + "url": "http://test.toto.com", + "description": "toto desc" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test.", + "description": "Test.", + "operationId": "test", + "parameters": [ + { + "name": "hello", + "in": "query", + "description": "the hello", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "security_auth": [] + } + ] + } + } + }, + "components": { + "securitySchemes": { + "security_auth": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "http://authorization.url", + "tokenUrl": "http://token.url", + "scopes": {} + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app138.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app138.json new file mode 100644 index 000000000..8ac947fc2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app138.json @@ -0,0 +1,74 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/testA": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test a.", + "description": "Test a.", + "operationId": "testA", + "parameters": [ + { + "name": "hello", + "in": "query", + "description": "the hello", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/testB": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test b.", + "description": "Test b.", + "operationId": "testB", + "parameters": [ + { + "name": "hello", + "in": "query", + "description": "the hello", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app139.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app139.json new file mode 100644 index 000000000..2c67c92d1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app139.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Echo 1 string.", + "description": "Echo 1 string.", + "operationId": "echo1", + "parameters": [ + { + "name": "text", + "in": "query", + "description": "the text", + "required": false, + "schema": { + "type": "string", + "default": "default-text" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Echo 2 string.", + "description": "Echo 2 string.", + "operationId": "echo2", + "parameters": [ + { + "name": "text", + "in": "query", + "description": "the text", + "required": false, + "schema": { + "type": "string", + "default": "default-text" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app14.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app14.json new file mode 100644 index 000000000..cae257649 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app14.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Demo 2 http entity.", + "description": "Demo 2 http entity.", + "operationId": "demo2", + "responses": { + "200": { + "description": "the http entity", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons.", + "description": "Persons.", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app140.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app140.json new file mode 100644 index 000000000..9b3eb4e37 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app140.json @@ -0,0 +1,168 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "greetings-rest-controller", + "description": "The type Greetings rest controller." + }, + { + "name": "person-service", + "description": "The type Person service." + } + ], + "paths": { + "/greet/{name}": { + "get": { + "tags": [ + "greetings-rest-controller" + ], + "summary": "Greet string.", + "description": "Greet string.", + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/people": { + "get": { + "tags": [ + "person-service" + ], + "summary": "All set.", + "description": "All set.", + "operationId": "all", + "responses": { + "200": { + "description": "the set", + "content": { + "*/*": { + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "person-service" + ], + "summary": "Save person.", + "description": "Save person.", + "operationId": "save", + "parameters": [ + { + "name": "p", + "in": "query", + "description": "the p", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/people/{id}": { + "get": { + "tags": [ + "person-service" + ], + "summary": "By id person.", + "description": "By id person.", + "operationId": "byId", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The Name." + } + }, + "description": "The type Person." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app141.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app141.json new file mode 100644 index 000000000..edf3839a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app141.json @@ -0,0 +1,428 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "book-repository", + "description": "The type Book repository." + } + ], + "paths": { + "/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll_1", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor_1", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll_2", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/test/greeter/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor_2", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll_3", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor_3", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find all list.", + "description": "Find all list.", + "operationId": "findAll_4", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + }, + "text/plain": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + }, + "/greeter2/books/{author}": { + "get": { + "tags": [ + "book-repository" + ], + "summary": "Find by author list.", + "description": "Find by author list.", + "operationId": "findByAuthor_4", + "parameters": [ + { + "name": "author", + "in": "path", + "description": "the author", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Book" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Book": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Id." + }, + "title": { + "type": "string", + "description": "The Title." + }, + "author": { + "type": "string", + "description": "The Author." + } + }, + "description": "The type Book." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app142.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app142.json new file mode 100644 index 000000000..9b3eb4e37 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app142.json @@ -0,0 +1,168 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "greetings-rest-controller", + "description": "The type Greetings rest controller." + }, + { + "name": "person-service", + "description": "The type Person service." + } + ], + "paths": { + "/greet/{name}": { + "get": { + "tags": [ + "greetings-rest-controller" + ], + "summary": "Greet string.", + "description": "Greet string.", + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/people": { + "get": { + "tags": [ + "person-service" + ], + "summary": "All set.", + "description": "All set.", + "operationId": "all", + "responses": { + "200": { + "description": "the set", + "content": { + "*/*": { + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "person-service" + ], + "summary": "Save person.", + "description": "Save person.", + "operationId": "save", + "parameters": [ + { + "name": "p", + "in": "query", + "description": "the p", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "/people/{id}": { + "get": { + "tags": [ + "person-service" + ], + "summary": "By id person.", + "description": "By id person.", + "operationId": "byId", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "the person", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The Name." + } + }, + "description": "The type Person." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app149.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app149.json new file mode 100644 index 000000000..d66a10160 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app149.json @@ -0,0 +1,106 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "To test the case a user does not use @RestController but puts @Operation on handler methods\n and wants these methods to be exposed." + } + ], + "paths": { + "/message": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Message hello message.", + "description": "Message hello message.", + "operationId": "message", + "responses": { + "200": { + "description": "the hello message", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloMessage" + } + } + } + } + } + } + }, + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Hello string.", + "description": "Hello string.", + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloMessage" + } + } + } + } + } + } + }, + "/helloModelAndView": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Hello model and view model and view.", + "description": "Hello model and view model and view.", + "operationId": "helloModelAndView", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/HelloMessage" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloMessage": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "The Text." + }, + "number": { + "type": "integer", + "description": "The Number.", + "format": "int32" + } + }, + "description": "The type Hello message." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app15.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app15.json new file mode 100644 index 000000000..79ce6ed95 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app15.json @@ -0,0 +1,47 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "My title", + "description": "My description", + "termsOfService": "My terms", + "contact": { + "email": "My contact email", + "name": "My contact name", + "url": "My contact url" + }, + "license": { + "name": "My license name", + "url": "My license url" + }, + "version": "My version" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "My Desc", + "operationId": "persons", + "responses": { + "200": { + "description": "the json object" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app150.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app150.json new file mode 100644 index 000000000..af4081757 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app150.json @@ -0,0 +1,137 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test/": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test.", + "description": "Test.", + "operationId": "test", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + } + ], + "responses": { + "204": { + "description": "No content" + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test 1.", + "description": "Test 1.", + "operationId": "test1", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": true, + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "No content" + } + } + } + }, + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test 3.", + "description": "Test 3.", + "operationId": "test3", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "users", + "123" + ] + } + } + ], + "responses": { + "204": { + "description": "No content" + } + } + } + }, + "/test4": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test 4.", + "description": "Test 4.", + "operationId": "test4", + "parameters": [ + { + "name": "localDate", + "in": "query", + "description": "the local date", + "required": false, + "schema": { + "type": "string", + "format": "date" + } + } + ], + "responses": { + "204": { + "description": "No content" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app151.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app151.json new file mode 100644 index 000000000..9bdb7292d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app151.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test int.", + "description": "Test int.", + "operationId": "test", + "responses": { + "200": { + "description": "the int", + "content": { + "*/*": { + "schema": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app152.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app152.json new file mode 100644 index 000000000..f752800dc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app152.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Hello world string.", + "description": "Hello world string.", + "operationId": "helloWorld", + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app153.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app153.json new file mode 100644 index 000000000..55649f6fe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app153.json @@ -0,0 +1,60 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "test-controller", + "description": "The type Test controller." + } + ], + "paths": { + "/orders": { + "get": { + "tags": [ + "test-controller" + ], + "summary": "Method object.", + "description": "Method object.", + "operationId": "method", + "parameters": [ + { + "name": "state", + "in": "query", + "description": "the order state", + "required": false, + "schema": { + "type": "string", + "default": "finished", + "enum": [ + "finished", + "new" + ] + } + } + ], + "responses": { + "200": { + "description": "the object", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app154.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app154.json new file mode 100644 index 000000000..caeb96bf3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app154.json @@ -0,0 +1,194 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "toto", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "security": [ + { + "basicAuth": [] + }, + { + "bearerToken": [] + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/personsone": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Createone.", + "description": "Createone.", + "operationId": "createone", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "the id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "the o", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/persons": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create.", + "description": "Create.", + "operationId": "create", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "the id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "description": "the o", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/createtwo": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Createtwo.", + "description": "Createtwo.", + "operationId": "createtwo", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "the id", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/createthree": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Createthree.", + "description": "Createthree.", + "operationId": "createthree", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "the id", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Hello string.", + "description": "Hello string.", + "operationId": "hello", + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "bearerToken": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + }, + "basicAuth": { + "type": "http", + "scheme": "basic" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app155.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app155.json new file mode 100644 index 000000000..bb98b0a84 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app155.json @@ -0,0 +1,133 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Say hello response entity.", + "description": "Say hello response entity.", + "operationId": "sayHello_1", + "parameters": [ + { + "name": "primitiveConcreteField", + "in": "query", + "description": "The Primitive concrete field.", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "primitiveBaseField", + "in": "query", + "description": "The Primitive base field.", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "genericField", + "in": "query", + "description": "The Generic field.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ONE", + "TWO" + ] + } + } + ], + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Say hello response entity.", + "description": "Say hello response entity.", + "operationId": "sayHello", + "parameters": [ + { + "name": "primitiveConcreteField", + "in": "query", + "description": "The Primitive concrete field.", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "primitiveBaseField", + "in": "query", + "description": "The Primitive base field.", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "genericField", + "in": "query", + "description": "The Generic field.", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app156.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app156.json new file mode 100644 index 000000000..f36d91205 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app156.json @@ -0,0 +1,80 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Hello string.", + "description": "Hello string.", + "operationId": "hello", + "parameters": [ + { + "name": "someEnums", + "in": "query", + "description": "SomeEum decs", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "FIRST", + "SECOND" + ] + } + } + }, + { + "name": "textSet", + "in": "query", + "description": "First decs", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "someText", + "in": "query", + "description": "Second decs", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app157.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app157.json new file mode 100644 index 000000000..cf4bea57e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app157.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "API Examples", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Operations" + } + ], + "paths": { + "/api/foo": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "409": { + "description": "Conflict", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorDTO" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SimpleDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorDTO": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "SimpleDTO": { + "type": "object", + "properties": { + "payload": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app158.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app158.json new file mode 100644 index 000000000..add523316 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app158.json @@ -0,0 +1,80 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "API Examples", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Operations" + }, + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/foo": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Hello simple dto.", + "description": "Hello simple dto.", + "operationId": "hello", + "responses": { + "200": { + "description": "the simple dto", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SimpleDTO" + } + } + } + }, + "409": { + "description": "the error dto", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorDTO": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The Message." + } + }, + "description": "The type Error dto." + }, + "SimpleDTO": { + "type": "object", + "properties": { + "payload": { + "type": "string", + "description": "The Payload." + } + }, + "description": "The type Simple dto." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app159.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app159.json new file mode 100644 index 000000000..f8505d1d4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app159.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "API Examples", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Operations" + }, + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/foo": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create string.", + "description": "Create string.", + "operationId": "create", + "requestBody": { + "description": "the foo", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/FooBean_View2" + } + } + } + }, + "500": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/FooBean_View1" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "FooBean_View1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "The Code.", + "format": "int32" + } + }, + "description": "The type Foo bean." + }, + "FooBean_View2": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "The Code.", + "format": "int32" + }, + "message": { + "type": "string", + "description": "The Message." + } + }, + "description": "The type Foo bean." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app160.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app160.json new file mode 100644 index 000000000..e15cd7999 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app160.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Do something interesting error response.", + "description": "Do something interesting error response.", + "operationId": "doSomethingInteresting", + "responses": { + "200": { + "description": "the error response", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorResponse": { + "required": [ + "errorCode" + ], + "type": "object", + "properties": { + "errorCode": { + "type": "integer", + "description": "titi", + "format": "int32" + }, + "errorMessage": { + "type": "string", + "description": "tata" + } + }, + "description": "toto" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app161.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app161.json new file mode 100644 index 000000000..169dd28af --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app161.json @@ -0,0 +1,132 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/add": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "add", + "description": "Add response entity.", + "operationId": "add", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "content" + ], + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "content" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "the response entity" + } + } + } + }, + "/add2": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "add2", + "description": "Add 2 response entity.", + "operationId": "add2", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "content", + "type" + ], + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "content" + }, + "type": { + "type": "string", + "description": "the type" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "the response entity" + } + } + } + }, + "/": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "test", + "description": "Test.", + "operationId": "test", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "intValue", + "strValue" + ], + "type": "object", + "properties": { + "strValue": { + "type": "string", + "description": "the str value" + }, + "intValue": { + "type": "integer", + "description": "the int value", + "format": "int32" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app162.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app162.json new file mode 100644 index 000000000..9df83bcf3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app162.json @@ -0,0 +1,343 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "SpringShop API", + "description": "The description of the api", + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "javadoc-only-rest-controller", + "description": "This is the JavadocOnlyRestController class javadoc." + } + ], + "paths": { + "/javadoc-only/{guid}": { + "get": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the find method's javadoc.", + "description": "This is the find method's javadoc.\n The method's signature: #find(String)", + "operationId": "find", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "the @param guid javadoc for the #find(String) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "the @throws NoResultException javadoc for the #find(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #find(String) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + }, + "put": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the update method's javadoc.", + "description": "This is the update method's javadoc.\n The method's signature: #update(String, JavadocOnlyRestDto)", + "operationId": "update", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "the @param input javadoc for the #update(String, JavadocOnlyRestDto) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #update(String, JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + }, + "/javadoc-only": { + "get": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the list method's javadoc.", + "description": "This is the list method's javadoc.\n The method's signature: #list()", + "operationId": "list", + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #list() method", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the create method's javadoc.", + "description": "This is the create method's javadoc.\n The method's signature: #create(JavadocOnlyRestDto)", + "operationId": "create", + "requestBody": { + "description": "the @param input javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NonUniqueResultException" + ] + }, + "201": { + "description": "the @return javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + }, + "/javadoc-only/startsBy/{prefix}": { + "get": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the findStartsBy method's javadoc.", + "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", + "operationId": "findStartsBy", + "parameters": [ + { + "name": "prefix", + "in": "path", + "description": "the @param prefix javadoc for the #findStartsBy(String) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "the @throws NoResultException javadoc for the #findStartsBy(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NoResultException" + ] + }, + "400": { + "description": "the @throws NonUniqueResultException javadoc for the #findStartsBy(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app162.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #findStartsBy(String) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "JavadocOnlyRestDto": { + "type": "object", + "description": "This is the JavadocOnlyRestDto class javadoc.", + "properties": { + "guid": { + "type": "string", + "description": "This is the private #guid field's javadoc." + }, + "inner": { + "$ref": "#/components/schemas/JavadocOnlyStaticInnerRestDto", + "description": "This is the private #inner field's javadoc.\n\n This javadoc description is ignored by the REST documentation:\n the $ref can't have a description as any sibling elements of a $ref are ignored." + } + } + }, + "JavadocOnlyStaticInnerRestDto": { + "type": "object", + "description": "This is the JavadocOnlyStaticInnerRestDto class javadoc.", + "properties": { + "content": { + "type": "string", + "description": "This is the private #content field's javadoc." + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app163.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app163.json new file mode 100644 index 000000000..dd3c086cc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app163.json @@ -0,0 +1,228 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "SpringShop API", + "description": "The description of the api", + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "annotation-override", + "description": "Description for the tag." + } + ], + "paths": { + "/annotation-override/{guid}": { + "put": { + "tags": [ + "annotation-override" + ], + "summary": "Summary for #update(String, AnnotationOverrideForJavadocRestDto)", + "description": "This is the update method's javadoc.\n The method's signature: #update(String, AnnotationOverrideForJavadocRestDto)", + "operationId": "update", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "the @param input javadoc for the #update(String, AnnotationOverrideForJavadocRestDto) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app163.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app163.exception.NonUniqueResultException" + ] + }, + "200": { + "description": "the @return javadoc for the #update(String, AnnotationOverrideForJavadocRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + } + } + } + } + }, + "/annotation-override": { + "post": { + "tags": [ + "annotation-override" + ], + "summary": "Summary for #create(AnnotationOverrideForJavadocRestDto)", + "description": "Description for #create(AnnotationOverrideForJavadocRestDto)", + "operationId": "create", + "requestBody": { + "description": "Request body for #create(AnnotationOverrideForJavadocRestDto)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app163.exception.NoResultException" + ] + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app163.exception.NonUniqueResultException" + ] + }, + "default": { + "description": "API Response 201 for #create(AnnotationOverrideForJavadocRestDto)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + } + } + } + } + }, + "/annotation-override/startsBy/{prefix}": { + "get": { + "tags": [ + "annotation-override" + ], + "summary": "This is the findStartsBy method's javadoc.", + "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", + "operationId": "findStartsBy", + "parameters": [ + { + "name": "prefix", + "in": "path", + "description": "Parameter prefix", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "the @throws NoResultException javadoc for the #findStartsBy(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-exception-class": [ + "test.org.springdoc.api.v31.app163.exception.NoResultException" + ] + }, + "400": { + "description": "API Response 400 for #findStartsBy(prefix)" + }, + "200": { + "description": "API Response 200 for #findStartsBy(prefix)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AnnotationOverrideForJavadocRestDto": { + "type": "object", + "description": "Description for the tag.", + "properties": { + "guid": { + "type": "string", + "description": "Description for the #guid field" + }, + "inner": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocStaticInnerRestDto", + "description": "This is the private #inner field's javadoc.\n

\n This javadoc description is ignored by the REST documentation:\n the $ref can't have a description as any sibling elements of a $ref are ignored." + } + }, + "title": "annotation-override-dto" + }, + "AnnotationOverrideForJavadocStaticInnerRestDto": { + "type": "object", + "description": "This is the AnnotationOverrideForJavadocStaticInnerRestDto class javadoc.", + "properties": { + "content": { + "type": "string", + "description": "This is the private #content field's javadoc." + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app164.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app164.json new file mode 100644 index 000000000..f4030bb2a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app164.json @@ -0,0 +1,129 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "SpringShop API", + "description": "The description of the api", + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "no-generic-override-rest-controller", + "description": "This is the JavadocOnlyRestController class javadoc." + } + ], + "paths": { + "/no-generic-override": { + "post": { + "tags": [ + "no-generic-override-rest-controller" + ], + "summary": "This is the create method's javadoc.", + "description": "This is the create method's javadoc.\n The method's signature: #create(JavadocOnlyRestDto)", + "operationId": "create", + "requestBody": { + "description": "the @param input javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "201": { + "description": "the @return javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/no-generic-override/startsBy/{prefix}": { + "get": { + "tags": [ + "no-generic-override-rest-controller" + ], + "summary": "This is the findStartsBy method's javadoc.", + "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", + "operationId": "findStartsBy", + "parameters": [ + { + "name": "prefix", + "in": "path", + "description": "the @param prefix javadoc for the #findStartsBy(String) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "the @return javadoc for the #findStartsBy(String) method", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app166.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app166.json new file mode 100644 index 000000000..d0b75a178 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app166.json @@ -0,0 +1,175 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/nested": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "nested", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Returns the name of the outer class", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "innerClass.innerInnerClass.name", + "in": "query", + "description": "Returns the name of the inner inner class", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "innerClass.innerInnerClass.maxNumber", + "in": "query", + "description": "Returns the maxNumber of the inner inner class", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "innerClass.name", + "in": "query", + "description": "Returns the boolean name", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "innerClass.maxNumber", + "in": "query", + "description": "Returns the max number", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/nestedTypeErasureGeneric": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "nestedTypeErasureGeneric", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Returns name", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/nestedReifiableGeneric": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "nestedReifiableGeneric", + "parameters": [ + { + "name": "topName", + "in": "query", + "description": "Return the top name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "description": "Returns name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "child.firstName", + "in": "query", + "description": "Returns the first name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "child.maxNumber", + "in": "query", + "description": "Returns the max number", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app167.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app167.json new file mode 100644 index 000000000..434414a9c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app167.json @@ -0,0 +1,101 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/process": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "process", + "responses": { + "200": { + "description": "OK" + } + } + }, + "put": { + "tags": [ + "hello-controller" + ], + "operationId": "process_2", + "responses": { + "200": { + "description": "OK" + } + } + }, + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "process_1", + "responses": { + "200": { + "description": "OK" + } + } + }, + "delete": { + "tags": [ + "hello-controller" + ], + "operationId": "process_3", + "responses": { + "200": { + "description": "OK" + } + } + }, + "options": { + "tags": [ + "hello-controller" + ], + "operationId": "process_6", + "responses": { + "200": { + "description": "OK" + } + } + }, + "head": { + "tags": [ + "hello-controller" + ], + "operationId": "process_5", + "responses": { + "200": { + "description": "OK" + } + } + }, + "patch": { + "tags": [ + "hello-controller" + ], + "operationId": "process_4", + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app168.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app168.json new file mode 100644 index 000000000..34d5caa2a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app168.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "description-field-in-request-body-is-null-controller", + "description": "If the RequestBody description field is null, get the description from the javadoc." + } + ], + "paths": { + "/description-in-requestbody-is-null": { + "post": { + "tags": [ + "description-field-in-request-body-is-null-controller" + ], + "operationId": "person", + "summary": "Person person.", + "description": "Person person.", + "operationId": "person", + "requestBody": { + "description": "the person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int64" + } + }, + "description": "The type Person." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app169.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app169.json new file mode 100644 index 000000000..2e8475681 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app169.json @@ -0,0 +1,98 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/record": { + "get": { + "tags": [ + "record-controller" + ], + "operationId": "index", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name of the outer class", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "simpleInnerClass.name", + "in": "query", + "description": "the boolean name", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "simpleInnerClass.maxNumber", + "in": "query", + "description": "the max number", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SimpleOuterClass" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SimpleInnerClass": { + "type": "object", + "description": "simple inner class", + "properties": { + "maxNumber": { + "type": "integer", + "format": "int32", + "description": "the max number" + }, + "name": { + "type": "boolean", + "description": "the boolean name" + } + } + }, + "SimpleOuterClass": { + "type": "object", + "description": "simple outer class", + "properties": { + "name": { + "type": "string", + "description": "the name of the outer class" + }, + "simpleInnerClass": { + "$ref": "#/components/schemas/SimpleInnerClass", + "description": "the inner class" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app17.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app17.json new file mode 100644 index 000000000..90b470867 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app17.json @@ -0,0 +1,50 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons.", + "description": "Persons.", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name", + "required": true, + "schema": { + "maxLength": 6, + "minLength": 4, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app170.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app170.json new file mode 100644 index 000000000..f95d8ba43 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app170.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test1": { + "get": { + "tags": [ + "basic-controller" + ], + "summary": "get1", + "description": "Provides an animal.", + "operationId": "get1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Cat" + }, + { + "$ref": "#/components/schemas/Dog" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Animal": { + "type": "object", + "description": "Represents an Animal class." + }, + "Cat": { + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "speed": { + "type": "integer", + "format": "int32" + } + } + } + ] + }, + "Dog": { + "allOf": [ + { + "$ref": "#/components/schemas/Animal" + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + } + } + ], + "description": "Represents a Dog class." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app171.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app171.json new file mode 100644 index 000000000..f862b1ea4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app171.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "PersonProjection interface.", + "description": "PersonProjection interface.", + "operationId": "persons", + "responses": { + "200": { + "description": "the PersonProjection", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonProjection" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonProjection" : { + "type" : "object", + "properties" : { + "email" : { + "type" : "string", + "description" : "The Email." + }, + "firstName" : { + "type" : "string", + "description" : "The First name." + }, + "lastName" : { + "type" : "string", + "description" : "The Last name." + } + }, + "description" : "The type PersonProjection dto interface." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app173.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app173.json new file mode 100644 index 000000000..c6c1539cc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app173.json @@ -0,0 +1,132 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "example-controller", + "description": "The Example Controller" + } + ], + "paths": { + "/example": { + "put": { + "tags": [ + "example-controller" + ], + "summary": "update example", + "description": "Allows to update an example", + "operationId": "putExample", + "requestBody": { + "description": "Default description for example", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Example" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "uuid" + } + } + } + } + } + }, + "post": { + "tags": [ + "example-controller" + ], + "summary": "insert example", + "description": "Allows to insert an example", + "operationId": "postExample", + "requestBody": { + "description": "The example object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Example" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "uuid" + } + } + } + } + } + }, + "patch": { + "tags": [ + "example-controller" + ], + "summary": "patch example", + "description": "Allows to patch an example", + "operationId": "patchExample", + "requestBody": { + "description": "Description without the use of variables", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Example" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "uuid" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Example": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "description": "The Example object" + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app174.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app174.json new file mode 100644 index 000000000..b15e95920 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app174.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "example-controller", + "description": "The Example Controller" + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "example-controller" + ], + "operationId": "post", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Test" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Question": { + "type": "object", + "description": "The type Question.", + "discriminator": { + "propertyName": "type" + }, + "properties": { + "question": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "Test": { + "type": "object", + "description": "The type Test.", + "properties": { + "questions": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TestQuestion" + }, + { + "$ref": "#/components/schemas/TextQuestion" + } + ] + } + } + } + }, + "TestQuestion": { + "allOf": [ + { + "$ref": "#/components/schemas/Question" + }, + { + "type": "object", + "properties": { + "variants": { + "type": "array", + "description": "list of variants", + "items": { + "type": "string" + } + }, + "answer": { + "type": "integer", + "format": "int32", + "description": "correct answer" + } + } + } + ], + "description": "The type Test question." + }, + "TextQuestion": { + "allOf": [ + { + "$ref": "#/components/schemas/Question" + }, + { + "type": "object", + "properties": { + "answer": { + "type": "string" + } + } + } + ], + "description": "The type Text question." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app18.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app18.json new file mode 100644 index 000000000..af987cb87 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app18.json @@ -0,0 +1,224 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons string.", + "description": "Persons string.", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons6": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons 6 string.", + "description": "Persons 6 string.", + "operationId": "persons6", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "persons name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons5": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons 5 string.", + "description": "Persons 5 string.", + "operationId": "persons5", + "parameters": [ + { + "name": "age", + "in": "query", + "description": "the age", + "required": true, + "schema": { + "maximum": 0, + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons4": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons 4 string.", + "description": "Persons 4 string.", + "operationId": "persons4", + "parameters": [ + { + "name": "age", + "in": "query", + "description": "the age", + "required": true, + "schema": { + "minimum": 0, + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons3": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons 3 string.", + "description": "Persons 3 string.", + "operationId": "persons3", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "persons name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons 2 string.", + "description": "Persons 2 string.", + "operationId": "persons2", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "persons name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app19.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app19.json new file mode 100644 index 000000000..615738628 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app19.json @@ -0,0 +1,119 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Persons string.", + "description": "Persons string.", + "operationId": "persons", + "requestBody": { + "description": "requestBody description as parameter", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons3": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Persons 3 string.", + "description": "Persons 3 string.", + "operationId": "persons3", + "requestBody": { + "description": "requestBody inside operation annotation", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons2": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Persons 2 string.", + "description": "Persons 2 string.", + "operationId": "persons2", + "requestBody": { + "description": "requestBody description outside", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app2.json new file mode 100644 index 000000000..efe180514 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app2.json @@ -0,0 +1,1305 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "user", + "description": "the user API" + }, + { + "name": "pet", + "description": "the pet API" + }, + { + "name": "store", + "description": "the store API" + } + ], + "paths": { + "/user/{username}": { + "get": { + "tags": [ + "user" + ], + "summary": "Get user by user name", + "description": "Gets user by name.", + "operationId": "getUserByName", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "The name that needs to be fetched. Use user1 for testing.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid username supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "404": { + "description": "User not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + }, + "put": { + "tags": [ + "user" + ], + "summary": "Updated user", + "description": "Update user response entity.", + "operationId": "updateUser", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "name that need to be deleted", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Updated user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid user supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "User not found" + } + } + }, + "delete": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "description": "Delete user response entity.", + "operationId": "deleteUser", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "the username", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/pet": { + "put": { + "tags": [ + "pet" + ], + "summary": "Update an existing pet", + "description": "Update pet response entity.", + "operationId": "updatePet", + "requestBody": { + "description": "Pet object that needs to be added to the store", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Pet not found" + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + }, + "post": { + "tags": [ + "pet" + ], + "summary": "Add a new pet to the store", + "description": "Add pet.", + "operationId": "addPet", + "requestBody": { + "description": "Pet object that needs to be added to the store", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/user": { + "post": { + "tags": [ + "user" + ], + "summary": "Create user", + "description": "Create user response entity.", + "operationId": "createUser", + "requestBody": { + "description": "Created user object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/createWithList": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "description": "Create users with list input response entity.", + "operationId": "createUsersWithListInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/createWithArray": { + "post": { + "tags": [ + "user" + ], + "summary": "Creates list of users with given input array", + "description": "Create users with array input response entity.", + "operationId": "createUsersWithArrayInput", + "requestBody": { + "description": "List of user object", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/store/order": { + "post": { + "tags": [ + "store" + ], + "summary": "Place an order for a pet", + "description": "Place order response entity.", + "operationId": "placeOrder", + "requestBody": { + "description": "the order", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + }, + "required": true + }, + "responses": { + "400": { + "description": "Invalid Order", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + } + } + } + }, + "/pet/{petId}": { + "get": { + "tags": [ + "pet" + ], + "summary": "Find pet by ID", + "description": "Returns a single pet", + "operationId": "getPetById", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to return", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Pet not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + }, + "security": [ + { + "api_key": [] + } + ] + }, + "post": { + "tags": [ + "pet" + ], + "summary": "Updates a pet in the store with form data", + "description": "Update pet with form response entity.", + "operationId": "updatePetWithForm", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet that needs to be updated", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Updated name of the pet" + }, + "status": { + "type": "string", + "description": "Updated status of the pet" + } + } + } + } + } + }, + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + }, + "delete": { + "tags": [ + "pet" + ], + "summary": "Deletes a pet", + "description": "Delete pet response entity.", + "operationId": "deletePet", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "Pet id to delete", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "api_key", + "in": "header", + "description": "the api key", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Pet not found" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/{petId}/uploadImage": { + "post": { + "tags": [ + "pet" + ], + "summary": "uploads an image", + "description": "Upload file response entity.", + "operationId": "uploadFile", + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet to update", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "additionalMetadata", + "in": "query", + "description": "Additional data to pass to server", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "file detail" + } + }, + "required": [ + "file" + ] + } + } + } + }, + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModelApiResponse" + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/user/logout": { + "get": { + "tags": [ + "user" + ], + "summary": "Logs out current logged in user session", + "description": "Logout user response entity.", + "operationId": "logoutUser", + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation" + } + } + } + }, + "/user/login": { + "get": { + "tags": [ + "user" + ], + "summary": "Logs user into the system", + "description": "Login user response entity.", + "operationId": "loginUser", + "parameters": [ + { + "name": "username", + "in": "query", + "description": "The user name for login", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "password", + "in": "query", + "description": "The password for login in clear text", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid username/password supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/store/order/{orderId}": { + "get": { + "tags": [ + "store" + ], + "summary": "Find purchase order by ID", + "description": "Gets order by id.", + "operationId": "getOrderById", + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of pet that needs to be fetched", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "maximum": 5, + "minimum": 1 + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Order not found", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/Order" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/Order" + } + } + } + } + } + }, + "delete": { + "tags": [ + "store" + ], + "summary": "Delete purchase order by ID", + "description": "Delete order response entity.", + "operationId": "deleteOrder", + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "ID of the order that needs to be deleted", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "Invalid ID supplied", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "404": { + "description": "Order not found" + } + } + } + }, + "/store/inventory": { + "get": { + "tags": [ + "store" + ], + "summary": "Returns pet inventories by status", + "description": "Returns a map of status codes to quantities", + "operationId": "getInventory", + "responses": { + "400": { + "description": "the map", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "security": [ + { + "api_key": [] + } + ] + } + }, + "/pet/findByTags": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by tags", + "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId": "findPetsByTags", + "parameters": [ + { + "name": "tags", + "in": "query", + "description": "Tags to filter by", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "400": { + "description": "Invalid tag value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, + "/pet/findByStatus": { + "get": { + "tags": [ + "pet" + ], + "summary": "Finds Pets by status", + "description": "Multiple status values can be provided with comma separated strings", + "operationId": "findPetsByStatus", + "parameters": [ + { + "name": "status", + "in": "query", + "description": "Status values that need to be considered for filter", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "400": { + "description": "Invalid status value", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/xml": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "description": "The type User.", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The Id." + }, + "username": { + "type": "string", + "description": "The Username." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + }, + "email": { + "type": "string", + "description": "The Email." + }, + "password": { + "type": "string", + "description": "The Password." + }, + "phone": { + "type": "string", + "description": "The Phone." + }, + "userStatus": { + "type": "integer", + "format": "int32", + "description": "User Status" + } + } + }, + "Category": { + "type": "object", + "description": "The type Category.", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The Id." + }, + "name": { + "type": "string", + "description": "The Name." + } + } + }, + "Pet": { + "type": "object", + "description": "The type Pet.", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The Id." + }, + "category": { + "$ref": "#/components/schemas/Category", + "description": "The Category." + }, + "name": { + "type": "string", + "description": "The Name.", + "example": "doggie" + }, + "photoUrls": { + "type": "array", + "description": "The Photo urls.", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "description": "The Tags.", + "items": { + "$ref": "#/components/schemas/Tag" + } + }, + "status": { + "type": "string", + "description": "pet status in the store", + "enum": [ + "available", + "pending", + "sold" + ] + } + }, + "required": [ + "name", + "photoUrls" + ] + }, + "Tag": { + "type": "object", + "description": "The type Tag.", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The Id." + }, + "name": { + "type": "string", + "description": "The Name." + } + } + }, + "Order": { + "type": "object", + "description": "The type Order.", + "properties": { + "complete": { + "type": "boolean", + "description": "The Complete." + }, + "id": { + "type": "integer", + "format": "int64", + "description": "The Id." + }, + "petId": { + "type": "integer", + "format": "int64", + "description": "The Pet id." + }, + "quantity": { + "type": "integer", + "format": "int32", + "description": "The Quantity." + }, + "shipDate": { + "type": "string", + "format": "date-time", + "description": "The Ship date." + }, + "status": { + "type": "string", + "description": "Order Status" + } + } + }, + "ModelApiResponse": { + "type": "object", + "description": "The type Model api response.", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "The Code." + }, + "type": { + "type": "string", + "description": "The Type." + }, + "message": { + "type": "string", + "description": "The Message." + } + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "petstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app20.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app20.json new file mode 100644 index 000000000..16823bacd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app20.json @@ -0,0 +1,15 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": {}, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app21.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app21.json new file mode 100644 index 000000000..75ef58948 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app21.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "person" + ], + "summary": "Add a new person to the store", + "description": "Persons.", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "personstore_auth": [ + "write:persons", + "read:persons" + ] + } + ] + } + } + }, + "components": { + "securitySchemes": { + "personstore_auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "http://personstore.swagger.io/oauth/dialog", + "scopes": { + "write:persons": "modify persons in your account", + "read:persons": "read your persons" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app22.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app22.json new file mode 100644 index 000000000..a17a53e22 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app22.json @@ -0,0 +1,71 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Do get response entity.", + "description": "Do get response entity.", + "operationId": "doGet", + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + } + }, + "description": "The type Person dto." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app23.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app23.json new file mode 100644 index 000000000..88155203a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app23.json @@ -0,0 +1,62 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Add a new person to the store", + "description": "Persons.", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "Authorization": [] + } + ] + } + } + }, + "components": { + "securitySchemes": { + "Authorization": { + "type": "apiKey", + "description": "A core-auth Bearer token", + "name": "JWT", + "in": "header" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app24.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app24.json new file mode 100644 index 000000000..7575323f0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app24.json @@ -0,0 +1,89 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Petstore API", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService": "http://swagger.io/terms/", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Add a new person to the store", + "description": "Persons.", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "Authorization": [] + } + ] + } + } + }, + "components": { + "parameters": { + "myHeader1": { + "name": "myHeader1", + "in": "header", + "schema": { + "type": "string" + } + } + }, + "headers": { + "myHeader2": { + "description": "myHeader2 header", + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, + "Authorization": { + "type": "apiKey", + "description": "A core-auth Bearer token", + "name": "Authorization", + "in": "header" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app25.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app25.json new file mode 100644 index 000000000..389afd31d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app25.json @@ -0,0 +1,193 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/values/{trackerId}/data": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Get last data from a tracker", + "operationId": "thirdList", + "parameters": [ + { + "name": "trackerId", + "in": "path", + "description": "the tracker id", + "required": true, + "schema": { + "type": "string", + "example": "the-tracker-id" + } + }, + { + "name": "start", + "in": "query", + "description": "the start", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:00:00.000Z" + } + }, + { + "name": "end", + "in": "query", + "description": "the end", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:10:00.000Z" + } + }, + { + "name": "limit", + "in": "query", + "description": "the limit", + "required": false, + "schema": { + "type": "number", + "example": 10 + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/secondlist/{trackerId}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Secondlist.", + "description": "Secondlist.", + "operationId": "secondlist", + "parameters": [ + { + "name": "trackerId", + "in": "path", + "description": "the tracker id", + "required": true, + "schema": { + "type": "string", + "example": "the-tracker-id" + } + }, + { + "name": "start", + "in": "query", + "description": "the start date", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:00:00.000Z" + } + }, + { + "name": "end", + "in": "query", + "description": "the end date", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:10:00.000Z" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/list/{trackerId}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "List.", + "description": "List.", + "operationId": "list", + "parameters": [ + { + "name": "trackerId", + "in": "path", + "description": "the tracker id", + "required": true, + "schema": { + "type": "string", + "example": "the-tracker-id" + } + }, + { + "name": "start", + "in": "query", + "description": "the start date", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:00:00.000Z" + } + }, + { + "name": "end", + "in": "query", + "description": "the end date", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "1970-01-01T00:10:00.000Z" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/check": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Check.", + "description": "Check.", + "operationId": "check", + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app26.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app26.json new file mode 100644 index 000000000..c8b7aeb38 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app26.json @@ -0,0 +1,102 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Persons my model.", + "description": "Persons my model.", + "operationId": "persons", + "parameters": [ + { + "name": "myModel", + "in": "query", + "description": "the my model", + "required": true, + "schema": { + "$ref": "#/components/schemas/MyModel" + } + } + ], + "responses": { + "200": { + "description": "the my model", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MyModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Bar": { + "type": "object", + "description": "The type Bar.", + "properties": { + "bar": { + "type": "string", + "description": "The Bar." + } + } + }, + "Foo": { + "type": "object", + "description": "The type Foo.", + "properties": { + "foo": { + "type": "string", + "description": "The Foo." + } + } + }, + "MyModel": { + "type": "object", + "description": "The type My model.", + "properties": { + "thing": { + "type": "object", + "description": "Hello", + "oneOf": [ + { + "$ref": "#/components/schemas/Foo" + }, + { + "$ref": "#/components/schemas/Bar" + }, + { + "$ref": "#/components/schemas/Foo" + }, + { + "$ref": "#/components/schemas/Bar" + } + ] + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app27.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app27.json new file mode 100644 index 000000000..2ebe908a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app27.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "operationId": "test", + "responses": { + "500": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Bar" + }, + { + "$ref": "#/components/schemas/Foo" + } + ] + } + } + } + }, + "200": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Foo": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + }, + "Bar": { + "type": "object", + "properties": { + "bar": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app28.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app28.json new file mode 100644 index 000000000..a19278516 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app28.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/upload2": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Upload 2 string.", + "description": "Upload 2 string.", + "operationId": "upload2", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "one", + "two" + ], + "type": "object", + "properties": { + "one": { + "type": "string", + "description": "the one", + "format": "binary" + }, + "two": { + "type": "string", + "description": "the two", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app29.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app29.json new file mode 100644 index 000000000..b6f802bad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app29.json @@ -0,0 +1,87 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/post-entity": { + "post": { + "tags": [ + "hello-controller" + ], + "description": "Post entity", + "operationId": "postEntity", + "requestBody": { + "description": "the post entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrackerData" + } + } + } + }, + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TrackerData" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TrackerData": { + "required": [ + "timestamp", + "trackerId", + "value" + ], + "type": "object", + "properties": { + "trackerId": { + "type": "string", + "description": "The Tracker id.", + "example": "the-tracker-id" + }, + "timestamp": { + "type": "string", + "description": "The Timestamp.", + "format": "date-time", + "example": "2018-01-01T00:00:00Z" + }, + "value": { + "type": "number", + "description": "The data value", + "format": "double", + "example": 19.0 + } + }, + "description": "The type Tracker data." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app3.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app3.json new file mode 100644 index 000000000..d798a430c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app3.json @@ -0,0 +1,113 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Echo playing card.", + "description": "Echo playing card.", + "operationId": "echo", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto baby", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "the card baby", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlayingCard" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the playing card baby", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PlayingCard": { + "type": "object", + "properties": { + "suit": { + "type": "string", + "description": "The Suit.", + "enum": [ + "Hearts", + "Diamonds", + "Clubs", + "Spades" + ] + }, + "value": { + "type": "integer", + "description": "The Value.", + "format": "int32" + }, + "toto": { + "type": "string", + "description": "The Toto.", + "format": "date-time" + } + }, + "description": "The type Playing card." + }, + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The email" + }, + "firstName": { + "type": "string", + "description": "The firstName" + }, + "lastName": { + "type": "string", + "description": "The lastName" + } + }, + "description": "The type Person dto." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app30.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app30.json new file mode 100644 index 000000000..95e4e7ade --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app30.json @@ -0,0 +1,56 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Echo string.", + "description": "Echo string.", + "operationId": "echo", + "parameters": [ + { + "name": "text", + "in": "query", + "description": "the text", + "required": false, + "schema": { + "type": "string", + "default": "Hello, World!" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app31.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app31.json new file mode 100644 index 000000000..47e4ca02c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app31.json @@ -0,0 +1,111 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "description": "subscribes a client to updates relevant to the requestor's account, as identified by the input token. The supplied url will be used as the delivery address for response payloads", + "operationId": "subscribe", + "parameters": [ + { + "name": "x-auth-token", + "in": "header", + "description": "the authentication token provided after initially authenticating to the application", + "required": true, + "schema": { + "type": "string", + "description": "the authentication token provided after initially authenticating to the application" + } + }, + { + "name": "url", + "in": "query", + "description": "the URL to call with response data", + "required": true, + "schema": { + "type": "string", + "description": "the URL to call with response data" + } + } + ], + "responses": { + "200": { + "description": "the subscription response", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SubscriptionResponse" + } + } + } + } + }, + "callbacks": { + "subscription": { + "http://$request.query.url": { + "post": { + "description": "payload data will be sent", + "parameters": [ + { + "name": "subscriptionId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "the generated UUID", + "format": "uuid", + "readOnly": true + } + } + ], + "responses": { + "200": { + "description": "Return this code if the callback was received and processed successfully" + }, + "205": { + "description": "Return this code to unsubscribe from future data updates" + }, + "default": { + "description": "All other response codes will disable this callback subscription" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SubscriptionResponse": { + "type": "object", + "properties": { + "subscriptionUuid": { + "type": "string", + "description": "The Subscription uuid." + } + }, + "description": "The type Subscription response." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app32.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app32.json new file mode 100644 index 000000000..46d07e6e9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app32.json @@ -0,0 +1,75 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/filter": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Filter post string.", + "description": "Filter post string.", + "operationId": "filterPost", + "requestBody": { + "description": "the filter", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MyTestDto" + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "MyTestDto": { + "type": "object", + "properties": { + "object1": { + "type": "string", + "description": "The Object 1." + }, + "object2": { + "type": "string", + "description": "The Object 2." + }, + "object3": { + "type": "string", + "description": "The Object 3." + } + }, + "description": "The type My test dto." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app33.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app33.json new file mode 100644 index 000000000..bf711def1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app33.json @@ -0,0 +1,64 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello/{numTelco}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GET Persons", + "description": "Index t.", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "description": "the num tel", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "description": "the adresse", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "418": { + "description": "the t", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app34.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app34.json new file mode 100644 index 000000000..bf711def1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app34.json @@ -0,0 +1,64 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello/{numTelco}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "GET Persons", + "description": "Index t.", + "operationId": "index", + "parameters": [ + { + "name": "numTelco", + "in": "path", + "description": "the num tel", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "adresse", + "in": "query", + "description": "the adresse", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "418": { + "description": "the t", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app35.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app35.json new file mode 100644 index 000000000..cee19de65 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app35.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/v1/poc/testme": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get thing", + "description": "Testme response entity.", + "operationId": "testme", + "responses": { + "200": { + "description": "Successful Operation", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + }, + "401": { + "description": "Authentication Failure" + } + } + } + }, + "/api/v1/poc/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get thing", + "description": "Test response entity.", + "operationId": "test", + "responses": { + "200": { + "description": "Successful Operation", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Not found" + }, + "401": { + "description": "Authentication Failure" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app37.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app37.json new file mode 100644 index 000000000..be3651b4c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app37.json @@ -0,0 +1,169 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/bar/baz": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Process car.", + "description": "Process car.", + "operationId": "process", + "requestBody": { + "description": "the c", + "content": { + "application/x.a+json": { + "schema": { + "$ref": "#/components/schemas/Foo" + } + }, + "application/x.b+json": { + "schema": { + "$ref": "#/components/schemas/Bar" + } + }, + "application/x.c+json": { + "schema": { + "$ref": "#/components/schemas/Car" + } + } + } + }, + "responses": { + "200": { + "description": "the car", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Car" + } + }, + "text/plain": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Foo" + }, + { + "$ref": "#/components/schemas/Bar" + } + ] + } + } + } + } + } + } + }, + "/pets1": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Pets post response entity.", + "description": "Pets post response entity.", + "operationId": "petsPost1", + "requestBody": { + "description": "the pet", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "the response entity" + } + } + } + }, + "/pets2": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Pets post response entity.", + "description": "Pets post response entity.", + "operationId": "petsPost2", + "requestBody": { + "description": "the pet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + } + }, + "responses": { + "200": { + "description": "the response entity" + } + } + } + } + }, + "components": { + "schemas": { + "Bar": { + "type": "object", + "properties": { + "bar": { + "type": "string", + "description": "The Bar." + } + }, + "description": "The type Bar." + }, + "Car": { + "type": "object", + "properties": { + "car": { + "type": "string", + "description": "The Car." + } + }, + "description": "The type Car." + }, + "Foo": { + "type": "object", + "properties": { + "foo": { + "type": "string", + "description": "The Foo." + } + }, + "description": "The type Foo." + }, + "Pet": { + "type": "object", + "properties": { + "pet": { + "type": "string", + "description": "The Pet." + } + }, + "description": "The type Pet." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app38.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app38.json new file mode 100644 index 000000000..736ed56c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app38.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/npe_error": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets model resource.", + "description": "Gets model resource.", + "operationId": "getModelResource", + "responses": { + "200": { + "description": "the model resource", + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "byte" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app39.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app39.json new file mode 100644 index 000000000..8fb8ed523 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app39.json @@ -0,0 +1,94 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Hello string.", + "description": "Hello string.", + "operationId": "hello", + "parameters": [ + { + "$ref": "#/components/parameters/myGlobalHeader", + "in": "header" + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "test Request", + "description": "Search employee.", + "operationId": "searchEmployee", + "parameters": [ + { + "$ref": "#/components/parameters/myGlobalHeader", + "in": "header" + } + ], + "requestBody": { + "description": "test value", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "parameters": { + "myGlobalHeader": { + "name": "My-Global-Header", + "in": "header", + "description": "My Global Header", + "required": true, + "schema": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app4.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app4.json new file mode 100644 index 000000000..081ab063f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app4.json @@ -0,0 +1,86 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/values/data": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "List tracker data.", + "description": "List tracker data.", + "operationId": "list", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": true, + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v31.app4.TrackerData" + } + } + ], + "responses": { + "200": { + "description": "the tracker data", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v31.app4.TrackerData" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "test.org.springdoc.api.v31.app4.TrackerData": { + "required": [ + "timestamp", + "trackerId", + "value" + ], + "type": "object", + "properties": { + "trackerId": { + "type": "string", + "description": "The Tracker id.", + "example": "the-tracker-id" + }, + "timestamp": { + "type": "string", + "description": "The Timestamp.", + "format": "date-time", + "example": "2018-01-01T00:00:00Z" + }, + "value": { + "type": "number", + "description": "The data value", + "format": "double", + "example": 19.0 + } + }, + "description": "The type Tracker data." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app40.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app40.json new file mode 100644 index 000000000..0413b3e6b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app40.json @@ -0,0 +1,44 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/iae_error": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets start form properties.", + "description": "Gets start form properties.", + "operationId": "getStartFormProperties", + "responses": { + "200": { + "description": "the start form properties", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app41.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app41.json new file mode 100644 index 000000000..6fb3d61a0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app41.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/file": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Download file", + "operationId": "getFile", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "File path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "500": { + "description": "Unexpected error", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "File resource", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "Wrong request", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app42.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app42.json new file mode 100644 index 000000000..c8e6b5153 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app42.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/tweets/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Tweets.", + "description": "Tweets.", + "operationId": "tweets", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "$ref": "#/components/schemas/TweetId" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "TweetId": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app43.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app43.json new file mode 100644 index 000000000..b7e5f3188 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app43.json @@ -0,0 +1,66 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/documents": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Upload documents response entity.", + "description": "Upload documents response entity.", + "operationId": "uploadDocuments", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "doc" + ], + "type": "object", + "properties": { + "doc": { + "type": "array", + "description": "the multipart files", + "items": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app44.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app44.json new file mode 100644 index 000000000..f9b750dc4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app44.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/helloworld": { + "post": { + "operationId": "hello_1", + "requestBody": { + "content": { + "application/vnd.v1+json": { + "schema": { + "$ref": "#/components/schemas/RequestV1" + } + }, + "application/vnd.v2+json": { + "schema": { + "$ref": "#/components/schemas/RequestV2" + } + } + } + }, + "responses": { + "400": { + "description": "Bad name", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDTO" + } + } + } + }, + "200": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/HelloDTO2" + }, + { + "$ref": "#/components/schemas/HelloDTO1" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "RequestV1": { + "type": "object", + "properties": { + "nameV1": { + "type": "string" + } + } + }, + "ErrorDTO": { + "type": "object", + "properties": { + "errorMessage": { + "type": "string" + } + } + }, + "HelloDTO1": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "RequestV2": { + "type": "object", + "properties": { + "nameV2": { + "type": "string" + } + } + }, + "HelloDTO2": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app45.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app45.json new file mode 100644 index 000000000..fa1622a4d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app45.json @@ -0,0 +1,166 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "My App", + "description": "Some long and useful description", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "People", + "description": "Use this resource to serve all requests and initiate all operations related to people" + } + ], + "paths": { + "/v1/people2/list": { + "get": { + "tags": [ + "People" + ], + "description": "List all persons", + "operationId": "list", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/v1/people2/listTwo": { + "get": { + "tags": [ + "People" + ], + "description": "List all persons", + "operationId": "listTwo", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/v1/people/list": { + "get": { + "tags": [ + "People" + ], + "description": "List all persons", + "operationId": "list_1", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/v1/people/listTwo": { + "get": { + "tags": [ + "People" + ], + "description": "List all persons", + "operationId": "listTwo_1", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + } + }, + "description": "The type Person dto." + } + }, + "securitySchemes": { + "bearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app46.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app46.json new file mode 100644 index 000000000..65ddb363f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app46.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons/{subscriptionId}": { + "get": { + "tags": [ + "Example Tag" + ], + "summary": "Operation Summary", + "description": "Operation Description", + "externalDocs": { + "description": "External documentation description", + "url": "http://url.com" + }, + "operationId": "operationId", + "parameters": [ + { + "name": "subscriptionId", + "in": "path", + "description": "parameter description", + "required": true, + "allowEmptyValue": true, + "allowReserved": true, + "schema": { + "type": "string", + "description": "the generated UUID", + "format": "uuid", + "readOnly": true + } + } + ], + "responses": { + "200": { + "description": "voila!", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app47.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app47.json new file mode 100644 index 000000000..f8c62edc7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app47.json @@ -0,0 +1,55 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/documents/{locale}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets documents with locale.", + "description": "Gets documents with locale.", + "operationId": "getDocumentsWithLocale", + "parameters": [ + { + "name": "locale", + "in": "path", + "description": "the locale", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the documents with locale", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app48.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app48.json new file mode 100644 index 000000000..6b8033997 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app48.json @@ -0,0 +1,114 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/documents/{locale}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets documents.", + "description": "Gets documents.", + "operationId": "getDocuments", + "responses": { + "400": { + "description": "the documents", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "401": { + "description": "the documents", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "402": { + "description": "the documents", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "403": { + "description": "the documents", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "410": { + "description": "the documents", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "411": { + "description": "the documents", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "412": { + "description": "the documents", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "413": { + "description": "the documents", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app49.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app49.json new file mode 100644 index 000000000..878b849e5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app49.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Obtain the list of services available in the system", + "operationId": "list", + "responses": { + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + } + } + }, + "components": { + "responses": { + "Unauthorized": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app50.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app50.json new file mode 100644 index 000000000..bcf417178 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app50.json @@ -0,0 +1,59 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "list", + "responses": { + "401": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "components": { + "responses": { + "Unauthorized": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app51.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app51.json new file mode 100644 index 000000000..420aff299 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app51.json @@ -0,0 +1,212 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Hello response entity.", + "description": "Hello response entity.", + "operationId": "hello", + "requestBody": { + "description": "the map", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + }, + "/test3": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test 3 string.", + "description": "Test 3 string.", + "operationId": "test3", + "parameters": [ + { + "name": "test_header", + "in": "header", + "required": true, + "schema": { + "type": "string", + "example": "rherherherherh" + } + }, + { + "name": "param1", + "in": "query", + "description": "desc1", + "required": true, + "schema": { + "type": "string", + "example": "something" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test 2 string.", + "description": "Test 2 string.", + "operationId": "test2", + "parameters": [ + { + "name": "test_header", + "in": "header", + "required": true, + "schema": { + "type": "string", + "example": "rherherherherh" + } + }, + { + "name": "param1", + "in": "query", + "description": "the param 1", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test 1 string.", + "description": "Test 1 string.", + "operationId": "test1", + "parameters": [ + { + "name": "test_header", + "in": "header", + "required": true, + "schema": { + "type": "string", + "example": "rherherherherh" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test/{path}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get string.", + "description": "Get string.", + "operationId": "get", + "parameters": [ + { + "name": "path", + "in": "path", + "description": "the path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app52.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app52.json new file mode 100644 index 000000000..1904233b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app52.json @@ -0,0 +1,206 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test3": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create test 3 string.", + "description": "Create test 3 string.", + "operationId": "createTest3", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "test": { + "$ref": "#/components/schemas/MyTestDto", + "description": "the test" + }, + "doc": { + "type": "array", + "description": "the multipart files", + "items": { + "type": "string", + "format": "binary" + } + } + }, + "required": [ + "doc", + "test" + ] + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2/{username}": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create test 2 string.", + "description": "Create test 2 string.", + "operationId": "createTest2", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "the username", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "the image file" + }, + "test": { + "$ref": "#/components/schemas/MyTestDto", + "description": "the test" + } + }, + "required": [ + "image", + "test" + ] + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1/{username}": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Create test 1 string.", + "description": "Create test 1 string.", + "operationId": "createTest1", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "the username", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "test": { + "$ref": "#/components/schemas/MyTestDto", + "description": "the test" + }, + "image": { + "type": "string", + "format": "binary", + "description": "the image file" + } + }, + "required": [ + "image", + "test" + ] + } + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "MyTestDto": { + "type": "object", + "description": "The type My test dto.", + "properties": { + "object1": { + "type": "string", + "description": "The Object 1." + }, + "object2": { + "type": "string", + "description": "The Object 2." + }, + "object3": { + "type": "string", + "description": "The Object 3." + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app53.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app53.json new file mode 100644 index 000000000..734394892 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app53.json @@ -0,0 +1,246 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + }, + { + "name": "hello-controller-with-global-api-response", + "description": "The type Hello controller with global api response." + } + ], + "paths": { + "/hello7": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "getNestedDTOWithDefaultResponseStatus", + "responses": { + "200": { + "description": "the nested dto with default response status", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloDTO1" + } + } + } + } + } + } + }, + "/hello6": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "getDTOWithDefaultResponseStatus", + "responses": { + "200": { + "description": "the dto with default response status", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloDTO1" + } + } + } + } + } + } + }, + "/hello5": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "listWithDefaultResponseStatus", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/hello4": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "getDTOWithExplicitResponseStatus", + "responses": { + "204": { + "description": "the dto with explicit response status", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HelloDTO1" + } + } + } + } + } + } + }, + "/hello3": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "listWithExplicitResponseStatus", + "responses": { + "204": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/hello2": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "listWithEmptyApiResponse", + "responses": { + "default": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/hello1": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation", + "operationId": "listWithNoApiResponse", + "responses": { + "200": { + "description": "the list", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/global/hello2": { + "get": { + "tags": [ + "hello-controller-with-global-api-response" + ], + "description": "Some operation", + "operationId": "listWithDefaultResponseStatus_1", + "responses": { + "200": { + "description": "Explicit description for this response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/global/hello1": { + "get": { + "tags": [ + "hello-controller-with-global-api-response" + ], + "description": "Some operation", + "operationId": "listWithNoApiResponse_1", + "responses": { + "204": { + "description": "Explicit description for this response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HelloDTO1": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The Message." + } + }, + "description": "The type Hello dto 1." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app54.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app54.json new file mode 100644 index 000000000..9960fa129 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app54.json @@ -0,0 +1,151 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/parties": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Save meal party response entity.", + "description": "Save meal party response entity.", + "operationId": "saveMealParty", + "requestBody": { + "description": "the p", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MealParty_Public" + } + } + } + }, + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MealParty_MealPartyAdmin" + } + } + } + } + } + } + }, + "/new-parties": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Save meal new party response entity.", + "description": "Save meal new party response entity.", + "operationId": "saveMealNewParty", + "requestBody": { + "description": "the p", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MealParty_Public" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MealParty_MealPartyAdmin" + } + } + } + } + } + } + }, + "/parties/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets meal party details [Meal party admin restricted]", + "description": "Gets meal party.", + "operationId": "getMealParty", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "the meal party id", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the meal party", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/MealParty_Public" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "MealParty_Public": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The Name." + } + }, + "description": "The type Meal party." + }, + "MealParty_MealPartyAdmin": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The Name." + }, + "members": { + "type": "array", + "description": "The Members.", + "items": { + "type": "string" + } + } + }, + "description": "The type Meal party." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app55.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app55.json new file mode 100644 index 000000000..f43e74b75 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app55.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/ping": { + "get": { + "tags": [ + "health" + ], + "summary": "Simple health check", + "description": "Ping endpoint used for health checks.", + "operationId": "ping", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app56.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app56.json new file mode 100644 index 000000000..68d1daf5a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app56.json @@ -0,0 +1,67 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons string.", + "description": "Persons string.", + "operationId": "persons", + "responses": { + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDTO" + } + } + } + }, + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ErrorDTO": { + "type": "object", + "properties": { + "errorMessage": { + "type": "string", + "description": "The Error message." + } + }, + "description": "The type Error dto." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app57.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app57.json new file mode 100644 index 000000000..668fc728c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app57.json @@ -0,0 +1,55 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/{name}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets text.", + "description": "Gets text.", + "operationId": "getText", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "desc", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the text", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app58.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app58.json new file mode 100644 index 000000000..22d347dd7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app58.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/examplePost": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "schema example", + "description": "Example object.", + "operationId": "example", + "responses": { + "200": { + "description": "the object", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/foo": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Foobar.", + "description": "Foobar.", + "operationId": "foobar", + "parameters": [ + { + "name": "user", + "in": "query", + "description": "User", + "required": true, + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/foo1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Foobar 1.", + "description": "Foobar 1.", + "operationId": "foobar1", + "parameters": [ + { + "name": "user", + "in": "query", + "description": "User", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/example": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test.", + "description": "Test.", + "operationId": "test", + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + } + }, + "description": "The type Person dto." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app59.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app59.json new file mode 100644 index 000000000..d7ea16f1b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app59.json @@ -0,0 +1,38 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/example": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test.", + "description": "Test.", + "operationId": "test", + "responses": { + "200": { + "description": "OK" + } + }, + "deprecated": true + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app6.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app6.json new file mode 100644 index 000000000..8ef6012de --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app6.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get Something by key", + "description": "Say hello response entity.", + "operationId": "sayHello", + "responses": { + "200": { + "description": "Successful Operation", + "content": { + "application/json": { + "schema": { + "type": "string", + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int32" + } + ] + }, + "examples": { + "The String example": { + "description": "The String example", + "value": "urgheiurgheirghieurg" + }, + "The Integer example": { + "description": "The Integer example", + "value": 311414 + } + } + } + } + }, + "404": { + "description": "Thing not found" + }, + "401": { + "description": "Authentication Failure" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app60.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app60.json new file mode 100644 index 000000000..7415af483 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app60.json @@ -0,0 +1,121 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/hello2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "summary2", + "description": "List 2 list.", + "operationId": "list2", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "desc page from Annotated interface", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "desc page from Annotated interface", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "sort", + "in": "query", + "description": "desc sort from Annotated interface", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + } + } + }, + "/hello1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "summary1", + "description": "List 1 list.", + "operationId": "list1", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "The page", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "The size", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the list", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app61.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app61.json new file mode 100644 index 000000000..a5fd6fc9e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app61.json @@ -0,0 +1,94 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons-with-user": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "List", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "phone", + "in": "query", + "description": "Phone", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "createdFrom", + "in": "query", + "description": "createdFrom", + "required": true, + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + { + "name": "createdRange", + "in": "query", + "description": "createdRange", + "required": true, + "schema": { + "maxItems": 2, + "minItems": 2, + "type": "array", + "items": { + "type": "string", + "format": "date" + } + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app62.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app62.json new file mode 100644 index 000000000..56e0db3bf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app62.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Test Controller" + ], + "summary": "This is the test endpoint", + "description": "Test string.", + "operationId": "test", + "parameters": [ + { + "name": "Accept", + "in": "header", + "description": "the accept", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "application/xml": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app63.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app63.json new file mode 100644 index 000000000..16823bacd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app63.json @@ -0,0 +1,15 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": {}, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app64.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app64.json new file mode 100644 index 000000000..1f5a97c2f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app64.json @@ -0,0 +1,55 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/balance/abcd": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "This is the test endpoint", + "description": "Test 2 string.", + "operationId": "test2", + "parameters": [ + { + "name": "from", + "in": "query", + "description": "the from", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app65.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app65.json new file mode 100644 index 000000000..30e140d3a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app65.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Health", + "description": "Health check / ping API" + } + ], + "paths": { + "/health": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping", + "responses": { + "200": { + "description": "the response entity", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ping": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_1", + "responses": { + "200": { + "description": "the response entity", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_2", + "responses": { + "200": { + "description": "the response entity", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app66.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app66.json new file mode 100644 index 000000000..997a89dbd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app66.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Health", + "description": "Health check / ping API" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_2", + "responses": { + "200": { + "description": "the response entity", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/health": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping", + "responses": { + "200": { + "description": "the response entity", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ping": { + "get": { + "tags": [ + "Health" + ], + "summary": "Check server status", + "description": "Check server status, will return 200 with simple string if alive. Do nothing else.", + "operationId": "ping_1", + "responses": { + "200": { + "description": "the response entity", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app67.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app67.json new file mode 100644 index 000000000..5385070a9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app67.json @@ -0,0 +1,188 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/demo/operation4": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Operation 4 (expected result - 3 parameters)", + "description": "Operation 4 string.", + "operationId": "operation4", + "parameters": [ + { + "name": "pageNumber", + "in": "query", + "description": "page number", + "schema": { + "type": "integer" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "page size", + "schema": { + "type": "integer" + } + }, + { + "name": "sort", + "in": "query", + "description": "sort specification", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/demo/operation3": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Operation 3 (expected result - 3 parameters)", + "description": "Operation 3 string.", + "operationId": "operation3", + "parameters": [ + { + "name": "pageNumber", + "in": "query", + "description": "page number", + "schema": { + "type": "integer" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "page size", + "schema": { + "type": "integer" + } + }, + { + "name": "sort", + "in": "query", + "description": "sort specification", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/demo/operation2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Operation 2 (expected result - 3 parameters)", + "description": "Operation 2 string.", + "operationId": "operation2", + "parameters": [ + { + "name": "pageNumber", + "in": "query", + "description": "page number", + "schema": { + "type": "integer" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "page size", + "schema": { + "type": "integer" + } + }, + { + "name": "sort", + "in": "query", + "description": "sort specification", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/demo/operation1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Operation 1 (expected result - no parameters)", + "description": "Operation 1 string.", + "operationId": "operation1", + "responses": { + "200": { + "description": "the string", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app69.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app69.json new file mode 100644 index 000000000..e76fa359b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app69.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/tasks": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets tasks.", + "description": "Gets tasks.", + "operationId": "getTasks", + "parameters": [ + { + "name": "str", + "in": "query", + "description": "the str", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the tasks", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + } + }, + "description": "The type Person dto." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app7.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app7.json new file mode 100644 index 000000000..f91a3e405 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app7.json @@ -0,0 +1,48 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "test Request", + "description": "Search employee.", + "operationId": "searchEmployee", + "requestBody": { + "description": "test value", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app70.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app70.json new file mode 100644 index 000000000..b64b8dbca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app70.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/example/{test}": { + "get": { + "tags": [ + "hello-controller" + ], + "description": "Some operation, customized operation!", + "operationId": "test", + "parameters": [ + { + "name": "test", + "in": "path", + "description": "Parameter description, customized parameter!", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the api type", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ApiType" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ApiType": { + "type": "object", + "description": "The type Api type.", + "properties": { + "someProperty": { + "type": "string", + "format": "duration", + "description": "Test description", + "properties": {} + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app71.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app71.json new file mode 100644 index 000000000..c77a6c2b4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app71.json @@ -0,0 +1,69 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Persons string.", + "description": "Persons string.", + "operationId": "persons", + "parameters": [ + { + "name": "dog", + "in": "query", + "description": "the dog", + "required": true, + "schema": { + "$ref": "#/components/schemas/Dog" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Dog": { + "type": "object", + "properties": { + "display_name": { + "type": "string", + "description": "A name given to the Dog", + "example": "Fido" + } + }, + "description": "The type Dog." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app73.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app73.json new file mode 100644 index 000000000..77d68b7fe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app73.json @@ -0,0 +1,172 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/{country_code}/persons/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get string.", + "description": "Get string.", + "operationId": "get", + "parameters": [ + { + "name": "country_code", + "in": "query", + "description": "the country code", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "hello-controller" + ], + "summary": "Delete.", + "description": "Delete.", + "operationId": "delete", + "parameters": [ + { + "name": "country_code", + "in": "query", + "description": "the country code", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/persons/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get string.", + "description": "Get string.", + "operationId": "get_1", + "parameters": [ + { + "name": "country_code", + "in": "query", + "description": "the country code", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "tags": [ + "hello-controller" + ], + "summary": "Delete.", + "description": "Delete.", + "operationId": "delete_1", + "parameters": [ + { + "name": "country_code", + "in": "query", + "description": "the country code", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app74.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app74.json new file mode 100644 index 000000000..4c4ecb9f0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app74.json @@ -0,0 +1,55 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Post my request body string.", + "description": "Post my request body string.", + "operationId": "postMyRequestBody", + "requestBody": { + "description": "the my request body", + "content": { + "application/json": { + "schema": { + "type": "string" + }, + "example": "sample" + } + } + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app75.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app75.json new file mode 100644 index 000000000..8e5e05b43 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app75.json @@ -0,0 +1,178 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test3/{uuid}": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Example api that realize an ECHO operation", + "description": "The result of the echo is the input value of the api", + "operationId": "postMyRequestBody3", + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "Is the identification of the document", + "required": true, + "schema": { + "type": "string", + "example": "uuid" + } + } + ], + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + }, + "201": { + "description": "other possible response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test2/{uuid}": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Example api that realize an ECHO operation", + "description": "The result of the echo is the input value of the api", + "operationId": "postMyRequestBody2", + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "Is the identification of the document", + "required": true, + "schema": { + "type": "string", + "example": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Successful Operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + }, + "201": { + "description": "other possible response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/test1/{uuid}": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Example api that realize an ECHO operation", + "description": "The result of the echo is the input value of the api", + "operationId": "postMyRequestBody1", + "parameters": [ + { + "name": "uuid", + "in": "path", + "description": "Is the identification of the document", + "required": true, + "schema": { + "type": "string", + "example": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Successful Operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + }, + "201": { + "description": "other possible response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + } + }, + "description": "The type Person dto." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app76.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app76.json new file mode 100644 index 000000000..dff90ed52 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app76.json @@ -0,0 +1,83 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "security": [ + { + "bearer-jwt": [ + "read", + "write" + ] + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/secure": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Secured string.", + "description": "Secured string.", + "operationId": "secured", + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/open": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Open string.", + "description": "Open string.", + "operationId": "open", + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + }, + "security": [] + } + } + }, + "components": { + "securitySchemes": { + "bearer-jwt": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app77.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app77.json new file mode 100644 index 000000000..0d5e8e402 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app77.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons.", + "description": "Persons.", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-is-file": "true" + } + } + } + }, + "/persons2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons 2.", + "description": "Persons 2.", + "operationId": "persons2", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "the name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "x-is-file": "true" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app78.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app78.json new file mode 100644 index 000000000..540fffb87 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app78.json @@ -0,0 +1,109 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/person2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets person 2.", + "description": "Gets person 2.", + "operationId": "getPerson2", + "parameters": [ + { + "name": "str", + "in": "query", + "description": "the str", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the person 2", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + }, + "/person1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Gets person 1.", + "description": "Gets person 1.", + "operationId": "getPerson1", + "parameters": [ + { + "name": "str", + "in": "query", + "description": "the str", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the person 1", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + } + }, + "description": "The type Person dto." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app79.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app79.json new file mode 100644 index 000000000..1dfccd26c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app79.json @@ -0,0 +1,55 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Echo string.", + "description": "Echo string.", + "operationId": "echo", + "parameters": [ + { + "name": "text", + "in": "query", + "description": "the text", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app8.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app8.json new file mode 100644 index 000000000..e87dfaabc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app8.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "put": { + "tags": [ + "hello-controller" + ], + "operationId": "put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "configuration": { + "type": "string" + }, + "second": { + "type": "string" + }, + "personDTO": { + "$ref": "#/components/schemas/PersonDTO" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "default response", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app80.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app80.json new file mode 100644 index 000000000..3dfc18569 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app80.json @@ -0,0 +1,95 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Hello response entity.", + "description": "Hello response entity.", + "operationId": "hello", + "responses": { + "200": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/testpost1": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Testpost 1 response entity.", + "description": "Testpost 1 response entity.", + "operationId": "testpost1", + "requestBody": { + "description": "the dto", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestObject" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TestObject": { + "type": "object", + "properties": { + "localDateTime": { + "type": "string", + "description": "The Local date time.", + "format": "date-time" + }, + "stringValue": { + "type": "string", + "description": "The String value." + } + }, + "description": "The type Test object." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app82.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app82.json new file mode 100644 index 000000000..e46be40ac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app82.json @@ -0,0 +1,94 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "put": { + "tags": [ + "hello-controller" + ], + "summary": "Put response entity.", + "description": "Put response entity.", + "operationId": "put", + "parameters": [ + { + "name": "configuration", + "in": "query", + "description": "the configuration", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "second", + "in": "query", + "description": "the second", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "personDTO", + "in": "query", + "description": "the person dto", + "required": true, + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + ], + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The Email." + }, + "firstName": { + "type": "string", + "description": "The First name." + }, + "lastName": { + "type": "string", + "description": "The Last name." + } + }, + "description": "The type Person dto." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app83.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app83.json new file mode 100644 index 000000000..9eaa8558e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app83.json @@ -0,0 +1,80 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/{config}": { + "put": { + "tags": [ + "hello-controller" + ], + "summary": "Put response entity.", + "description": "Put response entity.", + "operationId": "put", + "parameters": [ + { + "name": "config", + "in": "path", + "description": "the config", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "configuration", + "file" + ], + "type": "object", + "properties": { + "configuration": { + "type": "string", + "description": "the configuration", + "format": "binary" + }, + "file": { + "type": "string", + "description": "the a file", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app84.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app84.json new file mode 100644 index 000000000..90de7138c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app84.json @@ -0,0 +1,77 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons string.", + "description": "Persons string.", + "operationId": "persons", + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/persons1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons string.", + "description": "Persons string.", + "operationId": "persons_1", + "parameters": [ + { + "name": "toto", + "in": "query", + "description": "the toto", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app85.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app85.json new file mode 100644 index 000000000..6ca1b1c32 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app85.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/test/{id}": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Testme.", + "description": "Testme.", + "operationId": "testme", + "parameters": [ + { + "$ref": "#/components/parameters/paramA" + }, + { + "$ref": "#/components/parameters/paramB" + }, + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app86.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app86.json new file mode 100644 index 000000000..c63fb2931 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app86.json @@ -0,0 +1,48 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test.", + "description": "Test.", + "operationId": "test", + "parameters": [ + { + "name": "hello", + "in": "query", + "description": "the hello", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app87.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app87.json new file mode 100644 index 000000000..d97ae618f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app87.json @@ -0,0 +1,82 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/{itemId}": { + "put": { + "tags": [ + "hello-controller" + ], + "summary": "Put item response entity.", + "description": "Put item response entity.", + "operationId": "putItem", + "parameters": [ + { + "name": "cookie", + "in": "cookie", + "description": "the cookie", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "path", + "description": "the item id", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "the item", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + }, + "responses": { + "200": { + "description": "the response entity", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Item" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Item": { + "type": "object", + "description": "The type Item." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app88.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app88.json new file mode 100644 index 000000000..e49840b77 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app88.json @@ -0,0 +1,35 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "get": { + "summary": "Persons string.", + "description": "Persons string.", + "operationId": "persons", + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app89.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app89.json new file mode 100644 index 000000000..5de4a5547 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app89.json @@ -0,0 +1,55 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/status/{id}": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Get Status", + "description": "Gets address.", + "operationId": "getAddress", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "the id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the address", + "content": { + "text/html": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app9.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app9.json new file mode 100644 index 000000000..b3a4002a0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app9.json @@ -0,0 +1,64 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "my-api-controller", + "description": "The type My api controller." + } + ], + "paths": { + "/myapi": { + "get": { + "tags": [ + "my-api-controller" + ], + "description": "Annotations from interfaces test", + "operationId": "get", + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/myapi/getCode": { + "get": { + "tags": [ + "my-api-controller" + ], + "description": "Annotations from class with hidden parameter code", + "operationId": "getCode", + "responses": { + "200": { + "description": "the code", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app90.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app90.json new file mode 100644 index 000000000..8c9354cd0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app90.json @@ -0,0 +1,161 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test2": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Test 2.", + "description": "Test 2.", + "operationId": "test2", + "requestBody": { + "description": "Details of the Item to be created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + }, + "examples": { + "An example request with the minimum required fields to create.": { + "summary": "Minimal request", + "description": "An example request with the minimum required fields to create.", + "value": "min" + }, + "An example request with all fields provided with example values.": { + "summary": "Full request", + "description": "An example request with all fields provided with example values.", + "value": "full" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test 1.", + "description": "Test 1.", + "operationId": "test1", + "parameters": [ + { + "name": "hello", + "in": "query", + "description": "the hello", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + }, + "examples": { + "500": { + "$ref": "#/components/examples/http500Example" + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "description": "User", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The Id.", + "example": 10 + }, + "username": { + "type": "string", + "description": "The Username.", + "example": "theUser" + }, + "firstName": { + "type": "string", + "description": "The First name.", + "example": "John" + }, + "lastName": { + "type": "string", + "description": "The Last name.", + "example": "James" + }, + "email": { + "type": "string", + "description": "The Email.", + "example": "john@email.com" + }, + "password": { + "type": "string", + "description": "The Password.", + "example": 12345 + }, + "phone": { + "type": "string", + "description": "The Phone.", + "example": 12345 + }, + "userStatus": { + "type": "integer", + "format": "int32", + "description": "User Status", + "example": 1 + } + } + } + }, + "examples": { + "http500Example": { + "summary": "HTTP 500 JSON Body response example", + "description": "An example of HTTP response in case an error occurs on server side. instance attribute reference a traceId to ease server side analysis.", + "value": "{\"500\":{\"$ref\":\"#/components/examples/http500Example\"}}" + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app91.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app91.json new file mode 100644 index 000000000..a06b5e714 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app91.json @@ -0,0 +1,101 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Demo", + "description": "The Demo API" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "Demo" + ], + "summary": "This API will return a random greeting.", + "description": "Say hello response entity.", + "operationId": "sayHello", + "responses": { + "200": { + "description": "the response entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/test": { + "get": { + "tags": [ + "Demo" + ], + "summary": "Say hello 2 response entity.", + "description": "Say hello 2 response entity.", + "operationId": "sayHello2", + "responses": { + "201": { + "description": "item created", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + }, + "400": { + "description": "invalid input, object invalid", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + }, + "409": { + "description": "an existing item already exists", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "title": "Greeting", + "type": "object", + "properties": { + "payload": { + "type": "string", + "description": "The greeting value", + "example": "sdfsdfs" + } + }, + "description": "An object containing a greeting message" + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app92.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app92.json new file mode 100644 index 000000000..db80d69ad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app92.json @@ -0,0 +1,55 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Index string.", + "description": "Index string.", + "operationId": "index", + "parameters": [ + { + "name": "test", + "in": "query", + "description": "the test", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app93.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app93.json new file mode 100644 index 000000000..27f24b85e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app93.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "specific-controller", + "description": "The type Specific controller." + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "specific-controller" + ], + "summary": "Get t client model.", + "description": "Get t client model.", + "operationId": "get", + "parameters": [ + { + "name": "param", + "in": "query", + "description": "the param", + "required": true, + "schema": { + "$ref": "#/components/schemas/SpecificClientModel" + } + } + ], + "responses": { + "200": { + "description": "the t client model", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SpecificClientModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SpecificClientModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The Id.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "The Name." + } + }, + "description": "The type Specific client model." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app94.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app94.json new file mode 100644 index 000000000..7ecc8ba42 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app94.json @@ -0,0 +1,79 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Demo", + "description": "The Demo API" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Demo" + ], + "summary": "Say hello 2 response entity.", + "description": "Say hello 2 response entity.", + "operationId": "sayHello2", + "responses": { + "201": { + "description": "item created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + }, + "400": { + "description": "invalid input, object invalid", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + }, + "409": { + "description": "an existing item already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "title": "Greeting", + "type": "object", + "properties": { + "payload": { + "type": "string", + "description": "The greeting value", + "example": "sdfsdfs" + } + }, + "description": "An object containing a greeting message" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app95.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app95.json new file mode 100644 index 000000000..c8a738efd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app95.json @@ -0,0 +1,48 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Summary of operation persons", + "description": "Description of operation persons", + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Description of parameter name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app96.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app96.json new file mode 100644 index 000000000..f13560b17 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app96.json @@ -0,0 +1,123 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api1": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Test 1 string.", + "description": "Test 1 string.", + "operationId": "test1", + "requestBody": { + "description": "the test", + "content": { + "application/json": { + "schema": { + "minimum": 2, + "type": "integer", + "format": "int32" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api2": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Test 2 string.", + "description": "Test 2 string.", + "operationId": "test2", + "requestBody": { + "description": "the test", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api3": { + "post": { + "tags": [ + "hello-controller" + ], + "summary": "Test 3 string.", + "description": "Test 3 string.", + "operationId": "test3", + "parameters": [ + { + "name": "test", + "in": "query", + "description": "the test", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the string", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app97.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app97.json new file mode 100644 index 000000000..be77ef3b3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app97.json @@ -0,0 +1,154 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/api/student/header3": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Header v 3 student v 3.", + "description": "Header v 3 student v 3.", + "operationId": "headerV3", + "parameters": [ + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "the student v 3", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/StudentV3" + } + } + } + } + } + } + }, + "/api/student/header2": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Header v 2 student v 2.", + "description": "Header v 2 student v 2.", + "operationId": "headerV2", + "parameters": [ + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "2" + ] + } + } + ], + "responses": { + "200": { + "description": "the student v 2", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/StudentV2" + } + } + } + } + } + } + }, + "/api/student/header1": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Header v 1 student v 1.", + "description": "Header v 1 student v 1.", + "operationId": "headerV1", + "parameters": [ + { + "name": "X-API-VERSION", + "in": "header", + "schema": { + "type": "string", + "enum": [ + "1" + ] + } + } + ], + "responses": { + "200": { + "description": "the student v 1", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/StudentV1" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "StudentV3": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The Name." + } + }, + "description": "The type Student v 3." + }, + "StudentV2": { + "type": "object", + "properties": { + "bb": { + "type": "string", + "description": "The Name." + } + }, + "description": "The type Student v 2." + }, + "StudentV1": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The Name." + } + }, + "description": "The type Student v 1." + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app98.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app98.json new file mode 100644 index 000000000..b3e434687 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app98.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons.", + "description": "Persons.", + "operationId": "persons", + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app99.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app99.json new file mode 100644 index 000000000..9024dd52d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app99.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/persons": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Persons.", + "description": "Persons.", + "operationId": "persons", + "responses": { + "202": { + "description": "Description of api response 202" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app162.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app162.json deleted file mode 100644 index 10fea0271..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app162.json +++ /dev/null @@ -1,342 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "SpringShop API", - "description": "The description of the api", - "version": "v1" - }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "javadoc-only-rest-controller", - "description": "This is the JavadocOnlyRestController class javadoc." - } - ], - "paths": { - "/javadoc-only": { - "get": { - "tags": [ - "javadoc-only-rest-controller" - ], - "summary": "This is the list method's javadoc.", - "description": "This is the list method's javadoc.\n The method's signature: #list()", - "operationId": "list", - "responses": { - "200": { - "description": "the @return javadoc for the #list() method", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/JavadocOnlyRestDto" - } - } - } - } - }, - "400": { - "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NonUniqueResultException" - ] - }, - "404": { - "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NoResultException" - ] - } - } - }, - "post": { - "tags": [ - "javadoc-only-rest-controller" - ], - "summary": "This is the create method's javadoc.", - "description": "This is the create method's javadoc.\n The method's signature: #create(JavadocOnlyRestDto)", - "operationId": "create", - "requestBody": { - "description": "the @param input javadoc for the #create(JavadocOnlyRestDto) method", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JavadocOnlyRestDto" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "the @return javadoc for the #create(JavadocOnlyRestDto) method", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JavadocOnlyRestDto" - } - } - } - }, - "400": { - "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NonUniqueResultException" - ] - }, - "404": { - "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NoResultException" - ] - } - } - } - }, - "/javadoc-only/startsBy/{prefix}": { - "get": { - "tags": [ - "javadoc-only-rest-controller" - ], - "summary": "This is the findStartsBy method's javadoc.", - "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", - "operationId": "findStartsBy", - "parameters": [ - { - "name": "prefix", - "in": "path", - "description": "the @param prefix javadoc for the #findStartsBy(String) method", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "the @return javadoc for the #findStartsBy(String) method", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JavadocOnlyRestDto" - } - } - } - }, - "400": { - "description": "the @throws NonUniqueResultException javadoc for the #findStartsBy(String) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NonUniqueResultException" - ] - }, - "404": { - "description": "the @throws NoResultException javadoc for the #findStartsBy(String) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NoResultException" - ] - } - } - } - }, - "/javadoc-only/{guid}": { - "get": { - "tags": [ - "javadoc-only-rest-controller" - ], - "summary": "This is the find method's javadoc.", - "description": "This is the find method's javadoc.\n The method's signature: #find(String)", - "operationId": "find", - "parameters": [ - { - "name": "guid", - "in": "path", - "description": "the @param guid javadoc for the #find(String) method", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "the @return javadoc for the #find(String) method", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JavadocOnlyRestDto" - } - } - } - }, - "400": { - "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NonUniqueResultException" - ] - }, - "404": { - "description": "the @throws NoResultException javadoc for the #find(String) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NoResultException" - ] - } - } - }, - "put": { - "tags": [ - "javadoc-only-rest-controller" - ], - "summary": "This is the update method's javadoc.", - "description": "This is the update method's javadoc.\n The method's signature: #update(String, JavadocOnlyRestDto)", - "operationId": "update", - "parameters": [ - { - "name": "guid", - "in": "path", - "description": "the @param input javadoc for the #update(String, JavadocOnlyRestDto) method", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JavadocOnlyRestDto" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "the @return javadoc for the #update(String, JavadocOnlyRestDto) method", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JavadocOnlyRestDto" - } - } - } - }, - "400": { - "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NonUniqueResultException" - ] - }, - "404": { - "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app162.exception.NoResultException" - ] - } - } - } - } - }, - "components": { - "schemas": { - "JavadocOnlyRestDto": { - "type": "object", - "properties": { - "guid": { - "type": "string", - "description": "This is the private #guid field's javadoc." - }, - "inner": { - "$ref": "#/components/schemas/JavadocOnlyStaticInnerRestDto" - } - }, - "description": "This is the JavadocOnlyRestDto class javadoc." - }, - "JavadocOnlyStaticInnerRestDto": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "This is the private #content field's javadoc." - } - }, - "description": "This is the JavadocOnlyStaticInnerRestDto class javadoc." - } - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app163.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app163.json deleted file mode 100644 index 00af8c11d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app163.json +++ /dev/null @@ -1,227 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "SpringShop API", - "description": "The description of the api", - "version": "v1" - }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "annotation-override", - "description": "Description for the tag." - } - ], - "paths": { - "/annotation-override/{guid}": { - "put": { - "tags": [ - "annotation-override" - ], - "summary": "Summary for #update(String, AnnotationOverrideForJavadocRestDto)", - "description": "This is the update method's javadoc.\n The method's signature: #update(String, AnnotationOverrideForJavadocRestDto)", - "operationId": "update", - "parameters": [ - { - "name": "guid", - "in": "path", - "description": "the @param input javadoc for the #update(String, AnnotationOverrideForJavadocRestDto) method", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" - } - } - }, - "required": true - }, - "responses": { - "400": { - "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app163.exception.NonUniqueResultException" - ] - }, - "404": { - "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app163.exception.NoResultException" - ] - }, - "200": { - "description": "the @return javadoc for the #update(String, AnnotationOverrideForJavadocRestDto) method", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" - } - } - } - } - } - } - }, - "/annotation-override": { - "post": { - "tags": [ - "annotation-override" - ], - "summary": "Summary for #create(AnnotationOverrideForJavadocRestDto)", - "description": "Description for #create(AnnotationOverrideForJavadocRestDto)", - "operationId": "create", - "requestBody": { - "description": "Request body for #create(AnnotationOverrideForJavadocRestDto)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" - } - } - }, - "required": true - }, - "responses": { - "400": { - "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app163.exception.NonUniqueResultException" - ] - }, - "404": { - "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app163.exception.NoResultException" - ] - }, - "default": { - "description": "API Response 201 for #create(AnnotationOverrideForJavadocRestDto)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" - } - } - } - } - } - } - }, - "/annotation-override/startsBy/{prefix}": { - "get": { - "tags": [ - "annotation-override" - ], - "summary": "This is the findStartsBy method's javadoc.", - "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", - "operationId": "findStartsBy", - "parameters": [ - { - "name": "prefix", - "in": "path", - "description": "Parameter prefix", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "400": { - "description": "API Response 400 for #findStartsBy(prefix)" - }, - "404": { - "description": "the @throws NoResultException javadoc for the #findStartsBy(String) method", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - }, - "x-exception-class": [ - "test.org.springdoc.api.app163.exception.NoResultException" - ] - }, - "200": { - "description": "API Response 200 for #findStartsBy(prefix)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "AnnotationOverrideForJavadocRestDto": { - "title": "annotation-override-dto", - "type": "object", - "properties": { - "guid": { - "type": "string", - "description": "Description for the #guid field" - }, - "inner": { - "$ref": "#/components/schemas/AnnotationOverrideForJavadocStaticInnerRestDto" - } - }, - "description": "Description for the tag." - }, - "AnnotationOverrideForJavadocStaticInnerRestDto": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "This is the private #content field's javadoc." - } - }, - "description": "This is the AnnotationOverrideForJavadocStaticInnerRestDto class javadoc." - } - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app4.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app4.json deleted file mode 100644 index 5b08ca8ce..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/app4.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "OpenAPI definition", - "version": "v0" - }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "hello-controller", - "description": "The type Hello controller." - } - ], - "paths": { - "/values/data": { - "post": { - "tags": [ - "hello-controller" - ], - "summary": "List tracker data.", - "description": "List tracker data.", - "operationId": "list", - "parameters": [ - { - "name": "toto", - "in": "query", - "description": "the toto", - "required": true, - "schema": { - "$ref": "#/components/schemas/test.org.springdoc.api.app4.TrackerData" - } - } - ], - "responses": { - "200": { - "description": "the tracker data", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/test.org.springdoc.api.app4.TrackerData" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "test.org.springdoc.api.app4.TrackerData": { - "required": [ - "timestamp", - "trackerId", - "value" - ], - "type": "object", - "properties": { - "trackerId": { - "type": "string", - "description": "The Tracker id.", - "example": "the-tracker-id" - }, - "timestamp": { - "type": "string", - "description": "The Timestamp.", - "format": "date-time", - "example": "2018-01-01T00:00:00Z" - }, - "value": { - "type": "number", - "description": "The data value", - "format": "double", - "example": 19.0 - } - }, - "description": "The type Tracker data." - } - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index 549773fb9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springdoc.core.utils.Constants; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.reactive.server.EntityExchangeResult; -import org.springframework.test.web.reactive.server.WebTestClient; - -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; - -@WebFluxTest -@ActiveProfiles("test") -@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) -public abstract class AbstractSpringDocTest { - - protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractSpringDocTest.class); - - @Autowired - private WebTestClient webTestClient; - - public static String getContent(String fileName) { - try { - Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } - - @Test - void testApp() throws Exception { - String result = null; - try { - EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() - .expectStatus().isOk().expectBody().returnResult(); - - result = new String(getResult.getResponseBody()); - String className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } - catch (java.lang.AssertionError e) { - LOGGER.error(result); - throw e; - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/ControllerWithContinuationParameter.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/ControllerWithContinuationParameter.java deleted file mode 100644 index 413beb27a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/ControllerWithContinuationParameter.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import io.swagger.v3.oas.annotations.Operation; -import kotlin.coroutines.Continuation; -import reactor.core.publisher.Mono; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class ControllerWithContinuationParameter { - - @Operation(summary = "Ignore Continuation parameter") - @GetMapping(value = "/test/{id}", produces = { MediaType.APPLICATION_JSON_VALUE }) - public Mono get(@PathVariable(value = "id") String key, Continuation continuation) { - return null; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java deleted file mode 100644 index d3c5a5f17..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import test.org.springdoc.api.AbstractSpringDocTest; - -public class SpringDocApp1Test extends AbstractSpringDocTest { - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/SpringDocTestApp.java deleted file mode 100644 index f16e3284d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app1/SpringDocTestApp.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; - -@SpringBootApplication -@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app1" }) -public class SpringDocTestApp { - public static void main(String[] args) { - SpringApplication.run(SpringDocTestApp.class, args); - } - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info().title("Kotlin API").version("v1") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java deleted file mode 100644 index 10e0b6359..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/HelloController.java +++ /dev/null @@ -1,25 +0,0 @@ -package test.org.springdoc.api.app21; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@Tag(name = "Test") -@RestController -@RequestMapping(value = "/api/v2/test", produces = MediaType.APPLICATION_JSON_VALUE) -public class HelloController { - - @GetMapping("/") - public void greet(@RequestParam(required = false) @Parameter(required = false) final String name) { - } - - @GetMapping("/test2") - public void greet1(@RequestHeader(required = false) @Parameter(required = false) final String name) { - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java deleted file mode 100644 index b5e473e96..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/app21/SpringDocApp21Test.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * Copyright 2019-2024 the original author or authors. - * * * * * - * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * you may not use this file except in compliance with the License. - * * * * * You may obtain a copy of the License at - * * * * * - * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * - * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * See the License for the specific language governing permissions and - * * * * * limitations under the License. - * * * * - * * * - * * - * - */ - -package test.org.springdoc.api.app21; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - - -public class SpringDocApp21Test extends AbstractSpringDocTest { - - @SpringBootApplication - @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.app21" }) - static class SpringDocTestApp {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..9fe19c31c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,87 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.reactive.server.EntityExchangeResult; +import org.springframework.test.web.reactive.server.WebTestClient; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@WebFluxTest +@ActiveProfiles("test") +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) +public abstract class AbstractSpringDocTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractSpringDocTest.class); + + @Autowired + private WebTestClient webTestClient; + + public static String getContent(String fileName) { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + void testApp() throws Exception { + String result = null; + try { + EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk().expectBody().returnResult(); + + result = new String(getResult.getResponseBody()); + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + catch (java.lang.AssertionError e) { + LOGGER.error(result); + throw e; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/ControllerWithContinuationParameter.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/ControllerWithContinuationParameter.java new file mode 100644 index 000000000..9afa3470e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/ControllerWithContinuationParameter.java @@ -0,0 +1,38 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app1; + +import io.swagger.v3.oas.annotations.Operation; +import kotlin.coroutines.Continuation; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ControllerWithContinuationParameter { + + @Operation(summary = "Ignore Continuation parameter") + @GetMapping(value = "/test/{id}", produces = { MediaType.APPLICATION_JSON_VALUE }) + public Mono get(@PathVariable(value = "id") String key, Continuation continuation) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..009084aad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java @@ -0,0 +1,25 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app1; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +public class SpringDocApp1Test extends AbstractSpringDocTest { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocTestApp.java new file mode 100644 index 000000000..7b6401858 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocTestApp.java @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app1; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app1" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Kotlin API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java new file mode 100644 index 000000000..e202dfea9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app21/HelloController.java @@ -0,0 +1,25 @@ +package test.org.springdoc.api.v30.app21; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "Test") +@RestController +@RequestMapping(value = "/api/v2/test", produces = MediaType.APPLICATION_JSON_VALUE) +public class HelloController { + + @GetMapping("/") + public void greet(@RequestParam(required = false) @Parameter(required = false) final String name) { + } + + @GetMapping("/test2") + public void greet1(@RequestHeader(required = false) @Parameter(required = false) final String name) { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java new file mode 100644 index 000000000..80235f9a7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v30/app21/SpringDocApp21Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app21; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + + +public class SpringDocApp21Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v30.app21" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..672cf2501 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.reactive.server.EntityExchangeResult; +import org.springframework.test.web.reactive.server.WebTestClient; + +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; + +@WebFluxTest +@ActiveProfiles("test") +public abstract class AbstractSpringDocTest { + + protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractSpringDocTest.class); + + @Autowired + private WebTestClient webTestClient; + + public static String getContent(String fileName) { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + void testApp() throws Exception { + String result = null; + try { + EntityExchangeResult getResult = webTestClient.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk().expectBody().returnResult(); + + result = new String(getResult.getResponseBody()); + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + catch (AssertionError e) { + LOGGER.error(result); + throw e; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/ControllerWithContinuationParameter.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/ControllerWithContinuationParameter.java new file mode 100644 index 000000000..25aedbce1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/ControllerWithContinuationParameter.java @@ -0,0 +1,38 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app1; + +import io.swagger.v3.oas.annotations.Operation; +import kotlin.coroutines.Continuation; +import reactor.core.publisher.Mono; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ControllerWithContinuationParameter { + + @Operation(summary = "Ignore Continuation parameter") + @GetMapping(value = "/test/{id}", produces = { MediaType.APPLICATION_JSON_VALUE }) + public Mono get(@PathVariable(value = "id") String key, Continuation continuation) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..64400f19a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java @@ -0,0 +1,25 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app1; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +public class SpringDocApp1Test extends AbstractSpringDocTest { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocTestApp.java new file mode 100644 index 000000000..ab84c8b11 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocTestApp.java @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app1; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app1" }) +public class SpringDocTestApp { + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Kotlin API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java new file mode 100644 index 000000000..0526c4cb9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java @@ -0,0 +1,25 @@ +package test.org.springdoc.api.v31.app21; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "Test") +@RestController +@RequestMapping(value = "/api/v2/test", produces = MediaType.APPLICATION_JSON_VALUE) +public class HelloController { + + @GetMapping("/") + public void greet(@RequestParam(required = false) @Parameter(required = false) final String name) { + } + + @GetMapping("/test2") + public void greet1(@RequestHeader(required = false) @Parameter(required = false) final String name) { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java new file mode 100644 index 000000000..64f3e842a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app21; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + + +public class SpringDocApp21Test extends AbstractSpringDocTest { + + @SpringBootApplication + @ComponentScan(basePackages = { "org.springdoc", "test.org.springdoc.api.v31.app21" }) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt deleted file mode 100644 index 04c85ebfc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocTest.kt +++ /dev/null @@ -1,84 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api - -import org.junit.jupiter.api.Test -import org.skyscreamer.jsonassert.JSONAssert -import org.slf4j.LoggerFactory -import org.springdoc.core.utils.Constants -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient -import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest -import org.springframework.test.context.ActiveProfiles -import org.springframework.test.context.TestPropertySource -import org.springframework.test.web.reactive.server.WebTestClient -import java.nio.charset.StandardCharsets -import java.nio.file.Files -import java.nio.file.Paths - -@WebFluxTest -@ActiveProfiles("test") -@AutoConfigureWebTestClient(timeout = "3600000") -@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_0"]) -abstract class AbstractKotlinSpringDocTest { - - @Autowired - private val webTestClient: WebTestClient? = null - - private val logger = LoggerFactory.getLogger(AbstractKotlinSpringDocTest::class.java) - - @Test - @Throws(Exception::class) - fun testApp() { - var result: String? = null - try { - val getResult = - webTestClient!!.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() - .expectStatus().isOk.expectBody().returnResult() - - result = String(getResult.responseBody!!) - val className = javaClass.simpleName - val testNumber = className.replace("[^0-9]".toRegex(), "") - - val expected = getContent("results/app$testNumber.json") - JSONAssert.assertEquals(expected, result, true) - } catch (e: AssertionError) { - logger.error(result) - throw e - } - } - - companion object { - @Throws(Exception::class) - fun getContent(fileName: String): String { - try { - val path = Paths.get( - AbstractKotlinSpringDocTest::class.java.classLoader.getResource( - fileName - )!!.toURI() - ) - val fileBytes = Files.readAllBytes(path) - return String(fileBytes, StandardCharsets.UTF_8) - } catch (e: Exception) { - throw RuntimeException("Failed to read file: $fileName", e) - } - - } - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app10/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app10/ExampleController.kt deleted file mode 100644 index e88e0a6c1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app10/ExampleController.kt +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app10 - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.RestController -import test.org.springdoc.api.app8.Greeting - -data class Greeting(val greeting: String) - -@RestController -class ExampleController { - @GetMapping("/") - fun greet(@RequestParam name: String?) = Greeting("Hello ${name ?: "world"}") - - @GetMapping("/test") - fun test(@RequestParam name: String) = Greeting("Hello $name") - - @GetMapping("/test-with-default") - fun testWithDefault(@RequestParam(defaultValue = "world") name: String) = Greeting("Hello $name") -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app10/SpringDocApp10Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app10/SpringDocApp10Test.kt deleted file mode 100644 index 50d51183b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app10/SpringDocApp10Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app10 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -class SpringDocApp10Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app10"]) - open class DemoApplication - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt deleted file mode 100644 index f8f2b79ca..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app11 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -class SpringDocApp11Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app11"]) - class DemoApplication - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt deleted file mode 100644 index f407aa069..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app11/SystemStatusController.kt +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app11 - -import io.swagger.v3.oas.annotations.media.Schema -import kotlinx.coroutines.reactor.mono -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -enum class SystemStatus(val status: String) { - OK("OK") -} - -data class PersonDTO( - @Deprecated ("no-email") val email: String, - val firstName: String, - val lastName: String -) - -data class SystemStatusResponse( - @Deprecated ("will be removed in next version") - val systemStatus: SystemStatus, - - @Deprecated ("") - val emptyTest:String, - - @Deprecated ("should be ignored") - @Schema(description = "nonEmptyDesc") - val nonEmptyDesc:String -) - -@RestController -@RequestMapping("/status") -class SystemStatusController { - @GetMapping - suspend fun index() = SystemStatusResponse(SystemStatus.OK,"","") - - @GetMapping("/foo") - fun foo(personDTO: PersonDTO) = mono { - SystemStatusResponse(SystemStatus.OK,"","") - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SpringDocApp2Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SpringDocApp2Test.kt deleted file mode 100644 index 6990adc0b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SpringDocApp2Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -class SpringDocApp2Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app2"]) - open class DemoApplication - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt deleted file mode 100644 index 8ff57bd4c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2 - -import jakarta.validation.Valid -import kotlinx.coroutines.reactor.mono -import org.springframework.http.HttpStatus -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.PostMapping -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.ResponseStatus -import org.springframework.web.bind.annotation.RestController - -enum class SystemStatus(val status: String) { - OK("OK") -} - -data class SystemStatusResponse( - val status: SystemStatus -) - -@RestController -@RequestMapping("/status") -class SystemStatusController { - @GetMapping - suspend fun index() = SystemStatusResponse(SystemStatus.OK) - - @GetMapping("/foo") - fun foo() = mono { - SystemStatusResponse(SystemStatus.OK) - } - - @PostMapping("{token}/activate") - @ResponseStatus(HttpStatus.NO_CONTENT) - suspend fun activateUser( - @PathVariable token: String, - @RequestBody @Valid request: String - ) { - // do something - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app3/SpringDocApp3Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app3/SpringDocApp3Test.kt deleted file mode 100644 index e2998ced1..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app3/SpringDocApp3Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -class SpringDocApp3Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app3"]) - open class DemoApplication - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app3/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app3/SystemStatusController.kt deleted file mode 100644 index 7877ae038..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app3/SystemStatusController.kt +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3 - -import kotlinx.coroutines.reactor.mono -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -enum class SystemStatus(val status: String) { - OK("OK") -} - -data class SystemStatusResponse( - val status: SystemStatus -) - -@RestController -@RequestMapping("/status") -class SystemStatusController { - @GetMapping - suspend fun index() = SystemStatusResponse(SystemStatus.OK) - - @GetMapping("/foo") - @Deprecated("") - fun foo() = mono { - SystemStatusResponse(SystemStatus.OK) - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app4/HelloController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app4/HelloController.kt deleted file mode 100644 index 6d0d9199e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app4/HelloController.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4 - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - - -data class Person( - val name: String, - val nickname: String? -) - -@RestController -@RequestMapping("/test") -class HelloController { - @GetMapping - suspend fun index(s: Person) = s - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app4/SpringDocApp4Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app4/SpringDocApp4Test.kt deleted file mode 100644 index 958febce5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app4/SpringDocApp4Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -class SpringDocApp4Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app4"]) - open class DemoApplication - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app5/HelloController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app5/HelloController.kt deleted file mode 100644 index 38fa97b62..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app5/HelloController.kt +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5 - -import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.flow -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - - -data class Person( - val name: String, - val nickname: String? -) - -@RestController -@RequestMapping("/test") -class HelloController { - - @GetMapping("/") - fun foo(): Flow = flow { // flow builder - for (i in 1..3) { - delay(100) // pretend we are doing something useful here - emit(i) // emit next value - } - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app5/SpringDocApp5Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app5/SpringDocApp5Test.kt deleted file mode 100644 index 0a0dca615..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app5/SpringDocApp5Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -class SpringDocApp5Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app5"]) - open class DemoApplication - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt deleted file mode 100644 index 584d2f3ed..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app6 - -import io.swagger.v3.oas.annotations.media.Schema -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -data class Foo( - @Schema(description = "Some description about a byte array.") - val data: ByteArray -) - -@RestController -@RequestMapping("/bytearray") -class ByteArrayController { - - @GetMapping("/") - fun getByteArray(): Foo = Foo(byteArrayOf(0)) - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/SpringDocApp6Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/SpringDocApp6Test.kt deleted file mode 100644 index 2197721dc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app6/SpringDocApp6Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app6 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -class SpringDocApp6Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app6"]) - open class DemoApplication - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app7/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app7/ExampleController.kt deleted file mode 100644 index 657889310..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app7/ExampleController.kt +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app7 - -import io.swagger.v3.oas.annotations.Parameter -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.RestController - -data class Greeting(val greeting: String) - -@RestController -interface ExampleController { - @GetMapping("/") - fun greet(@RequestParam name: String?): Greeting - - @GetMapping("/test") - fun test(@RequestParam @Parameter(required = true) name: String?): Greeting -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app7/SpringDocApp7Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app7/SpringDocApp7Test.kt deleted file mode 100644 index 46800d614..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app7/SpringDocApp7Test.kt +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7 - -import org.springframework.aop.framework.ProxyFactory -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.ComponentScan -import org.springframework.context.support.GenericApplicationContext -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -class SpringDocApp7Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app7"]) - open class DemoApplication{ - @Bean - fun controller(applicationContext: GenericApplicationContext): ExampleController { - return createProxy(ExampleController::class.java) - } - - private fun createProxy(clazz: Class): T { - val proxyFactory = ProxyFactory(clazz) - proxyFactory.targetClass = clazz - @Suppress("UNCHECKED_CAST") - return proxyFactory.proxy as T - } - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app8/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app8/ExampleController.kt deleted file mode 100644 index 939318ecc..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app8/ExampleController.kt +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app8 - -import io.swagger.v3.oas.annotations.Parameter -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.RestController - -data class Greeting(val greeting: String) - -@RestController -interface ExampleController { - @GetMapping("/") - fun greet(@RequestParam name: String?): Greeting - - @GetMapping("/test") - fun test(@RequestParam @Parameter(required = true) name: String?): Greeting -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app8/SpringDocApp8Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app8/SpringDocApp8Test.kt deleted file mode 100644 index 59c916891..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app8/SpringDocApp8Test.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app8 - -import org.springdoc.core.utils.Constants -import org.springframework.aop.framework.ProxyFactory -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.ComponentScan -import org.springframework.context.support.GenericApplicationContext -import org.springframework.test.context.TestPropertySource -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -@TestPropertySource(properties = [Constants.SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED+"=false"]) -class SpringDocApp8Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app8"]) - class DemoApplication{ - @Bean - fun controller(applicationContext: GenericApplicationContext): ExampleController { - return createProxy(ExampleController::class.java) - } - - private fun createProxy(clazz: Class): T { - val proxyFactory = ProxyFactory(clazz) - proxyFactory.targetClass = clazz - @Suppress("UNCHECKED_CAST") - return proxyFactory.proxy as T - } - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app9/DemoController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app9/DemoController.kt deleted file mode 100644 index e49d7dc0c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app9/DemoController.kt +++ /dev/null @@ -1,72 +0,0 @@ -package test.org.springdoc.api.app9 - -import io.swagger.v3.oas.annotations.media.Schema -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -@RestController -@RequestMapping("/api/demo") -class DocumentsApiController { - - @GetMapping - suspend fun getDocuments( request: DemoRequest - ): DemoDto = DemoDto(42) -} - -data class DemoDto( - var id: Long, -) - -class DemoRequest ( - - @field:Schema(required = true, defaultValue = "a default value") - val requiredNullableDefault: String?, - - @field:Schema(required = true) - val requiredNullableNoDefault: String?, - - @field:Schema(required = true, defaultValue = "a default value") - val requiredNoNullableDefault: String, - - @field:Schema(required = true) - val requiredNoNullableNoDefault: String, - - @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") - val requiredNullableDefault1: String?, - - @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) - val requiredNullableNoDefault1: String?, - - @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") - val requiredNoNullableDefault1: String, - - @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) - val requiredNoNullableNoDefault1: String, - - @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") - val noRequiredNullableDefault2: String?, - - @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) - val noRequiredNullableNoDefault2: String?, - - @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") - val noRequiredNoNullableDefault2: String, - - @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) - val noRequiredNoNullableNoDefault2: String, - - @field:Schema(defaultValue = "a default value") - val noRequiredNullableDefault: String?, - - @field:Schema - val noRequiredNullableNoDefault: String?, - - @field:Schema(defaultValue = "a default value") - val noRequiredNoNullableDefault: String, - - @field:Schema - val noRequiredNoNullableNoDefault: String, - - -) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app9/SpringDocApp9Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app9/SpringDocApp9Test.kt deleted file mode 100644 index 3c4a5a8c3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/app9/SpringDocApp9Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app9 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocTest - -class SpringDocApp9Test : AbstractKotlinSpringDocTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app9"]) - open class DemoApplication - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/AbstractKotlinSpringDocTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/AbstractKotlinSpringDocTest.kt new file mode 100644 index 000000000..b4e83808c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/AbstractKotlinSpringDocTest.kt @@ -0,0 +1,92 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30 + +import org.junit.jupiter.api.Test +import org.skyscreamer.jsonassert.JSONAssert +import org.slf4j.LoggerFactory +import org.springdoc.core.utils.Constants +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.TestPropertySource +import org.springframework.test.web.reactive.server.WebTestClient +import java.nio.charset.StandardCharsets +import java.nio.file.Files +import java.nio.file.Paths + +@WebFluxTest +@ActiveProfiles("test") +@AutoConfigureWebTestClient(timeout = "3600000") +@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_0"]) +abstract class AbstractKotlinSpringDocTest { + + @Autowired + private val webTestClient: WebTestClient? = null + + private val logger = LoggerFactory.getLogger(AbstractKotlinSpringDocTest::class.java) + + @Test + @Throws(Exception::class) + fun testApp() { + var result: String? = null + try { + val getResult = + webTestClient!!.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk.expectBody().returnResult() + + result = String(getResult.responseBody!!) + val className = javaClass.simpleName + val testNumber = className.replace("[^0-9]".toRegex(), "") + + val expected = getContent("results/3.0.1/app$testNumber.json") + JSONAssert.assertEquals(expected, result, true) + } catch (e: AssertionError) { + logger.error(result) + throw e + } + } + + companion object { + @Throws(Exception::class) + fun getContent(fileName: String): String { + try { + val path = Paths.get( + AbstractKotlinSpringDocTest::class.java.classLoader.getResource( + fileName + )!!.toURI() + ) + val fileBytes = Files.readAllBytes(path) + return String(fileBytes, StandardCharsets.UTF_8) + } catch (e: Exception) { + throw RuntimeException("Failed to read file: $fileName", e) + } + + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/ExampleController.kt new file mode 100644 index 000000000..aef52b178 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/ExampleController.kt @@ -0,0 +1,20 @@ +package test.org.springdoc.api.v30.app10 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController +import test.org.springdoc.api.v30.app8.Greeting + +data class Greeting(val greeting: String) + +@RestController +class ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?) = Greeting("Hello ${name ?: "world"}") + + @GetMapping("/test") + fun test(@RequestParam name: String) = Greeting("Hello $name") + + @GetMapping("/test-with-default") + fun testWithDefault(@RequestParam(defaultValue = "world") name: String) = Greeting("Hello $name") +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/SpringDocApp10Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/SpringDocApp10Test.kt new file mode 100644 index 000000000..121737fa6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/SpringDocApp10Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app10 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp10Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app10"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SpringDocApp11Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SpringDocApp11Test.kt new file mode 100644 index 000000000..3f6a7ae66 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SpringDocApp11Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app11 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp11Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app11"]) + class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SystemStatusController.kt new file mode 100644 index 000000000..db37e9b41 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SystemStatusController.kt @@ -0,0 +1,59 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app11 + +import io.swagger.v3.oas.annotations.media.Schema +import kotlinx.coroutines.reactor.mono +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class PersonDTO( + @Deprecated ("no-email") val email: String, + val firstName: String, + val lastName: String +) + +data class SystemStatusResponse( + @Deprecated ("will be removed in next version") + val systemStatus: SystemStatus, + + @Deprecated ("") + val emptyTest:String, + + @Deprecated ("should be ignored") + @Schema(description = "nonEmptyDesc") + val nonEmptyDesc:String +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + suspend fun index() = SystemStatusResponse(SystemStatus.OK,"","") + + @GetMapping("/foo") + fun foo(personDTO: PersonDTO) = mono { + SystemStatusResponse(SystemStatus.OK,"","") + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SpringDocApp2Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SpringDocApp2Test.kt new file mode 100644 index 000000000..49e94b21f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SpringDocApp2Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app2 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp2Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app2"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SystemStatusController.kt new file mode 100644 index 000000000..ccfdf5822 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SystemStatusController.kt @@ -0,0 +1,59 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app2 + +import jakarta.validation.Valid +import kotlinx.coroutines.reactor.mono +import org.springframework.http.HttpStatus +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.ResponseStatus +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class SystemStatusResponse( + val status: SystemStatus +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + suspend fun index() = SystemStatusResponse(SystemStatus.OK) + + @GetMapping("/foo") + fun foo() = mono { + SystemStatusResponse(SystemStatus.OK) + } + + @PostMapping("{token}/activate") + @ResponseStatus(HttpStatus.NO_CONTENT) + suspend fun activateUser( + @PathVariable token: String, + @RequestBody @Valid request: String + ) { + // do something + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SpringDocApp3Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SpringDocApp3Test.kt new file mode 100644 index 000000000..3253d72e0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SpringDocApp3Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app3 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp3Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app3"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SystemStatusController.kt new file mode 100644 index 000000000..de44f2a3c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SystemStatusController.kt @@ -0,0 +1,45 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app3 + +import kotlinx.coroutines.reactor.mono +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class SystemStatusResponse( + val status: SystemStatus +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + suspend fun index() = SystemStatusResponse(SystemStatus.OK) + + @GetMapping("/foo") + @Deprecated("") + fun foo() = mono { + SystemStatusResponse(SystemStatus.OK) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/HelloController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/HelloController.kt new file mode 100644 index 000000000..94d495cc8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/HelloController.kt @@ -0,0 +1,37 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app4 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + + +data class Person( + val name: String, + val nickname: String? +) + +@RestController +@RequestMapping("/test") +class HelloController { + @GetMapping + suspend fun index(s: Person) = s + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/SpringDocApp4Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/SpringDocApp4Test.kt new file mode 100644 index 000000000..248b89073 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/SpringDocApp4Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app4 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp4Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app4"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/HelloController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/HelloController.kt new file mode 100644 index 000000000..26fab15d7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/HelloController.kt @@ -0,0 +1,46 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app5 + +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.flow +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + + +data class Person( + val name: String, + val nickname: String? +) + +@RestController +@RequestMapping("/test") +class HelloController { + + @GetMapping("/") + fun foo(): Flow = flow { // flow builder + for (i in 1..3) { + delay(100) // pretend we are doing something useful here + emit(i) // emit next value + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/SpringDocApp5Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/SpringDocApp5Test.kt new file mode 100644 index 000000000..d1e7da47e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/SpringDocApp5Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app5 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp5Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app5"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/ByteArrayController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/ByteArrayController.kt new file mode 100644 index 000000000..eea1383c9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/ByteArrayController.kt @@ -0,0 +1,38 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app6 + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +data class Foo( + @Schema(description = "Some description about a byte array.") + val data: ByteArray +) + +@RestController +@RequestMapping("/bytearray") +class ByteArrayController { + + @GetMapping("/") + fun getByteArray(): Foo = Foo(byteArrayOf(0)) + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/SpringDocApp6Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/SpringDocApp6Test.kt new file mode 100644 index 000000000..b3b203012 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/SpringDocApp6Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app6 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp6Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app6"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/ExampleController.kt new file mode 100644 index 000000000..64afa35d6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/ExampleController.kt @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v30.app7 + +import io.swagger.v3.oas.annotations.Parameter +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +data class Greeting(val greeting: String) + +@RestController +interface ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?): Greeting + + @GetMapping("/test") + fun test(@RequestParam @Parameter(required = true) name: String?): Greeting +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/SpringDocApp7Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/SpringDocApp7Test.kt new file mode 100644 index 000000000..8a473d3e5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/SpringDocApp7Test.kt @@ -0,0 +1,46 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app7 + +import org.springframework.aop.framework.ProxyFactory +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.ComponentScan +import org.springframework.context.support.GenericApplicationContext +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp7Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app7"]) + open class DemoApplication{ + @Bean + fun controller(applicationContext: GenericApplicationContext): ExampleController { + return createProxy(ExampleController::class.java) + } + + private fun createProxy(clazz: Class): T { + val proxyFactory = ProxyFactory(clazz) + proxyFactory.targetClass = clazz + @Suppress("UNCHECKED_CAST") + return proxyFactory.proxy as T + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/ExampleController.kt new file mode 100644 index 000000000..9778adba4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/ExampleController.kt @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v30.app8 + +import io.swagger.v3.oas.annotations.Parameter +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +data class Greeting(val greeting: String) + +@RestController +interface ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?): Greeting + + @GetMapping("/test") + fun test(@RequestParam @Parameter(required = true) name: String?): Greeting +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/SpringDocApp8Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/SpringDocApp8Test.kt new file mode 100644 index 000000000..ad52fde72 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/SpringDocApp8Test.kt @@ -0,0 +1,49 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app8 + +import org.springdoc.core.utils.Constants +import org.springframework.aop.framework.ProxyFactory +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.ComponentScan +import org.springframework.context.support.GenericApplicationContext +import org.springframework.test.context.TestPropertySource +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +@TestPropertySource(properties = [Constants.SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED+"=false"]) +class SpringDocApp8Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app8"]) + class DemoApplication{ + @Bean + fun controller(applicationContext: GenericApplicationContext): ExampleController { + return createProxy(ExampleController::class.java) + } + + private fun createProxy(clazz: Class): T { + val proxyFactory = ProxyFactory(clazz) + proxyFactory.targetClass = clazz + @Suppress("UNCHECKED_CAST") + return proxyFactory.proxy as T + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/DemoController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/DemoController.kt new file mode 100644 index 000000000..efb1e34de --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/DemoController.kt @@ -0,0 +1,72 @@ +package test.org.springdoc.api.v30.app9 + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +@RequestMapping("/api/demo") +class DocumentsApiController { + + @GetMapping + suspend fun getDocuments( request: DemoRequest + ): DemoDto = DemoDto(42) +} + +data class DemoDto( + var id: Long, +) + +class DemoRequest ( + + @field:Schema(required = true, defaultValue = "a default value") + val requiredNullableDefault: String?, + + @field:Schema(required = true) + val requiredNullableNoDefault: String?, + + @field:Schema(required = true, defaultValue = "a default value") + val requiredNoNullableDefault: String, + + @field:Schema(required = true) + val requiredNoNullableNoDefault: String, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") + val requiredNullableDefault1: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) + val requiredNullableNoDefault1: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") + val requiredNoNullableDefault1: String, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) + val requiredNoNullableNoDefault1: String, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") + val noRequiredNullableDefault2: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) + val noRequiredNullableNoDefault2: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") + val noRequiredNoNullableDefault2: String, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) + val noRequiredNoNullableNoDefault2: String, + + @field:Schema(defaultValue = "a default value") + val noRequiredNullableDefault: String?, + + @field:Schema + val noRequiredNullableNoDefault: String?, + + @field:Schema(defaultValue = "a default value") + val noRequiredNoNullableDefault: String, + + @field:Schema + val noRequiredNoNullableNoDefault: String, + + +) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/SpringDocApp9Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/SpringDocApp9Test.kt new file mode 100644 index 000000000..92dba2234 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/SpringDocApp9Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app9 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp9Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app9"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocTest.kt new file mode 100644 index 000000000..6ce0c9f84 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocTest.kt @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31 + +import org.junit.jupiter.api.Test +import org.skyscreamer.jsonassert.JSONAssert +import org.slf4j.LoggerFactory +import org.springdoc.core.utils.Constants +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.TestPropertySource +import org.springframework.test.web.reactive.server.WebTestClient +import java.nio.charset.StandardCharsets +import java.nio.file.Files +import java.nio.file.Paths + +@WebFluxTest +@ActiveProfiles("test") +@AutoConfigureWebTestClient(timeout = "3600000") +abstract class AbstractKotlinSpringDocTest { + + @Autowired + private val webTestClient: WebTestClient? = null + + private val logger = LoggerFactory.getLogger(AbstractKotlinSpringDocTest::class.java) + + @Test + @Throws(Exception::class) + fun testApp() { + var result: String? = null + try { + val getResult = + webTestClient!!.get().uri(Constants.DEFAULT_API_DOCS_URL).exchange() + .expectStatus().isOk.expectBody().returnResult() + + result = String(getResult.responseBody!!) + val className = javaClass.simpleName + val testNumber = className.replace("[^0-9]".toRegex(), "") + + val expected = getContent("results/3.1.0/app$testNumber.json") + JSONAssert.assertEquals(expected, result, true) + } catch (e: AssertionError) { + logger.error(result) + throw e + } + } + + companion object { + @Throws(Exception::class) + fun getContent(fileName: String): String { + try { + val path = Paths.get( + AbstractKotlinSpringDocTest::class.java.classLoader.getResource( + fileName + )!!.toURI() + ) + val fileBytes = Files.readAllBytes(path) + return String(fileBytes, StandardCharsets.UTF_8) + } catch (e: Exception) { + throw RuntimeException("Failed to read file: $fileName", e) + } + + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/ExampleController.kt new file mode 100644 index 000000000..853824584 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/ExampleController.kt @@ -0,0 +1,20 @@ +package test.org.springdoc.api.v31.app10 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController +import test.org.springdoc.api.v30.app8.Greeting + +data class Greeting(val greeting: String) + +@RestController +class ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?) = Greeting("Hello ${name ?: "world"}") + + @GetMapping("/test") + fun test(@RequestParam name: String) = Greeting("Hello $name") + + @GetMapping("/test-with-default") + fun testWithDefault(@RequestParam(defaultValue = "world") name: String) = Greeting("Hello $name") +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt new file mode 100644 index 000000000..b753c3037 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app10 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp10Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app10"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt new file mode 100644 index 000000000..b9e740b8b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app11 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp11Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app11"]) + class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SystemStatusController.kt new file mode 100644 index 000000000..145911386 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SystemStatusController.kt @@ -0,0 +1,59 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app11 + +import io.swagger.v3.oas.annotations.media.Schema +import kotlinx.coroutines.reactor.mono +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class PersonDTO( + @Deprecated ("no-email") val email: String, + val firstName: String, + val lastName: String +) + +data class SystemStatusResponse( + @Deprecated ("will be removed in next version") + val systemStatus: SystemStatus, + + @Deprecated ("") + val emptyTest:String, + + @Deprecated ("should be ignored") + @Schema(description = "nonEmptyDesc") + val nonEmptyDesc:String +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + suspend fun index() = SystemStatusResponse(SystemStatus.OK,"","") + + @GetMapping("/foo") + fun foo(personDTO: PersonDTO) = mono { + SystemStatusResponse(SystemStatus.OK,"","") + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt new file mode 100644 index 000000000..222137f6d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app2 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp2Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app2"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SystemStatusController.kt new file mode 100644 index 000000000..03281517a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SystemStatusController.kt @@ -0,0 +1,59 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app2 + +import jakarta.validation.Valid +import kotlinx.coroutines.reactor.mono +import org.springframework.http.HttpStatus +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.ResponseStatus +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class SystemStatusResponse( + val status: SystemStatus +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + suspend fun index() = SystemStatusResponse(SystemStatus.OK) + + @GetMapping("/foo") + fun foo() = mono { + SystemStatusResponse(SystemStatus.OK) + } + + @PostMapping("{token}/activate") + @ResponseStatus(HttpStatus.NO_CONTENT) + suspend fun activateUser( + @PathVariable token: String, + @RequestBody @Valid request: String + ) { + // do something + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt new file mode 100644 index 000000000..eb475f349 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app3 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp3Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app3"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SystemStatusController.kt new file mode 100644 index 000000000..25f1478e6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SystemStatusController.kt @@ -0,0 +1,45 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app3 + +import kotlinx.coroutines.reactor.mono +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class SystemStatusResponse( + val status: SystemStatus +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + suspend fun index() = SystemStatusResponse(SystemStatus.OK) + + @GetMapping("/foo") + @Deprecated("") + fun foo() = mono { + SystemStatusResponse(SystemStatus.OK) + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/HelloController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/HelloController.kt new file mode 100644 index 000000000..f1ff201e3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/HelloController.kt @@ -0,0 +1,37 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app4 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + + +data class Person( + val name: String, + val nickname: String? +) + +@RestController +@RequestMapping("/test") +class HelloController { + @GetMapping + suspend fun index(s: Person) = s + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt new file mode 100644 index 000000000..f56c9576e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app4 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp4Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app4"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/HelloController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/HelloController.kt new file mode 100644 index 000000000..6eb8e828e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/HelloController.kt @@ -0,0 +1,46 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app5 + +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.flow +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + + +data class Person( + val name: String, + val nickname: String? +) + +@RestController +@RequestMapping("/test") +class HelloController { + + @GetMapping("/") + fun foo(): Flow = flow { // flow builder + for (i in 1..3) { + delay(100) // pretend we are doing something useful here + emit(i) // emit next value + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt new file mode 100644 index 000000000..34fe86409 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app5 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp5Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app5"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/ByteArrayController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/ByteArrayController.kt new file mode 100644 index 000000000..5ae608680 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/ByteArrayController.kt @@ -0,0 +1,38 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app6 + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +data class Foo( + @Schema(description = "Some description about a byte array.") + val data: ByteArray +) + +@RestController +@RequestMapping("/bytearray") +class ByteArrayController { + + @GetMapping("/") + fun getByteArray(): Foo = Foo(byteArrayOf(0)) + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt new file mode 100644 index 000000000..8c8a7c5aa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app6 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp6Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app6"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/ExampleController.kt new file mode 100644 index 000000000..bc0852278 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/ExampleController.kt @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v31.app7 + +import io.swagger.v3.oas.annotations.Parameter +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +data class Greeting(val greeting: String) + +@RestController +interface ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?): Greeting + + @GetMapping("/test") + fun test(@RequestParam @Parameter(required = true) name: String?): Greeting +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt new file mode 100644 index 000000000..8dc8915c9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt @@ -0,0 +1,46 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app7 + +import org.springframework.aop.framework.ProxyFactory +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.ComponentScan +import org.springframework.context.support.GenericApplicationContext +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp7Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app7"]) + open class DemoApplication{ + @Bean + fun controller(applicationContext: GenericApplicationContext): ExampleController { + return createProxy(ExampleController::class.java) + } + + private fun createProxy(clazz: Class): T { + val proxyFactory = ProxyFactory(clazz) + proxyFactory.targetClass = clazz + @Suppress("UNCHECKED_CAST") + return proxyFactory.proxy as T + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/ExampleController.kt new file mode 100644 index 000000000..074eed409 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/ExampleController.kt @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v31.app8 + +import io.swagger.v3.oas.annotations.Parameter +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +data class Greeting(val greeting: String) + +@RestController +interface ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?): Greeting + + @GetMapping("/test") + fun test(@RequestParam @Parameter(required = true) name: String?): Greeting +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt new file mode 100644 index 000000000..aef6d155d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt @@ -0,0 +1,49 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app8 + +import org.springdoc.core.utils.Constants +import org.springframework.aop.framework.ProxyFactory +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.ComponentScan +import org.springframework.context.support.GenericApplicationContext +import org.springframework.test.context.TestPropertySource +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +@TestPropertySource(properties = [Constants.SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED+"=false"]) +class SpringDocApp8Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app8"]) + class DemoApplication{ + @Bean + fun controller(applicationContext: GenericApplicationContext): ExampleController { + return createProxy(ExampleController::class.java) + } + + private fun createProxy(clazz: Class): T { + val proxyFactory = ProxyFactory(clazz) + proxyFactory.targetClass = clazz + @Suppress("UNCHECKED_CAST") + return proxyFactory.proxy as T + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/DemoController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/DemoController.kt new file mode 100644 index 000000000..1957c6f9e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/DemoController.kt @@ -0,0 +1,72 @@ +package test.org.springdoc.api.v31.app9 + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +@RequestMapping("/api/demo") +class DocumentsApiController { + + @GetMapping + suspend fun getDocuments( request: DemoRequest + ): DemoDto = DemoDto(42) +} + +data class DemoDto( + var id: Long, +) + +class DemoRequest ( + + @field:Schema(required = true, defaultValue = "a default value") + val requiredNullableDefault: String?, + + @field:Schema(required = true) + val requiredNullableNoDefault: String?, + + @field:Schema(required = true, defaultValue = "a default value") + val requiredNoNullableDefault: String, + + @field:Schema(required = true) + val requiredNoNullableNoDefault: String, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") + val requiredNullableDefault1: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) + val requiredNullableNoDefault1: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") + val requiredNoNullableDefault1: String, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) + val requiredNoNullableNoDefault1: String, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") + val noRequiredNullableDefault2: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) + val noRequiredNullableNoDefault2: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") + val noRequiredNoNullableDefault2: String, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) + val noRequiredNoNullableNoDefault2: String, + + @field:Schema(defaultValue = "a default value") + val noRequiredNullableDefault: String?, + + @field:Schema + val noRequiredNullableNoDefault: String?, + + @field:Schema(defaultValue = "a default value") + val noRequiredNoNullableDefault: String, + + @field:Schema + val noRequiredNoNullableNoDefault: String, + + +) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt new file mode 100644 index 000000000..207740f45 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app9 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest + +class SpringDocApp9Test : AbstractKotlinSpringDocTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app9"]) + open class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app1.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app10.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app10.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app10.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app10.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app11.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app11.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app11.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app2.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app21.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app21.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app21.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app21.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app3.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app3.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app3.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app3.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app4.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app4.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app4.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app4.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app5.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app5.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app5.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app5.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app6.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app6.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app6.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app6.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app7.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app7.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app7.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app7.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app8.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app8.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app8.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app8.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app9.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app9.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/app9.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.0.1/app9.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app1.json new file mode 100644 index 000000000..611c6c404 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app1.json @@ -0,0 +1,51 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Kotlin API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/test/{id}": { + "get": { + "tags": [ + "controller-with-continuation-parameter" + ], + "summary": "Ignore Continuation parameter", + "operationId": "get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app10.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app10.json new file mode 100644 index 000000000..b115cb24d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app10.json @@ -0,0 +1,121 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/test": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/test-with-default": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "testWithDefault", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "world" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "required": [ + "greeting" + ], + "type": "object", + "properties": { + "greeting": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app11.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app11.json new file mode 100644 index 000000000..e658d38d2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app11.json @@ -0,0 +1,117 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/status": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "index", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + }, + "/status/foo": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "foo", + "parameters": [ + { + "name": "personDTO", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/PersonDTO" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SystemStatusResponse": { + "required": [ + "emptyTest", + "nonEmptyDesc", + "systemStatus" + ], + "type": "object", + "properties": { + "systemStatus": { + "type": "string", + "description": "will be removed in next version", + "deprecated": true, + "enum": [ + "OK" + ] + }, + "emptyTest": { + "type": "string", + "deprecated": true + }, + "nonEmptyDesc": { + "type": "string", + "description": "nonEmptyDesc", + "deprecated": true + } + } + }, + "PersonDTO": { + "required": [ + "email", + "firstName", + "lastName" + ], + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "no-email", + "deprecated": true + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app2.json new file mode 100644 index 000000000..979aafe3b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app2.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/status/{token}/activate": { + "post": { + "tags": [ + "system-status-controller" + ], + "operationId": "activateUser", + "parameters": [ + { + "name": "token", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "No Content", + "content": {} + } + } + } + }, + "/status": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "index", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + }, + "/status/foo": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "foo", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SystemStatusResponse": { + "required": [ + "status" + ], + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "OK" + ] + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app21.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app21.json new file mode 100644 index 000000000..6412410d1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app21.json @@ -0,0 +1,62 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/api/v2/test/test2": { + "get": { + "tags": [ + "Test" + ], + "operationId": "greet1", + "parameters": [ + { + "name": "name", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/v2/test/": { + "get": { + "tags": [ + "Test" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app3.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app3.json new file mode 100644 index 000000000..b7c467abb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app3.json @@ -0,0 +1,74 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/status": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "index", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + }, + "/status/foo": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "foo", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + }, + "deprecated": true + } + } + }, + "components": { + "schemas": { + "SystemStatusResponse": { + "required": [ + "status" + ], + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "OK" + ] + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app4.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app4.json new file mode 100644 index 000000000..b064b6abb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app4.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "index", + "parameters": [ + { + "name": "s", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "nickname": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app5.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app5.json new file mode 100644 index 000000000..8c5a14c58 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app5.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/test/": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "foo", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app6.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app6.json new file mode 100644 index 000000000..21c36b6fc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app6.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/bytearray/": { + "get": { + "tags": [ + "byte-array-controller" + ], + "operationId": "getByteArray", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Foo" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Foo": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "string", + "description":"Some description about a byte array.", + "format": "byte" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app7.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app7.json new file mode 100644 index 000000000..496a95b69 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app7.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/test": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "required": [ + "greeting" + ], + "type": "object", + "properties": { + "greeting": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app8.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app8.json new file mode 100644 index 000000000..496a95b69 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app8.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/test": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "required": [ + "greeting" + ], + "type": "object", + "properties": { + "greeting": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app9.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app9.json new file mode 100644 index 000000000..ec665f3d2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/resources/results/3.1.0/app9.json @@ -0,0 +1,133 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/api/demo": { + "get": { + "tags": [ + "documents-api-controller" + ], + "operationId": "getDocuments", + "parameters": [ + { + "name": "request", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/DemoRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/DemoDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "DemoRequest": { + "required": [ + "noRequiredNoNullableNoDefault", + "requiredNoNullableDefault", + "requiredNoNullableDefault1", + "requiredNoNullableNoDefault", + "requiredNoNullableNoDefault1", + "requiredNullableDefault", + "requiredNullableDefault1", + "requiredNullableNoDefault", + "requiredNullableNoDefault1" + ], + "type": "object", + "properties": { + "requiredNullableDefault": { + "type": "string", + "default": "a default value" + }, + "requiredNullableNoDefault": { + "type": "string" + }, + "requiredNoNullableDefault": { + "type": "string", + "default": "a default value" + }, + "requiredNoNullableNoDefault": { + "type": "string" + }, + "requiredNullableDefault1": { + "type": "string", + "default": "a default value" + }, + "requiredNullableNoDefault1": { + "type": "string" + }, + "requiredNoNullableDefault1": { + "type": "string", + "default": "a default value" + }, + "requiredNoNullableNoDefault1": { + "type": "string" + }, + "noRequiredNullableDefault2": { + "type": "string", + "default": "a default value" + }, + "noRequiredNullableNoDefault2": { + "type": "string" + }, + "noRequiredNoNullableDefault2": { + "type": "string", + "default": "a default value" + }, + "noRequiredNoNullableNoDefault2": { + "type": "string" + }, + "noRequiredNullableDefault": { + "type": "string", + "default": "a default value" + }, + "noRequiredNullableNoDefault": { + "type": "string" + }, + "noRequiredNoNullableDefault": { + "type": "string", + "default": "a default value" + }, + "noRequiredNoNullableNoDefault": { + "type": "string" + } + } + }, + "DemoDto": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/EnumController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/EnumController.java index 7bdd2ffe2..71cd71a2b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/EnumController.java +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/java/test/org/springdoc/api/app12/EnumController.java @@ -1,7 +1,7 @@ package test.org.springdoc.api.app12; import jakarta.annotation.Nullable; -import test.org.springdoc.api.app12.SpringDocApp12Test.MyEnum; +import test.org.springdoc.api.v30.app12.SpringDocApp12Test.MyEnum; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocMVCTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocMVCTest.kt deleted file mode 100644 index 129ce3197..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/AbstractKotlinSpringDocMVCTest.kt +++ /dev/null @@ -1,83 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api - -import org.junit.jupiter.api.Test -import org.skyscreamer.jsonassert.JSONAssert -import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc -import org.springframework.boot.test.context.SpringBootTest -import org.springframework.test.context.ActiveProfiles -import org.springframework.test.context.TestPropertySource -import org.springframework.test.web.servlet.MockMvc -import org.springframework.test.web.servlet.request.MockMvcRequestBuilders -import org.springframework.test.web.servlet.result.MockMvcResultMatchers -import java.nio.charset.StandardCharsets -import java.nio.file.Files -import java.nio.file.Paths - -@SpringBootTest -@AutoConfigureMockMvc -@ActiveProfiles("test") -@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_0"]) -abstract class AbstractKotlinSpringDocMVCTest { - - @Autowired - val mockMvc: MockMvc? = null - - private val logger = LoggerFactory.getLogger(AbstractKotlinSpringDocMVCTest::class.java) - - @Test - fun testApp() { - var result: String? = null - try { - val response = mockMvc!!.perform(MockMvcRequestBuilders.get("/v3/api-docs")) - .andExpect(MockMvcResultMatchers.status().isOk).andReturn() - - result = response.response.contentAsString - val className = javaClass.simpleName - val testNumber = className.replace("[^0-9]".toRegex(), "") - - val expected = getContent("results/app$testNumber.json") - JSONAssert.assertEquals(expected, result, true) - } catch (e: AssertionError) { - logger.error(result) - throw e - } - } - - companion object { - @Throws(Exception::class) - fun getContent(fileName: String): String { - try { - val path = Paths.get( - AbstractKotlinSpringDocMVCTest::class.java.classLoader.getResource( - fileName - )!!.toURI() - ) - val fileBytes = Files.readAllBytes(path) - return String(fileBytes, StandardCharsets.UTF_8) - } catch (e: Exception) { - throw RuntimeException("Failed to read file: $fileName", e) - } - - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app10/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app10/ExampleController.kt deleted file mode 100644 index 077d6bc2f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app10/ExampleController.kt +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app10 - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.RestController -import test.org.springdoc.api.app8.Greeting - -data class Greeting(val greeting: String) - -@RestController -class ExampleController { - @GetMapping("/") - fun greet(@RequestParam name: String?) = Greeting("Hello ${name ?: "world"}") - - @GetMapping("/test") - fun test(@RequestParam name: String) = Greeting("Hello $name") - - @GetMapping("/test-with-default") - fun testWithDefault(@RequestParam(defaultValue = "world") name: String) = Greeting("Hello $name") -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app10/SpringDocApp10Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app10/SpringDocApp10Test.kt deleted file mode 100644 index 300a3c02d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app10/SpringDocApp10Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app10 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp10Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app10"]) - class DemoApplication - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/ExampleController.kt deleted file mode 100644 index 79116e0b4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/ExampleController.kt +++ /dev/null @@ -1,96 +0,0 @@ -package test.org.springdoc.api.app11 - -import io.swagger.v3.oas.annotations.Operation -import io.swagger.v3.oas.annotations.media.Schema -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.RestController - -@RestController -class ExampleController { - - @Operation( - summary = "foo api", - description = """ - this api is foo - - #### Custom exception case - | Http Status | Error Code | Error Message | Error Data | Remark | - |-------------|-------------|--------------|------------|-----------| - | 403 | NO_PERMISSION |This request is only available to administrators. | | | - | 400 | STORE_NOT_FOUND |Store not found. | | | - """ - ) - @GetMapping("/foo/trim-kotlin-indent") - fun readFoo(@RequestParam name: String?) = FooResponse("Hello ${name ?: "world"}") - -} - -data class FooResponse( - val name: String, -) - -@RestController -class ExampleController2 { - - @GetMapping("/foo/trim-kotlin-indent/schema") - fun readFoo( - @RequestBody request: FooRequestWithSchema, - ) = FooResponseWithSchema( - name = "Hello ${request.age ?: "world"}", - subFoo = SubFooResponseWithSchema(subName = "sub foo name"), - ) -} - -@Schema( - name = "foo request", - description = """ - foo request class description - with kotlin indent - """ -) -data class FooRequestWithSchema( - @Schema( - name = "age", - description = """ - foo request field with kotlin indent - """ - ) - val age: Int, -) - -@Schema( - name = "foo response", - description = """ - foo response class description - with kotlin indent - """ -) -data class FooResponseWithSchema( - @Schema( - name = "name", - description = """ - foo response fields with kotlin indent - """ - ) - val name: String, - val subFoo: SubFooResponseWithSchema -) - -@Schema( - name = "sub foo response", - description = """ - sub foo response class description - with kotlin indent - """ -) -data class SubFooResponseWithSchema( - @Schema( - name = "subName", - description = """ - sub foo response fields with kotlin indent - """ - ) - val subName: String, -) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt deleted file mode 100644 index 36ba93710..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app11/SpringDocApp11Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app11 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import org.springframework.test.context.TestPropertySource -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -@TestPropertySource(properties = ["springdoc.trim-kotlin-indent=true"]) -class SpringDocApp11Test : AbstractKotlinSpringDocMVCTest() { - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app11"]) - class DemoApplication -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt deleted file mode 100644 index f522f7de3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app12/SpringDocApp12Test.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app12 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp12Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app12"]) - class DemoApplication - - enum class MyEnum { - A, B; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt deleted file mode 100644 index 13c893550..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/SpringDocApp13Test.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app13 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.test.context.TestPropertySource -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_1"]) -class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - class DemoApplication { - } - - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt deleted file mode 100644 index e13610707..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app13/TestController.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app13 - - -import io.swagger.v3.oas.annotations.media.Schema -import org.springframework.web.bind.annotation.PostMapping -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -@Schema(description = "Generic description") -data class KeyValue( - val key: String, - val value: String, -) - -@Schema -data class SomeDTO( - @Schema(description = "Description A") val fieldA: KeyValue, - @Schema(description = "Description B") val fieldB: KeyValue, -) - - - -@RestController -@RequestMapping("/test") -class TestController { - @PostMapping("/test") - fun create(@RequestBody some: SomeDTO) { - - } -} - diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt deleted file mode 100644 index 967f289c9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/SpringDocApp14Test.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app14 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp14Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - class DemoApplication - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/TestController.kt deleted file mode 100644 index 3f220e658..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app14/TestController.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app14 - -import io.swagger.v3.oas.annotations.media.Schema -import org.springframework.web.bind.annotation.PostMapping -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -@Schema(description = "Generic description") -data class KeyValue( - val key: String, - val value: String, -) - -@Schema -data class SomeDTO( - @Schema(description = "Description A", allOf = [KeyValue::class]) val field_a: KeyValue, - @Schema(description = "Description B", allOf = [KeyValue::class]) val field_b: KeyValue, -) - -@RestController -@RequestMapping("/test") -class TestController { - - @PostMapping("/test") - fun create(@RequestBody some: SomeDTO) { - - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app2/SpringDocApp2Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app2/SpringDocApp2Test.kt deleted file mode 100644 index 253caa4be..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app2/SpringDocApp2Test.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp2Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - class DemoApplication - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt deleted file mode 100644 index 5205485dd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app2/SystemStatusController.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2 - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -enum class SystemStatus(val status: String) { - OK("OK") -} - -data class SystemStatusResponse( - val status: SystemStatus -) - -@RestController -@RequestMapping("/status") -class SystemStatusController { - @GetMapping - fun index() = SystemStatusResponse(SystemStatus.OK) - - @GetMapping("/foo") - fun foo() = - SystemStatusResponse(SystemStatus.OK) - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app3/SpringDocApp3Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app3/SpringDocApp3Test.kt deleted file mode 100644 index 856022f3a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app3/SpringDocApp3Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp3Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app3"]) - class DemoApplication - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app3/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app3/SystemStatusController.kt deleted file mode 100644 index c07452e9c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app3/SystemStatusController.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3 - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -enum class SystemStatus(val status: String) { - OK("OK") -} - -data class SystemStatusResponse( - val status: SystemStatus -) - -@RestController -@RequestMapping("/status") -class SystemStatusController { - @GetMapping - fun index() = SystemStatusResponse(SystemStatus.OK) - - @GetMapping("/foo") - @Deprecated("") - fun foo() = SystemStatusResponse(SystemStatus.OK) - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app4/HelloController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app4/HelloController.kt deleted file mode 100644 index 6d0d9199e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app4/HelloController.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4 - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - - -data class Person( - val name: String, - val nickname: String? -) - -@RestController -@RequestMapping("/test") -class HelloController { - @GetMapping - suspend fun index(s: Person) = s - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app4/SpringDocApp4Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app4/SpringDocApp4Test.kt deleted file mode 100644 index d66e0fd9f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app4/SpringDocApp4Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app4 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp4Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app4"]) - class DemoApplication - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app5/ListController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app5/ListController.kt deleted file mode 100644 index 262f508b8..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app5/ListController.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5 - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -@RestController -@RequestMapping("/test") -class ListController { - - @GetMapping("/") - fun foo(): List = listOf(1, 2, 3) -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app5/SpringDocApp5Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app5/SpringDocApp5Test.kt deleted file mode 100644 index 6d87b74dd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app5/SpringDocApp5Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp5Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app5"]) - class DemoApplication - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt deleted file mode 100644 index 78fda637e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/ByteArrayController.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * * Copyright 2019-2024 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app6 - -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -data class Foo(val data: ByteArray) - -@RestController -@RequestMapping("/bytearray") -class ByteArrayController { - - @GetMapping("/") - fun getByteArray(): Foo = Foo(byteArrayOf(0)) - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/SpringDocApp6Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/SpringDocApp6Test.kt deleted file mode 100644 index ef9ca29a5..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app6/SpringDocApp6Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app6 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp6Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app6"]) - class DemoApplication - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app7/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app7/ExampleController.kt deleted file mode 100644 index 4f8ca13de..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app7/ExampleController.kt +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app7 - -import io.swagger.v3.oas.annotations.Parameter -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.RestController - -data class Greeting(val greeting: String) - -@RestController -interface ExampleController { - @GetMapping("/") - fun greet(@RequestParam name: String?): Greeting - - @GetMapping("/test") - fun test(@RequestParam @Parameter(required = true) name: String?): Greeting -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app7/SpringDocApp7Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app7/SpringDocApp7Test.kt deleted file mode 100644 index 5b321c55f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app7/SpringDocApp7Test.kt +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7 - -import org.springframework.aop.framework.ProxyFactory -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.ComponentScan -import org.springframework.context.support.GenericApplicationContext -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp7Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app7"]) - class DemoApplication{ - @Bean - fun controller(applicationContext: GenericApplicationContext): ExampleController { - return createProxy(ExampleController::class.java) - } - - private fun createProxy(clazz: Class): T { - val proxyFactory = ProxyFactory(clazz) - proxyFactory.targetClass = clazz - @Suppress("UNCHECKED_CAST") - return proxyFactory.proxy as T - } - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app8/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app8/ExampleController.kt deleted file mode 100644 index 061b2b9eb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app8/ExampleController.kt +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app8 - -import io.swagger.v3.oas.annotations.Parameter -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.RestController - -data class Greeting(val greeting: String) - -@RestController -interface ExampleController { - @GetMapping("/") - fun greet(@RequestParam name: String?): Greeting - - @GetMapping("/test") - fun test(@RequestParam @Parameter(required = true) name: String?): Greeting -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app8/SpringDocApp8Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app8/SpringDocApp8Test.kt deleted file mode 100644 index 3d00589d4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app8/SpringDocApp8Test.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app8 - -import org.springdoc.core.utils.Constants -import org.springframework.aop.framework.ProxyFactory -import org.springframework.boot.autoconfigure.SpringBootApplication -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.ComponentScan -import org.springframework.context.support.GenericApplicationContext -import org.springframework.test.context.TestPropertySource -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -@TestPropertySource(properties = [Constants.SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED+"=false"]) -class SpringDocApp8Test : AbstractKotlinSpringDocMVCTest() { - - @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.app8"]) - class DemoApplication{ - @Bean - fun controller(applicationContext: GenericApplicationContext): ExampleController { - return createProxy(ExampleController::class.java) - } - - private fun createProxy(clazz: Class): T { - val proxyFactory = ProxyFactory(clazz) - proxyFactory.targetClass = clazz - @Suppress("UNCHECKED_CAST") - return proxyFactory.proxy as T - } - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app9/DemoController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app9/DemoController.kt deleted file mode 100644 index 6b8793276..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app9/DemoController.kt +++ /dev/null @@ -1,71 +0,0 @@ -package test.org.springdoc.api.app9 - -import io.swagger.v3.oas.annotations.media.Schema -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -@RestController -@RequestMapping("/api/demo") -class DocumentsApiController { - - @GetMapping - suspend fun getDocuments( request: DemoRequest - ): DemoDto = DemoDto(42) -} - -data class DemoDto( - var id: Long, -) - -class DemoRequest ( - - @field:Schema(required = true, defaultValue = "a default value") - val requiredNullableDefault: String?, - - @field:Schema(required = true) - val requiredNullableNoDefault: String?, - - @field:Schema(required = true, defaultValue = "a default value") - val requiredNoNullableDefault: String, - - @field:Schema(required = true) - val requiredNoNullableNoDefault: String, - - @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") - val requiredNullableDefault1: String?, - - @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) - val requiredNullableNoDefault1: String?, - - @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") - val requiredNoNullableDefault1: String, - - @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) - val requiredNoNullableNoDefault1: String, - - @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") - val noRequiredNullableDefault2: String?, - - @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) - val noRequiredNullableNoDefault2: String?, - - @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") - val noRequiredNoNullableDefault2: String, - - @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) - val noRequiredNoNullableNoDefault2: String, - - @field:Schema(defaultValue = "a default value") - val noRequiredNullableDefault: String?, - - @field:Schema - val noRequiredNullableNoDefault: String?, - - @field:Schema(defaultValue = "a default value") - val noRequiredNoNullableDefault: String, - - @field:Schema - val noRequiredNoNullableNoDefault: String, - -) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app9/SpringDocApp9Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app9/SpringDocApp9Test.kt deleted file mode 100644 index 424b16a56..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/app9/SpringDocApp9Test.kt +++ /dev/null @@ -1,9 +0,0 @@ -package test.org.springdoc.api.app9 - -import org.springframework.boot.autoconfigure.SpringBootApplication -import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest - -class SpringDocApp9Test: AbstractKotlinSpringDocMVCTest() { - @SpringBootApplication - class DemoApplication -} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/AbstractKotlinSpringDocMVCTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/AbstractKotlinSpringDocMVCTest.kt new file mode 100644 index 000000000..ca3efc3a7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/AbstractKotlinSpringDocMVCTest.kt @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30 + +import org.junit.jupiter.api.Test +import org.skyscreamer.jsonassert.JSONAssert +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc +import org.springframework.boot.test.context.SpringBootTest +import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.TestPropertySource +import org.springframework.test.web.servlet.MockMvc +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders +import org.springframework.test.web.servlet.result.MockMvcResultMatchers +import java.nio.charset.StandardCharsets +import java.nio.file.Files +import java.nio.file.Paths + +@SpringBootTest +@AutoConfigureMockMvc +@ActiveProfiles("test") +@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_0"]) +abstract class AbstractKotlinSpringDocMVCTest { + + @Autowired + val mockMvc: MockMvc? = null + + private val logger = LoggerFactory.getLogger(AbstractKotlinSpringDocMVCTest::class.java) + + @Test + fun testApp() { + var result: String? = null + try { + val response = mockMvc!!.perform(MockMvcRequestBuilders.get("/v3/api-docs")) + .andExpect(MockMvcResultMatchers.status().isOk).andReturn() + + result = response.response.contentAsString + val className = javaClass.simpleName + val testNumber = className.replace("[^0-9]".toRegex(), "") + + val expected = getContent("results/3.0.1/app$testNumber.json") + JSONAssert.assertEquals(expected, result, true) + } catch (e: AssertionError) { + logger.error(result) + throw e + } + } + + companion object { + @Throws(Exception::class) + fun getContent(fileName: String): String { + try { + val path = Paths.get( + AbstractKotlinSpringDocMVCTest::class.java.classLoader.getResource( + fileName + )!!.toURI() + ) + val fileBytes = Files.readAllBytes(path) + return String(fileBytes, StandardCharsets.UTF_8) + } catch (e: Exception) { + throw RuntimeException("Failed to read file: $fileName", e) + } + + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/ExampleController.kt new file mode 100644 index 000000000..f6a934d51 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/ExampleController.kt @@ -0,0 +1,20 @@ +package test.org.springdoc.api.v30.app10 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController +import test.org.springdoc.api.v30.app8.Greeting + +data class Greeting(val greeting: String) + +@RestController +class ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?) = Greeting("Hello ${name ?: "world"}") + + @GetMapping("/test") + fun test(@RequestParam name: String) = Greeting("Hello $name") + + @GetMapping("/test-with-default") + fun testWithDefault(@RequestParam(defaultValue = "world") name: String) = Greeting("Hello $name") +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/SpringDocApp10Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/SpringDocApp10Test.kt new file mode 100644 index 000000000..c6da84742 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app10/SpringDocApp10Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app10 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp10Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app10"]) + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/ExampleController.kt new file mode 100644 index 000000000..9d76259b1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/ExampleController.kt @@ -0,0 +1,96 @@ +package test.org.springdoc.api.v30.app11 + +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +@RestController +class ExampleController { + + @Operation( + summary = "foo api", + description = """ + this api is foo + + #### Custom exception case + | Http Status | Error Code | Error Message | Error Data | Remark | + |-------------|-------------|--------------|------------|-----------| + | 403 | NO_PERMISSION |This request is only available to administrators. | | | + | 400 | STORE_NOT_FOUND |Store not found. | | | + """ + ) + @GetMapping("/foo/trim-kotlin-indent") + fun readFoo(@RequestParam name: String?) = FooResponse("Hello ${name ?: "world"}") + +} + +data class FooResponse( + val name: String, +) + +@RestController +class ExampleController2 { + + @GetMapping("/foo/trim-kotlin-indent/schema") + fun readFoo( + @RequestBody request: FooRequestWithSchema, + ) = FooResponseWithSchema( + name = "Hello ${request.age ?: "world"}", + subFoo = SubFooResponseWithSchema(subName = "sub foo name"), + ) +} + +@Schema( + name = "foo request", + description = """ + foo request class description + with kotlin indent + """ +) +data class FooRequestWithSchema( + @Schema( + name = "age", + description = """ + foo request field with kotlin indent + """ + ) + val age: Int, +) + +@Schema( + name = "foo response", + description = """ + foo response class description + with kotlin indent + """ +) +data class FooResponseWithSchema( + @Schema( + name = "name", + description = """ + foo response fields with kotlin indent + """ + ) + val name: String, + val subFoo: SubFooResponseWithSchema +) + +@Schema( + name = "sub foo response", + description = """ + sub foo response class description + with kotlin indent + """ +) +data class SubFooResponseWithSchema( + @Schema( + name = "subName", + description = """ + sub foo response fields with kotlin indent + """ + ) + val subName: String, +) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SpringDocApp11Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SpringDocApp11Test.kt new file mode 100644 index 000000000..7629835f1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app11/SpringDocApp11Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app11 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import org.springframework.test.context.TestPropertySource +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +@TestPropertySource(properties = ["springdoc.trim-kotlin-indent=true"]) +class SpringDocApp11Test : AbstractKotlinSpringDocMVCTest() { + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app11"]) + class DemoApplication +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java new file mode 100644 index 000000000..d66aa497f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java @@ -0,0 +1,18 @@ +package test.org.springdoc.api.v30.app12; + +import jakarta.annotation.Nullable; +import test.org.springdoc.api.v30.app12.SpringDocApp12Test.MyEnum; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +public class EnumController { + @GetMapping("/test-enum-2") + String testEnum2(@Nullable MyEnum e) { + return ""; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt new file mode 100644 index 000000000..b64b2d186 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt @@ -0,0 +1,35 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app12 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp12Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app12"]) + class DemoApplication + + enum class MyEnum { + A, B; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app13/SpringDocApp13Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app13/SpringDocApp13Test.kt new file mode 100644 index 000000000..de0d251ee --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app13/SpringDocApp13Test.kt @@ -0,0 +1,33 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app13 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.test.context.TestPropertySource +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_1"]) +class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + class DemoApplication { + } + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app13/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app13/TestController.kt new file mode 100644 index 000000000..e9feb4c50 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app13/TestController.kt @@ -0,0 +1,50 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app13 + + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@Schema(description = "Generic description") +data class KeyValue( + val key: String, + val value: String, +) + +@Schema +data class SomeDTO( + @Schema(description = "Description A") val fieldA: KeyValue, + @Schema(description = "Description B") val fieldB: KeyValue, +) + + + +@RestController +@RequestMapping("/test") +class TestController { + @PostMapping("/test") + fun create(@RequestBody some: SomeDTO) { + + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app14/SpringDocApp14Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app14/SpringDocApp14Test.kt new file mode 100644 index 000000000..52068bd62 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app14/SpringDocApp14Test.kt @@ -0,0 +1,29 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app14 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp14Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app14/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app14/TestController.kt new file mode 100644 index 000000000..3dcc3b1c5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app14/TestController.kt @@ -0,0 +1,47 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app14 + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@Schema(description = "Generic description") +data class KeyValue( + val key: String, + val value: String, +) + +@Schema +data class SomeDTO( + @Schema(description = "Description A", allOf = [KeyValue::class]) val field_a: KeyValue, + @Schema(description = "Description B", allOf = [KeyValue::class]) val field_b: KeyValue, +) + +@RestController +@RequestMapping("/test") +class TestController { + + @PostMapping("/test") + fun create(@RequestBody some: SomeDTO) { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SpringDocApp2Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SpringDocApp2Test.kt new file mode 100644 index 000000000..8efd5fac7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SpringDocApp2Test.kt @@ -0,0 +1,29 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app2 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp2Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SystemStatusController.kt new file mode 100644 index 000000000..43484e033 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app2/SystemStatusController.kt @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app2 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class SystemStatusResponse( + val status: SystemStatus +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + fun index() = SystemStatusResponse(SystemStatus.OK) + + @GetMapping("/foo") + fun foo() = + SystemStatusResponse(SystemStatus.OK) + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SpringDocApp3Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SpringDocApp3Test.kt new file mode 100644 index 000000000..e3a872246 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SpringDocApp3Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app3 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp3Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app3"]) + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SystemStatusController.kt new file mode 100644 index 000000000..970a7df71 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app3/SystemStatusController.kt @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app3 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class SystemStatusResponse( + val status: SystemStatus +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + fun index() = SystemStatusResponse(SystemStatus.OK) + + @GetMapping("/foo") + @Deprecated("") + fun foo() = SystemStatusResponse(SystemStatus.OK) + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/HelloController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/HelloController.kt new file mode 100644 index 000000000..94d495cc8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/HelloController.kt @@ -0,0 +1,37 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app4 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + + +data class Person( + val name: String, + val nickname: String? +) + +@RestController +@RequestMapping("/test") +class HelloController { + @GetMapping + suspend fun index(s: Person) = s + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/SpringDocApp4Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/SpringDocApp4Test.kt new file mode 100644 index 000000000..12bf40fed --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app4/SpringDocApp4Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app4 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp4Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app4"]) + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/ListController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/ListController.kt new file mode 100644 index 000000000..be4ea76f1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/ListController.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app5 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +@RequestMapping("/test") +class ListController { + + @GetMapping("/") + fun foo(): List = listOf(1, 2, 3) +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/SpringDocApp5Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/SpringDocApp5Test.kt new file mode 100644 index 000000000..d0f27c312 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app5/SpringDocApp5Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app5 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp5Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app5"]) + class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/ByteArrayController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/ByteArrayController.kt new file mode 100644 index 000000000..3d38ef2e6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/ByteArrayController.kt @@ -0,0 +1,34 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app6 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +data class Foo(val data: ByteArray) + +@RestController +@RequestMapping("/bytearray") +class ByteArrayController { + + @GetMapping("/") + fun getByteArray(): Foo = Foo(byteArrayOf(0)) + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/SpringDocApp6Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/SpringDocApp6Test.kt new file mode 100644 index 000000000..b9c96e777 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app6/SpringDocApp6Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app6 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp6Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app6"]) + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/ExampleController.kt new file mode 100644 index 000000000..351b60f88 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/ExampleController.kt @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v30.app7 + +import io.swagger.v3.oas.annotations.Parameter +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +data class Greeting(val greeting: String) + +@RestController +interface ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?): Greeting + + @GetMapping("/test") + fun test(@RequestParam @Parameter(required = true) name: String?): Greeting +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/SpringDocApp7Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/SpringDocApp7Test.kt new file mode 100644 index 000000000..d4c6c38aa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app7/SpringDocApp7Test.kt @@ -0,0 +1,46 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app7 + +import org.springframework.aop.framework.ProxyFactory +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.ComponentScan +import org.springframework.context.support.GenericApplicationContext +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp7Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app7"]) + class DemoApplication{ + @Bean + fun controller(applicationContext: GenericApplicationContext): ExampleController { + return createProxy(ExampleController::class.java) + } + + private fun createProxy(clazz: Class): T { + val proxyFactory = ProxyFactory(clazz) + proxyFactory.targetClass = clazz + @Suppress("UNCHECKED_CAST") + return proxyFactory.proxy as T + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/ExampleController.kt new file mode 100644 index 000000000..60058ec9d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/ExampleController.kt @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v30.app8 + +import io.swagger.v3.oas.annotations.Parameter +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +data class Greeting(val greeting: String) + +@RestController +interface ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?): Greeting + + @GetMapping("/test") + fun test(@RequestParam @Parameter(required = true) name: String?): Greeting +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/SpringDocApp8Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/SpringDocApp8Test.kt new file mode 100644 index 000000000..a6a17dca9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app8/SpringDocApp8Test.kt @@ -0,0 +1,49 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v30.app8 + +import org.springdoc.core.utils.Constants +import org.springframework.aop.framework.ProxyFactory +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.ComponentScan +import org.springframework.context.support.GenericApplicationContext +import org.springframework.test.context.TestPropertySource +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +@TestPropertySource(properties = [Constants.SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED+"=false"]) +class SpringDocApp8Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app8"]) + class DemoApplication{ + @Bean + fun controller(applicationContext: GenericApplicationContext): ExampleController { + return createProxy(ExampleController::class.java) + } + + private fun createProxy(clazz: Class): T { + val proxyFactory = ProxyFactory(clazz) + proxyFactory.targetClass = clazz + @Suppress("UNCHECKED_CAST") + return proxyFactory.proxy as T + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/DemoController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/DemoController.kt new file mode 100644 index 000000000..7e3e12eda --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/DemoController.kt @@ -0,0 +1,71 @@ +package test.org.springdoc.api.v30.app9 + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +@RequestMapping("/api/demo") +class DocumentsApiController { + + @GetMapping + suspend fun getDocuments( request: DemoRequest + ): DemoDto = DemoDto(42) +} + +data class DemoDto( + var id: Long, +) + +class DemoRequest ( + + @field:Schema(required = true, defaultValue = "a default value") + val requiredNullableDefault: String?, + + @field:Schema(required = true) + val requiredNullableNoDefault: String?, + + @field:Schema(required = true, defaultValue = "a default value") + val requiredNoNullableDefault: String, + + @field:Schema(required = true) + val requiredNoNullableNoDefault: String, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") + val requiredNullableDefault1: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) + val requiredNullableNoDefault1: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") + val requiredNoNullableDefault1: String, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) + val requiredNoNullableNoDefault1: String, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") + val noRequiredNullableDefault2: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) + val noRequiredNullableNoDefault2: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") + val noRequiredNoNullableDefault2: String, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) + val noRequiredNoNullableNoDefault2: String, + + @field:Schema(defaultValue = "a default value") + val noRequiredNullableDefault: String?, + + @field:Schema + val noRequiredNullableNoDefault: String?, + + @field:Schema(defaultValue = "a default value") + val noRequiredNoNullableDefault: String, + + @field:Schema + val noRequiredNoNullableNoDefault: String, + +) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/SpringDocApp9Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/SpringDocApp9Test.kt new file mode 100644 index 000000000..070591c3c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app9/SpringDocApp9Test.kt @@ -0,0 +1,9 @@ +package test.org.springdoc.api.v30.app9 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp9Test: AbstractKotlinSpringDocMVCTest() { + @SpringBootApplication + class DemoApplication +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt new file mode 100644 index 000000000..bf7f9e4f7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31 + +import org.junit.jupiter.api.Test +import org.skyscreamer.jsonassert.JSONAssert +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc +import org.springframework.boot.test.context.SpringBootTest +import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.TestPropertySource +import org.springframework.test.web.servlet.MockMvc +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders +import org.springframework.test.web.servlet.result.MockMvcResultMatchers +import java.nio.charset.StandardCharsets +import java.nio.file.Files +import java.nio.file.Paths + +@SpringBootTest +@AutoConfigureMockMvc +@ActiveProfiles("test") +@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_0"]) +abstract class AbstractKotlinSpringDocMVCTest { + + @Autowired + val mockMvc: MockMvc? = null + + private val logger = LoggerFactory.getLogger(AbstractKotlinSpringDocMVCTest::class.java) + + @Test + fun testApp() { + var result: String? = null + try { + val response = mockMvc!!.perform(MockMvcRequestBuilders.get("/v3/api-docs")) + .andExpect(MockMvcResultMatchers.status().isOk).andReturn() + + result = response.response.contentAsString + val className = javaClass.simpleName + val testNumber = className.replace("[^0-9]".toRegex(), "") + + val expected = getContent("results/3.1.0/app$testNumber.json") + JSONAssert.assertEquals(expected, result, true) + } catch (e: AssertionError) { + logger.error(result) + throw e + } + } + + companion object { + @Throws(Exception::class) + fun getContent(fileName: String): String { + try { + val path = Paths.get( + AbstractKotlinSpringDocMVCTest::class.java.classLoader.getResource( + fileName + )!!.toURI() + ) + val fileBytes = Files.readAllBytes(path) + return String(fileBytes, StandardCharsets.UTF_8) + } catch (e: Exception) { + throw RuntimeException("Failed to read file: $fileName", e) + } + + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/ExampleController.kt new file mode 100644 index 000000000..558f23c08 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/ExampleController.kt @@ -0,0 +1,20 @@ +package test.org.springdoc.api.v31.app10 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController +import test.org.springdoc.api.v30.app8.Greeting + +data class Greeting(val greeting: String) + +@RestController +class ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?) = Greeting("Hello ${name ?: "world"}") + + @GetMapping("/test") + fun test(@RequestParam name: String) = Greeting("Hello $name") + + @GetMapping("/test-with-default") + fun testWithDefault(@RequestParam(defaultValue = "world") name: String) = Greeting("Hello $name") +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt new file mode 100644 index 000000000..07eab19ac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app10 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp10Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app10"]) + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/ExampleController.kt new file mode 100644 index 000000000..a1a1cab17 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/ExampleController.kt @@ -0,0 +1,96 @@ +package test.org.springdoc.api.v31.app11 + +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +@RestController +class ExampleController { + + @Operation( + summary = "foo api", + description = """ + this api is foo + + #### Custom exception case + | Http Status | Error Code | Error Message | Error Data | Remark | + |-------------|-------------|--------------|------------|-----------| + | 403 | NO_PERMISSION |This request is only available to administrators. | | | + | 400 | STORE_NOT_FOUND |Store not found. | | | + """ + ) + @GetMapping("/foo/trim-kotlin-indent") + fun readFoo(@RequestParam name: String?) = FooResponse("Hello ${name ?: "world"}") + +} + +data class FooResponse( + val name: String, +) + +@RestController +class ExampleController2 { + + @GetMapping("/foo/trim-kotlin-indent/schema") + fun readFoo( + @RequestBody request: FooRequestWithSchema, + ) = FooResponseWithSchema( + name = "Hello ${request.age ?: "world"}", + subFoo = SubFooResponseWithSchema(subName = "sub foo name"), + ) +} + +@Schema( + name = "foo request", + description = """ + foo request class description + with kotlin indent + """ +) +data class FooRequestWithSchema( + @Schema( + name = "age", + description = """ + foo request field with kotlin indent + """ + ) + val age: Int, +) + +@Schema( + name = "foo response", + description = """ + foo response class description + with kotlin indent + """ +) +data class FooResponseWithSchema( + @Schema( + name = "name", + description = """ + foo response fields with kotlin indent + """ + ) + val name: String, + val subFoo: SubFooResponseWithSchema +) + +@Schema( + name = "sub foo response", + description = """ + sub foo response class description + with kotlin indent + """ +) +data class SubFooResponseWithSchema( + @Schema( + name = "subName", + description = """ + sub foo response fields with kotlin indent + """ + ) + val subName: String, +) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt new file mode 100644 index 000000000..32c35f763 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app11 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import org.springframework.test.context.TestPropertySource +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +@TestPropertySource(properties = ["springdoc.trim-kotlin-indent=true"]) +class SpringDocApp11Test : AbstractKotlinSpringDocMVCTest() { + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app11"]) + class DemoApplication +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java new file mode 100644 index 000000000..84bd951a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java @@ -0,0 +1,18 @@ +package test.org.springdoc.api.v31.app12; + +import jakarta.annotation.Nullable; +import test.org.springdoc.api.v30.app12.SpringDocApp12Test.MyEnum; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author bnasslahsen + */ +@RestController +public class EnumController { + @GetMapping("/test-enum-2") + String testEnum2(@Nullable MyEnum e) { + return ""; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt new file mode 100644 index 000000000..1eb24c835 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt @@ -0,0 +1,35 @@ +/* + * + * * Copyright 2019-2023 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app12 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp12Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app12"]) + class DemoApplication + + enum class MyEnum { + A, B; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/SpringDocApp13Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/SpringDocApp13Test.kt new file mode 100644 index 000000000..eedc437f3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/SpringDocApp13Test.kt @@ -0,0 +1,33 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app13 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.test.context.TestPropertySource +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_1"]) +class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + class DemoApplication { + } + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/TestController.kt new file mode 100644 index 000000000..054b141b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/TestController.kt @@ -0,0 +1,50 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app13 + + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@Schema(description = "Generic description") +data class KeyValue( + val key: String, + val value: String, +) + +@Schema +data class SomeDTO( + @Schema(description = "Description A") val fieldA: KeyValue, + @Schema(description = "Description B") val fieldB: KeyValue, +) + + + +@RestController +@RequestMapping("/test") +class TestController { + @PostMapping("/test") + fun create(@RequestBody some: SomeDTO) { + + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/SpringDocApp14Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/SpringDocApp14Test.kt new file mode 100644 index 000000000..0a039c9b4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/SpringDocApp14Test.kt @@ -0,0 +1,29 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app14 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp14Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/TestController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/TestController.kt new file mode 100644 index 000000000..feb0099a9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/TestController.kt @@ -0,0 +1,47 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app14 + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@Schema(description = "Generic description") +data class KeyValue( + val key: String, + val value: String, +) + +@Schema +data class SomeDTO( + @Schema(description = "Description A", allOf = [KeyValue::class]) val field_a: KeyValue, + @Schema(description = "Description B", allOf = [KeyValue::class]) val field_b: KeyValue, +) + +@RestController +@RequestMapping("/test") +class TestController { + + @PostMapping("/test") + fun create(@RequestBody some: SomeDTO) { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt new file mode 100644 index 000000000..2bce75616 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt @@ -0,0 +1,29 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app2 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp2Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SystemStatusController.kt new file mode 100644 index 000000000..2c91ee198 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SystemStatusController.kt @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app2 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class SystemStatusResponse( + val status: SystemStatus +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + fun index() = SystemStatusResponse(SystemStatus.OK) + + @GetMapping("/foo") + fun foo() = + SystemStatusResponse(SystemStatus.OK) + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt new file mode 100644 index 000000000..d6d36c472 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app3 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp3Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app3"]) + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SystemStatusController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SystemStatusController.kt new file mode 100644 index 000000000..9e0645677 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SystemStatusController.kt @@ -0,0 +1,43 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app3 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +enum class SystemStatus(val status: String) { + OK("OK") +} + +data class SystemStatusResponse( + val status: SystemStatus +) + +@RestController +@RequestMapping("/status") +class SystemStatusController { + @GetMapping + fun index() = SystemStatusResponse(SystemStatus.OK) + + @GetMapping("/foo") + @Deprecated("") + fun foo() = SystemStatusResponse(SystemStatus.OK) + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/HelloController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/HelloController.kt new file mode 100644 index 000000000..f1ff201e3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/HelloController.kt @@ -0,0 +1,37 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app4 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + + +data class Person( + val name: String, + val nickname: String? +) + +@RestController +@RequestMapping("/test") +class HelloController { + @GetMapping + suspend fun index(s: Person) = s + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt new file mode 100644 index 000000000..2759ab955 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app4 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp4Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app4"]) + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/ListController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/ListController.kt new file mode 100644 index 000000000..a3eb0eebb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/ListController.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app5 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +@RequestMapping("/test") +class ListController { + + @GetMapping("/") + fun foo(): List = listOf(1, 2, 3) +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt new file mode 100644 index 000000000..33358bcc5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app5 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp5Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app5"]) + class DemoApplication + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/ByteArrayController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/ByteArrayController.kt new file mode 100644 index 000000000..1e468b12b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/ByteArrayController.kt @@ -0,0 +1,34 @@ +/* + * + * * Copyright 2019-2024 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app6 + +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +data class Foo(val data: ByteArray) + +@RestController +@RequestMapping("/bytearray") +class ByteArrayController { + + @GetMapping("/") + fun getByteArray(): Foo = Foo(byteArrayOf(0)) + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt new file mode 100644 index 000000000..e09f33a0e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app6 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp6Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app6"]) + class DemoApplication + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/ExampleController.kt new file mode 100644 index 000000000..7675ccc3f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/ExampleController.kt @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v31.app7 + +import io.swagger.v3.oas.annotations.Parameter +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +data class Greeting(val greeting: String) + +@RestController +interface ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?): Greeting + + @GetMapping("/test") + fun test(@RequestParam @Parameter(required = true) name: String?): Greeting +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt new file mode 100644 index 000000000..6841c4503 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt @@ -0,0 +1,46 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app7 + +import org.springframework.aop.framework.ProxyFactory +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.ComponentScan +import org.springframework.context.support.GenericApplicationContext +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp7Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app7"]) + class DemoApplication{ + @Bean + fun controller(applicationContext: GenericApplicationContext): ExampleController { + return createProxy(ExampleController::class.java) + } + + private fun createProxy(clazz: Class): T { + val proxyFactory = ProxyFactory(clazz) + proxyFactory.targetClass = clazz + @Suppress("UNCHECKED_CAST") + return proxyFactory.proxy as T + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/ExampleController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/ExampleController.kt new file mode 100644 index 000000000..6d78841cd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/ExampleController.kt @@ -0,0 +1,17 @@ +package test.org.springdoc.api.v31.app8 + +import io.swagger.v3.oas.annotations.Parameter +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestParam +import org.springframework.web.bind.annotation.RestController + +data class Greeting(val greeting: String) + +@RestController +interface ExampleController { + @GetMapping("/") + fun greet(@RequestParam name: String?): Greeting + + @GetMapping("/test") + fun test(@RequestParam @Parameter(required = true) name: String?): Greeting +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt new file mode 100644 index 000000000..a8251dbc2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt @@ -0,0 +1,49 @@ +/* + * + * * Copyright 2019-2020 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app8 + +import org.springdoc.core.utils.Constants +import org.springframework.aop.framework.ProxyFactory +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.ComponentScan +import org.springframework.context.support.GenericApplicationContext +import org.springframework.test.context.TestPropertySource +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +@TestPropertySource(properties = [Constants.SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED+"=false"]) +class SpringDocApp8Test : AbstractKotlinSpringDocMVCTest() { + + @SpringBootApplication + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app8"]) + class DemoApplication{ + @Bean + fun controller(applicationContext: GenericApplicationContext): ExampleController { + return createProxy(ExampleController::class.java) + } + + private fun createProxy(clazz: Class): T { + val proxyFactory = ProxyFactory(clazz) + proxyFactory.targetClass = clazz + @Suppress("UNCHECKED_CAST") + return proxyFactory.proxy as T + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/DemoController.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/DemoController.kt new file mode 100644 index 000000000..89de59a98 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/DemoController.kt @@ -0,0 +1,71 @@ +package test.org.springdoc.api.v31.app9 + +import io.swagger.v3.oas.annotations.media.Schema +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +@RequestMapping("/api/demo") +class DocumentsApiController { + + @GetMapping + suspend fun getDocuments( request: DemoRequest + ): DemoDto = DemoDto(42) +} + +data class DemoDto( + var id: Long, +) + +class DemoRequest ( + + @field:Schema(required = true, defaultValue = "a default value") + val requiredNullableDefault: String?, + + @field:Schema(required = true) + val requiredNullableNoDefault: String?, + + @field:Schema(required = true, defaultValue = "a default value") + val requiredNoNullableDefault: String, + + @field:Schema(required = true) + val requiredNoNullableNoDefault: String, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") + val requiredNullableDefault1: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) + val requiredNullableNoDefault1: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED, defaultValue = "a default value") + val requiredNoNullableDefault1: String, + + @field:Schema(requiredMode = Schema.RequiredMode.REQUIRED) + val requiredNoNullableNoDefault1: String, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") + val noRequiredNullableDefault2: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) + val noRequiredNullableNoDefault2: String?, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, defaultValue = "a default value") + val noRequiredNoNullableDefault2: String, + + @field:Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED) + val noRequiredNoNullableNoDefault2: String, + + @field:Schema(defaultValue = "a default value") + val noRequiredNullableDefault: String?, + + @field:Schema + val noRequiredNullableNoDefault: String?, + + @field:Schema(defaultValue = "a default value") + val noRequiredNoNullableDefault: String, + + @field:Schema + val noRequiredNoNullableNoDefault: String, + +) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt new file mode 100644 index 000000000..bef0623e6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt @@ -0,0 +1,9 @@ +package test.org.springdoc.api.v31.app9 + +import org.springframework.boot.autoconfigure.SpringBootApplication +import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest + +class SpringDocApp9Test: AbstractKotlinSpringDocMVCTest() { + @SpringBootApplication + class DemoApplication +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app1.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app10.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app10.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app10.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app10.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app11.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app11.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app11.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app12.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app12.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app12.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app12.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app13.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app13.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app13.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app14.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app14.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app14.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app14.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app2.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app3.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app3.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app3.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app3.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app4.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app4.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app4.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app4.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app5.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app5.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app5.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app5.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app6.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app6.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app6.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app6.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app7.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app7.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app7.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app7.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app8.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app8.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app8.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app8.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app9.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app9.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/app9.json rename to springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app9.json diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app1.json new file mode 100644 index 000000000..611c6c404 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app1.json @@ -0,0 +1,51 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Kotlin API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "", + "description": "Generated server url" + } + ], + "paths": { + "/test/{id}": { + "get": { + "tags": [ + "controller-with-continuation-parameter" + ], + "summary": "Ignore Continuation parameter", + "operationId": "get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app10.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app10.json new file mode 100644 index 000000000..6c1d0bb05 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app10.json @@ -0,0 +1,121 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/test": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/test-with-default": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "testWithDefault", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "world" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "required": [ + "greeting" + ], + "type": "object", + "properties": { + "greeting": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app11.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app11.json new file mode 100644 index 000000000..a15b4ed94 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app11.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/foo/trim-kotlin-indent": { + "get": { + "tags": [ + "example-controller" + ], + "summary": "foo api", + "description": "\nthis api is foo\n\n#### Custom exception case\n| Http Status | Error Code | Error Message | Error Data | Remark |\n|-------------|-------------|--------------|------------|-----------|\n| 403 | NO_PERMISSION |This request is only available to administrators. | | |\n| 400 | STORE_NOT_FOUND |Store not found. | | |\n", + "operationId": "readFoo", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/FooResponse" + } + } + } + } + } + } + }, + "/foo/trim-kotlin-indent/schema": { + "get": { + "tags": [ + "example-controller-2" + ], + "operationId": "readFoo_1", + "parameters": [ + { + "name": "request", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/foo request" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/foo response" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "FooResponse": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "foo request": { + "required": [ + "age" + ], + "type": "object", + "properties": { + "age": { + "type": "integer", + "description": "\nfoo request field with kotlin indent\n", + "format": "int32" + } + }, + "description": "\nfoo request class description\nwith kotlin indent\n" + }, + "foo response": { + "required": [ + "name", + "subFoo" + ], + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "\nfoo response fields with kotlin indent\n" + }, + "subFoo": { + "$ref": "#/components/schemas/sub foo response" + } + }, + "description": "\nfoo response class description\nwith kotlin indent\n" + }, + "sub foo response": { + "required": [ + "subName" + ], + "type": "object", + "properties": { + "subName": { + "type": "string", + "description": "\nsub foo response fields with kotlin indent\n" + } + }, + "description": "\nsub foo response class description\nwith kotlin indent\n" + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app12.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app12.json new file mode 100644 index 000000000..868d8de2b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app12.json @@ -0,0 +1,50 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test-enum-2": { + "get": { + "tags": [ + "enum-controller" + ], + "operationId": "testEnum2", + "parameters": [ + { + "name": "e", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "A", + "B" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app13.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app13.json new file mode 100644 index 000000000..6bf07eb5b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app13.json @@ -0,0 +1,68 @@ +{ + "openapi" : "3.1.0", + "info" : { + "title" : "OpenAPI definition", + "version" : "v0" + }, + "servers" : [ { + "url" : "http://localhost", + "description" : "Generated server url" + } ], + "paths" : { + "/test/test" : { + "post" : { + "tags" : [ "test-controller" ], + "operationId" : "create", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SomeDTO" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK" + } + } + } + } + }, + "components" : { + "schemas" : { + "KeyValue" : { + "required" : [ "key", "value" ], + "type" : "object", + "description" : "Generic description", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" + } + } + }, + "SomeDTO" : { + "required": [ + "fieldA", + "fieldB" + ], + "type": "object", + "properties": { + "fieldA": { + "description": "Description A", + "$ref": "#/components/schemas/KeyValue" + }, + "fieldB": { + "description": "Description B", + "$ref": "#/components/schemas/KeyValue" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app14.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app14.json new file mode 100644 index 000000000..987ebdff3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app14.json @@ -0,0 +1,81 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test/test": { + "post": { + "tags": [ + "test-controller" + ], + "operationId": "create", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SomeDTO" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "KeyValue": { + "required": [ + "key", + "value" + ], + "type": "object", + "description": "Generic description", + "allOf": [ + { + "$ref": "#/components/schemas/KeyValue" + }, + { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + ] + }, + "SomeDTO": { + "required": [ + "field_a", + "field_b" + ], + "type": "object", + "properties": { + "field_a": { + "$ref": "#/components/schemas/KeyValue" + }, + "field_b": { + "$ref": "#/components/schemas/KeyValue" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app2.json new file mode 100644 index 000000000..956fd589c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app2.json @@ -0,0 +1,73 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/status": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "index", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + }, + "/status/foo": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "foo", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SystemStatusResponse": { + "required": [ + "status" + ], + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "OK" + ] + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app3.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app3.json new file mode 100644 index 000000000..65a4798da --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app3.json @@ -0,0 +1,74 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/status": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "index", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + } + } + }, + "/status/foo": { + "get": { + "tags": [ + "system-status-controller" + ], + "operationId": "foo", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SystemStatusResponse" + } + } + } + } + }, + "deprecated": true + } + } + }, + "components": { + "schemas": { + "SystemStatusResponse": { + "required": [ + "status" + ], + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "OK" + ] + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app4.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app4.json new file mode 100644 index 000000000..e374b0e9a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app4.json @@ -0,0 +1,63 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "index", + "parameters": [ + { + "name": "s", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Person" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "nickname": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app5.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app5.json new file mode 100644 index 000000000..2b7a7f5bf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app5.json @@ -0,0 +1,40 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test/": { + "get": { + "tags": [ + "list-controller" + ], + "operationId": "foo", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app6.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app6.json new file mode 100644 index 000000000..5b159ebcd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app6.json @@ -0,0 +1,51 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/bytearray/": { + "get": { + "tags": [ + "byte-array-controller" + ], + "operationId": "getByteArray", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Foo" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Foo": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte" + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app7.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app7.json new file mode 100644 index 000000000..60439b2ba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app7.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/test": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "required": [ + "greeting" + ], + "type": "object", + "properties": { + "greeting": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app8.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app8.json new file mode 100644 index 000000000..60439b2ba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app8.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "greet", + "parameters": [ + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + }, + "/test": { + "get": { + "tags": [ + "example-controller" + ], + "operationId": "test", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Greeting" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Greeting": { + "required": [ + "greeting" + ], + "type": "object", + "properties": { + "greeting": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app9.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app9.json new file mode 100644 index 000000000..99fc92a3a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app9.json @@ -0,0 +1,133 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/demo": { + "get": { + "tags": [ + "documents-api-controller" + ], + "operationId": "getDocuments", + "parameters": [ + { + "name": "request", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/DemoRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/DemoDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "DemoRequest": { + "required": [ + "noRequiredNoNullableNoDefault", + "requiredNoNullableDefault", + "requiredNoNullableDefault1", + "requiredNoNullableNoDefault", + "requiredNoNullableNoDefault1", + "requiredNullableDefault", + "requiredNullableDefault1", + "requiredNullableNoDefault", + "requiredNullableNoDefault1" + ], + "type": "object", + "properties": { + "requiredNullableDefault": { + "type": "string", + "default": "a default value" + }, + "requiredNullableNoDefault": { + "type": "string" + }, + "requiredNoNullableDefault": { + "type": "string", + "default": "a default value" + }, + "requiredNoNullableNoDefault": { + "type": "string" + }, + "requiredNullableDefault1": { + "type": "string", + "default": "a default value" + }, + "requiredNullableNoDefault1": { + "type": "string" + }, + "requiredNoNullableDefault1": { + "type": "string", + "default": "a default value" + }, + "requiredNoNullableNoDefault1": { + "type": "string" + }, + "noRequiredNullableDefault2": { + "type": "string", + "default": "a default value" + }, + "noRequiredNullableNoDefault2": { + "type": "string" + }, + "noRequiredNoNullableDefault2": { + "type": "string", + "default": "a default value" + }, + "noRequiredNoNullableNoDefault2": { + "type": "string" + }, + "noRequiredNullableDefault": { + "type": "string", + "default": "a default value" + }, + "noRequiredNullableNoDefault": { + "type": "string" + }, + "noRequiredNoNullableDefault": { + "type": "string", + "default": "a default value" + }, + "noRequiredNoNullableNoDefault": { + "type": "string" + } + } + }, + "DemoDto": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java deleted file mode 100644 index 6bff84da3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/AbstractSpringDocTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api; - -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.junit.jupiter.api.Test; -import org.springdoc.core.utils.Constants; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.Configuration; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; - -import static org.hamcrest.Matchers.is; -import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@ActiveProfiles("test") -@SpringBootTest -@AutoConfigureMockMvc -@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) -public abstract class AbstractSpringDocTest { - - public static String className; - - @Autowired - protected MockMvc mockMvc; - - public static String getContent(String fileName) { - try { - Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); - byte[] fileBytes = Files.readAllBytes(path); - return new String(fileBytes, StandardCharsets.UTF_8); - } - catch (Exception e) { - throw new RuntimeException("Failed to read file: " + fileName, e); - } - } - - @Test - void testApp() throws Exception { - className = getClass().getSimpleName(); - String testNumber = className.replaceAll("[^0-9]", ""); - MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) - .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); - String result = mockMvcResult.getResponse().getContentAsString(); - String expected = getContent("results/app" + testNumber + ".json"); - assertEquals(expected, result, true); - } - - @Configuration - @EnableAutoConfiguration(exclude = { SecurityAutoConfiguration.class }) - static class ContextConfiguration {} -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java deleted file mode 100644 index 063133377..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/HelloController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import org.springframework.security.core.annotation.AuthenticationPrincipal; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; -import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @PostMapping(value = "/persons") - public String persons(@RequestBody() Person person) { - return "OK"; - } - - @PostMapping(value = "/persons-with-user") - public String personsWithUser(@RequestBody() Person person, - @AuthenticationPrincipal User user) { - return "OK"; - } - - @PostMapping(value = "/persons-with-oauth2-user") - public String personsWithUser(@RequestBody() Person person, - @RegisteredOAuth2AuthorizedClient OAuth2AuthorizedClient authorizedClient, - @AuthenticationPrincipal User user) { - return "OK"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/Person.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/Person.java deleted file mode 100644 index f33d80b6f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/Person.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -public class Person { - - private String name; - - public Person() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java deleted file mode 100644 index 4daff5662..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app1/SpringDocApp1Test.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app1; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -public class SpringDocApp1Test extends AbstractSpringDocTest { - - @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration,test.org.springdoc.api.app1" }) - static class SpringDocTestApp { - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info().title("Security API").version("v1") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/AuthorizationServerConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/AuthorizationServerConfig.java deleted file mode 100644 index cf0c68acd..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/AuthorizationServerConfig.java +++ /dev/null @@ -1,78 +0,0 @@ -package test.org.springdoc.api.app10; - -import java.util.UUID; - -import com.nimbusds.jose.jwk.JWKSet; -import com.nimbusds.jose.jwk.RSAKey; -import com.nimbusds.jose.jwk.source.JWKSource; -import com.nimbusds.jose.proc.SecurityContext; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.oauth2.core.AuthorizationGrantType; -import org.springframework.security.oauth2.jwt.JwtDecoder; -import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService; -import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; -import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; -import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; -import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; -import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; -import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; -import org.springframework.security.oauth2.server.authorization.settings.ClientSettings; -import org.springframework.security.web.SecurityFilterChain; - -/* - * @author James Selvakumar - * @since 8.0.0 - */ -@Configuration -public class AuthorizationServerConfig -{ - @Bean - public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception - { - OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); - return http.build(); - } - - @Bean - public RegisteredClientRepository registeredClientRepository() { - RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) - .clientId("messaging-client") - .clientSecret("{noop}secret") - .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) - .scope("message.read") - .scope("message.write") - .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) - .build(); - - return new InMemoryRegisteredClientRepository(registeredClient); - } - - @Bean - public OAuth2AuthorizationService authorizationService() - { - return new InMemoryOAuth2AuthorizationService(); - } - - @Bean - public AuthorizationServerSettings authorizationServerSettings() - { - return AuthorizationServerSettings.builder().build(); - } - - @Bean - public JWKSource jwkSource() - { - RSAKey rsaKey = Jwks.generateRsa(); - JWKSet jwkSet = new JWKSet(rsaKey); - return (jwkSelector, securityContext) -> jwkSelector.select(jwkSet); - } - - @Bean - public JwtDecoder jwtDecoder(JWKSource jwkSource) - { - return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java deleted file mode 100644 index fbbc34c13..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/HelloController.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.org.springdoc.api.app10; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/* - * @author James Selvakumar - * @since 8.0.0 - */ -@RestController -@RequestMapping("/api") -public class HelloController -{ - @GetMapping("/hello") - public String hello() - { - return "Hello"; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/Jwks.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/Jwks.java deleted file mode 100644 index aaa2ec209..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/Jwks.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2023. mCruncher Sdn Bhd, Cyberjaya, Malaysia. - * All rights reserved. - */ -package test.org.springdoc.api.app10; - - -import java.security.KeyPair; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.util.UUID; - -import com.nimbusds.jose.jwk.RSAKey; - - -/** - * @author Joe Grandja - * @since 0.1.0 - */ -public final class Jwks -{ - private Jwks() - { - //final class constructor should be hidden - } - - public static RSAKey generateRsa() - { - KeyPair keyPair = KeyGeneratorUtils.generateRsaKey(); - RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); - RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); - return new RSAKey.Builder(publicKey) - .privateKey(privateKey) - .keyID(UUID.randomUUID().toString()) - .build(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/KeyGeneratorUtils.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/KeyGeneratorUtils.java deleted file mode 100644 index aafe10f62..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/KeyGeneratorUtils.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023. mCruncher Sdn Bhd, Cyberjaya, Malaysia. - * All rights reserved. - */ -package test.org.springdoc.api.app10; - -import java.security.KeyPair; -import java.security.KeyPairGenerator; - -/** - * @author Joe Grandja - * @since 0.1.0 - */ -public final class KeyGeneratorUtils -{ - private KeyGeneratorUtils() - { - //final class constructor should be hidden - } - - static KeyPair generateRsaKey() - { - KeyPair keyPair; - try { - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); - keyPairGenerator.initialize(2048); - keyPair = keyPairGenerator.generateKeyPair(); - } catch (Exception ex) { - throw new IllegalStateException(ex); - } - return keyPair; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java deleted file mode 100644 index 3ed51ff96..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app10/SpringDocApp10Test.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app10; - -import java.util.Optional; - -import io.swagger.v3.core.converter.ModelConverter; -import io.swagger.v3.core.converter.ModelConverters; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = {"springdoc.show-oauth2-endpoints=true", "springdoc.model-converters.deprecating-converter.enabled=false"}) -public class SpringDocApp10Test extends AbstractSpringDocTest { - - @BeforeAll - public static void init() { - Optional deprecatingConverterOptional = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); - deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); - } - - @AfterAll - public static void clean() { - Optional deprecatingConverterOptional = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); - deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); - } - - @SpringBootApplication - static class SpringDocTestApp { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/AuthorizationServerConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/AuthorizationServerConfig.java deleted file mode 100644 index f9e60d6ac..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/AuthorizationServerConfig.java +++ /dev/null @@ -1,75 +0,0 @@ -package test.org.springdoc.api.app11; - -import java.util.UUID; - -import com.nimbusds.jose.jwk.JWKSet; -import com.nimbusds.jose.jwk.RSAKey; -import com.nimbusds.jose.jwk.source.JWKSource; -import com.nimbusds.jose.proc.SecurityContext; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.Customizer; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.oauth2.core.AuthorizationGrantType; -import org.springframework.security.oauth2.jwt.JwtDecoder; -import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService; -import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; -import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; -import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; -import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; -import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; -import org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer; -import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; -import org.springframework.security.oauth2.server.authorization.settings.ClientSettings; -import org.springframework.security.web.SecurityFilterChain; - -/* - * @author yuta.saito - */ -@Configuration -public class AuthorizationServerConfig { - @Bean - public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { - OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); - http.getConfigurer(OAuth2AuthorizationServerConfigurer.class) - .oidc(Customizer.withDefaults()); - return http.build(); - } - - @Bean - public RegisteredClientRepository registeredClientRepository() { - RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) - .clientId("messaging-client") - .clientSecret("{noop}secret") - .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) - .scope("message.read") - .scope("message.write") - .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) - .build(); - - return new InMemoryRegisteredClientRepository(registeredClient); - } - - @Bean - public OAuth2AuthorizationService authorizationService() { - return new InMemoryOAuth2AuthorizationService(); - } - - @Bean - public AuthorizationServerSettings authorizationServerSettings() { - return AuthorizationServerSettings.builder().build(); - } - - @Bean - public JWKSource jwkSource() { - RSAKey rsaKey = Jwks.generateRsa(); - JWKSet jwkSet = new JWKSet(rsaKey); - return (jwkSelector, securityContext) -> jwkSelector.select(jwkSet); - } - - @Bean - public JwtDecoder jwtDecoder(JWKSource jwkSource) { - return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java deleted file mode 100644 index 52548cd1f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/HelloController.java +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app11; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/* - * @author yuta.saito - */ -@RestController -@RequestMapping("/api") -public class HelloController { - @GetMapping("/hello") - public String hello() { - return "Hello"; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/Jwks.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/Jwks.java deleted file mode 100644 index ab8d9cc79..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/Jwks.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app11; - - -import java.security.KeyPair; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.util.UUID; - -import com.nimbusds.jose.jwk.RSAKey; - - -/** - * @author yuta.saito - */ -public final class Jwks { - private Jwks() { - //final class constructor should be hidden - } - - public static RSAKey generateRsa() { - KeyPair keyPair = KeyGeneratorUtils.generateRsaKey(); - RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); - RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); - return new RSAKey.Builder(publicKey) - .privateKey(privateKey) - .keyID(UUID.randomUUID().toString()) - .build(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/KeyGeneratorUtils.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/KeyGeneratorUtils.java deleted file mode 100644 index 49ae4597d..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/KeyGeneratorUtils.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app11; - -import java.security.KeyPair; -import java.security.KeyPairGenerator; - -/** - * @author yuta.saito - */ -public final class KeyGeneratorUtils { - private KeyGeneratorUtils() { - //final class constructor should be hidden - } - - static KeyPair generateRsaKey() { - KeyPair keyPair; - try { - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); - keyPairGenerator.initialize(2048); - keyPair = keyPairGenerator.generateKeyPair(); - } - catch (Exception ex) { - throw new IllegalStateException(ex); - } - return keyPair; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java deleted file mode 100644 index 91cf142a9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app11/SpringDocApp11Test.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app11; - -import java.util.Optional; - -import io.swagger.v3.core.converter.ModelConverter; -import io.swagger.v3.core.converter.ModelConverters; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = { "springdoc.show-oauth2-endpoints=true", "springdoc.model-converters.deprecating-converter.enabled=false" }) -public class SpringDocApp11Test extends AbstractSpringDocTest { - - @BeforeAll - public static void init() { - Optional deprecatingConverterOptional = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); - deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); - } - - @AfterAll - public static void clean() { - Optional deprecatingConverterOptional = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); - deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); - } - - @SpringBootApplication - static class SpringDocTestApp { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/AuthorizationServerConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/AuthorizationServerConfig.java deleted file mode 100644 index 06a888fe6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/AuthorizationServerConfig.java +++ /dev/null @@ -1,75 +0,0 @@ -package test.org.springdoc.api.app12; - -import java.util.UUID; - -import com.nimbusds.jose.jwk.JWKSet; -import com.nimbusds.jose.jwk.RSAKey; -import com.nimbusds.jose.jwk.source.JWKSource; -import com.nimbusds.jose.proc.SecurityContext; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.Customizer; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.oauth2.core.AuthorizationGrantType; -import org.springframework.security.oauth2.jwt.JwtDecoder; -import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService; -import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; -import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; -import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; -import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; -import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; -import org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer; -import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; -import org.springframework.security.oauth2.server.authorization.settings.ClientSettings; -import org.springframework.security.web.SecurityFilterChain; - -/* - * @author yuta.saito - */ -@Configuration -public class AuthorizationServerConfig { - @Bean - public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { - OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); - http.getConfigurer(OAuth2AuthorizationServerConfigurer.class) - .oidc(oidc -> oidc.clientRegistrationEndpoint(Customizer.withDefaults())); - return http.build(); - } - - @Bean - public RegisteredClientRepository registeredClientRepository() { - RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) - .clientId("messaging-client") - .clientSecret("{noop}secret") - .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) - .scope("message.read") - .scope("message.write") - .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) - .build(); - - return new InMemoryRegisteredClientRepository(registeredClient); - } - - @Bean - public OAuth2AuthorizationService authorizationService() { - return new InMemoryOAuth2AuthorizationService(); - } - - @Bean - public AuthorizationServerSettings authorizationServerSettings() { - return AuthorizationServerSettings.builder().build(); - } - - @Bean - public JWKSource jwkSource() { - RSAKey rsaKey = Jwks.generateRsa(); - JWKSet jwkSet = new JWKSet(rsaKey); - return (jwkSelector, securityContext) -> jwkSelector.select(jwkSet); - } - - @Bean - public JwtDecoder jwtDecoder(JWKSource jwkSource) { - return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java deleted file mode 100644 index 74e1ca709..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/HelloController.java +++ /dev/null @@ -1,17 +0,0 @@ -package test.org.springdoc.api.app12; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/* - * @author yuta.saito - */ -@RestController -@RequestMapping("/api") -public class HelloController { - @GetMapping("/hello") - public String hello() { - return "Hello"; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/Jwks.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/Jwks.java deleted file mode 100644 index 2df2f0a1c..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/Jwks.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app12; - - -import java.security.KeyPair; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.util.UUID; - -import com.nimbusds.jose.jwk.RSAKey; - - -/** - * @author yuta.saito - */ -public final class Jwks { - private Jwks() { - //final class constructor should be hidden - } - - public static RSAKey generateRsa() { - KeyPair keyPair = KeyGeneratorUtils.generateRsaKey(); - RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); - RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); - return new RSAKey.Builder(publicKey) - .privateKey(privateKey) - .keyID(UUID.randomUUID().toString()) - .build(); - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/KeyGeneratorUtils.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/KeyGeneratorUtils.java deleted file mode 100644 index 46efd9d2e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/KeyGeneratorUtils.java +++ /dev/null @@ -1,26 +0,0 @@ -package test.org.springdoc.api.app12; - -import java.security.KeyPair; -import java.security.KeyPairGenerator; - -/** - * @author yuta.saito - */ -public final class KeyGeneratorUtils { - private KeyGeneratorUtils() { - //final class constructor should be hidden - } - - static KeyPair generateRsaKey() { - KeyPair keyPair; - try { - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); - keyPairGenerator.initialize(2048); - keyPair = keyPairGenerator.generateKeyPair(); - } - catch (Exception ex) { - throw new IllegalStateException(ex); - } - return keyPair; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java deleted file mode 100644 index 4bfb122eb..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app12/SpringDocApp12Test.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * Copyright 2019-2023 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app12; - -import java.util.Optional; - -import io.swagger.v3.core.converter.ModelConverter; -import io.swagger.v3.core.converter.ModelConverters; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = { "springdoc.show-oauth2-endpoints=true", "springdoc.model-converters.deprecating-converter.enabled=false" }) -public class SpringDocApp12Test extends AbstractSpringDocTest { - - @BeforeAll - public static void init() { - Optional deprecatingConverterOptional = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); - deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); - } - - @AfterAll - public static void clean() { - Optional deprecatingConverterOptional = - ModelConverters.getInstance().getConverters() - .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); - deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); - } - - @SpringBootApplication - static class SpringDocTestApp { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/HelloController.java deleted file mode 100644 index fa2b8b670..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/HelloController.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2; - -import org.springframework.security.core.Authentication; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @GetMapping("oneParameterAndAuthentication") - public Object oneParameterAndAuthentication(@RequestBody String req, Authentication authentication) { - return null; - } - - @GetMapping("noParametersAndAuthentication") - public Object noParametersAndAuthentication(Authentication authentication) { - return null; - } - - @GetMapping("oneParameterAndUser") - public Object oneParameterAndUser(@RequestBody String req, User user) { - return null; - } - - @GetMapping("noParametersAndUser") - public Object noParametersAndUser(User user) { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java deleted file mode 100644 index bfc2cc649..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/SpringDocApp2Test.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app2; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -public class SpringDocApp2Test extends AbstractSpringDocTest { - - @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration,test.org.springdoc.api.app2" }) - static class SpringDocTestApp { - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info().title("Security API").version("v1") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/User.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/User.java deleted file mode 100644 index a59358a4b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app2/User.java +++ /dev/null @@ -1,43 +0,0 @@ -package test.org.springdoc.api.app2; - -import java.util.Collection; - -import org.springframework.security.core.Authentication; -import org.springframework.security.core.GrantedAuthority; - -public class User implements Authentication { - @Override - public Collection getAuthorities() { - return null; - } - - @Override - public Object getCredentials() { - return null; - } - - @Override - public Object getDetails() { - return null; - } - - @Override - public Object getPrincipal() { - return null; - } - - @Override - public boolean isAuthenticated() { - return false; - } - - @Override - public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException { - - } - - @Override - public String getName() { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app3/SpringOauth2Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app3/SpringOauth2Test.java deleted file mode 100644 index 210c3f908..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app3/SpringOauth2Test.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app3; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.SpringBootConfiguration; -import org.springframework.boot.test.context.runner.WebApplicationContextRunner; - -import static org.assertj.core.api.Assertions.assertThat; - -public class SpringOauth2Test { - - private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() - .withUserConfiguration(TestApp.class); - - @Test - void configurations_successfully_loaded() { - contextRunner - .run(context -> assertThat(context) - .hasNotFailed() - .doesNotHaveBean("springSecurityOAuth2Provider") - ); - } - - @SpringBootConfiguration - static class TestApp { - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/HelloController.java deleted file mode 100644 index a069ad6b3..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/HelloController.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5; - -import org.springframework.security.core.Authentication; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - - @GetMapping - public Authentication doGet() { - return null; - } - - @PostMapping - public Sample doPost() { - return null; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/Sample.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/Sample.java deleted file mode 100644 index 14eca023f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/Sample.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5; - -import org.springframework.security.core.Authentication; - -public class Sample { - private String toto; - - private Authentication authentication; - - public String getToto() { - return toto; - } - - public void setToto(String toto) { - this.toto = toto; - } - - public Authentication getAuthentication() { - return authentication; - } - - public void setAuthentication(Authentication authentication) { - this.authentication = authentication; - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java deleted file mode 100644 index d9fcfd384..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app5/SpringDocApp5Test.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app5; - -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -public class SpringDocApp5Test extends AbstractSpringDocTest { - - @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration,test.org.springdoc.api.app5" }) - static class SpringDocTestApp {} - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java deleted file mode 100644 index 3e774fb8e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/SpringDocApp6Test.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app6; - -import test.org.springdoc.api.AbstractSpringDocTest; -import test.org.springdoc.api.app6.security.MyUserDetailsService; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.show-login-endpoint=true") -public class SpringDocApp6Test extends AbstractSpringDocTest { - - @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration,test.org.springdoc.api.app6" }) - static class SpringDocTestApp { - @Bean - MyUserDetailsService userDetailsService() { - return new MyUserDetailsService(); - } - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/SpringDocConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/SpringDocConfig.java deleted file mode 100644 index 3a9fb09aa..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/SpringDocConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package test.org.springdoc.api.app6; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.security.SecurityRequirement; -import io.swagger.v3.oas.models.security.SecurityScheme; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - - -@Configuration -public class SpringDocConfig { - - - @Bean - public OpenAPI myOpenAPI() { - final String securitySchemeName = "bearerAuth"; - return new OpenAPI().info(new Info().title("My MWE API") - .description("This document specifies the API") - .version("v23")) - .addSecurityItem(new SecurityRequirement().addList(securitySchemeName)) - .components(new Components().addSecuritySchemes(securitySchemeName, - new SecurityScheme() - .type(SecurityScheme.Type.HTTP) - .scheme("bearer") - .bearerFormat("JWT"))); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/controllers/MyController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/controllers/MyController.java deleted file mode 100644 index 264be090e..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/controllers/MyController.java +++ /dev/null @@ -1,30 +0,0 @@ -package test.org.springdoc.api.app6.controllers; - -import java.util.List; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -@RequestMapping("/fax") -@Tag(name = "Fax stuff", description = "For managing fax machines.") -public class MyController { - - @Operation(summary = "Get information about currently existing fax machines") - @ApiResponse(responseCode = "200", description = "list of existing fax machines") - @GetMapping("list") - public List getFaxList(@RequestParam(name = "vendorName", required = false) - @Parameter(description = "vendor name to restrict the list") String vendorFilter) { - - return null; - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/JWTAuthenticationFilter.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/JWTAuthenticationFilter.java deleted file mode 100644 index 7f64be2d9..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/JWTAuthenticationFilter.java +++ /dev/null @@ -1,113 +0,0 @@ -package test.org.springdoc.api.app6.security; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; - -import com.fasterxml.jackson.databind.ObjectMapper; -import io.jsonwebtoken.Jwts; -import io.jsonwebtoken.SignatureAlgorithm; -import jakarta.servlet.FilterChain; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.authentication.InternalAuthenticationServiceException; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; - - -public class JWTAuthenticationFilter extends UsernamePasswordAuthenticationFilter { - - - private final AuthenticationManager authenticationManager; - - - private final long lifetime; - - - private final String key; - - - public JWTAuthenticationFilter(AuthenticationManager authenticationManager, long lifetime, - String key) { - this.authenticationManager = authenticationManager; - this.lifetime = lifetime; - this.key = key; - } - - - @Override - public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse res) - throws AuthenticationException { - try { - - UserCredentials credentials = - new ObjectMapper().readValue(req.getInputStream(), UserCredentials.class); - - return authenticationManager.authenticate( - new UsernamePasswordAuthenticationToken(credentials.getUsername(), - credentials.getPassword(), new ArrayList<>())); - - } - catch (IOException e) { - throw new InternalAuthenticationServiceException("Error processing credentials", e); - } - } - - - @Override - protected void successfulAuthentication(HttpServletRequest req, HttpServletResponse res, - FilterChain chain, Authentication auth) - throws IOException, ServletException { - Date notBefore = new Date(); - Date expirationDate = new Date(notBefore.getTime() + lifetime); - - String token = Jwts.builder() - .setClaims(new HashMap<>()) - .setSubject(((User) auth.getPrincipal()).getUsername()) - .setNotBefore(notBefore) - .setExpiration(expirationDate) - .signWith(SignatureAlgorithm.HS512, key) - .compact(); - res.addHeader(WebSecurity.HeaderString, WebSecurity.TokenPrefix + token); - - } - - - private static class UserCredentials { - - - private String username; - - - private String password; - - - String getUsername() { - return username; - } - - - public void setUsername(String username) { - this.username = username; - } - - - String getPassword() { - return password; - } - - - public void setPassword(String password) { - this.password = password; - } - - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/JWTAuthorizationFilter.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/JWTAuthorizationFilter.java deleted file mode 100644 index fe1b34f7b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/JWTAuthorizationFilter.java +++ /dev/null @@ -1,83 +0,0 @@ -package test.org.springdoc.api.app6.security; - -import java.io.IOException; -import java.util.ArrayList; - -import io.jsonwebtoken.ExpiredJwtException; -import io.jsonwebtoken.Jwts; -import jakarta.servlet.FilterChain; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; - - -public class JWTAuthorizationFilter extends BasicAuthenticationFilter { - - - public static final String AUTH_ERROR_ATTRIBUTE = "authError"; - - - private final String key; - - - public JWTAuthorizationFilter(AuthenticationManager authManager, String key) { - super(authManager); - this.key = key; - } - - - @Override - protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res, FilterChain chain) - throws IOException, ServletException { - String header = req.getHeader(WebSecurity.HeaderString); - - if (header == null || !header.startsWith(WebSecurity.TokenPrefix)) { - chain.doFilter(req, res); - return; - } - - UsernamePasswordAuthenticationToken authentication = getAuthentication(req); - - SecurityContextHolder.getContext().setAuthentication(authentication); - - chain.doFilter(req, res); - } - - - /** - * Check the validity of the JWT (JWS, more precisely) as submitted via the - * {@link HttpServletRequest}. - * - * @param request the {@link HttpServletRequest} containing a JWS. - * @return a {@link UsernamePasswordAuthenticationToken} if the JWS is - * valid, {@code null} otherwise. - */ - - private UsernamePasswordAuthenticationToken getAuthentication(HttpServletRequest request) { - String token = request.getHeader(WebSecurity.HeaderString); - if (token != null) { - String user = null; - try { - user = Jwts.parser() - .setSigningKey(key) - .parseClaimsJws(token.replace(WebSecurity.TokenPrefix, "")) - .getBody() - .getSubject(); - } - catch (ExpiredJwtException e) { - request.setAttribute(AUTH_ERROR_ATTRIBUTE, e.getMessage()); - } - if (user != null) { - return new UsernamePasswordAuthenticationToken(user, null, new ArrayList<>()); - } - return null; - } - return null; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/MyUserDetailsService.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/MyUserDetailsService.java deleted file mode 100644 index 8972f5f28..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/MyUserDetailsService.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.org.springdoc.api.app6.security; - -import java.util.Collections; - -import org.springframework.security.core.userdetails.User; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.stereotype.Service; - - -@Service -public class MyUserDetailsService implements UserDetailsService { - - @Override - public UserDetails loadUserByUsername(String username) - throws UsernameNotFoundException { - BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); - - - if (!username.equals("demouser")) { - throw new UsernameNotFoundException(username); - } - - return new User("demouser", encoder.encode("secret"), Collections.emptyList()); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/WebSecurity.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/WebSecurity.java deleted file mode 100644 index 2311650ec..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app6/security/WebSecurity.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * - * * - * * * Copyright 2019-2020 the original author or authors. - * * * - * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * you may not use this file except in compliance with the License. - * * * You may obtain a copy of the License at - * * * - * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * - * * * Unless required by applicable law or agreed to in writing, software - * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * See the License for the specific language governing permissions and - * * * limitations under the License. - * * - * - */ - -package test.org.springdoc.api.app6.security; - -import org.springdoc.core.properties.SpringDocConfigProperties; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.annotation.Order; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.http.SessionCreationPolicy; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.web.SecurityFilterChain; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.CorsConfigurationSource; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; - -import static org.springdoc.core.utils.Constants.ALL_PATTERN; - -@Configuration -@EnableWebSecurity -@Order(200) -public class WebSecurity { - - - public static final String TokenPrefix = "Bearer "; - - - public static final String HeaderString = "Authorization"; - - - private final UserDetailsService userDetailsService; - - - @Autowired - SpringDocConfigProperties configProperties; - - - private long lifetime = 123456789L; - - - private String key = - "YRv13MrZah/rHJPMGIN6AjdjB09F9gpIC7i9mdFwdIDZ296doUg/nhG/mQ/CnlxPNtcWR6z6RCKtW5cCspGM9w=="; - - - public WebSecurity(UserDetailsService userDetailsService) { - this.userDetailsService = userDetailsService; - - } - - - @Bean - public SecurityFilterChain securityWebFilterChain(HttpSecurity http, AuthenticationManager authenticationManager) throws Exception { - String apiDocsPath = configProperties.getApiDocs().getPath(); - http.cors() - .and() - .csrf() - .disable() - .authorizeRequests() - .requestMatchers(apiDocsPath + ALL_PATTERN) - .permitAll() - .requestMatchers(apiDocsPath.substring(0, apiDocsPath.lastIndexOf("/") + 1) + "api-docs.yaml") - .permitAll() - .anyRequest() - .authenticated() - .and() - .exceptionHandling() - .and() - .addFilter(new JWTAuthenticationFilter(authenticationManager, lifetime, key)) - .addFilter(new JWTAuthorizationFilter(authenticationManager, key)) - // this disables session creation on Spring Security - .sessionManagement() - .sessionCreationPolicy(SessionCreationPolicy.STATELESS); - return http.build(); - } - - - @Autowired - public void configure(AuthenticationManagerBuilder auth) - throws Exception { - auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder()); - } - - - @Bean - CorsConfigurationSource corsConfigurationSource() { - final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - - CorsConfiguration configuration = new CorsConfiguration().applyPermitDefaultValues(); - - configuration.addExposedHeader(HeaderString); - source.registerCorsConfiguration(ALL_PATTERN, configuration); - - return source; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/AnotherPerson.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/AnotherPerson.java deleted file mode 100644 index c70e2a495..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/AnotherPerson.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -import io.swagger.v3.oas.annotations.Hidden; - -public class AnotherPerson { - - @Hidden - private String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/CurrentUser.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/CurrentUser.java deleted file mode 100644 index 069063533..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/CurrentUser.java +++ /dev/null @@ -1,16 +0,0 @@ -package test.org.springdoc.api.app7; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.springframework.security.core.annotation.AuthenticationPrincipal; - -@Target({ ElementType.PARAMETER, ElementType.TYPE, ElementType.FIELD }) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@AuthenticationPrincipal -public @interface CurrentUser { -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java deleted file mode 100644 index e1163d029..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/HelloController.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -import org.springdoc.core.annotations.ParameterObject; - -import org.springframework.security.core.annotation.AuthenticationPrincipal; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloController { - - @PostMapping(value = "/hello") - public String hello( - @AuthenticationPrincipal Person person1, - @CurrentUser Person person2, - @ParameterObject AnotherPerson person3, - @ParameterObject TheOtherPerson person4) { - return "OK"; - } - -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/Person.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/Person.java deleted file mode 100644 index 97f8781ae..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/Person.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -public class Person { - - private String name; - - public Person() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java deleted file mode 100644 index 9d2852a10..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/SpringDocApp7Test.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -public class SpringDocApp7Test extends AbstractSpringDocTest { - - @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration,test.org.springdoc.api.app7" }) - static class SpringDocTestApp { - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info().title("Security API").version("v1") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/TheOtherPerson.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/TheOtherPerson.java deleted file mode 100644 index 7a8aa431b..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app7/TheOtherPerson.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app7; - -public class TheOtherPerson { - - @CurrentUser - private String name; - - public TheOtherPerson() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java deleted file mode 100644 index 23ad69b4f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app8/SpringDocApp8Test.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.org.springdoc.api.app8; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = "springdoc.show-login-endpoint=true") -public class SpringDocApp8Test extends AbstractSpringDocTest { - - @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration,test.org.springdoc.api.app8" }) - static class SpringDocTestApp { - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info().title("Security API").version("v1") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app8/security/WebConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app8/security/WebConfig.java deleted file mode 100644 index 402368e8a..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app8/security/WebConfig.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app8.security; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.annotation.Order; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.web.SecurityFilterChain; - -@Configuration -@EnableWebSecurity -@Order(200) -public class WebConfig { - - @Bean - public SecurityFilterChain securityWebFilterChain(HttpSecurity http) throws Exception { - http.formLogin() - .loginProcessingUrl("/api/login"); - return http.build(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java deleted file mode 100644 index bc0071734..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/SpringDocApp9Test.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.app9; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import test.org.springdoc.api.AbstractSpringDocTest; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(properties = { "springdoc.show-login-endpoint=true", "springdoc.enable-spring-security=false" }) -public class SpringDocApp9Test extends AbstractSpringDocTest { - - @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration","test.org.springdoc.api.app9" }) - static class SpringDocTestApp { - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info().title("Security API").version("v1") - .license(new License().name("Apache 2.0").url("http://springdoc.org"))); - } - } -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/WebConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/WebConfig.java deleted file mode 100644 index fb15dcaf4..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/app9/WebConfig.java +++ /dev/null @@ -1,22 +0,0 @@ -package test.org.springdoc.api.app9; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.annotation.Order; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.web.SecurityFilterChain; - -@Configuration -@EnableWebSecurity -@Order(200) -public class WebConfig { - - @Bean - public SecurityFilterChain securityWebFilterChain(HttpSecurity http) throws Exception { - http.formLogin() - .loginProcessingUrl("/api/login"); - return http.build(); - } - -} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/configuration/SecurityConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/configuration/SecurityConfiguration.java deleted file mode 100644 index 6ffda6210..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/configuration/SecurityConfiguration.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * * Copyright 2019-2020 the original author or authors. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * https://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package test.org.springdoc.api.configuration; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Lazy; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.web.SecurityFilterChain; - -@Configuration -class SecurityConfiguration { - - @Bean - @ConditionalOnMissingBean - @Lazy(false) - public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { - http.securityMatcher("/**") - .authorizeHttpRequests((requests) -> requests.requestMatchers("/**").permitAll()); - return http.build(); - } - - @Bean - public AuthenticationManager authenticationManager(AuthenticationConfiguration authConfig) throws Exception { - return authConfig.getAuthenticationManager(); - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java new file mode 100644 index 000000000..e3aeff89b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/AbstractSpringDocTest.java @@ -0,0 +1,90 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +@TestPropertySource(properties = "springdoc.api-docs.version=openapi_3_0" ) +public abstract class AbstractSpringDocTest { + + public static String className; + + @Autowired + protected MockMvc mockMvc; + + public static String getContent(String fileName) { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + + @Configuration + @EnableAutoConfiguration(exclude = { SecurityAutoConfiguration.class }) + static class ContextConfiguration {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java new file mode 100644 index 000000000..9096ddb8f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; +import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/persons") + public String persons(@RequestBody() Person person) { + return "OK"; + } + + @PostMapping(value = "/persons-with-user") + public String personsWithUser(@RequestBody() Person person, + @AuthenticationPrincipal User user) { + return "OK"; + } + + @PostMapping(value = "/persons-with-oauth2-user") + public String personsWithUser(@RequestBody() Person person, + @RegisteredOAuth2AuthorizedClient OAuth2AuthorizedClient authorizedClient, + @AuthenticationPrincipal User user) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/Person.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/Person.java new file mode 100644 index 000000000..694a8c714 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/Person.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +public class Person { + + private String name; + + public Person() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..3e89b712d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app1/SpringDocApp1Test.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app1; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp1Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v30.configuration","test.org.springdoc.api.v30.app1" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/AuthorizationServerConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/AuthorizationServerConfig.java new file mode 100644 index 000000000..c7ac5fb32 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/AuthorizationServerConfig.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import java.util.UUID; + +import com.nimbusds.jose.jwk.JWKSet; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.proc.SecurityContext; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.oauth2.core.AuthorizationGrantType; +import org.springframework.security.oauth2.jwt.JwtDecoder; +import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; +import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; +import org.springframework.security.oauth2.server.authorization.settings.ClientSettings; +import org.springframework.security.web.SecurityFilterChain; + +/* + * @author James Selvakumar + * @since 8.0.0 + */ +@Configuration +public class AuthorizationServerConfig +{ + @Bean + public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception + { + OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); + return http.build(); + } + + @Bean + public RegisteredClientRepository registeredClientRepository() { + RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) + .clientId("messaging-client") + .clientSecret("{noop}secret") + .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) + .scope("message.read") + .scope("message.write") + .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) + .build(); + + return new InMemoryRegisteredClientRepository(registeredClient); + } + + @Bean + public OAuth2AuthorizationService authorizationService() + { + return new InMemoryOAuth2AuthorizationService(); + } + + @Bean + public AuthorizationServerSettings authorizationServerSettings() + { + return AuthorizationServerSettings.builder().build(); + } + + @Bean + public JWKSource jwkSource() + { + RSAKey rsaKey = Jwks.generateRsa(); + JWKSet jwkSet = new JWKSet(rsaKey); + return (jwkSelector, securityContext) -> jwkSelector.select(jwkSet); + } + + @Bean + public JwtDecoder jwtDecoder(JWKSource jwkSource) + { + return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java new file mode 100644 index 000000000..6b33a3987 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/* + * @author James Selvakumar + * @since 8.0.0 + */ +@RestController +@RequestMapping("/api") +public class HelloController +{ + @GetMapping("/hello") + public String hello() + { + return "Hello"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/Jwks.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/Jwks.java new file mode 100644 index 000000000..9c50c0699 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/Jwks.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app10; + + +import java.security.KeyPair; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.UUID; + +import com.nimbusds.jose.jwk.RSAKey; + + +/** + * @author Joe Grandja + * @since 0.1.0 + */ +public final class Jwks +{ + private Jwks() + { + //final class constructor should be hidden + } + + public static RSAKey generateRsa() + { + KeyPair keyPair = KeyGeneratorUtils.generateRsaKey(); + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); + return new RSAKey.Builder(publicKey) + .privateKey(privateKey) + .keyID(UUID.randomUUID().toString()) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/KeyGeneratorUtils.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/KeyGeneratorUtils.java new file mode 100644 index 000000000..83124d90a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/KeyGeneratorUtils.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v30.app10; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; + +/** + * @author Joe Grandja + * @since 0.1.0 + */ +public final class KeyGeneratorUtils +{ + private KeyGeneratorUtils() + { + //final class constructor should be hidden + } + + static KeyPair generateRsaKey() + { + KeyPair keyPair; + try { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(2048); + keyPair = keyPairGenerator.generateKeyPair(); + } catch (Exception ex) { + throw new IllegalStateException(ex); + } + return keyPair; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java new file mode 100644 index 000000000..ad08803bf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app10/SpringDocApp10Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app10; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = {"springdoc.show-oauth2-endpoints=true", "springdoc.model-converters.deprecating-converter.enabled=false"}) +public class SpringDocApp10Test extends AbstractSpringDocTest { + + @BeforeAll + public static void init() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @AfterAll + public static void clean() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); + } + + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/AuthorizationServerConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/AuthorizationServerConfig.java new file mode 100644 index 000000000..ef3730e91 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/AuthorizationServerConfig.java @@ -0,0 +1,101 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import java.util.UUID; + +import com.nimbusds.jose.jwk.JWKSet; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.proc.SecurityContext; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.oauth2.core.AuthorizationGrantType; +import org.springframework.security.oauth2.jwt.JwtDecoder; +import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer; +import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; +import org.springframework.security.oauth2.server.authorization.settings.ClientSettings; +import org.springframework.security.web.SecurityFilterChain; + +/* + * @author yuta.saito + */ +@Configuration +public class AuthorizationServerConfig { + @Bean + public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { + OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); + http.getConfigurer(OAuth2AuthorizationServerConfigurer.class) + .oidc(Customizer.withDefaults()); + return http.build(); + } + + @Bean + public RegisteredClientRepository registeredClientRepository() { + RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) + .clientId("messaging-client") + .clientSecret("{noop}secret") + .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) + .scope("message.read") + .scope("message.write") + .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) + .build(); + + return new InMemoryRegisteredClientRepository(registeredClient); + } + + @Bean + public OAuth2AuthorizationService authorizationService() { + return new InMemoryOAuth2AuthorizationService(); + } + + @Bean + public AuthorizationServerSettings authorizationServerSettings() { + return AuthorizationServerSettings.builder().build(); + } + + @Bean + public JWKSource jwkSource() { + RSAKey rsaKey = Jwks.generateRsa(); + JWKSet jwkSet = new JWKSet(rsaKey); + return (jwkSelector, securityContext) -> jwkSelector.select(jwkSet); + } + + @Bean + public JwtDecoder jwtDecoder(JWKSource jwkSource) { + return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java new file mode 100644 index 000000000..b1559a1d0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/* + * @author yuta.saito + */ +@RestController +@RequestMapping("/api") +public class HelloController { + @GetMapping("/hello") + public String hello() { + return "Hello"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/Jwks.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/Jwks.java new file mode 100644 index 000000000..0cc9d0e89 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/Jwks.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + + +import java.security.KeyPair; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.UUID; + +import com.nimbusds.jose.jwk.RSAKey; + + +/** + * @author yuta.saito + */ +public final class Jwks { + private Jwks() { + //final class constructor should be hidden + } + + public static RSAKey generateRsa() { + KeyPair keyPair = KeyGeneratorUtils.generateRsaKey(); + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); + return new RSAKey.Builder(publicKey) + .privateKey(privateKey) + .keyID(UUID.randomUUID().toString()) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/KeyGeneratorUtils.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/KeyGeneratorUtils.java new file mode 100644 index 000000000..b613fbfb6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/KeyGeneratorUtils.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; + +/** + * @author yuta.saito + */ +public final class KeyGeneratorUtils { + private KeyGeneratorUtils() { + //final class constructor should be hidden + } + + static KeyPair generateRsaKey() { + KeyPair keyPair; + try { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(2048); + keyPair = keyPairGenerator.generateKeyPair(); + } + catch (Exception ex) { + throw new IllegalStateException(ex); + } + return keyPair; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..de390071c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app11; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.show-oauth2-endpoints=true", "springdoc.model-converters.deprecating-converter.enabled=false" }) +public class SpringDocApp11Test extends AbstractSpringDocTest { + + @BeforeAll + public static void init() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @AfterAll + public static void clean() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); + } + + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/AuthorizationServerConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/AuthorizationServerConfig.java new file mode 100644 index 000000000..aceb45ead --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/AuthorizationServerConfig.java @@ -0,0 +1,101 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app12; + +import java.util.UUID; + +import com.nimbusds.jose.jwk.JWKSet; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.proc.SecurityContext; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.oauth2.core.AuthorizationGrantType; +import org.springframework.security.oauth2.jwt.JwtDecoder; +import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer; +import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; +import org.springframework.security.oauth2.server.authorization.settings.ClientSettings; +import org.springframework.security.web.SecurityFilterChain; + +/* + * @author yuta.saito + */ +@Configuration +public class AuthorizationServerConfig { + @Bean + public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { + OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); + http.getConfigurer(OAuth2AuthorizationServerConfigurer.class) + .oidc(oidc -> oidc.clientRegistrationEndpoint(Customizer.withDefaults())); + return http.build(); + } + + @Bean + public RegisteredClientRepository registeredClientRepository() { + RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) + .clientId("messaging-client") + .clientSecret("{noop}secret") + .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) + .scope("message.read") + .scope("message.write") + .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) + .build(); + + return new InMemoryRegisteredClientRepository(registeredClient); + } + + @Bean + public OAuth2AuthorizationService authorizationService() { + return new InMemoryOAuth2AuthorizationService(); + } + + @Bean + public AuthorizationServerSettings authorizationServerSettings() { + return AuthorizationServerSettings.builder().build(); + } + + @Bean + public JWKSource jwkSource() { + RSAKey rsaKey = Jwks.generateRsa(); + JWKSet jwkSet = new JWKSet(rsaKey); + return (jwkSelector, securityContext) -> jwkSelector.select(jwkSet); + } + + @Bean + public JwtDecoder jwtDecoder(JWKSource jwkSource) { + return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java new file mode 100644 index 000000000..5eb93d79a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app12; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/* + * @author yuta.saito + */ +@RestController +@RequestMapping("/api") +public class HelloController { + @GetMapping("/hello") + public String hello() { + return "Hello"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/Jwks.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/Jwks.java new file mode 100644 index 000000000..dec189f66 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/Jwks.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app12; + + +import java.security.KeyPair; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.UUID; + +import com.nimbusds.jose.jwk.RSAKey; + + +/** + * @author yuta.saito + */ +public final class Jwks { + private Jwks() { + //final class constructor should be hidden + } + + public static RSAKey generateRsa() { + KeyPair keyPair = KeyGeneratorUtils.generateRsaKey(); + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); + return new RSAKey.Builder(publicKey) + .privateKey(privateKey) + .keyID(UUID.randomUUID().toString()) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/KeyGeneratorUtils.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/KeyGeneratorUtils.java new file mode 100644 index 000000000..fd1206b08 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/KeyGeneratorUtils.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app12; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; + +/** + * @author yuta.saito + */ +public final class KeyGeneratorUtils { + private KeyGeneratorUtils() { + //final class constructor should be hidden + } + + static KeyPair generateRsaKey() { + KeyPair keyPair; + try { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(2048); + keyPair = keyPairGenerator.generateKeyPair(); + } + catch (Exception ex) { + throw new IllegalStateException(ex); + } + return keyPair; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java new file mode 100644 index 000000000..f01d3c04d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app12/SpringDocApp12Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app12; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.show-oauth2-endpoints=true", "springdoc.model-converters.deprecating-converter.enabled=false" }) +public class SpringDocApp12Test extends AbstractSpringDocTest { + + @BeforeAll + public static void init() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @AfterAll + public static void clean() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); + } + + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/HelloController.java new file mode 100644 index 000000000..78c639903 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2; + +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("oneParameterAndAuthentication") + public Object oneParameterAndAuthentication(@RequestBody String req, Authentication authentication) { + return null; + } + + @GetMapping("noParametersAndAuthentication") + public Object noParametersAndAuthentication(Authentication authentication) { + return null; + } + + @GetMapping("oneParameterAndUser") + public Object oneParameterAndUser(@RequestBody String req, User user) { + return null; + } + + @GetMapping("noParametersAndUser") + public Object noParametersAndUser(User user) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..d7cf6a89b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/SpringDocApp2Test.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp2Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v30.configuration","test.org.springdoc.api.v30.app2" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/User.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/User.java new file mode 100644 index 000000000..aa1791a85 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app2/User.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app2; + +import java.util.Collection; + +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; + +public class User implements Authentication { + @Override + public Collection getAuthorities() { + return null; + } + + @Override + public Object getCredentials() { + return null; + } + + @Override + public Object getDetails() { + return null; + } + + @Override + public Object getPrincipal() { + return null; + } + + @Override + public boolean isAuthenticated() { + return false; + } + + @Override + public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException { + + } + + @Override + public String getName() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringOauth2Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringOauth2Test.java new file mode 100644 index 000000000..4a116c17e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app3/SpringOauth2Test.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app3; + +import org.junit.jupiter.api.Test; + +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +public class SpringOauth2Test { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void configurations_successfully_loaded() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("springSecurityOAuth2Provider") + ); + } + + @SpringBootConfiguration + static class TestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/HelloController.java new file mode 100644 index 000000000..a3afb7279 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @GetMapping + public Authentication doGet() { + return null; + } + + @PostMapping + public Sample doPost() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/Sample.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/Sample.java new file mode 100644 index 000000000..fd1ef00ed --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/Sample.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import org.springframework.security.core.Authentication; + +public class Sample { + private String toto; + + private Authentication authentication; + + public String getToto() { + return toto; + } + + public void setToto(String toto) { + this.toto = toto; + } + + public Authentication getAuthentication() { + return authentication; + } + + public void setAuthentication(Authentication authentication) { + this.authentication = authentication; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java new file mode 100644 index 000000000..115650f46 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app5/SpringDocApp5Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app5; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp5Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v30.configuration","test.org.springdoc.api.v30.app5" }) + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java new file mode 100644 index 000000000..f64b64c1a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocApp6Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6; + +import test.org.springdoc.api.v30.AbstractSpringDocTest; +import test.org.springdoc.api.v30.app6.security.MyUserDetailsService; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.show-login-endpoint=true") +public class SpringDocApp6Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v30.configuration","test.org.springdoc.api.v30.app6" }) + static class SpringDocTestApp { + @Bean + MyUserDetailsService userDetailsService() { + return new MyUserDetailsService(); + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocConfig.java new file mode 100644 index 000000000..376d6bb0f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/SpringDocConfig.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + + +@Configuration +public class SpringDocConfig { + + + @Bean + public OpenAPI myOpenAPI() { + final String securitySchemeName = "bearerAuth"; + return new OpenAPI().info(new Info().title("My MWE API") + .description("This document specifies the API") + .version("v23")) + .addSecurityItem(new SecurityRequirement().addList(securitySchemeName)) + .components(new Components().addSecuritySchemes(securitySchemeName, + new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT"))); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/controllers/MyController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/controllers/MyController.java new file mode 100644 index 000000000..5082f3c9b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/controllers/MyController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6.controllers; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequestMapping("/fax") +@Tag(name = "Fax stuff", description = "For managing fax machines.") +public class MyController { + + @Operation(summary = "Get information about currently existing fax machines") + @ApiResponse(responseCode = "200", description = "list of existing fax machines") + @GetMapping("list") + public List getFaxList(@RequestParam(name = "vendorName", required = false) + @Parameter(description = "vendor name to restrict the list") String vendorFilter) { + + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/JWTAuthenticationFilter.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/JWTAuthenticationFilter.java new file mode 100644 index 000000000..3ecb3625b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/JWTAuthenticationFilter.java @@ -0,0 +1,139 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6.security; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.InternalAuthenticationServiceException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + + +public class JWTAuthenticationFilter extends UsernamePasswordAuthenticationFilter { + + + private final AuthenticationManager authenticationManager; + + + private final long lifetime; + + + private final String key; + + + public JWTAuthenticationFilter(AuthenticationManager authenticationManager, long lifetime, + String key) { + this.authenticationManager = authenticationManager; + this.lifetime = lifetime; + this.key = key; + } + + + @Override + public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse res) + throws AuthenticationException { + try { + + UserCredentials credentials = + new ObjectMapper().readValue(req.getInputStream(), UserCredentials.class); + + return authenticationManager.authenticate( + new UsernamePasswordAuthenticationToken(credentials.getUsername(), + credentials.getPassword(), new ArrayList<>())); + + } + catch (IOException e) { + throw new InternalAuthenticationServiceException("Error processing credentials", e); + } + } + + + @Override + protected void successfulAuthentication(HttpServletRequest req, HttpServletResponse res, + FilterChain chain, Authentication auth) + throws IOException, ServletException { + Date notBefore = new Date(); + Date expirationDate = new Date(notBefore.getTime() + lifetime); + + String token = Jwts.builder() + .setClaims(new HashMap<>()) + .setSubject(((User) auth.getPrincipal()).getUsername()) + .setNotBefore(notBefore) + .setExpiration(expirationDate) + .signWith(SignatureAlgorithm.HS512, key) + .compact(); + res.addHeader(WebSecurity.HeaderString, WebSecurity.TokenPrefix + token); + + } + + + private static class UserCredentials { + + + private String username; + + + private String password; + + + String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/JWTAuthorizationFilter.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/JWTAuthorizationFilter.java new file mode 100644 index 000000000..f5dd4bc99 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/JWTAuthorizationFilter.java @@ -0,0 +1,109 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6.security; + +import java.io.IOException; +import java.util.ArrayList; + +import io.jsonwebtoken.ExpiredJwtException; +import io.jsonwebtoken.Jwts; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; + + +public class JWTAuthorizationFilter extends BasicAuthenticationFilter { + + + public static final String AUTH_ERROR_ATTRIBUTE = "authError"; + + + private final String key; + + + public JWTAuthorizationFilter(AuthenticationManager authManager, String key) { + super(authManager); + this.key = key; + } + + + @Override + protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res, FilterChain chain) + throws IOException, ServletException { + String header = req.getHeader(WebSecurity.HeaderString); + + if (header == null || !header.startsWith(WebSecurity.TokenPrefix)) { + chain.doFilter(req, res); + return; + } + + UsernamePasswordAuthenticationToken authentication = getAuthentication(req); + + SecurityContextHolder.getContext().setAuthentication(authentication); + + chain.doFilter(req, res); + } + + + /** + * Check the validity of the JWT (JWS, more precisely) as submitted via the + * {@link HttpServletRequest}. + * + * @param request the {@link HttpServletRequest} containing a JWS. + * @return a {@link UsernamePasswordAuthenticationToken} if the JWS is + * valid, {@code null} otherwise. + */ + + private UsernamePasswordAuthenticationToken getAuthentication(HttpServletRequest request) { + String token = request.getHeader(WebSecurity.HeaderString); + if (token != null) { + String user = null; + try { + user = Jwts.parser() + .setSigningKey(key) + .parseClaimsJws(token.replace(WebSecurity.TokenPrefix, "")) + .getBody() + .getSubject(); + } + catch (ExpiredJwtException e) { + request.setAttribute(AUTH_ERROR_ATTRIBUTE, e.getMessage()); + } + if (user != null) { + return new UsernamePasswordAuthenticationToken(user, null, new ArrayList<>()); + } + return null; + } + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/MyUserDetailsService.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/MyUserDetailsService.java new file mode 100644 index 000000000..10edfafba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/MyUserDetailsService.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6.security; + +import java.util.Collections; + +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.stereotype.Service; + + +@Service +public class MyUserDetailsService implements UserDetailsService { + + @Override + public UserDetails loadUserByUsername(String username) + throws UsernameNotFoundException { + BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); + + + if (!username.equals("demouser")) { + throw new UsernameNotFoundException(username); + } + + return new User("demouser", encoder.encode("secret"), Collections.emptyList()); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/WebSecurity.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/WebSecurity.java new file mode 100644 index 000000000..f09ea0681 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app6/security/WebSecurity.java @@ -0,0 +1,126 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app6.security; + +import org.springdoc.core.properties.SpringDocConfigProperties; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; + +import static org.springdoc.core.utils.Constants.ALL_PATTERN; + +@Configuration +@EnableWebSecurity +@Order(200) +public class WebSecurity { + + + public static final String TokenPrefix = "Bearer "; + + + public static final String HeaderString = "Authorization"; + + + private final UserDetailsService userDetailsService; + + + @Autowired + SpringDocConfigProperties configProperties; + + + private long lifetime = 123456789L; + + + private String key = + "YRv13MrZah/rHJPMGIN6AjdjB09F9gpIC7i9mdFwdIDZ296doUg/nhG/mQ/CnlxPNtcWR6z6RCKtW5cCspGM9w=="; + + + public WebSecurity(UserDetailsService userDetailsService) { + this.userDetailsService = userDetailsService; + + } + + + @Bean + public SecurityFilterChain securityWebFilterChain(HttpSecurity http, AuthenticationManager authenticationManager) throws Exception { + String apiDocsPath = configProperties.getApiDocs().getPath(); + http.cors() + .and() + .csrf() + .disable() + .authorizeRequests() + .requestMatchers(apiDocsPath + ALL_PATTERN) + .permitAll() + .requestMatchers(apiDocsPath.substring(0, apiDocsPath.lastIndexOf("/") + 1) + "api-docs.yaml") + .permitAll() + .anyRequest() + .authenticated() + .and() + .exceptionHandling() + .and() + .addFilter(new JWTAuthenticationFilter(authenticationManager, lifetime, key)) + .addFilter(new JWTAuthorizationFilter(authenticationManager, key)) + // this disables session creation on Spring Security + .sessionManagement() + .sessionCreationPolicy(SessionCreationPolicy.STATELESS); + return http.build(); + } + + + @Autowired + public void configure(AuthenticationManagerBuilder auth) + throws Exception { + auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder()); + } + + + @Bean + CorsConfigurationSource corsConfigurationSource() { + final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + + CorsConfiguration configuration = new CorsConfiguration().applyPermitDefaultValues(); + + configuration.addExposedHeader(HeaderString); + source.registerCorsConfiguration(ALL_PATTERN, configuration); + + return source; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/AnotherPerson.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/AnotherPerson.java new file mode 100644 index 000000000..fea638cdb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/AnotherPerson.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import io.swagger.v3.oas.annotations.Hidden; + +public class AnotherPerson { + + @Hidden + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/CurrentUser.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/CurrentUser.java new file mode 100644 index 000000000..190d9d581 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/CurrentUser.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.security.core.annotation.AuthenticationPrincipal; + +@Target({ ElementType.PARAMETER, ElementType.TYPE, ElementType.FIELD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@AuthenticationPrincipal +public @interface CurrentUser { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java new file mode 100644 index 000000000..36d80bf7a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/hello") + public String hello( + @AuthenticationPrincipal Person person1, + @CurrentUser Person person2, + @ParameterObject AnotherPerson person3, + @ParameterObject TheOtherPerson person4) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/Person.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/Person.java new file mode 100644 index 000000000..e164d2581 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/Person.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +public class Person { + + private String name; + + public Person() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java new file mode 100644 index 000000000..89f5c95b8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/SpringDocApp7Test.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp7Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v30.configuration","test.org.springdoc.api.v30.app7" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/TheOtherPerson.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/TheOtherPerson.java new file mode 100644 index 000000000..ed4fdf9af --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app7/TheOtherPerson.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app7; + +public class TheOtherPerson { + + @CurrentUser + private String name; + + public TheOtherPerson() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java new file mode 100644 index 000000000..551114ff9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app8/SpringDocApp8Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app8; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.show-login-endpoint=true") +public class SpringDocApp8Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v30.configuration","test.org.springdoc.api.v30.app8" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app8/security/WebConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app8/security/WebConfig.java new file mode 100644 index 000000000..e25024268 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app8/security/WebConfig.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app8.security; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.web.SecurityFilterChain; + +@Configuration +@EnableWebSecurity +@Order(200) +public class WebConfig { + + @Bean + public SecurityFilterChain securityWebFilterChain(HttpSecurity http) throws Exception { + http.formLogin() + .loginProcessingUrl("/api/login"); + return http.build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..9dd8c2478 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app9/SpringDocApp9Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.show-login-endpoint=true", "springdoc.enable-spring-security=false" }) +public class SpringDocApp9Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.configuration","test.org.springdoc.api.v30.app9" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app9/WebConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app9/WebConfig.java new file mode 100644 index 000000000..7fcccb97b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/app9/WebConfig.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app9; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.web.SecurityFilterChain; + +@Configuration +@EnableWebSecurity +@Order(200) +public class WebConfig { + + @Bean + public SecurityFilterChain securityWebFilterChain(HttpSecurity http) throws Exception { + http.formLogin() + .loginProcessingUrl("/api/login"); + return http.build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/configuration/SecurityConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/configuration/SecurityConfiguration.java new file mode 100644 index 000000000..8766fd19e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v30/configuration/SecurityConfiguration.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.configuration; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.web.SecurityFilterChain; + +@Configuration +class SecurityConfiguration { + + @Bean + @ConditionalOnMissingBean + @Lazy(false) + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + http.securityMatcher("/**") + .authorizeHttpRequests((requests) -> requests.requestMatchers("/**").permitAll()); + return http.build(); + } + + @Bean + public AuthenticationManager authenticationManager(AuthenticationConfiguration authConfig) throws Exception { + return authConfig.getAuthenticationManager(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..7a98bdced --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,88 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +public abstract class AbstractSpringDocTest { + + public static String className; + + @Autowired + protected MockMvc mockMvc; + + public static String getContent(String fileName) { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + @Test + void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } + + @Configuration + @EnableAutoConfiguration(exclude = { SecurityAutoConfiguration.class }) + static class ContextConfiguration {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java new file mode 100644 index 000000000..20af408ac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; +import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/persons") + public String persons(@RequestBody() Person person) { + return "OK"; + } + + @PostMapping(value = "/persons-with-user") + public String personsWithUser(@RequestBody() Person person, + @AuthenticationPrincipal User user) { + return "OK"; + } + + @PostMapping(value = "/persons-with-oauth2-user") + public String personsWithUser(@RequestBody() Person person, + @RegisteredOAuth2AuthorizedClient OAuth2AuthorizedClient authorizedClient, + @AuthenticationPrincipal User user) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/Person.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/Person.java new file mode 100644 index 000000000..3899a0646 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/Person.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +public class Person { + + private String name; + + public Person() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..594d788df --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp1Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v31.configuration","test.org.springdoc.api.v31.app1" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/AuthorizationServerConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/AuthorizationServerConfig.java new file mode 100644 index 000000000..91ddca9ec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/AuthorizationServerConfig.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import java.util.UUID; + +import com.nimbusds.jose.jwk.JWKSet; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.proc.SecurityContext; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.oauth2.core.AuthorizationGrantType; +import org.springframework.security.oauth2.jwt.JwtDecoder; +import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; +import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; +import org.springframework.security.oauth2.server.authorization.settings.ClientSettings; +import org.springframework.security.web.SecurityFilterChain; + +/* + * @author James Selvakumar + * @since 8.0.0 + */ +@Configuration +public class AuthorizationServerConfig +{ + @Bean + public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception + { + OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); + return http.build(); + } + + @Bean + public RegisteredClientRepository registeredClientRepository() { + RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) + .clientId("messaging-client") + .clientSecret("{noop}secret") + .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) + .scope("message.read") + .scope("message.write") + .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) + .build(); + + return new InMemoryRegisteredClientRepository(registeredClient); + } + + @Bean + public OAuth2AuthorizationService authorizationService() + { + return new InMemoryOAuth2AuthorizationService(); + } + + @Bean + public AuthorizationServerSettings authorizationServerSettings() + { + return AuthorizationServerSettings.builder().build(); + } + + @Bean + public JWKSource jwkSource() + { + RSAKey rsaKey = Jwks.generateRsa(); + JWKSet jwkSet = new JWKSet(rsaKey); + return (jwkSelector, securityContext) -> jwkSelector.select(jwkSet); + } + + @Bean + public JwtDecoder jwtDecoder(JWKSource jwkSource) + { + return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java new file mode 100644 index 000000000..e9230407a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/* + * @author James Selvakumar + * @since 8.0.0 + */ +@RestController +@RequestMapping("/api") +public class HelloController +{ + @GetMapping("/hello") + public String hello() + { + return "Hello"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/Jwks.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/Jwks.java new file mode 100644 index 000000000..645258008 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/Jwks.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app10; + + +import java.security.KeyPair; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.UUID; + +import com.nimbusds.jose.jwk.RSAKey; + + +/** + * @author Joe Grandja + * @since 0.1.0 + */ +public final class Jwks +{ + private Jwks() + { + //final class constructor should be hidden + } + + public static RSAKey generateRsa() + { + KeyPair keyPair = KeyGeneratorUtils.generateRsaKey(); + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); + return new RSAKey.Builder(publicKey) + .privateKey(privateKey) + .keyID(UUID.randomUUID().toString()) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/KeyGeneratorUtils.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/KeyGeneratorUtils.java new file mode 100644 index 000000000..a441df246 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/KeyGeneratorUtils.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app10; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; + +/** + * @author Joe Grandja + * @since 0.1.0 + */ +public final class KeyGeneratorUtils +{ + private KeyGeneratorUtils() + { + //final class constructor should be hidden + } + + static KeyPair generateRsaKey() + { + KeyPair keyPair; + try { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(2048); + keyPair = keyPairGenerator.generateKeyPair(); + } catch (Exception ex) { + throw new IllegalStateException(ex); + } + return keyPair; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java new file mode 100644 index 000000000..673c19076 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = {"springdoc.show-oauth2-endpoints=true", "springdoc.model-converters.deprecating-converter.enabled=false"}) +public class SpringDocApp10Test extends AbstractSpringDocTest { + + @BeforeAll + public static void init() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @AfterAll + public static void clean() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); + } + + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/AuthorizationServerConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/AuthorizationServerConfig.java new file mode 100644 index 000000000..05d0e4b4a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/AuthorizationServerConfig.java @@ -0,0 +1,101 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import java.util.UUID; + +import com.nimbusds.jose.jwk.JWKSet; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.proc.SecurityContext; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.oauth2.core.AuthorizationGrantType; +import org.springframework.security.oauth2.jwt.JwtDecoder; +import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer; +import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; +import org.springframework.security.oauth2.server.authorization.settings.ClientSettings; +import org.springframework.security.web.SecurityFilterChain; + +/* + * @author yuta.saito + */ +@Configuration +public class AuthorizationServerConfig { + @Bean + public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { + OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); + http.getConfigurer(OAuth2AuthorizationServerConfigurer.class) + .oidc(Customizer.withDefaults()); + return http.build(); + } + + @Bean + public RegisteredClientRepository registeredClientRepository() { + RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) + .clientId("messaging-client") + .clientSecret("{noop}secret") + .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) + .scope("message.read") + .scope("message.write") + .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) + .build(); + + return new InMemoryRegisteredClientRepository(registeredClient); + } + + @Bean + public OAuth2AuthorizationService authorizationService() { + return new InMemoryOAuth2AuthorizationService(); + } + + @Bean + public AuthorizationServerSettings authorizationServerSettings() { + return AuthorizationServerSettings.builder().build(); + } + + @Bean + public JWKSource jwkSource() { + RSAKey rsaKey = Jwks.generateRsa(); + JWKSet jwkSet = new JWKSet(rsaKey); + return (jwkSelector, securityContext) -> jwkSelector.select(jwkSet); + } + + @Bean + public JwtDecoder jwtDecoder(JWKSource jwkSource) { + return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java new file mode 100644 index 000000000..07a3cede7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/* + * @author yuta.saito + */ +@RestController +@RequestMapping("/api") +public class HelloController { + @GetMapping("/hello") + public String hello() { + return "Hello"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/Jwks.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/Jwks.java new file mode 100644 index 000000000..2ddf16cfc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/Jwks.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + + +import java.security.KeyPair; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.UUID; + +import com.nimbusds.jose.jwk.RSAKey; + + +/** + * @author yuta.saito + */ +public final class Jwks { + private Jwks() { + //final class constructor should be hidden + } + + public static RSAKey generateRsa() { + KeyPair keyPair = KeyGeneratorUtils.generateRsaKey(); + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); + return new RSAKey.Builder(publicKey) + .privateKey(privateKey) + .keyID(UUID.randomUUID().toString()) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/KeyGeneratorUtils.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/KeyGeneratorUtils.java new file mode 100644 index 000000000..1d98681ed --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/KeyGeneratorUtils.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; + +/** + * @author yuta.saito + */ +public final class KeyGeneratorUtils { + private KeyGeneratorUtils() { + //final class constructor should be hidden + } + + static KeyPair generateRsaKey() { + KeyPair keyPair; + try { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(2048); + keyPair = keyPairGenerator.generateKeyPair(); + } + catch (Exception ex) { + throw new IllegalStateException(ex); + } + return keyPair; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..ba8a0579b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.show-oauth2-endpoints=true", "springdoc.model-converters.deprecating-converter.enabled=false" }) +public class SpringDocApp11Test extends AbstractSpringDocTest { + + @BeforeAll + public static void init() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @AfterAll + public static void clean() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); + } + + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/AuthorizationServerConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/AuthorizationServerConfig.java new file mode 100644 index 000000000..617ad3f45 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/AuthorizationServerConfig.java @@ -0,0 +1,101 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import java.util.UUID; + +import com.nimbusds.jose.jwk.JWKSet; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.proc.SecurityContext; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.oauth2.core.AuthorizationGrantType; +import org.springframework.security.oauth2.jwt.JwtDecoder; +import org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; +import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer; +import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; +import org.springframework.security.oauth2.server.authorization.settings.ClientSettings; +import org.springframework.security.web.SecurityFilterChain; + +/* + * @author yuta.saito + */ +@Configuration +public class AuthorizationServerConfig { + @Bean + public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { + OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); + http.getConfigurer(OAuth2AuthorizationServerConfigurer.class) + .oidc(oidc -> oidc.clientRegistrationEndpoint(Customizer.withDefaults())); + return http.build(); + } + + @Bean + public RegisteredClientRepository registeredClientRepository() { + RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) + .clientId("messaging-client") + .clientSecret("{noop}secret") + .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) + .scope("message.read") + .scope("message.write") + .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()) + .build(); + + return new InMemoryRegisteredClientRepository(registeredClient); + } + + @Bean + public OAuth2AuthorizationService authorizationService() { + return new InMemoryOAuth2AuthorizationService(); + } + + @Bean + public AuthorizationServerSettings authorizationServerSettings() { + return AuthorizationServerSettings.builder().build(); + } + + @Bean + public JWKSource jwkSource() { + RSAKey rsaKey = Jwks.generateRsa(); + JWKSet jwkSet = new JWKSet(rsaKey); + return (jwkSelector, securityContext) -> jwkSelector.select(jwkSet); + } + + @Bean + public JwtDecoder jwtDecoder(JWKSource jwkSource) { + return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java new file mode 100644 index 000000000..3b09300dd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/* + * @author yuta.saito + */ +@RestController +@RequestMapping("/api") +public class HelloController { + @GetMapping("/hello") + public String hello() { + return "Hello"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/Jwks.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/Jwks.java new file mode 100644 index 000000000..334e71f48 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/Jwks.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + + +import java.security.KeyPair; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.UUID; + +import com.nimbusds.jose.jwk.RSAKey; + + +/** + * @author yuta.saito + */ +public final class Jwks { + private Jwks() { + //final class constructor should be hidden + } + + public static RSAKey generateRsa() { + KeyPair keyPair = KeyGeneratorUtils.generateRsaKey(); + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); + return new RSAKey.Builder(publicKey) + .privateKey(privateKey) + .keyID(UUID.randomUUID().toString()) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/KeyGeneratorUtils.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/KeyGeneratorUtils.java new file mode 100644 index 000000000..13e7a8ffe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/KeyGeneratorUtils.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; + +/** + * @author yuta.saito + */ +public final class KeyGeneratorUtils { + private KeyGeneratorUtils() { + //final class constructor should be hidden + } + + static KeyPair generateRsaKey() { + KeyPair keyPair; + try { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(2048); + keyPair = keyPairGenerator.generateKeyPair(); + } + catch (Exception ex) { + throw new IllegalStateException(ex); + } + return keyPair; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java new file mode 100644 index 000000000..1fcc97688 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.show-oauth2-endpoints=true", "springdoc.model-converters.deprecating-converter.enabled=false" }) +public class SpringDocApp12Test extends AbstractSpringDocTest { + + @BeforeAll + public static void init() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::removeConverter); + } + + @AfterAll + public static void clean() { + Optional deprecatingConverterOptional = + ModelConverters.getInstance().getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance()::addConverter); + } + + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/HelloController.java new file mode 100644 index 000000000..c1d4ab916 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2; + +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @GetMapping("oneParameterAndAuthentication") + public Object oneParameterAndAuthentication(@RequestBody String req, Authentication authentication) { + return null; + } + + @GetMapping("noParametersAndAuthentication") + public Object noParametersAndAuthentication(Authentication authentication) { + return null; + } + + @GetMapping("oneParameterAndUser") + public Object oneParameterAndUser(@RequestBody String req, User user) { + return null; + } + + @GetMapping("noParametersAndUser") + public Object noParametersAndUser(User user) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..131afbc59 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp2Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v31.configuration","test.org.springdoc.api.v31.app2" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/User.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/User.java new file mode 100644 index 000000000..d6dd32fbc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app2/User.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2; + +import java.util.Collection; + +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; + +public class User implements Authentication { + @Override + public Collection getAuthorities() { + return null; + } + + @Override + public Object getCredentials() { + return null; + } + + @Override + public Object getDetails() { + return null; + } + + @Override + public Object getPrincipal() { + return null; + } + + @Override + public boolean isAuthenticated() { + return false; + } + + @Override + public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException { + + } + + @Override + public String getName() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringOauth2Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringOauth2Test.java new file mode 100644 index 000000000..3bedbcc55 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringOauth2Test.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import org.junit.jupiter.api.Test; + +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +public class SpringOauth2Test { + + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + @Test + void configurations_successfully_loaded() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("springSecurityOAuth2Provider") + ); + } + + @SpringBootConfiguration + static class TestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/HelloController.java new file mode 100644 index 000000000..1f1a196f1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + + @GetMapping + public Authentication doGet() { + return null; + } + + @PostMapping + public Sample doPost() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/Sample.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/Sample.java new file mode 100644 index 000000000..172d46177 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/Sample.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import org.springframework.security.core.Authentication; + +public class Sample { + private String toto; + + private Authentication authentication; + + public String getToto() { + return toto; + } + + public void setToto(String toto) { + this.toto = toto; + } + + public Authentication getAuthentication() { + return authentication; + } + + public void setAuthentication(Authentication authentication) { + this.authentication = authentication; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java new file mode 100644 index 000000000..cb5136ff5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app5/SpringDocApp5Test.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp5Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v31.configuration","test.org.springdoc.api.v31.app5" }) + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java new file mode 100644 index 000000000..799ba828a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; +import test.org.springdoc.api.v31.app6.security.MyUserDetailsService; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.show-login-endpoint=true") +public class SpringDocApp6Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v31.configuration","test.org.springdoc.api.v31.app6" }) + static class SpringDocTestApp { + @Bean + MyUserDetailsService userDetailsService() { + return new MyUserDetailsService(); + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocConfig.java new file mode 100644 index 000000000..1988aa243 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocConfig.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + + +@Configuration +public class SpringDocConfig { + + + @Bean + public OpenAPI myOpenAPI() { + final String securitySchemeName = "bearerAuth"; + return new OpenAPI().info(new Info().title("My MWE API") + .description("This document specifies the API") + .version("v23")) + .addSecurityItem(new SecurityRequirement().addList(securitySchemeName)) + .components(new Components().addSecuritySchemes(securitySchemeName, + new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT"))); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/controllers/MyController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/controllers/MyController.java new file mode 100644 index 000000000..ae0e32f33 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/controllers/MyController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6.controllers; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequestMapping("/fax") +@Tag(name = "Fax stuff", description = "For managing fax machines.") +public class MyController { + + @Operation(summary = "Get information about currently existing fax machines") + @ApiResponse(responseCode = "200", description = "list of existing fax machines") + @GetMapping("list") + public List getFaxList(@RequestParam(name = "vendorName", required = false) + @Parameter(description = "vendor name to restrict the list") String vendorFilter) { + + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/JWTAuthenticationFilter.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/JWTAuthenticationFilter.java new file mode 100644 index 000000000..fb22cbc27 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/JWTAuthenticationFilter.java @@ -0,0 +1,139 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6.security; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.InternalAuthenticationServiceException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + + +public class JWTAuthenticationFilter extends UsernamePasswordAuthenticationFilter { + + + private final AuthenticationManager authenticationManager; + + + private final long lifetime; + + + private final String key; + + + public JWTAuthenticationFilter(AuthenticationManager authenticationManager, long lifetime, + String key) { + this.authenticationManager = authenticationManager; + this.lifetime = lifetime; + this.key = key; + } + + + @Override + public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse res) + throws AuthenticationException { + try { + + UserCredentials credentials = + new ObjectMapper().readValue(req.getInputStream(), UserCredentials.class); + + return authenticationManager.authenticate( + new UsernamePasswordAuthenticationToken(credentials.getUsername(), + credentials.getPassword(), new ArrayList<>())); + + } + catch (IOException e) { + throw new InternalAuthenticationServiceException("Error processing credentials", e); + } + } + + + @Override + protected void successfulAuthentication(HttpServletRequest req, HttpServletResponse res, + FilterChain chain, Authentication auth) + throws IOException, ServletException { + Date notBefore = new Date(); + Date expirationDate = new Date(notBefore.getTime() + lifetime); + + String token = Jwts.builder() + .setClaims(new HashMap<>()) + .setSubject(((User) auth.getPrincipal()).getUsername()) + .setNotBefore(notBefore) + .setExpiration(expirationDate) + .signWith(SignatureAlgorithm.HS512, key) + .compact(); + res.addHeader(WebSecurity.HeaderString, WebSecurity.TokenPrefix + token); + + } + + + private static class UserCredentials { + + + private String username; + + + private String password; + + + String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/JWTAuthorizationFilter.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/JWTAuthorizationFilter.java new file mode 100644 index 000000000..9efe60711 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/JWTAuthorizationFilter.java @@ -0,0 +1,109 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6.security; + +import java.io.IOException; +import java.util.ArrayList; + +import io.jsonwebtoken.ExpiredJwtException; +import io.jsonwebtoken.Jwts; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; + + +public class JWTAuthorizationFilter extends BasicAuthenticationFilter { + + + public static final String AUTH_ERROR_ATTRIBUTE = "authError"; + + + private final String key; + + + public JWTAuthorizationFilter(AuthenticationManager authManager, String key) { + super(authManager); + this.key = key; + } + + + @Override + protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res, FilterChain chain) + throws IOException, ServletException { + String header = req.getHeader(WebSecurity.HeaderString); + + if (header == null || !header.startsWith(WebSecurity.TokenPrefix)) { + chain.doFilter(req, res); + return; + } + + UsernamePasswordAuthenticationToken authentication = getAuthentication(req); + + SecurityContextHolder.getContext().setAuthentication(authentication); + + chain.doFilter(req, res); + } + + + /** + * Check the validity of the JWT (JWS, more precisely) as submitted via the + * {@link HttpServletRequest}. + * + * @param request the {@link HttpServletRequest} containing a JWS. + * @return a {@link UsernamePasswordAuthenticationToken} if the JWS is + * valid, {@code null} otherwise. + */ + + private UsernamePasswordAuthenticationToken getAuthentication(HttpServletRequest request) { + String token = request.getHeader(WebSecurity.HeaderString); + if (token != null) { + String user = null; + try { + user = Jwts.parser() + .setSigningKey(key) + .parseClaimsJws(token.replace(WebSecurity.TokenPrefix, "")) + .getBody() + .getSubject(); + } + catch (ExpiredJwtException e) { + request.setAttribute(AUTH_ERROR_ATTRIBUTE, e.getMessage()); + } + if (user != null) { + return new UsernamePasswordAuthenticationToken(user, null, new ArrayList<>()); + } + return null; + } + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/MyUserDetailsService.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/MyUserDetailsService.java new file mode 100644 index 000000000..545a77545 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/MyUserDetailsService.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6.security; + +import java.util.Collections; + +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.stereotype.Service; + + +@Service +public class MyUserDetailsService implements UserDetailsService { + + @Override + public UserDetails loadUserByUsername(String username) + throws UsernameNotFoundException { + BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); + + + if (!username.equals("demouser")) { + throw new UsernameNotFoundException(username); + } + + return new User("demouser", encoder.encode("secret"), Collections.emptyList()); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/WebSecurity.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/WebSecurity.java new file mode 100644 index 000000000..96fac8801 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app6/security/WebSecurity.java @@ -0,0 +1,126 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6.security; + +import org.springdoc.core.properties.SpringDocConfigProperties; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; + +import static org.springdoc.core.utils.Constants.ALL_PATTERN; + +@Configuration +@EnableWebSecurity +@Order(200) +public class WebSecurity { + + + public static final String TokenPrefix = "Bearer "; + + + public static final String HeaderString = "Authorization"; + + + private final UserDetailsService userDetailsService; + + + @Autowired + SpringDocConfigProperties configProperties; + + + private long lifetime = 123456789L; + + + private String key = + "YRv13MrZah/rHJPMGIN6AjdjB09F9gpIC7i9mdFwdIDZ296doUg/nhG/mQ/CnlxPNtcWR6z6RCKtW5cCspGM9w=="; + + + public WebSecurity(UserDetailsService userDetailsService) { + this.userDetailsService = userDetailsService; + + } + + + @Bean + public SecurityFilterChain securityWebFilterChain(HttpSecurity http, AuthenticationManager authenticationManager) throws Exception { + String apiDocsPath = configProperties.getApiDocs().getPath(); + http.cors() + .and() + .csrf() + .disable() + .authorizeRequests() + .requestMatchers(apiDocsPath + ALL_PATTERN) + .permitAll() + .requestMatchers(apiDocsPath.substring(0, apiDocsPath.lastIndexOf("/") + 1) + "api-docs.yaml") + .permitAll() + .anyRequest() + .authenticated() + .and() + .exceptionHandling() + .and() + .addFilter(new JWTAuthenticationFilter(authenticationManager, lifetime, key)) + .addFilter(new JWTAuthorizationFilter(authenticationManager, key)) + // this disables session creation on Spring Security + .sessionManagement() + .sessionCreationPolicy(SessionCreationPolicy.STATELESS); + return http.build(); + } + + + @Autowired + public void configure(AuthenticationManagerBuilder auth) + throws Exception { + auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder()); + } + + + @Bean + CorsConfigurationSource corsConfigurationSource() { + final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + + CorsConfiguration configuration = new CorsConfiguration().applyPermitDefaultValues(); + + configuration.addExposedHeader(HeaderString); + source.registerCorsConfiguration(ALL_PATTERN, configuration); + + return source; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/AnotherPerson.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/AnotherPerson.java new file mode 100644 index 000000000..a139a74bc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/AnotherPerson.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import io.swagger.v3.oas.annotations.Hidden; + +public class AnotherPerson { + + @Hidden + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/CurrentUser.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/CurrentUser.java new file mode 100644 index 000000000..fe9848f24 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/CurrentUser.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.security.core.annotation.AuthenticationPrincipal; + +@Target({ ElementType.PARAMETER, ElementType.TYPE, ElementType.FIELD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@AuthenticationPrincipal +public @interface CurrentUser { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java new file mode 100644 index 000000000..cbb673d1d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping(value = "/hello") + public String hello( + @AuthenticationPrincipal Person person1, + @CurrentUser Person person2, + @ParameterObject AnotherPerson person3, + @ParameterObject TheOtherPerson person4) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/Person.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/Person.java new file mode 100644 index 000000000..6539276f0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/Person.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +public class Person { + + private String name; + + public Person() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java new file mode 100644 index 000000000..1b2f4cff3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +public class SpringDocApp7Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v31.configuration","test.org.springdoc.api.v31.app7" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/TheOtherPerson.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/TheOtherPerson.java new file mode 100644 index 000000000..a8c4372d0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app7/TheOtherPerson.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +public class TheOtherPerson { + + @CurrentUser + private String name; + + public TheOtherPerson() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java new file mode 100644 index 000000000..aae8f2b19 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app8; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.show-login-endpoint=true") +public class SpringDocApp8Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v31.configuration","test.org.springdoc.api.v31.app8" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app8/security/WebConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app8/security/WebConfig.java new file mode 100644 index 000000000..dafe043eb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app8/security/WebConfig.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app8.security; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.web.SecurityFilterChain; + +@Configuration +@EnableWebSecurity +@Order(200) +public class WebConfig { + + @Bean + public SecurityFilterChain securityWebFilterChain(HttpSecurity http) throws Exception { + http.formLogin() + .loginProcessingUrl("/api/login"); + return http.build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..c8692c60b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.show-login-endpoint=true", "springdoc.enable-spring-security=false" }) +public class SpringDocApp9Test extends AbstractSpringDocTest { + + @SpringBootApplication(scanBasePackages = { "test.org.springdoc.api.v31.configuration","test.org.springdoc.api.v31.app9" }) + static class SpringDocTestApp { + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info().title("Security API").version("v1") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app9/WebConfig.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app9/WebConfig.java new file mode 100644 index 000000000..0c93146f1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/app9/WebConfig.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.web.SecurityFilterChain; + +@Configuration +@EnableWebSecurity +@Order(200) +public class WebConfig { + + @Bean + public SecurityFilterChain securityWebFilterChain(HttpSecurity http) throws Exception { + http.formLogin() + .loginProcessingUrl("/api/login"); + return http.build(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/configuration/SecurityConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/configuration/SecurityConfiguration.java new file mode 100644 index 000000000..24132aaab --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api/v31/configuration/SecurityConfiguration.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.configuration; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Lazy; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.web.SecurityFilterChain; + +@Configuration +class SecurityConfiguration { + + @Bean + @ConditionalOnMissingBean + @Lazy(false) + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + http.securityMatcher("/**") + .authorizeHttpRequests((requests) -> requests.requestMatchers("/**").permitAll()); + return http.build(); + } + + @Bean + public AuthenticationManager authenticationManager(AuthenticationConfiguration authConfig) throws Exception { + return authConfig.getAuthenticationManager(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app1.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app1.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app1.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app1.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app10.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app10.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app10.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app11.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app11.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app11.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app12.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app12.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app12.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app2.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app2.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app2.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app2.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app5.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app5.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app5.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app5.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app6.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app6.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app6.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app6.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app7.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app7.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app7.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app7.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app8.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app8.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app8.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app8.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app9.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app9.json similarity index 100% rename from springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/app9.json rename to springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.0.1/app9.json diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app1.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app1.json new file mode 100644 index 000000000..6e603a59c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app1.json @@ -0,0 +1,121 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Security API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/persons": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "persons", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons-with-user": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "personsWithUser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons-with-oauth2-user": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "personsWithUser_1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app10.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app10.json new file mode 100644 index 000000000..0b39dfe1b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app10.json @@ -0,0 +1,523 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/oauth2/jwks": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/.well-known/oauth-authorization-server": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2AuthorizationServerMetadata" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/.well-known/oauth-authorization-server/{subpath}": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2AuthorizationServerMetadata" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/oauth2/token": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "parameters": [ + { + "name": "Authorization", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "grant_type": { + "type": "string", + "enum": [ + "authorization_code", + "refresh_token", + "client_credentials" + ] + }, + "code": { + "type": "string" + }, + "redirect_uri": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, + "client_assertion_type": { + "type": "string" + }, + "client_assertion": { + "type": "string" + }, + "additionalParameters": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Token" + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/oauth2/authorize": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "parameters": [ + { + "name": "parameters", + "in": "query", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/html": {} + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + }, + "302": { + "description": "Found", + "headers": { + "Location": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/oauth2/introspect": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "token_type_hint": { + "type": "string" + }, + "additionalParameters": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2TokenIntrospection" + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/oauth2/revoke": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "token_type_hint": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "OAuth2Error": { + "type": "object", + "properties": { + "errorCode": { + "type": "string" + }, + "description": { + "type": "string" + }, + "uri": { + "type": "string" + } + } + }, + "OAuth2AuthorizationServerMetadata": { + "type": "object", + "properties": { + "response_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "grant_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint": { + "type": "string" + }, + "introspection_endpoint": { + "type": "string" + }, + "authorization_endpoint": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "token_endpoint": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "introspection_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "code_challenge_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "token_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "OAuth2Token": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "expires_in": { + "type": "integer", + "format": "int64" + }, + "token_type": { + "type": "string" + }, + "access_token": { + "type": "string" + } + } + }, + "OAuth2TokenIntrospection": { + "type": "object", + "properties": { + "jti": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "iat": { + "type": "integer", + "format": "int64" + }, + "token_type": { + "type": "string" + }, + "aud": { + "type": "array", + "items": { + "type": "string" + } + }, + "client_id": { + "type": "string" + }, + "exp": { + "type": "integer", + "format": "int64" + }, + "iss": { + "type": "string" + }, + "username": { + "type": "string" + }, + "sub": { + "type": "string" + }, + "nbf": { + "type": "integer", + "format": "int64" + }, + "active": { + "type": "boolean" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app11.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app11.json new file mode 100644 index 000000000..4063d7c4e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app11.json @@ -0,0 +1,674 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/oauth2/jwks": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/.well-known/oauth-authorization-server": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2AuthorizationServerMetadata" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/.well-known/oauth-authorization-server/{subpath}": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2AuthorizationServerMetadata" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/oauth2/token": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "parameters": [ + { + "name": "Authorization", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "grant_type": { + "type": "string", + "enum": [ + "authorization_code", + "refresh_token", + "client_credentials" + ] + }, + "code": { + "type": "string" + }, + "redirect_uri": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, + "client_assertion_type": { + "type": "string" + }, + "client_assertion": { + "type": "string" + }, + "additionalParameters": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Token" + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/oauth2/authorize": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "parameters": [ + { + "name": "parameters", + "in": "query", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/html": {} + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + }, + "302": { + "description": "Found", + "headers": { + "Location": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/oauth2/introspect": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "token_type_hint": { + "type": "string" + }, + "additionalParameters": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2TokenIntrospection" + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/oauth2/revoke": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "token_type_hint": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/.well-known/openid-configuration": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OidcProviderConfiguration" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/{subpath}/.well-known/openid-configuration": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OidcProviderConfiguration" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/userinfo": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + } + }, + "components": { + "schemas": { + "OAuth2Error": { + "type": "object", + "properties": { + "errorCode": { + "type": "string" + }, + "description": { + "type": "string" + }, + "uri": { + "type": "string" + } + } + }, + "OAuth2AuthorizationServerMetadata": { + "type": "object", + "properties": { + "response_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "grant_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint": { + "type": "string" + }, + "introspection_endpoint": { + "type": "string" + }, + "authorization_endpoint": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "token_endpoint": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "introspection_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "code_challenge_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "token_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "OAuth2Token": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "expires_in": { + "type": "integer", + "format": "int64" + }, + "token_type": { + "type": "string" + }, + "access_token": { + "type": "string" + } + } + }, + "OAuth2TokenIntrospection": { + "type": "object", + "properties": { + "jti": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "iat": { + "type": "integer", + "format": "int64" + }, + "token_type": { + "type": "string" + }, + "aud": { + "type": "array", + "items": { + "type": "string" + } + }, + "client_id": { + "type": "string" + }, + "exp": { + "type": "integer", + "format": "int64" + }, + "iss": { + "type": "string" + }, + "username": { + "type": "string" + }, + "sub": { + "type": "string" + }, + "nbf": { + "type": "integer", + "format": "int64" + }, + "active": { + "type": "boolean" + } + } + }, + "OidcProviderConfiguration": { + "type": "object", + "properties": { + "subject_types_supported": { + "type": "string" + }, + "response_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "grant_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint": { + "type": "string" + }, + "introspection_endpoint": { + "type": "string" + }, + "authorization_endpoint": { + "type": "string" + }, + "userinfo_endpoint": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "scopes_supported": { + "type": "string" + }, + "token_endpoint": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "introspection_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "code_challenge_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "token_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "id_token_signing_alg_values_supported": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app12.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app12.json new file mode 100644 index 000000000..94f1bac29 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app12.json @@ -0,0 +1,860 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/hello": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/oauth2/jwks": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/.well-known/oauth-authorization-server": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2AuthorizationServerMetadata" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/.well-known/oauth-authorization-server/{subpath}": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2AuthorizationServerMetadata" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/oauth2/token": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "parameters": [ + { + "name": "Authorization", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "grant_type": { + "type": "string", + "enum": [ + "authorization_code", + "refresh_token", + "client_credentials" + ] + }, + "code": { + "type": "string" + }, + "redirect_uri": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, + "client_assertion_type": { + "type": "string" + }, + "client_assertion": { + "type": "string" + }, + "additionalParameters": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Token" + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/oauth2/authorize": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "parameters": [ + { + "name": "parameters", + "in": "query", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "text/html": {} + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + }, + "302": { + "description": "Found", + "headers": { + "Location": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/oauth2/introspect": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "token_type_hint": { + "type": "string" + }, + "additionalParameters": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2TokenIntrospection" + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/oauth2/revoke": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "token_type_hint": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + }, + "/.well-known/openid-configuration": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OidcProviderConfiguration" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/{subpath}/.well-known/openid-configuration": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "summary": "Valid when multiple issuers are allowed", + "parameters": [ + { + "name": "subpath", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OidcProviderConfiguration" + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/userinfo": { + "get": { + "tags": [ + "authorization-server-endpoints" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/connect/register": { + "post": { + "tags": [ + "authorization-server-endpoints" + ], + "parameters": [ + { + "name": "Authorization", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientRegistrationRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientRegistrationResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Error" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "OAuth2Error": { + "type": "object", + "properties": { + "errorCode": { + "type": "string" + }, + "description": { + "type": "string" + }, + "uri": { + "type": "string" + } + } + }, + "OAuth2AuthorizationServerMetadata": { + "type": "object", + "properties": { + "response_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "grant_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint": { + "type": "string" + }, + "introspection_endpoint": { + "type": "string" + }, + "authorization_endpoint": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "token_endpoint": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "introspection_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "code_challenge_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "token_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "OAuth2Token": { + "type": "object", + "properties": { + "scope": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "expires_in": { + "type": "integer", + "format": "int64" + }, + "token_type": { + "type": "string" + }, + "access_token": { + "type": "string" + } + } + }, + "OAuth2TokenIntrospection": { + "type": "object", + "properties": { + "jti": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "iat": { + "type": "integer", + "format": "int64" + }, + "token_type": { + "type": "string" + }, + "aud": { + "type": "array", + "items": { + "type": "string" + } + }, + "client_id": { + "type": "string" + }, + "exp": { + "type": "integer", + "format": "int64" + }, + "iss": { + "type": "string" + }, + "username": { + "type": "string" + }, + "sub": { + "type": "string" + }, + "nbf": { + "type": "integer", + "format": "int64" + }, + "active": { + "type": "boolean" + } + } + }, + "OidcProviderConfiguration": { + "type": "object", + "properties": { + "subject_types_supported": { + "type": "string" + }, + "response_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "grant_types_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint": { + "type": "string" + }, + "introspection_endpoint": { + "type": "string" + }, + "authorization_endpoint": { + "type": "string" + }, + "userinfo_endpoint": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "scopes_supported": { + "type": "string" + }, + "token_endpoint": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "introspection_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "code_challenge_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "token_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "revocation_endpoint_auth_methods_supported": { + "type": "array", + "items": { + "type": "string" + } + }, + "id_token_signing_alg_values_supported": { + "type": "string" + } + } + }, + "ClientRegistrationResponse": { + "type": "object", + "properties": { + "registration_client_uri": { + "type": "string" + }, + "client_id_issued_at": { + "type": "integer", + "format": "int64" + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + } + }, + "grant_types": { + "type": "array", + "items": { + "type": "string" + } + }, + "response_types": { + "type": "array", + "items": { + "type": "string" + } + }, + "client_name": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "token_endpoint_auth_signing_alg": { + "type": "string" + }, + "client_secret_expires_at": { + "type": "integer", + "format": "int64" + }, + "registration_access_token": { + "type": "string" + }, + "id_token_signed_response_alg": { + "type": "string" + }, + "token_endpoint_auth_method": { + "type": "string" + } + } + }, + "ClientRegistrationRequest": { + "type": "object", + "properties": { + "client_id_issued_at": { + "type": "string", + "format": "date-time" + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + } + }, + "grant_types": { + "type": "array", + "items": { + "type": "string" + } + }, + "response_types": { + "type": "array", + "items": { + "type": "string" + } + }, + "client_name": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "token_endpoint_auth_signing_alg": { + "type": "string" + }, + "client_secret_expires_at": { + "type": "string", + "format": "date-time" + }, + "id_token_signed_response_alg": { + "type": "string" + }, + "token_endpoint_auth_method": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app2.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app2.json new file mode 100644 index 000000000..94152006b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app2.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Security API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/oneParameterAndUser": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "oneParameterAndUser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/oneParameterAndAuthentication": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "oneParameterAndAuthentication", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/noParametersAndUser": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "noParametersAndUser", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/noParametersAndAuthentication": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "noParametersAndAuthentication", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app5.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app5.json new file mode 100644 index 000000000..81768909d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app5.json @@ -0,0 +1,58 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "doGet", + "responses": { + "200": { + "description": "OK" + } + } + }, + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "doPost", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Sample" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Sample": { + "type": "object", + "properties": { + "toto": { + "type": "string" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app6.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app6.json new file mode 100644 index 000000000..71968e301 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app6.json @@ -0,0 +1,103 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "My MWE API", + "description": "This document specifies the API", + "version": "v23" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "security": [ + { + "bearerAuth": [] + } + ], + "tags": [ + { + "name": "Fax stuff", + "description": "For managing fax machines." + } + ], + "paths": { + "/fax/list": { + "get": { + "tags": [ + "Fax stuff" + ], + "summary": "Get information about currently existing fax machines", + "operationId": "getFaxList", + "parameters": [ + { + "name": "vendorName", + "in": "query", + "description": "vendor name to restrict the list", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "list of existing fax machines", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/login": { + "post": { + "tags": [ + "login-endpoint" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Unauthorized" + } + } + } + } + }, + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app7.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app7.json new file mode 100644 index 000000000..56eb8cc20 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app7.json @@ -0,0 +1,41 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Security API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/hello": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "hello", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app8.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app8.json new file mode 100644 index 000000000..a53412fe2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app8.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Security API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api/login": { + "post": { + "tags": [ + "login-endpoint" + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Unauthorized" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app9.json b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app9.json new file mode 100644 index 000000000..f2e4244bd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/src/test/resources/results/3.1.0/app9.json @@ -0,0 +1,19 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Security API", + "license": { + "name": "Apache 2.0", + "url": "http://springdoc.org" + }, + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": {}, + "components": {} +} From 911fb5fcb45c2744cb60f34d081b86061c2a311e Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 12 Jan 2025 01:46:00 +0100 Subject: [PATCH 155/226] Provide better compatibility for projects migrating from OAS 3.0 to OAS 3.1. Fixes #2849 --- .../api/v31/AbstractSpringDocTest.java | 102 ++++ .../springdoc/api/v31/app1/ApiException.java | 56 +++ .../api/v31/app1/ApiOriginFilter.java | 77 +++ .../api/v31/app1/ApiResponseMessage.java | 168 +++++++ .../springdoc/api/v31/app1/ErrorMessage.java | 91 ++++ .../api/v31/app1/ExceptionTranslator.java | 75 +++ .../api/v31/app1/HelloController.java | 58 +++ .../api/v31/app1/HomeController.java | 58 +++ .../springdoc/api/v31/app1/InventoryApi.java | 92 ++++ .../api/v31/app1/InventoryApiController.java | 115 +++++ .../springdoc/api/v31/app1/InventoryItem.java | 261 ++++++++++ .../api/v31/app1/ItemController.java | 89 ++++ .../org/springdoc/api/v31/app1/ItemDTO.java | 164 +++++++ .../springdoc/api/v31/app1/ItemLightDTO.java | 129 +++++ .../springdoc/api/v31/app1/Manufacturer.java | 215 +++++++++ .../api/v31/app1/PeopleRestService.java | 146 ++++++ .../org/springdoc/api/v31/app1/PersonDTO.java | 120 +++++ .../api/v31/app1/SpringDocApp1Test.java | 65 +++ .../api/v31/app10/HelloController.java | 69 +++ .../api/v31/app10/SpringDocApp10Test.java | 43 ++ .../api/v31/app100/HelloController.java | 55 +++ .../springdoc/api/v31/app100/PersonDTO.java | 123 +++++ .../api/v31/app100/SpringDocApp100Test.java | 45 ++ .../api/v31/app101/HelloController.java | 57 +++ .../springdoc/api/v31/app101/HelloDTO.java | 63 +++ .../api/v31/app101/SpringDocApp101Test.java | 47 ++ .../v31/app102/InheritedRequestParams.java | 60 +++ .../api/v31/app102/RequestParams.java | 284 +++++++++++ .../api/v31/app102/SpringDocApp102Test.java | 42 ++ .../api/v31/app102/TestController.java | 50 ++ .../springdoc/api/v31/app103/ExampleBody.java | 78 +++ .../api/v31/app103/HelloController.java | 69 +++ .../api/v31/app103/SpringDocApp103Test.java | 42 ++ .../api/v31/app104/CrudController.java | 73 +++ .../org/springdoc/api/v31/app104/Design.java | 33 ++ .../api/v31/app104/DesignController.java | 43 ++ .../springdoc/api/v31/app104/HavingPK.java | 33 ++ .../api/v31/app104/SpringDocApp104Test.java | 42 ++ .../api/v31/app105/SpringDocApp105Test.java | 144 ++++++ .../springdoc/api/v31/app105/api/ApiUtil.java | 69 +++ .../v31/app105/api/ExceptionTranslator.java | 74 +++ .../api/v31/app105/api/HomeController.java | 58 +++ .../api/v31/app105/api/pet/PetApi.java | 227 +++++++++ .../v31/app105/api/pet/PetApiController.java | 68 +++ .../v31/app105/api/pet/PetApiDelegate.java | 193 ++++++++ .../app105/api/pet/PetApiDelegateImpl.java | 38 ++ .../api/v31/app105/api/store/StoreApi.java | 148 ++++++ .../app105/api/store/StoreApiController.java | 68 +++ .../app105/api/store/StoreApiDelegate.java | 124 +++++ .../api/store/StoreApiDelegateImpl.java | 38 ++ .../api/v31/app105/api/user/UserApi.java | 197 ++++++++ .../app105/api/user/UserApiController.java | 68 +++ .../v31/app105/api/user/UserApiDelegate.java | 168 +++++++ .../app105/api/user/UserApiDelegateImpl.java | 38 ++ .../api/v31/app105/model/Category.java | 137 ++++++ .../v31/app105/model/ModelApiResponse.java | 174 +++++++ .../springdoc/api/v31/app105/model/Order.java | 364 ++++++++++++++ .../springdoc/api/v31/app105/model/Pet.java | 392 +++++++++++++++ .../springdoc/api/v31/app105/model/Tag.java | 137 ++++++ .../springdoc/api/v31/app105/model/User.java | 362 ++++++++++++++ .../api/v31/app106/HelloController.java | 66 +++ .../api/v31/app106/SpringDocApp106Test.java | 42 ++ .../api/v31/app107/HelloController.java | 85 ++++ .../api/v31/app107/SpringDocApp107Test.java | 42 ++ .../api/v31/app108/ActionResult.java | 173 +++++++ .../api/v31/app108/HelloController.java | 49 ++ .../api/v31/app108/SpringDocApp108Test.java | 42 ++ .../api/v31/app109/HelloController.java | 64 +++ .../api/v31/app109/SpringDocApp109Test.java | 42 ++ .../api/v31/app11/HelloController.java | 71 +++ .../api/v31/app11/SpringDocApp11Test.java | 44 ++ .../api/v31/app110/ErrorMessage.java | 94 ++++ .../v31/app110/GlobalControllerAdvice.java | 192 ++++++++ .../org/springdoc/api/v31/app110/Person.java | 212 +++++++++ .../api/v31/app110/PersonController.java | 96 ++++ .../api/v31/app110/PersonController2.java | 95 ++++ .../org/springdoc/api/v31/app110/Problem.java | 99 ++++ .../api/v31/app110/SpringDocApp110Test.java | 72 +++ .../api/v31/app111/ErrorMessage.java | 94 ++++ .../v31/app111/GlobalControllerAdvice.java | 192 ++++++++ .../org/springdoc/api/v31/app111/Person.java | 212 +++++++++ .../api/v31/app111/PersonController.java | 95 ++++ .../api/v31/app111/PersonController2.java | 95 ++++ .../org/springdoc/api/v31/app111/Problem.java | 99 ++++ .../api/v31/app111/SpringDocApp111Test.java | 71 +++ .../api/v31/app112/ErrorMessage.java | 94 ++++ .../v31/app112/GlobalControllerAdvice.java | 192 ++++++++ .../org/springdoc/api/v31/app112/Person.java | 212 +++++++++ .../api/v31/app112/PersonController.java | 95 ++++ .../org/springdoc/api/v31/app112/Problem.java | 99 ++++ .../api/v31/app112/SpringDocApp112Test.java | 71 +++ .../v31/app112/sample/PersonController2.java | 97 ++++ .../api/v31/app113/HelloController.java | 68 +++ .../api/v31/app113/SpringDocApp113Test.java | 44 ++ .../api/v31/app114/HelloController.java | 66 +++ .../api/v31/app114/SpringDocApp114Test.java | 51 ++ .../api/v31/app115/HelloController.java | 53 +++ .../app115/JavaTimeOperationCustomizer.java | 69 +++ .../api/v31/app115/SpringDocApp115Test.java | 45 ++ .../api/v31/app116/FooErrorHandler.java | 50 ++ .../api/v31/app116/HelloController.java | 58 +++ .../api/v31/app116/SpringDocApp116Test.java | 45 ++ .../api/v31/app117/HelloApplication.java | 304 ++++++++++++ .../api/v31/app117/SpringDocApp117Test.java | 44 ++ .../api/v31/app118/AbstractParent.java | 121 +++++ .../api/v31/app118/ConcreteParent.java | 121 +++++ .../springdoc/api/v31/app118/Controller.java | 114 +++++ .../api/v31/app118/SpringDocApp118Test.java | 44 ++ .../api/v31/app119/HelloController.java | 67 +++ .../springdoc/api/v31/app119/JsonRequest.java | 56 +++ .../api/v31/app119/SpringDocApp119Test.java | 44 ++ .../api/v31/app12/HelloController.java | 55 +++ .../api/v31/app12/SpringDocApp12Test.java | 43 ++ .../springdoc/api/v31/app120/AccountId.java | 81 ++++ .../v31/app120/MetaAnnotationController.java | 301 ++++++++++++ .../api/v31/app120/SpringDocApp120Test.java | 43 ++ .../v31/app121/InheritedRequestParams.java | 59 +++ .../api/v31/app121/RequestParams.java | 281 +++++++++++ .../api/v31/app121/SpringDocApp121Test.java | 43 ++ .../api/v31/app121/TestController.java | 52 ++ .../api/v31/app122/BaseController.java | 55 +++ .../springdoc/api/v31/app122/BaseObject.java | 41 ++ .../springdoc/api/v31/app122/CustomerDto.java | 41 ++ .../api/v31/app122/FirstController.java | 40 ++ .../api/v31/app122/SpringDocApp122Test.java | 43 ++ .../org/springdoc/api/v31/app122/Wrapper.java | 45 ++ .../api/v31/app123/HelloController.java | 56 +++ .../api/v31/app123/MyExceptionHandler.java | 66 +++ .../api/v31/app123/SpringDocApp123Test.java | 43 ++ .../api/v31/app124/HelloController.java | 73 +++ .../api/v31/app124/MyExceptionHandler.java | 51 ++ .../api/v31/app124/SpringDocApp124Test.java | 43 ++ .../api/v31/app125/DeprecatedEntity.java | 86 ++++ .../api/v31/app125/HelloController.java | 52 ++ .../api/v31/app125/SpringDocApp125Test.java | 58 +++ .../api/v31/app126/HelloController.java | 80 ++++ .../org/springdoc/api/v31/app126/Problem.java | 105 ++++ ...SecurityProblemResponsesConfiguration.java | 129 +++++ .../api/v31/app126/SpringDocApp126Test.java | 70 +++ .../api/v31/app127/AbstractObject.java | 83 ++++ .../api/v31/app127/ConcreteObjectA.java | 58 +++ .../api/v31/app127/ConcreteType.java | 64 +++ .../springdoc/api/v31/app127/Controller.java | 62 +++ .../api/v31/app127/SpringDocApp127Test.java | 64 +++ .../springdoc/api/v31/app127/Umbrella.java | 59 +++ .../api/v31/app129/ActualReturnedEntity.java | 42 ++ .../api/v31/app129/HelloController.java | 58 +++ .../api/v31/app129/OperationResponse.java | 43 ++ .../api/v31/app129/SpringDocApp129Test.java | 44 ++ .../api/v31/app13/HelloController.java | 49 ++ .../springdoc/api/v31/app13/PersonDTO.java | 124 +++++ .../api/v31/app13/SpringDocApp13Test.java | 43 ++ .../api/v31/app130/HelloController.java | 60 +++ .../api/v31/app130/SpringDocApp130Test.java | 44 ++ .../springdoc/api/v31/app130/TrackerData.java | 61 +++ .../api/v31/app131/HelloController.java | 99 ++++ .../api/v31/app131/Organization.java | 104 ++++ .../api/v31/app131/RestControllerError.java | 48 ++ .../api/v31/app131/SpringDocApp131Test.java | 44 ++ .../api/v31/app132/HelloController.java | 99 ++++ .../api/v31/app132/Organization.java | 104 ++++ .../api/v31/app132/RestControllerError.java | 48 ++ .../api/v31/app132/SpringDocApp132Test.java | 44 ++ .../api/v31/app133/HelloController.java | 83 ++++ .../api/v31/app133/SpringDocApp133Test.java | 44 ++ .../api/v31/app134/HelloController.java | 228 +++++++++ .../api/v31/app134/OpenApiConfig.java | 99 ++++ .../api/v31/app134/SpringDocApp134Test.java | 116 +++++ .../org/springdoc/api/v31/app135/Book.java | 115 +++++ .../api/v31/app135/BookRepository.java | 60 +++ .../springdoc/api/v31/app135/BookRouter.java | 140 ++++++ .../api/v31/app135/SpringDocApp135Test.java | 44 ++ .../api/v31/app137/HelloController.java | 49 ++ .../api/v31/app137/OpenApiConfig.java | 46 ++ .../api/v31/app137/SpringDocApp137Test.java | 46 ++ .../api/v31/app138/HelloController.java | 55 +++ .../api/v31/app138/SpringDocApp138Test.java | 46 ++ .../api/v31/app139/HelloController.java | 62 +++ .../api/v31/app139/SpringDocApp139Test.java | 46 ++ .../api/v31/app14/HelloController.java | 61 +++ .../api/v31/app14/SpringDocApp14Test.java | 43 ++ .../api/v31/app140/HelloApplication.java | 314 ++++++++++++ .../api/v31/app140/SpringDocApp140Test.java | 44 ++ .../org/springdoc/api/v31/app141/Book.java | 115 +++++ .../api/v31/app141/BookRepository.java | 60 +++ .../springdoc/api/v31/app141/BookRouter.java | 135 ++++++ .../api/v31/app141/SpringDocApp141Test.java | 44 ++ .../api/v31/app142/HelloApplication.java | 296 ++++++++++++ .../api/v31/app142/SpringDocApp142Test.java | 44 ++ .../api/v31/app149/HelloController.java | 91 ++++ .../api/v31/app149/HelloMessage.java | 53 +++ .../api/v31/app149/SpringDocApp149Test.java | 45 ++ .../api/v31/app15/HelloController.java | 55 +++ .../api/v31/app15/SpringDocApp15Test.java | 75 +++ .../api/v31/app150/HelloController.java | 99 ++++ .../api/v31/app150/SpringDocApp150Test.java | 45 ++ .../api/v31/app151/HelloController.java | 53 +++ .../api/v31/app151/SpringDocApp151Test.java | 45 ++ .../api/v31/app152/HelloController.java | 72 +++ .../api/v31/app152/SpringDocApp152Test.java | 45 ++ .../springdoc/api/v31/app153/OrderState.java | 68 +++ .../api/v31/app153/OrderStateMapper.java | 53 +++ .../api/v31/app153/SpringDocApp153Test.java | 45 ++ .../api/v31/app153/TestController.java | 62 +++ .../api/v31/app154/HelloController.java | 97 ++++ .../api/v31/app154/OpenApiConfiguration.java | 56 +++ .../api/v31/app154/SpringDocApp154Test.java | 45 ++ .../app155/AbstractIntParameterObject.java | 81 ++++ .../v31/app155/AbstractParameterObject.java | 85 ++++ .../api/v31/app155/ConcreteEnum.java | 43 ++ .../app155/ConcreteIntParameterObject.java | 56 +++ .../v31/app155/ConcreteParameterObject.java | 56 +++ .../api/v31/app155/HelloController.java | 66 +++ .../api/v31/app155/SpringDocApp155Test.java | 45 ++ .../api/v31/app156/HelloController.java | 80 ++++ .../springdoc/api/v31/app156/SomeEnum.java | 41 ++ .../api/v31/app156/SpringDocApp156Test.java | 45 ++ .../org/springdoc/api/v31/app156/User.java | 103 ++++ .../org/springdoc/api/v31/app157/Bar.java | 46 ++ .../org/springdoc/api/v31/app157/Foo.java | 46 ++ .../api/v31/app157/HelloController.java | 61 +++ .../api/v31/app157/SpringDocApp157Test.java | 91 ++++ .../api/v31/app157/StringyConverter.java | 64 +++ .../api/v31/app158/CommonFooErrorHandler.java | 49 ++ .../springdoc/api/v31/app158/ErrorDTO.java | 70 +++ .../api/v31/app158/HelloController.java | 54 +++ .../springdoc/api/v31/app158/SimpleDTO.java | 72 +++ .../v31/app158/SpecificFooErrorHandler.java | 36 ++ .../api/v31/app158/SpringDocApp158Test.java | 44 ++ .../api/v31/app159/CustomException.java | 41 ++ .../org/springdoc/api/v31/app159/FooBean.java | 93 ++++ .../api/v31/app159/FooErrorHandler.java | 68 +++ .../api/v31/app159/HelloController.java | 57 +++ .../api/v31/app159/SpringDocApp159Test.java | 44 ++ .../org/springdoc/api/v31/app159/Views.java | 44 ++ .../api/v31/app16/HelloController.java | 48 ++ .../api/v31/app16/SpringDocApp16Test.java | 61 +++ .../api/v31/app160/HelloController.java | 111 +++++ .../api/v31/app160/SpringDocApp160Test.java | 46 ++ .../api/v31/app161/HelloController.java | 86 ++++ .../api/v31/app161/SpringDocApp161Test.java | 44 ++ .../api/v31/app162/SpringDocApp162Test.java | 64 +++ .../app162/exception/NoResultException.java | 30 ++ .../exception/NonUniqueResultException.java | 33 ++ .../rest/JavadocOnlyRestController.java | 116 +++++ .../app162/rest/dto/JavadocOnlyRestDto.java | 85 ++++ .../rest/util/RestExceptionHandler.java | 71 +++ .../api/v31/app163/SpringDocApp163Test.java | 64 +++ .../app163/exception/NoResultException.java | 30 ++ .../exception/NonUniqueResultException.java | 33 ++ ...ationOverrideForJavadocRestController.java | 131 +++++ .../AnnotationOverrideForJavadocRestDto.java | 86 ++++ .../AnnotationOverrideForJavadocRestDto2.java | 46 ++ .../AnnotationOverrideForJavadocRestDto3.java | 46 ++ .../rest/util/RestExceptionHandler.java | 71 +++ .../api/v31/app164/SpringDocApp164Test.java | 62 +++ .../app164/SpringDocJavadocProviderTest.java | 87 ++++ .../app164/exception/NoResultException.java | 30 ++ .../exception/NonUniqueResultException.java | 33 ++ .../rest/NoGenericOverrideRestController.java | 75 +++ .../rest/util/RestExceptionHandler.java | 71 +++ .../app166/ConcreteSubclassFromGeneric.java | 39 ++ .../api/v31/app166/HelloController.java | 53 +++ .../org/springdoc/api/v31/app166/MyData.java | 48 ++ .../api/v31/app166/SimpleGeneric.java | 48 ++ .../api/v31/app166/SimpleInnerClass.java | 57 +++ .../api/v31/app166/SimpleInnerInnerClass.java | 47 ++ .../api/v31/app166/SimpleOuterClass.java | 48 ++ .../api/v31/app166/SpringDocApp166Test.java | 44 ++ .../api/v31/app167/HelloController.java | 42 ++ .../api/v31/app167/SpringDocApp167Test.java | 44 ++ ...ionFieldInRequestBodyIsNullController.java | 53 +++ .../org/springdoc/api/v31/app168/Person.java | 55 +++ .../api/v31/app168/SpringDocApp168Test.java | 44 ++ .../api/v31/app169/RecordController.java | 42 ++ .../api/v31/app169/SimpleInnerClass.java | 36 ++ .../api/v31/app169/SimpleOuterClass.java | 36 ++ .../api/v31/app169/SpringDocApp169Test.java | 44 ++ .../api/v31/app17/HelloController.java | 52 ++ .../api/v31/app17/SpringDocApp17Test.java | 43 ++ .../org/springdoc/api/v31/app170/Animal.java | 43 ++ .../api/v31/app170/BasicController.java | 45 ++ .../org/springdoc/api/v31/app170/Cat.java | 48 ++ .../org/springdoc/api/v31/app170/Dog.java | 59 +++ .../api/v31/app170/SpringDocApp170Test.java | 45 ++ .../api/v31/app171/HelloController.java | 48 ++ .../springdoc/api/v31/app171/PersonDTO.java | 81 ++++ .../api/v31/app171/PersonProjection.java | 50 ++ .../api/v31/app171/SpringDocApp171Test.java | 45 ++ .../app172/JavadocPropertyCustomizerTest.java | 144 ++++++ .../org/springdoc/api/v31/app173/Example.java | 47 ++ .../api/v31/app173/ExampleController.java | 65 +++ .../api/v31/app173/SpringDocApp173Test.java | 47 ++ .../api/v31/app174/ExampleController.java | 50 ++ .../springdoc/api/v31/app174/Question.java | 68 +++ .../api/v31/app174/SpringDocApp174Test.java | 45 ++ .../org/springdoc/api/v31/app174/Test.java | 70 +++ .../api/v31/app174/TestQuestion.java | 68 +++ .../api/v31/app174/TextQuestion.java | 54 +++ .../api/v31/app18/HelloController.java | 111 +++++ .../api/v31/app18/SpringDocApp18Test.java | 45 ++ .../api/v31/app19/HelloController.java | 77 +++ .../api/v31/app19/SpringDocApp19Test.java | 43 ++ .../api/v31/app2/SpringDocApp2Test.java | 65 +++ .../springdoc/api/v31/app2/api/ApiUtil.java | 69 +++ .../api/v31/app2/api/ExceptionTranslator.java | 74 +++ .../api/v31/app2/api/HomeController.java | 58 +++ .../springdoc/api/v31/app2/api/PetApi.java | 229 +++++++++ .../api/v31/app2/api/PetApiController.java | 68 +++ .../api/v31/app2/api/PetApiDelegate.java | 192 ++++++++ .../api/v31/app2/api/PetApiDelegateImpl.java | 38 ++ .../springdoc/api/v31/app2/api/StoreApi.java | 143 ++++++ .../api/v31/app2/api/StoreApiController.java | 68 +++ .../api/v31/app2/api/StoreApiDelegate.java | 123 +++++ .../v31/app2/api/StoreApiDelegateImpl.java | 38 ++ .../springdoc/api/v31/app2/api/UserApi.java | 197 ++++++++ .../api/v31/app2/api/UserApiController.java | 70 +++ .../api/v31/app2/api/UserApiDelegate.java | 167 +++++++ .../api/v31/app2/api/UserApiDelegateImpl.java | 38 ++ .../api/v31/app2/model/Category.java | 134 ++++++ .../api/v31/app2/model/ModelApiResponse.java | 170 +++++++ .../springdoc/api/v31/app2/model/Order.java | 360 ++++++++++++++ .../org/springdoc/api/v31/app2/model/Pet.java | 392 +++++++++++++++ .../org/springdoc/api/v31/app2/model/Tag.java | 137 ++++++ .../springdoc/api/v31/app2/model/User.java | 358 ++++++++++++++ .../api/v31/app20/HelloController.java | 53 +++ .../api/v31/app20/SpringDocApp20Test.java | 43 ++ .../api/v31/app21/HelloController.java | 64 +++ .../api/v31/app21/SpringDocApp21Test.java | 45 ++ .../api/v31/app22/HelloController.java | 52 ++ .../springdoc/api/v31/app22/PersonDTO.java | 120 +++++ .../api/v31/app22/SpringDocApp22Test.java | 43 ++ .../api/v31/app23/HelloController.java | 59 +++ .../api/v31/app23/SpringDocApp23Test.java | 43 ++ .../api/v31/app24/HelloController.java | 59 +++ .../api/v31/app24/SpringDocApp24Test.java | 37 ++ .../api/v31/app24/SpringDocTestApp.java | 77 +++ .../api/v31/app25/HelloController.java | 109 +++++ .../api/v31/app25/SpringDocApp25Test.java | 43 ++ .../test/org/springdoc/api/v31/app26/Bar.java | 56 +++ .../test/org/springdoc/api/v31/app26/Foo.java | 57 +++ .../api/v31/app26/HelloController.java | 49 ++ .../org/springdoc/api/v31/app26/MyModel.java | 59 +++ .../api/v31/app26/SpringDocApp26Test.java | 43 ++ .../org/springdoc/api/v31/app27/Advice.java | 82 ++++ .../test/org/springdoc/api/v31/app27/Bar.java | 37 ++ .../test/org/springdoc/api/v31/app27/Foo.java | 37 ++ .../api/v31/app27/HelloController.java | 65 +++ .../springdoc/api/v31/app27/MyException.java | 39 ++ .../api/v31/app27/SpringDocApp27Test.java | 63 +++ .../api/v31/app28/HelloController.java | 52 ++ .../api/v31/app28/SpringDocApp28Test.java | 43 ++ .../api/v31/app29/HelloController.java | 62 +++ .../api/v31/app29/SpringDocApp29Test.java | 43 ++ .../springdoc/api/v31/app29/TrackerData.java | 61 +++ .../api/v31/app3/HelloController.java | 52 ++ .../org/springdoc/api/v31/app3/PersonDTO.java | 121 +++++ .../springdoc/api/v31/app3/PlayingCard.java | 151 ++++++ .../api/v31/app3/SpringDocApp3Test.java | 42 ++ .../api/v31/app30/HelloController.java | 51 ++ .../api/v31/app30/SpringDocApp30Test.java | 43 ++ .../api/v31/app31/HelloController.java | 99 ++++ .../api/v31/app31/SpringDocApp31Test.java | 43 ++ .../api/v31/app32/HelloController.java | 75 +++ .../api/v31/app32/SpringDocApp32Test.java | 43 ++ .../api/v31/app33/HelloController.java | 56 +++ .../api/v31/app33/SpringDocApp33Test.java | 43 ++ .../api/v31/app34/HelloController.java | 56 +++ .../api/v31/app34/MyExceptionHandler.java | 66 +++ .../api/v31/app34/SpringDocApp34Test.java | 43 ++ .../api/v31/app35/HelloController.java | 73 +++ .../api/v31/app35/SpringDocApp35Test.java | 49 ++ .../test/org/springdoc/api/v31/app37/Bar.java | 37 ++ .../test/org/springdoc/api/v31/app37/Car.java | 38 ++ .../test/org/springdoc/api/v31/app37/Foo.java | 37 ++ .../api/v31/app37/HelloController.java | 99 ++++ .../test/org/springdoc/api/v31/app37/Pet.java | 38 ++ .../api/v31/app37/SpringDocApp37Test.java | 43 ++ .../api/v31/app38/HelloController.java | 51 ++ .../api/v31/app38/SpringDocApp38Test.java | 43 ++ .../api/v31/app39/HelloController.java | 64 +++ .../api/v31/app39/SpringDocApp39Test.java | 37 ++ .../api/v31/app39/SpringDocTestApp.java | 76 +++ .../api/v31/app4/HelloController.java | 50 ++ .../api/v31/app4/SpringDocApp4Test.java | 55 +++ .../springdoc/api/v31/app4/TrackerData.java | 60 +++ .../api/v31/app40/HelloController.java | 50 ++ .../api/v31/app40/SpringDocApp40Test.java | 43 ++ .../api/v31/app41/HelloController.java | 68 +++ .../api/v31/app41/SpringDocApp411Test.java | 78 +++ .../api/v31/app41/SpringDocApp41Test.java | 80 ++++ .../api/v31/app42/HelloController.java | 50 ++ .../api/v31/app42/SpringDocApp42Test.java | 58 +++ .../org/springdoc/api/v31/app42/TweetId.java | 55 +++ .../api/v31/app43/HelloController.java | 54 +++ .../api/v31/app43/SpringDocApp43Test.java | 43 ++ .../api/v31/app44/HelloController.java | 234 +++++++++ .../api/v31/app44/SpringDocApp44Test.java | 68 +++ .../api/v31/app45/HelloController.java | 84 ++++ .../api/v31/app45/HelloController2.java | 84 ++++ .../api/v31/app45/OpenApiConfig.java | 41 ++ .../springdoc/api/v31/app45/PersonDTO.java | 120 +++++ .../api/v31/app45/SpringDocApp45Test.java | 43 ++ .../api/v31/app46/HelloController.java | 61 +++ .../api/v31/app46/SpringDocApp46Test.java | 43 ++ .../api/v31/app47/HelloController.java | 55 +++ .../api/v31/app47/SpringDocApp47Test.java | 43 ++ .../v31/app48/AbstractHelloController.java | 58 +++ .../api/v31/app48/HelloController.java | 61 +++ .../api/v31/app48/SpringDocApp48Test.java | 43 ++ .../api/v31/app49/HelloController.java | 57 +++ .../api/v31/app49/SpringDocApp49Test.java | 37 ++ .../api/v31/app49/SpringDocTestApp.java | 70 +++ .../api/v31/app5/CustomOpenAPIConfig.java | 51 ++ ...gurationComponentsSecuritySchemesTest.java | 174 +++++++ ...penApiResourceCustomConfigurationTest.java | 73 +++ .../OpenApiResourceNoConfigurationTest.java | 68 +++ .../api/v31/app50/HelloController.java | 56 +++ .../api/v31/app50/SpringDocApp50Test.java | 37 ++ .../api/v31/app50/SpringDocTestApp.java | 70 +++ .../api/v31/app51/HelloController.java | 115 +++++ .../api/v31/app51/SpringDocApp51Test.java | 43 ++ .../api/v31/app52/HelloController.java | 104 ++++ .../api/v31/app52/SpringDocApp52Test.java | 43 ++ .../api/v31/app53/HelloController.java | 155 ++++++ .../HelloControllerWithGlobalApiResponse.java | 72 +++ .../api/v31/app53/SpringDocApp53Test.java | 43 ++ .../api/v31/app54/HelloController.java | 84 ++++ .../springdoc/api/v31/app54/MealParty.java | 49 ++ .../api/v31/app54/SpringDocApp54Test.java | 43 ++ .../org/springdoc/api/v31/app54/Views.java | 44 ++ .../api/v31/app55/HelloController.java | 60 +++ .../api/v31/app55/SpringDocApp55Test.java | 43 ++ .../api/v31/app56/GlobalExceptionHandler.java | 90 ++++ .../api/v31/app56/HelloController.java | 48 ++ .../api/v31/app56/SpringDocApp56Test.java | 43 ++ .../api/v31/app57/HelloController.java | 53 +++ .../api/v31/app57/SpringDocApp57Test.java | 43 ++ .../api/v31/app58/HelloController.java | 183 +++++++ .../api/v31/app58/SpringDocApp58Test.java | 43 ++ .../api/v31/app59/HelloController.java | 44 ++ .../api/v31/app59/SpringDocApp59Test.java | 43 ++ .../api/v31/app6/HelloController.java | 61 +++ .../api/v31/app6/SpringDocApp6Test.java | 44 ++ .../api/v31/app60/HelloController.java | 76 +++ .../springdoc/api/v31/app60/QueryPaging.java | 47 ++ .../springdoc/api/v31/app60/QuerySort.java | 43 ++ .../api/v31/app60/SpringDocApp60Test.java | 43 ++ .../api/v31/app61/HelloController.java | 66 +++ .../api/v31/app61/SpringDocApp61Test.java | 43 ++ .../api/v31/app62/BaseController.java | 62 +++ .../api/v31/app62/SpringDocApp62Test.java | 43 ++ .../api/v31/app62/TestController.java | 54 +++ .../api/v31/app63/HelloController.java | 58 +++ .../api/v31/app63/SpringDocApp63Test.java | 48 ++ .../api/v31/app64/HelloController.java | 61 +++ .../api/v31/app64/SpringDocApp64Test.java | 45 ++ .../api/v31/app65/HelloController.java | 55 +++ .../api/v31/app65/SpringDocApp65Test.java | 43 ++ .../api/v31/app66/DefaultHealthCheckApi.java | 57 +++ .../api/v31/app66/HelloController.java | 56 +++ .../api/v31/app66/SpringDocApp66Test.java | 43 ++ .../api/v31/app66/UndocumentedClass.java | 37 ++ .../api/v31/app67/HelloController.java | 141 ++++++ .../api/v31/app67/SpringDocApp67Test.java | 43 ++ .../api/v31/app69/HelloController.java | 53 +++ .../springdoc/api/v31/app69/PersonDTO.java | 120 +++++ .../api/v31/app69/SpringDocApp69Test.java | 43 ++ .../api/v31/app7/HelloController.java | 53 +++ .../api/v31/app7/SpringDocApp7Test.java | 44 ++ .../api/v31/app70/HelloController.java | 57 +++ .../api/v31/app70/SpringDocApp70Test.java | 43 ++ .../app70/customizer/CustomizedOperation.java | 43 ++ .../app70/customizer/CustomizedParameter.java | 43 ++ .../app70/customizer/CustomizedProperty.java | 43 ++ .../app70/customizer/OperationCustomizer.java | 54 +++ .../app70/customizer/ParameterCustomizer.java | 54 +++ .../app70/customizer/PropertyCustomizer.java | 78 +++ .../api/v31/app70/model/ApiType.java | 47 ++ .../test/org/springdoc/api/v31/app71/Dog.java | 50 ++ .../api/v31/app71/HelloController.java | 49 ++ .../api/v31/app71/SpringDocApp71Test.java | 43 ++ .../app72/BlockingAutoConfigurationTest.java | 130 +++++ .../app72/CacheAutoConfigurationTest1.java | 114 +++++ .../v31/app72/GroupAutoConfigurationTest.java | 81 ++++ .../api/v31/app73/HelloController.java | 71 +++ .../api/v31/app73/SpringDocApp73Test.java | 43 ++ .../api/v31/app74/HelloController.java | 62 +++ .../api/v31/app74/SpringDocApp74Test.java | 43 ++ .../api/v31/app75/HelloController.java | 127 +++++ .../springdoc/api/v31/app75/PersonDTO.java | 120 +++++ .../RestResponseEntityExceptionHandler.java | 58 +++ .../api/v31/app75/SpringDocApp75Test.java | 44 ++ .../api/v31/app76/HelloController.java | 65 +++ .../api/v31/app76/SpringDocApp76Test.java | 68 +++ .../api/v31/app77/HelloController.java | 71 +++ .../api/v31/app77/SpringDocApp77Test.java | 43 ++ .../api/v31/app78/HelloController.java | 65 +++ .../springdoc/api/v31/app78/PersonDTO.java | 120 +++++ .../api/v31/app78/SpringDocApp78Test.java | 43 ++ .../api/v31/app79/HelloController.java | 53 +++ .../api/v31/app79/SpringDocApp79Test.java | 44 ++ .../api/v31/app8/HelloController.java | 46 ++ .../api/v31/app8/SpringDocApp8Test.java | 60 +++ .../api/v31/app80/HelloController.java | 81 ++++ .../api/v31/app80/SpringDocApp80Test.java | 45 ++ .../springdoc/api/v31/app80/TestObject.java | 80 ++++ .../api/v31/app81/HelloController.java | 49 ++ .../api/v31/app81/SpringDocApp81Test.java | 84 ++++ .../api/v31/app82/HelloController.java | 55 +++ .../springdoc/api/v31/app82/PersonDTO.java | 120 +++++ .../api/v31/app82/SpringDocApp82Test.java | 44 ++ .../api/v31/app83/HelloController.java | 68 +++ .../springdoc/api/v31/app83/PersonDTO.java | 120 +++++ .../api/v31/app83/SpringDocApp83Test.java | 44 ++ .../api/v31/app84/HelloController.java | 61 +++ .../api/v31/app84/SpringDocApp84Test.java | 44 ++ .../api/v31/app85/HelloController.java | 58 +++ .../api/v31/app85/SpringDocApp85Test.java | 44 ++ .../api/v31/app86/HelloController.java | 58 +++ .../api/v31/app86/SpringDocApp86Test.java | 47 ++ .../api/v31/app86/test/HelloController2.java | 58 +++ .../api/v31/app87/HelloController.java | 72 +++ .../api/v31/app87/SpringDocApp87Test.java | 44 ++ .../api/v31/app88/HelloController.java | 48 ++ .../api/v31/app88/SpringDocApp88Test.java | 45 ++ .../api/v31/app89/HelloController.java | 54 +++ .../api/v31/app89/SpringDocApp89Test.java | 54 +++ .../org/springdoc/api/v31/app9/MyApi.java | 54 +++ .../api/v31/app9/MyApiController.java | 62 +++ .../api/v31/app9/SpringDocApp9Test.java | 44 ++ .../api/v31/app90/HelloController.java | 81 ++++ .../api/v31/app90/SpringDocApp90Test.java | 37 ++ .../api/v31/app90/SpringDocTestApp.java | 103 ++++ .../org/springdoc/api/v31/app90/User.java | 448 ++++++++++++++++++ .../org/springdoc/api/v31/app91/Advice.java | 110 +++++ .../org/springdoc/api/v31/app91/ApiError.java | 79 +++ .../org/springdoc/api/v31/app91/Greeting.java | 63 +++ .../api/v31/app91/GreetingController.java | 72 +++ .../api/v31/app91/SpringDocApp91Test.java | 47 ++ .../api/v31/app92/HelloController.java | 53 +++ .../api/v31/app92/ParameterCustomizer.java | 55 +++ .../api/v31/app92/SpringDocApp92Test.java | 45 ++ .../api/v31/app93/BaseClientModel.java | 40 ++ .../api/v31/app93/BaseController.java | 50 ++ .../api/v31/app93/SpecificClientModel.java | 40 ++ .../api/v31/app93/SpecificController.java | 35 ++ .../api/v31/app93/SpringDocApp93Test.java | 45 ++ .../org/springdoc/api/v31/app94/Greeting.java | 63 +++ .../api/v31/app94/SpringDocApp94Test.java | 186 ++++++++ .../api/v31/app95/HelloController.java | 55 +++ .../api/v31/app95/SpringDocApp95Test.java | 47 ++ .../api/v31/app96/HelloController.java | 76 +++ .../api/v31/app96/SpringDocApp96Test.java | 45 ++ .../api/v31/app97/HelloController.java | 69 +++ .../api/v31/app97/SpringDocApp97Test.java | 45 ++ .../springdoc/api/v31/app97/StudentV1.java | 50 ++ .../springdoc/api/v31/app97/StudentV2.java | 50 ++ .../springdoc/api/v31/app97/StudentV3.java | 50 ++ .../api/v31/app98/HelloController.java | 48 ++ .../v31/app98/IgnoredAnnotationParameter.java | 43 ++ .../api/v31/app98/SpringDocApp98Test.java | 49 ++ .../api/v31/app99/HelloController.java | 54 +++ .../api/v31/app99/SpringDocApp99Test.java | 47 ++ .../api/v31/AbstractKotlinSpringDocTest.kt | 1 - 565 files changed, 42605 insertions(+), 1 deletion(-) create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiOriginFilter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiResponseMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ErrorMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ExceptionTranslator.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/HomeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryItem.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemLightDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/Manufacturer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/PeopleRestService.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/HelloDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/ExampleBody.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/CrudController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/Design.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/DesignController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/HavingPK.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/ApiUtil.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/ExceptionTranslator.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/HomeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Category.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/ModelApiResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Order.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Tag.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app106/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app107/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/ActionResult.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app109/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/ErrorMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/GlobalControllerAdvice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/PersonController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/PersonController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/Problem.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/ErrorMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/GlobalControllerAdvice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/PersonController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/PersonController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/Problem.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/ErrorMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/GlobalControllerAdvice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/PersonController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/Problem.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/sample/PersonController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app113/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app114/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/FooErrorHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app117/HelloApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/AbstractParent.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/ConcreteParent.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/Controller.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/JsonRequest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/AccountId.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/MetaAnnotationController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/InheritedRequestParams.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/RequestParams.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/BaseController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/BaseObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/CustomerDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/FirstController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/Wrapper.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/MyExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/MyExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/DeprecatedEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/SpringDocApp125Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/Problem.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/SecurityProblemResponsesConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/AbstractObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/ConcreteObjectA.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/ConcreteType.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/Controller.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/Umbrella.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/ActualReturnedEntity.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/OperationResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/TrackerData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/Organization.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/RestControllerError.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/Organization.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/RestControllerError.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app133/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/Book.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/BookRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/BookRouter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app138/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app139/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app140/HelloApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/Book.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/BookRepository.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/BookRouter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app142/HelloApplication.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app150/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app151/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/OrderState.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/OrderStateMapper.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/OpenApiConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/AbstractIntParameterObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/AbstractParameterObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteEnum.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteIntParameterObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteParameterObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/SomeEnum.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/Bar.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/StringyConverter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/CommonFooErrorHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/ErrorDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SimpleDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SpecificFooErrorHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/CustomException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/FooBean.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/FooErrorHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/Views.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app16/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app160/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app161/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/exception/NoResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/exception/NonUniqueResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/JavadocOnlyRestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/dto/JavadocOnlyRestDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/util/RestExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/exception/NoResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/exception/NonUniqueResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/AnnotationOverrideForJavadocRestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/util/RestExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/SpringDocJavadocProviderTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/exception/NoResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/exception/NonUniqueResultException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/rest/NoGenericOverrideRestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/rest/util/RestExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/ConcreteSubclassFromGeneric.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/MyData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleGeneric.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleInnerClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleInnerInnerClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleOuterClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app167/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/DescriptionFieldInRequestBodyIsNullController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/Person.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/RecordController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SimpleInnerClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SimpleOuterClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app17/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Animal.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/BasicController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Cat.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Dog.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/PersonProjection.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app172/JavadocPropertyCustomizerTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/Example.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/ExampleController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/ExampleController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/Question.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/SpringDocApp174Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/TestQuestion.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/TextQuestion.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app19/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/ApiUtil.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/ExceptionTranslator.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/HomeController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegate.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegateImpl.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Category.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/ModelApiResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Order.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Tag.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app20/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app23/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app25/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/Bar.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/MyModel.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Advice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Bar.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/MyException.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/TrackerData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/PlayingCard.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/MyExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app35/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Bar.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Car.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Foo.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Pet.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app38/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/TrackerData.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app40/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/TweetId.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app43/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app44/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/HelloController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/OpenApiConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app46/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app47/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/AbstractHelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/CustomOpenAPIConfig.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenApiResourceCustomConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenApiResourceNoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app51/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app52/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/HelloControllerWithGlobalApiResponse.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/MealParty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/Views.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app55/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/GlobalExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app57/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app58/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app59/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app6/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/QueryPaging.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/QuerySort.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app61/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/BaseController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/TestController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/DefaultHealthCheckApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/UndocumentedClass.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedOperation.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedParameter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedProperty.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/OperationCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/ParameterCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/PropertyCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/model/ApiType.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/Dog.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app73/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app74/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/RestResponseEntityExceptionHandler.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app77/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app79/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app8/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/TestObject.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app81/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/PersonDTO.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app84/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app85/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/test/HelloController2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app87/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app88/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app89/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/MyApi.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/MyApiController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/SpringDocTestApp.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/User.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/Advice.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/ApiError.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/Greeting.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/GreetingController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/ParameterCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/BaseClientModel.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/BaseController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpecificClientModel.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpecificController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app94/Greeting.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app95/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app96/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV1.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV2.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV3.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/IgnoredAnnotationParameter.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app99/HelloController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java new file mode 100644 index 000000000..b8893cc2d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/AbstractSpringDocTest.java @@ -0,0 +1,102 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Abstract spring doc test. + */ +@ActiveProfiles("test") +@SpringBootTest +@AutoConfigureMockMvc +public abstract class AbstractSpringDocTest { + + /** + * The constant className. + */ + public static String className; + + /** + * The Mock mvc. + */ + @Autowired + protected MockMvc mockMvc; + + /** + * Gets content. + * + * @param fileName the file name + * @return the content + * @throws Exception the exception + */ + public static String getContent(String fileName) throws Exception { + try { + Path path = Paths.get(AbstractSpringDocTest.class.getClassLoader().getResource(fileName).toURI()); + byte[] fileBytes = Files.readAllBytes(path); + return new String(fileBytes, StandardCharsets.UTF_8); + } + catch (Exception e) { + throw new RuntimeException("Failed to read file: " + fileName, e); + } + } + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + assertEquals(expected, result, true); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiException.java new file mode 100644 index 000000000..dad236231 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiException.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +/** + * The type Api exception. + */ +public final class ApiException extends Exception { + + /** + * The constant serialVersionUID. + */ + private static final long serialVersionUID = 1L; + + /** + * The Code. + */ + @SuppressWarnings("unused") + + private final int code; + + /** + * Instantiates a new Api exception. + * + * @param code the code + * @param msg the msg + */ + public ApiException(int code, String msg) { + super(msg); + this.code = code; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiOriginFilter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiOriginFilter.java new file mode 100644 index 000000000..5e90f1014 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiOriginFilter.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import java.io.IOException; + +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletResponse; + +/** + * The type Api origin filter. + */ +class ApiOriginFilter implements jakarta.servlet.Filter { + /** + * Do filter. + * + * @param request the request + * @param response the response + * @param chain the chain + * @throws IOException the io exception + * @throws ServletException the servlet exception + */ + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletResponse res = (HttpServletResponse) response; + res.addHeader("Access-Control-Allow-Origin", "*"); + res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); + res.addHeader("Access-Control-Allow-Headers", "Content-Type"); + chain.doFilter(request, response); + } + + /** + * Destroy. + */ + @Override + public void destroy() { + } + + /** + * Init. + * + * @param filterConfig the filter config + * @throws ServletException the servlet exception + */ + @Override + public void init(FilterConfig filterConfig) throws ServletException { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiResponseMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiResponseMessage.java new file mode 100644 index 000000000..085d1feab --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ApiResponseMessage.java @@ -0,0 +1,168 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import jakarta.xml.bind.annotation.XmlTransient; + +/** + * The type Api response message. + */ +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") +@jakarta.xml.bind.annotation.XmlRootElement +class ApiResponseMessage { + /** + * The constant ERROR. + */ + public static final int ERROR = 1; + + /** + * The constant WARNING. + */ + public static final int WARNING = 2; + + /** + * The constant INFO. + */ + public static final int INFO = 3; + + /** + * The constant OK. + */ + public static final int OK = 4; + + /** + * The constant TOO_BUSY. + */ + public static final int TOO_BUSY = 5; + + /** + * The Code. + */ + int code; + + /** + * The Type. + */ + String type; + + /** + * The Message. + */ + String message; + + /** + * Instantiates a new Api response message. + */ + public ApiResponseMessage() { + } + + /** + * Instantiates a new Api response message. + * + * @param code the code + * @param message the message + */ + public ApiResponseMessage(int code, String message) { + this.code = code; + switch (code) { + case ERROR: + setType("error"); + break; + case WARNING: + setType("warning"); + break; + case INFO: + setType("info"); + break; + case OK: + setType("ok"); + break; + case TOO_BUSY: + setType("too busy"); + break; + default: + setType("unknown"); + break; + } + this.message = message; + } + + /** + * Gets code. + * + * @return the code + */ + @XmlTransient + public int getCode() { + return code; + } + + /** + * Sets code. + * + * @param code the code + */ + public void setCode(int code) { + this.code = code; + } + + /** + * Gets type. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Sets type. + * + * @param type the type + */ + public void setType(String type) { + this.type = type; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ErrorMessage.java new file mode 100644 index 000000000..6ca3d831a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ErrorMessage.java @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +/** + * The type Error message. + */ +class ErrorMessage { + + /** + * The Id. + */ + private String id; + + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Error message. + * + * @param id the id + * @param message2 the message 2 + */ + public ErrorMessage(String id, String message2) { + this.id = id; + this.message = message2; + } + + /** + * Gets id. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ExceptionTranslator.java new file mode 100644 index 000000000..dd71a4cfe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ExceptionTranslator.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import java.util.UUID; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * The type Exception translator. + */ +@ControllerAdvice +class ExceptionTranslator { + + /** + * The constant LOGGER. + */ + private static final Logger LOGGER = LoggerFactory.getLogger(ExceptionTranslator.class); + + /** + * Handle run time exception response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler({ RuntimeException.class }) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity handleRunTimeException(RuntimeException e) { + return error(HttpStatus.INTERNAL_SERVER_ERROR, e); + } + + + /** + * Error response entity. + * + * @param status the status + * @param e the e + * @return the response entity + */ + private ResponseEntity error(HttpStatus status, Exception e) { + LOGGER.error("Exception : ", e); + return ResponseEntity.status(status).body(new ErrorMessage(UUID.randomUUID().toString(), e.getMessage())); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java new file mode 100644 index 000000000..c28db707c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Index string. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the string + */ + @GetMapping(value = "/hello/{numTelco}") + @ResponseStatus(HttpStatus.I_AM_A_TEAPOT) + @Tag(name = "tea") + public String index(@PathVariable("numTelco") String numTel, String adresse) { + return "Greetings from Spring Boot!"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/HomeController.java new file mode 100644 index 000000000..e4d4638cd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/HomeController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; +import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; + +/** + * Home redirection to swagger api documentation + */ +@Controller +class HomeController { + + /** + * The Swagger ui path. + */ + @Value(SWAGGER_UI_PATH) + private String swaggerUiPath; + + /** + * Index string. + * + * @return the string + */ + @GetMapping(DEFAULT_PATH_SEPARATOR) + public String index() { + return REDIRECT_URL_PREFIX + swaggerUiPath; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryApi.java new file mode 100644 index 000000000..1c9d5ed95 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryApi.java @@ -0,0 +1,92 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by the swagger code generator program (3.0.8). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app1; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * The interface Inventory api. + */ +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") +@Tag(name = "inventory") +public interface InventoryApi { + + /** + * Add inventory response entity. + * + * @param body the body + * @return the response entity + */ + @Operation(description = "adds an inventory item", operationId = "addInventory", summary = "Adds an item to the system", tags = { + "admins", }) + @ApiResponses(value = { @ApiResponse(responseCode = "201", description = "item created"), + @ApiResponse(responseCode = "400", description = "invalid input, object invalid"), + @ApiResponse(responseCode = "409", description = "an existing item already exists") }) + @PostMapping(value = "/inventory", consumes = { "application/json" }) + ResponseEntity addInventory( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Inventory item to do") @Valid @RequestBody InventoryItem body); + + /** + * Search inventory response entity. + * + * @param searchString the search string + * @param skip the skip + * @param limit the limit + * @return the response entity + */ + @Operation(description = "searches inventory", operationId = "searchInventory", summary = "By passing in the appropriate options, you can search for available inventory in the system ", tags = { + "developers", }, parameters = { + @Parameter(description = "pass an optional search string for looking up inventory", name = "searchString") }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "search results matching criteria"), + @ApiResponse(responseCode = "400", description = "bad input parameter") }) + @GetMapping(value = "/inventory", produces = { "application/json" }) + ResponseEntity> searchInventory( + @Valid @RequestParam(value = "searchString", required = false) String searchString, + @Min(0) @Parameter(description = "number of records to skip for pagination") @Valid @RequestParam(value = "skip", required = true) Integer skip, + @Min(0) @Max(50) @Parameter(description = "maximum number of records to return") @Valid @RequestParam(value = "limit", required = true) Integer limit); + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryApiController.java new file mode 100644 index 000000000..e7bf184d8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryApiController.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import java.util.List; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Inventory api controller. + */ +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") +@RestController +class InventoryApiController implements InventoryApi { + + + /** + * The Object mapper. + */ + @SuppressWarnings("unused") + private final ObjectMapper objectMapper; + + /** + * The Request. + */ + private final HttpServletRequest request; + + /** + * Instantiates a new Inventory api controller. + * + * @param objectMapper the object mapper + * @param request the request + */ + @org.springframework.beans.factory.annotation.Autowired + public InventoryApiController(ObjectMapper objectMapper, HttpServletRequest request) { + this.objectMapper = objectMapper; + this.request = request; + } + + /** + * Add inventory response entity. + * + * @param body the body + * @return the response entity + */ + public ResponseEntity addInventory( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Inventory item to add") @Valid @RequestBody InventoryItem body) { + @SuppressWarnings("unused") + String accept = request.getHeader("Accept"); + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } + + /** + * Search inventory response entity. + * + * @param searchString the search string + * @param skip the skip + * @param limit the limit + * @return the response entity + */ + public ResponseEntity> searchInventory( + @Parameter(description = "pass an optional search string for looking up inventory") @Valid @RequestParam(value = "searchString", required = false) String searchString, + @Min(0) @Parameter(description = "number of records to skip for pagination") @Valid @RequestParam(value = "skip", required = true) Integer skip, + @Min(0) @Max(50) @Parameter(description = "maximum number of records to return") @Valid @RequestParam(value = "limit", required = true) Integer limit) { + @SuppressWarnings("unused") + String accept = request.getHeader("Accept"); + return new ResponseEntity>(HttpStatus.NOT_IMPLEMENTED); + } + + /** + * Gets . + * + * @param language the language + * @return the + */ + public String getme(String language) { + return language; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryItem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryItem.java new file mode 100644 index 000000000..de0c974c8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/InventoryItem.java @@ -0,0 +1,261 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import java.util.Objects; +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +import org.springframework.validation.annotation.Validated; + +/** + * InventoryItem + */ +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") +class InventoryItem { + /** + * The Id. + */ + @JsonProperty("id") + private UUID id = null; + + /** + * The Name. + */ + @JsonProperty("name") + private String name = null; + + /** + * The Release date. + */ + @JsonProperty("releaseDate") + private String releaseDate = null; + + /** + * The Manufacturer. + */ + @JsonProperty("manufacturer") + private Manufacturer manufacturer = null; + + /** + * Id inventory item. + * + * @param id the id + * @return the inventory item + */ + public InventoryItem id(UUID id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id id + */ + @Schema(example = "d290f1ee-6c54-4b01-90e6-d701748f0851", required = true) + @NotNull + + @Valid + public UUID getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(UUID id) { + this.id = id; + } + + /** + * Name inventory item. + * + * @param name the name + * @return the inventory item + */ + public InventoryItem name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name name + */ + @Schema(example = "Widget Adapter", required = true) + @NotNull + + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Release date inventory item. + * + * @param releaseDate the release date + * @return the inventory item + */ + public InventoryItem releaseDate(String releaseDate) { + this.releaseDate = releaseDate; + return this; + } + + /** + * Get releaseDate + * + * @return releaseDate release date + */ + @Schema(example = "2016-08-29T09:12:33.001Z", required = true) + @NotNull + + public String getReleaseDate() { + return releaseDate; + } + + /** + * Sets release date. + * + * @param releaseDate the release date + */ + public void setReleaseDate(String releaseDate) { + this.releaseDate = releaseDate; + } + + /** + * Manufacturer inventory item. + * + * @param manufacturer the manufacturer + * @return the inventory item + */ + public InventoryItem manufacturer(Manufacturer manufacturer) { + this.manufacturer = manufacturer; + return this; + } + + /** + * Get manufacturer + * + * @return manufacturer manufacturer + */ + @Schema(required = true) + @NotNull + + @Valid + public Manufacturer getManufacturer() { + return manufacturer; + } + + /** + * Sets manufacturer. + * + * @param manufacturer the manufacturer + */ + public void setManufacturer(Manufacturer manufacturer) { + this.manufacturer = manufacturer; + } + + + /** + * Equals boolean. + * + * @param o the o + * @return the boolean + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InventoryItem inventoryItem = (InventoryItem) o; + return Objects.equals(this.id, inventoryItem.id) && + Objects.equals(this.name, inventoryItem.name) && + Objects.equals(this.releaseDate, inventoryItem.releaseDate) && + Objects.equals(this.manufacturer, inventoryItem.manufacturer); + } + + /** + * Hash code int. + * + * @return the int + */ + @Override + public int hashCode() { + return Objects.hash(id, name, releaseDate, manufacturer); + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InventoryItem {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" releaseDate: ").append(toIndentedString(releaseDate)).append("\n"); + sb.append(" manufacturer: ").append(toIndentedString(manufacturer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemController.java new file mode 100644 index 000000000..40de6bb1e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemController.java @@ -0,0 +1,89 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import java.net.URI; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; + +/** + * The type Item controller. + */ +@RestController +@Tag(name = "items") +class ItemController { + + /** + * Show items list. + * + * @param customerID the customer id + * @param toto the toto + * @param startDate the start date + * @param filterIds the filter ids + * @return the list + */ + @GetMapping("/items") + public List showItems(@RequestParam("cusID") @Size(min = 4, max = 6) final String customerID, + @Size(min = 4, max = 6) int toto, + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, + @Parameter(name = "filterIds", in = ParameterIn.QUERY, array = @ArraySchema(schema = @Schema(type = "string")), explode = Explode.FALSE) @RequestParam(required = false) List filterIds) { + return new ArrayList(); + } + + /** + * Add item response entity. + * + * @param itemDTO the item dto + * @return the response entity + */ + @PostMapping("/items") + public ResponseEntity addItem(@Valid @RequestBody final ItemLightDTO itemDTO) { + final URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}") + .buildAndExpand(UUID.randomUUID()).toUri(); + return ResponseEntity.created(location).build(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemDTO.java new file mode 100644 index 000000000..84bfe48e1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemDTO.java @@ -0,0 +1,164 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import java.io.Serializable; + +/** + * The type Item dto. + * @author bnasslahsen + */ +class ItemDTO implements Serializable { + + /** + * serialVersionUID of type long + */ + private static final long serialVersionUID = 1L; + + /** + * itemID of type String + */ + private String itemID; + + /** + * description of type String + */ + private String description; + + /** + * price of type int + */ + private int price; + + /** + * The Deprecated price. + */ + @Deprecated + private int deprecatedPrice; + + /** + * Instantiates a new Item dto. + */ + public ItemDTO() { + } + + /** + * Instantiates a new Item dto. + * + * @param description description + * @param price price + */ + public ItemDTO(final String description, final int price) { + this.description = description; + this.price = price; + } + + /** + * Instantiates a new Item dto. + * + * @param itemID itemID + * @param description description + * @param price price + */ + public ItemDTO(final String itemID, final String description, final int price) { + this.itemID = itemID; + this.description = description; + this.price = price; + } + + /** + * Gets description. + * + * @return description description + */ + public String getDescription() { + return description; + } + + /** + * Sets description. + * + * @param description description + */ + public void setDescription(final String description) { + this.description = description; + } + + /** + * Gets item id. + * + * @return item id + */ + public String getItemID() { + return itemID; + } + + /** + * Sets item id. + * + * @param itemID itemID + */ + public void setItemID(final String itemID) { + this.itemID = itemID; + } + + /** + * Gets price. + * + * @return price price + */ + public int getPrice() { + return price; + } + + /** + * Sets price. + * + * @param price price + */ + public void setPrice(final int price) { + this.price = price; + } + + /** + * Gets deprecated price. + * + * @return the deprecated price + */ + public int getDeprecatedPrice() { + return deprecatedPrice; + } + + /** + * Sets deprecated price. + * + * @param deprecatedPrice the deprecated price + */ + public void setDeprecatedPrice(int deprecatedPrice) { + this.deprecatedPrice = deprecatedPrice; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemLightDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemLightDTO.java new file mode 100644 index 000000000..3e8cf7dd4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/ItemLightDTO.java @@ -0,0 +1,129 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import java.io.Serializable; + +/** + * The type Item light dto. + * @author bnasslahsen + */ +class ItemLightDTO implements Serializable { + + /** + * serialVersionUID of type long + */ + private static final long serialVersionUID = 1L; + + /** + * description of type String + */ + private String description; + + /** + * price of type int + */ + private int price; + + /** + * The Deprecated price. + */ + @Deprecated + private int deprecatedPrice; + + /** + * Instantiates a new Item light dto. + */ + public ItemLightDTO() { + } + + /** + * Instantiates a new Item light dto. + * + * @param description the description + * @param price the price + */ + public ItemLightDTO(String description, int price) { + super(); + this.description = description; + this.price = price; + } + + /** + * Gets description. + * + * @return description description + */ + public String getDescription() { + return description; + } + + /** + * Sets description. + * + * @param description description + */ + public void setDescription(final String description) { + this.description = description; + } + + /** + * Gets price. + * + * @return price price + */ + public int getPrice() { + return price; + } + + /** + * Sets price. + * + * @param price price + */ + public void setPrice(final int price) { + this.price = price; + } + + /** + * Gets deprecated price. + * + * @return the deprecated price + */ + public int getDeprecatedPrice() { + return deprecatedPrice; + } + + /** + * Sets deprecated price. + * + * @param deprecatedPrice the deprecated price + */ + public void setDeprecatedPrice(int deprecatedPrice) { + this.deprecatedPrice = deprecatedPrice; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/Manufacturer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/Manufacturer.java new file mode 100644 index 000000000..bcc1b1382 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/Manufacturer.java @@ -0,0 +1,215 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +import org.springframework.validation.annotation.Validated; + + +/** + * Manufacturer + */ +@Validated +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]") +class Manufacturer { + /** + * The Name. + */ + @JsonProperty("name") + private String name = null; + + /** + * The Home page. + */ + @JsonProperty("homePage") + private String homePage = null; + + /** + * The Phone. + */ + @JsonProperty("phone") + private String phone = null; + + /** + * Name manufacturer. + * + * @param name the name + * @return the manufacturer + */ + public Manufacturer name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name name + */ + @Schema(example = "ACME Corporation", required = true) + @NotNull + + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Home page manufacturer. + * + * @param homePage the home page + * @return the manufacturer + */ + public Manufacturer homePage(String homePage) { + this.homePage = homePage; + return this; + } + + /** + * Get homePage + * + * @return homePage home page + */ + @Schema(example = "https://www.acme-corp.com") + + public String getHomePage() { + return homePage; + } + + /** + * Sets home page. + * + * @param homePage the home page + */ + public void setHomePage(String homePage) { + this.homePage = homePage; + } + + /** + * Phone manufacturer. + * + * @param phone the phone + * @return the manufacturer + */ + public Manufacturer phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * + * @return phone phone + */ + @Schema(example = "408-867-5309") + public String getPhone() { + return phone; + } + + /** + * Sets phone. + * + * @param phone the phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + + + /** + * Equals boolean. + * + * @param o the o + * @return the boolean + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Manufacturer manufacturer = (Manufacturer) o; + return Objects.equals(this.name, manufacturer.name) && + Objects.equals(this.homePage, manufacturer.homePage) && + Objects.equals(this.phone, manufacturer.phone); + } + + /** + * Hash code int. + * + * @return the int + */ + @Override + public int hashCode() { + return Objects.hash(name, homePage, phone); + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Manufacturer {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" homePage: ").append(toIndentedString(homePage)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/PeopleRestService.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/PeopleRestService.java new file mode 100644 index 000000000..3d6e71f24 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/PeopleRestService.java @@ -0,0 +1,146 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import java.net.URI; +import java.util.Collection; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.headers.Header; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; + +/** + * The type People rest service. + */ +@RestController +@Tag(name = "people") +class PeopleRestService { + /** + * The People. + */ + private Map people = new ConcurrentHashMap<>(); + + /** + * Gets people. + * + * @return the people + */ + @GetMapping(value = "/people", produces = MediaType.APPLICATION_JSON_VALUE) + @Operation(description = "List all people", responses = { + @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class))), responseCode = "200") }) + public Collection getPeople() { + return people.values(); + } + + /** + * Find person person dto. + * + * @param email the email + * @return the person dto + */ + @Operation(description = "Find person by e-mail", responses = { + @ApiResponse(content = @Content(schema = @Schema(implementation = PersonDTO.class)), responseCode = "200"), + @ApiResponse(responseCode = "404", description = "Person with such e-mail doesn't exists") }) + @GetMapping(value = "/{email}", produces = MediaType.APPLICATION_JSON_VALUE) + public PersonDTO findPerson( + @Parameter(description = "E-Mail address to lookup for", required = true) @PathVariable("email") final String email) { + + final PersonDTO person = people.get(email); + + if (person == null) { + throw new RuntimeException("Person with such e-mail doesn't exists"); + } + + return person; + } + + /** + * Add person response entity. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + * @return the response entity + */ + @PostMapping(value = "/{email}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @Operation(description = "Create new person", responses = { + @ApiResponse(content = @Content(schema = @Schema(implementation = PersonDTO.class), mediaType = MediaType.APPLICATION_JSON_VALUE), headers = @Header(name = "Location"), responseCode = "201"), + @ApiResponse(responseCode = "409", description = "Person with such e-mail already exists") }) + public ResponseEntity addPerson( + @Parameter(description = "E-Mail", required = true) @PathVariable("email") final String email, + @Parameter(description = "First Name", required = true) @RequestParam("firstName") final String firstName, + @Parameter(description = "Last Name", required = true) @RequestParam("lastName") final String lastName) { + + final PersonDTO person = people.get(email); + + if (person != null) { + return ResponseEntity.status(HttpStatus.CONFLICT).body("Person with such e-mail already exists"); + } + + people.put(email, new PersonDTO(email, firstName, lastName)); + final URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}") + .buildAndExpand(UUID.randomUUID()).toUri(); + return ResponseEntity.created(location).build(); + } + + /** + * Delete person response entity. + * + * @param email the email + * @return the response entity + */ + @DeleteMapping(value = "/{email}") + @Operation(description = "Delete existing person", responses = { + @ApiResponse(responseCode = "204", description = "Person has been deleted"), + @ApiResponse(responseCode = "404", description = "Person with such e-mail doesn't exists") }) + public ResponseEntity deletePerson( + @Parameter(description = "E-Mail address to lookup for", required = true) @PathVariable("email") final String email) { + if (people.remove(email) == null) { + throw new RuntimeException("Person with such e-mail doesn't exists"); + } + return ResponseEntity.noContent().build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/PersonDTO.java new file mode 100644 index 000000000..175db8fba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java new file mode 100644 index 000000000..9ede493c8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app1/SpringDocApp1Test.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app1; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 1 test. + */ +@TestPropertySource(properties = "springdoc.default-produces-media-type=application/json") +class SpringDocApp1Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("SpringShop API").version("v0") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java new file mode 100644 index 000000000..48a47847e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app10/HelloController.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param header the header + * @param request the request + * @param response the response + * @param locale the locale + * @param hello the hello + */ + @GetMapping("/test") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + + /** + * Test request attribute. + * + * @param sample the sample + * @param s the s + */ + @GetMapping("/testreq") + public void testRequestAttribute(@RequestAttribute String sample, String s) { + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java new file mode 100644 index 000000000..5ad2dcd97 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app10/SpringDocApp10Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app10; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 10 test. + */ +class SpringDocApp10Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/HelloController.java new file mode 100644 index 000000000..33d254e74 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app100; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.tags.Tags; +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@Tags(value = @Tag(name = "hello-ap1")) +class HelloController { + + /** + * Gets all pets. + * + * @param toto the toto + * @return the all pets + */ + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + @Tags(value = @Tag(name = "hello-ap2")) + public PersonDTO getAllPets(@NotNull String toto) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/PersonDTO.java new file mode 100644 index 000000000..aa9c3767b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/PersonDTO.java @@ -0,0 +1,123 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app100; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Person dto. + */ +@Schema +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java new file mode 100644 index 000000000..63c3c0c3a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app100/SpringDocApp100Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app100; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 100 test. + */ +class SpringDocApp100Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/HelloController.java new file mode 100644 index 000000000..3e3aed723 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app101; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/hello") +class HelloController { + + /** + * Hello hello dto. + * + * @return the hello dto + */ + @GetMapping + @ApiResponse(content = @Content(schema = @Schema( + description = "${test.app101.operation.hello.response.schema.description}", + implementation = HelloDTO.class))) + public HelloDTO hello() { + return new HelloDTO(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/HelloDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/HelloDTO.java new file mode 100644 index 000000000..67fac5268 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/HelloDTO.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app101; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Hello dto. + */ +@Schema(description = "${test.app101.schema.hello.description}") +class HelloDTO { + + /** + * The Id. + */ + @Schema(description = "${test.app101.schema.hello.param.id.description}") + private String id; + + /** + * Gets id. + * + * @return the id + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java new file mode 100644 index 000000000..02cd66864 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app101/SpringDocApp101Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app101; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +/** + * The type Spring doc app 101 test. + */ +@ActiveProfiles("101") +class SpringDocApp101Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java new file mode 100644 index 000000000..b108c4264 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/InheritedRequestParams.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NotBlank; + +/** + * The type Inherited request params. + */ +class InheritedRequestParams extends RequestParams { + /** + * The Child param. + */ + @Parameter(description = "parameter from child of RequestParams") + @NotBlank + private String childParam; + + /** + * Gets child param. + * + * @return the child param + */ + public String getChildParam() { + return childParam; + } + + /** + * Sets child param. + * + * @param childParam the child param + */ + public void setChildParam(String childParam) { + this.childParam = childParam; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java new file mode 100644 index 000000000..158e49fdf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/RequestParams.java @@ -0,0 +1,284 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import java.math.BigInteger; +import java.util.List; +import java.util.Optional; + +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.lang.Nullable; + +/** + * The type Request params. + */ +class RequestParams { + + /** + * The String param. + */ + @Parameter(description = "string parameter") + private String stringParam; + + /** + * The String param 1. + */ + @Deprecated + private String stringParam1; + + /** + * The String param 2. + */ + @Parameter(description = "string parameter2", required = true) + private String stringParam2; + + /** + * The Int param. + */ + @Parameter(description = "int parameter") + private int intParam; + + /** + * The Int param 2. + */ + private Optional intParam2; + + /** + * The Int param 3. + */ + @Nullable + private String intParam3; + + /** + * The Nested. + */ + private Nested nested; + + /** + * The Nested list. + */ + private List nestedList; + + /** + * Gets string param. + * + * @return the string param + */ + public String getStringParam() { + return stringParam; + } + + /** + * Sets string param. + * + * @param stringParam the string param + */ + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + /** + * Gets int param. + * + * @return the int param + */ + public int getIntParam() { + return intParam; + } + + /** + * Sets int param. + * + * @param intParam the int param + */ + public void setIntParam(int intParam) { + this.intParam = intParam; + } + + /** + * Gets int param 2. + * + * @return the int param 2 + */ + public Optional getIntParam2() { + return intParam2; + } + + /** + * Sets int param 2. + * + * @param intParam2 the int param 2 + */ + public void setIntParam2(Optional intParam2) { + this.intParam2 = intParam2; + } + + /** + * Gets int param 3. + * + * @return the int param 3 + */ + @Nullable + public String getIntParam3() { + return intParam3; + } + + /** + * Sets int param 3. + * + * @param intParam3 the int param 3 + */ + public void setIntParam3(@Nullable String intParam3) { + this.intParam3 = intParam3; + } + + /** + * Gets string param 1. + * + * @return the string param 1 + */ + public String getStringParam1() { + return stringParam1; + } + + /** + * Sets string param 1. + * + * @param stringParam1 the string param 1 + */ + public void setStringParam1(String stringParam1) { + this.stringParam1 = stringParam1; + } + + /** + * Gets string param 2. + * + * @return the string param 2 + */ + public String getStringParam2() { + return stringParam2; + } + + /** + * Sets string param 2. + * + * @param stringParam2 the string param 2 + */ + public void setStringParam2(String stringParam2) { + this.stringParam2 = stringParam2; + } + + /** + * Gets nested. + * + * @return the nested + */ + public Nested getNested() { + return nested; + } + + /** + * Sets nested. + * + * @param nested the nested + */ + public void setNested(Nested nested) { + this.nested = nested; + } + + /** + * Gets nested list. + * + * @return the nested list + */ + public List getNestedList() { + return nestedList; + } + + /** + * Sets nested list. + * + * @param nestedList the nested list + */ + public void setNestedList(List nestedList) { + this.nestedList = nestedList; + } + + /** + * The type Nested. + */ + public static class Nested { + /** + * The Param 1. + */ + private String param1; + + /** + * The Param 2. + */ + private BigInteger param2; + + /** + * Gets param 1. + * + * @return the param 1 + */ + @Parameter(description = "nested string parameter") + public String getParam1() { + return param1; + } + + /** + * Sets param 1. + * + * @param param1 the param 1 + */ + public void setParam1(String param1) { + this.param1 = param1; + } + + /** + * Gets param 2. + * + * @return the param 2 + */ + @Parameter(description = "nested BigInteger parameter") + public BigInteger getParam2() { + return param2; + } + + /** + * Sets param 2. + * + * @param param2 the param 2 + */ + public void setParam2(BigInteger param2) { + this.param2 = param2; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java new file mode 100644 index 000000000..b2ea1347f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/SpringDocApp102Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 102 test. + */ +class SpringDocApp102Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/TestController.java new file mode 100644 index 000000000..4347f44d4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app102/TestController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app102; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.lang.Nullable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Test controller. + */ +@RestController +class TestController { + /** + * Gets test. + * + * @param param the param + * @param requestParams the request params + */ + @GetMapping("test") + public void getTest(@RequestParam @Nullable String param, @ParameterObject InheritedRequestParams requestParams) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/ExampleBody.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/ExampleBody.java new file mode 100644 index 000000000..be96d9581 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/ExampleBody.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app103; + +/** + * The type Example body. + */ +class ExampleBody { + /** + * The String param. + */ + private String stringParam; + + /** + * The Int param. + */ + private int intParam; + + /** + * Gets string param. + * + * @return the string param + */ + public String getStringParam() { + return stringParam; + } + + /** + * Sets string param. + * + * @param stringParam the string param + */ + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + /** + * Gets int param. + * + * @return the int param + */ + public int getIntParam() { + return intParam; + } + + /** + * Sets int param. + * + * @param intParam the int param + */ + public void setIntParam(int intParam) { + this.intParam = intParam; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/HelloController.java new file mode 100644 index 000000000..eeb08d164 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/HelloController.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app103; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Encoding; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Post my request body string. + * + * @param body the body + * @param file the file + * @return the string + */ + @PostMapping(value = "/test/103", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Operation( + requestBody = @RequestBody( + content = @Content( + encoding = @Encoding(name = "body", contentType = "application/json") + ) + ) + ) + public String postMyRequestBody( + @RequestPart("body") ExampleBody body, + @RequestParam("file") MultipartFile file + ) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java new file mode 100644 index 000000000..7cae09b43 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app103/SpringDocApp103Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app103; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 103 test. + */ +class SpringDocApp103Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/CrudController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/CrudController.java new file mode 100644 index 000000000..e12a74785 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/CrudController.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * The type Crud controller. + * + * @param the type parameter + */ +@Controller +@SuppressWarnings("rawtypes") +public abstract class CrudController { + + /** + * Get t. + * + * @param id the id + * @return the t + */ + @GetMapping(path = "{id}") + @ResponseBody + @Operation(description = "Get single object") + public T get( // + @Parameter(description = "The id to get.", required = true) @PathVariable("id") int id) { + return null; + } + + /** + * List list. + * + * @return the list + */ + @GetMapping(path = "") + @ResponseBody + @Operation(description = "Receive a list of objects") + public List list() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/Design.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/Design.java new file mode 100644 index 000000000..a062261fd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/Design.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +/** + * The type Design. + */ +class Design extends HavingPK { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/DesignController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/DesignController.java new file mode 100644 index 000000000..c7f5097d2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/DesignController.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * The type Design controller. + */ +@Tag(name = "design") +@Controller +@RequestMapping("/design") +class DesignController extends CrudController { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/HavingPK.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/HavingPK.java new file mode 100644 index 000000000..58cae1773 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/HavingPK.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +/** + * The type Having pk. + */ +class HavingPK { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java new file mode 100644 index 000000000..2f20b5ff4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app104/SpringDocApp104Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app104; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 104 test. + */ +class SpringDocApp104Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java new file mode 100644 index 000000000..74e764d07 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/SpringDocApp105Test.java @@ -0,0 +1,144 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 105 test. + */ +@TestPropertySource(properties = { + "springdoc.group-configs[0].group=stores", + "springdoc.group-configs[0].paths-to-match=/store/**", + "springdoc.group-configs[1].group=users", + "springdoc.group-configs[1].packages-to-scan=test.org.springdoc.api.v31.app105.api.user", + "springdoc.group-configs[2].group=pets", + "springdoc.group-configs[2].paths-to-match=/pet/**", + "springdoc.group-configs[3].group=groups test", + "springdoc.group-configs[3].paths-to-match=/v1/**", + "springdoc.group-configs[3].paths-to-exclude=/v1/users", + "springdoc.group-configs[3].packages-to-scan=test.org.springdoc.api.v31.app105.api.user,test.org.springdoc.api.v31.app105.api.store", +}) +class SpringDocApp105Test extends AbstractSpringDocTest { + + /** + * The constant className. + */ + public static String className; + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/stores")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app105-1.json"), true)); + } + + /** + * Test app 2. + * + * @throws Exception the exception + */ + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/users")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app105-2.json"), true)); + } + + /** + * Test app 3. + * + * @throws Exception the exception + */ + @Test + void testApp3() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/pets")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app105-3.json"), true)); + } + + /** + * Test app 4. + * + * @throws Exception the exception + */ + @Test + void testApp4() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/groups test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app105-4.json"), true)); + } + + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/ApiUtil.java new file mode 100644 index 000000000..b87168d0f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/ApiUtil.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api; + +import java.io.IOException; + +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.server.ResponseStatusException; + +/** + * The type Api util. + */ +public class ApiUtil { + + /** + * Sets example response. + * + * @param req the req + * @param contentType the content type + * @param example the example + */ + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); + req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Check api key. + * + * @param req the req + */ + public static void checkApiKey(NativeWebRequest req) { + if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { + throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/ExceptionTranslator.java new file mode 100644 index 000000000..11c5f1364 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/ExceptionTranslator.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api; + +import java.util.Map; + +import jakarta.validation.ConstraintViolationException; + +import org.springframework.boot.web.error.ErrorAttributeOptions; +import org.springframework.boot.web.servlet.error.ErrorAttributes; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.WebRequest; + +/** + * The type Exception translator. + */ +@RestControllerAdvice +class ExceptionTranslator { + + /** + * The Error attributes. + */ + private final ErrorAttributes errorAttributes; + + /** + * Instantiates a new Exception translator. + * + * @param errorAttributes the error attributes + */ + public ExceptionTranslator(ErrorAttributes errorAttributes) { + this.errorAttributes = errorAttributes; + } + + /** + * Process constraint violation exception map. + * + * @param request the request + * @return the map + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Map processConstraintViolationException(WebRequest request) { + request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); + return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/HomeController.java new file mode 100644 index 000000000..69a4d2cf8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/HomeController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; +import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; + +/** + * Home redirection to swagger api documentation + */ +@Controller +class HomeController { + + /** + * The Swagger ui path. + */ + @Value(SWAGGER_UI_PATH) + private String swaggerUiPath; + + /** + * Index string. + * + * @return the string + */ + @GetMapping(DEFAULT_PATH_SEPARATOR) + public String index() { + return REDIRECT_URL_PREFIX + swaggerUiPath; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApi.java new file mode 100644 index 000000000..36ce9c43a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApi.java @@ -0,0 +1,227 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app105.api.pet; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v31.app105.model.ModelApiResponse; +import test.org.springdoc.api.v31.app105.model.Pet; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +/** + * The interface Pet api. + */ +@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { + @OAuthScope(name = "write:pets", description = "modify pets in your account"), + @OAuthScope(name = "read:pets", description = "read your pets") }))) +@Tag(name = "pet", description = "the pet API") +public interface PetApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default PetApiDelegate getDelegate() { + return new PetApiDelegate() { + }; + } + + /** + * Add pet. + * + * @param pet the pet + */ + @Operation(summary = "Add a new pet to the store", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default void addPet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + // return getDelegate().addPet(pet); + } + + /** + * Delete pet response entity. + * + * @param petId the pet id + * @param apiKey the api key + * @return the response entity + */ + @Operation(summary = "Deletes a pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @DeleteMapping(value = "/pet/{petId}") + default ResponseEntity deletePet( + @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + return getDelegate().deletePet(petId, apiKey); + } + + /** + * Find pets by status response entity. + * + * @param status the status + * @return the response entity + */ + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid status value") }) + @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByStatus( + @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { + return getDelegate().findPetsByStatus(status); + } + + /** + * Find pets by tags response entity. + * + * @param tags the tags + * @return the response entity + */ + @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid tag value") }) + @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByTags( + @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + return getDelegate().findPetsByTags(tags); + } + + /** + * Gets pet by id. + * + * @param petId the pet id + * @return the pet by id + */ + @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { + @SecurityRequirement(name = "api_key") }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getPetById( + @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + return getDelegate().getPetById(petId); + } + + /** + * Update pet response entity. + * + * @param pet the pet + * @return the response entity + */ + @Operation(summary = "Update an existing pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") }) + @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default ResponseEntity updatePet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + return getDelegate().updatePet(pet); + } + + /** + * Update pet with form response entity. + * + * @param petId the pet id + * @param name the name + * @param status the status + * @return the response entity + */ + @Operation(summary = "Updates a pet in the store with form data", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) + default ResponseEntity updatePetWithForm( + @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, + @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { + return getDelegate().updatePetWithForm(petId, name, status); + } + + /** + * Upload file response entity. + * + * @param petId the pet id + * @param additionalMetadata the additional metadata + * @param file the file + * @return the response entity + */ + @Operation(summary = "uploads an image", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) + @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { + "multipart/form-data" }) + default ResponseEntity uploadFile( + @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { + return getDelegate().uploadFile(petId, additionalMetadata, file); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiController.java new file mode 100644 index 000000000..d12e3f0f7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.pet; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Pet api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class PetApiController implements PetApi { + + /** + * The Delegate. + */ + private final PetApiDelegate delegate; + + /** + * Instantiates a new Pet api controller. + * + * @param delegate the delegate + */ + public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public PetApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegate.java new file mode 100644 index 000000000..fad4feab6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegate.java @@ -0,0 +1,193 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.pet; + +import java.util.List; +import java.util.Optional; + +import jakarta.validation.Valid; +import test.org.springdoc.api.v31.app105.api.ApiUtil; +import test.org.springdoc.api.v31.app105.model.ModelApiResponse; +import test.org.springdoc.api.v31.app105.model.Pet; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface PetApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Add pet. + * + * @param pet the pet + * @see PetApi#addPet PetApi#addPet + */ + default void addPet(Pet pet) { + + } + + /** + * Delete pet response entity. + * + * @param petId the pet id + * @param apiKey the api key + * @return the response entity + * @see PetApi#deletePet PetApi#deletePet + */ + default ResponseEntity deletePet(Long petId, + String apiKey) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Find pets by status response entity. + * + * @param status the status + * @return the response entity + * @see PetApi#findPetsByStatus PetApi#findPetsByStatus + */ + default ResponseEntity> findPetsByStatus(List status) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Extract. + */ + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + break; + } + } + }); + } + + /** + * Find pets by tags response entity. + * + * @param tags the tags + * @return the response entity + * @see PetApi#findPetsByTags PetApi#findPetsByTags + */ + default ResponseEntity> findPetsByTags(List tags) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets pet by id. + * + * @param petId the pet id + * @return the pet by id + * @see PetApi#getPetById PetApi#getPetById + */ + default ResponseEntity getPetById(Long petId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update pet response entity. + * + * @param pet the pet + * @return the response entity + * @see PetApi#updatePet PetApi#updatePet + */ + default ResponseEntity updatePet(Pet pet) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update pet with form response entity. + * + * @param petId the pet id + * @param name the name + * @param status the status + * @return the response entity + * @see PetApi#updatePetWithForm PetApi#updatePetWithForm + */ + default ResponseEntity updatePetWithForm(Long petId, + String name, + String status) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Upload file response entity. + * + * @param petId the pet id + * @param additionalMetadata the additional metadata + * @param file the file + * @return the response entity + * @see PetApi#uploadFile PetApi#uploadFile + */ + default ResponseEntity uploadFile(Long petId, + String additionalMetadata, + @Valid MultipartFile file) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegateImpl.java new file mode 100644 index 000000000..d35f0c526 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/pet/PetApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.pet; + +import org.springframework.stereotype.Service; + +/** + * The type Pet api delegate. + */ +@Service +class PetApiDelegateImpl implements PetApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApi.java new file mode 100644 index 000000000..b3a4f1976 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApi.java @@ -0,0 +1,148 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app105.api.store; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import test.org.springdoc.api.v31.app105.model.Order; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * The interface Store api. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() { + }; + } + + /** + * Delete order response entity. + * + * @param orderId the order id + * @return the response entity + */ + @Operation(summary = "Delete purchase order by ID", tags = { "store" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @DeleteMapping(value = "/store/order/{orderId}") + default ResponseEntity deleteOrder( + @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { + return getDelegate().deleteOrder(orderId); + } + + /** + * Gets inventory. + * + * @return the inventory + */ + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { + @SecurityRequirement(name = "api_key") }, tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) + @GetMapping(value = "/store/inventory", produces = { "application/json" }) + default ResponseEntity> getInventory() { + return getDelegate().getInventory(); + } + + /** + * Gets order by id. + * + * @param orderId the order id + * @return the order by id + */ + @Operation(summary = "Find purchase order by ID", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { + return getDelegate().getOrderById(orderId); + } + + /** + * Place order response entity. + * + * @param order the order + * @return the response entity + */ + @Operation(summary = "Place an order for a pet", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid Order") }) + @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { + "application/json" }) + default ResponseEntity placeOrder( + @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { + return getDelegate().placeOrder(order); + } + + /** + * Stores. + * + * @param name the name + */ + @GetMapping(value = "/v1/stores") + default void stores(@Valid @NotBlank String name) { + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiController.java new file mode 100644 index 000000000..7e1e5bd16 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.store; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Store api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class StoreApiController implements StoreApi { + + /** + * The Delegate. + */ + private final StoreApiDelegate delegate; + + /** + * Instantiates a new Store api controller. + * + * @param delegate the delegate + */ + public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public StoreApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegate.java new file mode 100644 index 000000000..d56c2f330 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegate.java @@ -0,0 +1,124 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.store; + +import java.util.Map; +import java.util.Optional; + +import test.org.springdoc.api.v31.app105.api.ApiUtil; +import test.org.springdoc.api.v31.app105.model.Order; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface StoreApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Delete order response entity. + * + * @param orderId the order id + * @return the response entity + * @see StoreApi#deleteOrder StoreApi#deleteOrder + */ + default ResponseEntity deleteOrder(String orderId) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets inventory. + * + * @return the inventory + * @see StoreApi#getInventory StoreApi#getInventory + */ + default ResponseEntity> getInventory() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets order by id. + * + * @param orderId the order id + * @return the order by id + * @see StoreApi#getOrderById StoreApi#getOrderById + */ + default ResponseEntity getOrderById(Long orderId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Extract. + */ + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + break; + } + } + }); + } + + /** + * Place order response entity. + * + * @param order the order + * @return the response entity + * @see StoreApi#placeOrder StoreApi#placeOrder + */ + default ResponseEntity placeOrder(Order order) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegateImpl.java new file mode 100644 index 000000000..6695b9602 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/store/StoreApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.store; + +import org.springframework.stereotype.Service; + +/** + * The type Store api delegate. + */ +@Service +class StoreApiDelegateImpl implements StoreApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApi.java new file mode 100644 index 000000000..5625cb956 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApi.java @@ -0,0 +1,197 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app105.api.user; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v31.app105.model.User; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * The interface User api. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "user", description = "the user API") +public interface UserApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default UserApiDelegate getDelegate() { + return new UserApiDelegate() { + }; + } + + /** + * Create user response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Create user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user", consumes = { "application/json" }) + default ResponseEntity createUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { + return getDelegate().createUser(user); + } + + /** + * Create users with array input response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) + default ResponseEntity createUsersWithArrayInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithArrayInput(user); + } + + /** + * Create users with list input response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) + default ResponseEntity createUsersWithListInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithListInput(user); + } + + /** + * Delete user response entity. + * + * @param username the username + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @DeleteMapping(value = "/user/{username}") + default ResponseEntity deleteUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + return getDelegate().deleteUser(username); + } + + /** + * Gets user by name. + * + * @param username the username + * @return the user by name + */ + @Operation(summary = "Get user by user name", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + + @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) + default ResponseEntity getUserByName( + @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + return getDelegate().getUserByName(username); + } + + /** + * Login user response entity. + * + * @param username the username + * @param password the password + * @return the response entity + */ + @Operation(summary = "Logs user into the system", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) + @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) + default ResponseEntity loginUser( + @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + return getDelegate().loginUser(username, password); + } + + /** + * Logout user response entity. + * + * @return the response entity + */ + @Operation(summary = "Logs out current logged in user session", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @GetMapping(value = "/user/logout") + default ResponseEntity logoutUser() { + return getDelegate().logoutUser(); + } + + /** + * Update user response entity. + * + * @param username the username + * @param user the user + * @return the response entity + */ + @Operation(summary = "Updated user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + @PutMapping(value = "/user/{username}", consumes = { "application/json" }) + default ResponseEntity updateUser( + @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { + return getDelegate().updateUser(username, user); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiController.java new file mode 100644 index 000000000..6dcad17c7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.user; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type User api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@RestController +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class UserApiController implements UserApi { + + /** + * The Delegate. + */ + private final UserApiDelegate delegate; + + /** + * Instantiates a new User api controller. + * + * @param delegate the delegate + */ + public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public UserApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegate.java new file mode 100644 index 000000000..35d51c6d6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegate.java @@ -0,0 +1,168 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.user; + +import java.util.List; +import java.util.Optional; + +import test.org.springdoc.api.v31.app105.api.ApiUtil; +import test.org.springdoc.api.v31.app105.model.User; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface UserApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Create user response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUser UserApi#createUser + */ + default ResponseEntity createUser(User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Create users with array input response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUsersWithArrayInput UserApi#createUsersWithArrayInput + */ + default ResponseEntity createUsersWithArrayInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Create users with list input response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUsersWithListInput UserApi#createUsersWithListInput + */ + default ResponseEntity createUsersWithListInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Delete user response entity. + * + * @param username the username + * @return the response entity + * @see UserApi#deleteUser UserApi#deleteUser + */ + default ResponseEntity deleteUser(String username) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets user by name. + * + * @param username the username + * @return the user by name + * @see UserApi#getUserByName UserApi#getUserByName + */ + default ResponseEntity getUserByName(String username) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Login user response entity. + * + * @param username the username + * @param password the password + * @return the response entity + * @see UserApi#loginUser UserApi#loginUser + */ + default ResponseEntity loginUser(String username, + String password) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Logout user response entity. + * + * @return the response entity + * @see UserApi#logoutUser UserApi#logoutUser + */ + default ResponseEntity logoutUser() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update user response entity. + * + * @param username the username + * @param user the user + * @return the response entity + * @see UserApi#updateUser UserApi#updateUser + */ + default ResponseEntity updateUser(String username, + User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegateImpl.java new file mode 100644 index 000000000..1482be035 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/api/user/UserApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.api.user; + +import org.springframework.stereotype.Service; + +/** + * The type User api delegate. + */ +@Service +class UserApiDelegateImpl implements UserApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Category.java new file mode 100644 index 000000000..e45fc486b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Category.java @@ -0,0 +1,137 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Category. + */ +class Category { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Name. + */ + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id category. + * + * @param id the id + * @return the category + */ + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name category. + * + * @param name the name + * @return the category + */ + public Category name(String name) { + this.name = name; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/ModelApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/ModelApiResponse.java new file mode 100644 index 000000000..dbec36222 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/ModelApiResponse.java @@ -0,0 +1,174 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Model api response. + */ +public class ModelApiResponse { + + /** + * The Code. + */ + @Schema(description = "") + private Integer code = null; + + /** + * The Type. + */ + @Schema(description = "") + private String type = null; + + /** + * The Message. + */ + @Schema(description = "") + private String message = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get code + * + * @return code code + */ + @JsonProperty("code") + public Integer getCode() { + return code; + } + + /** + * Sets code. + * + * @param code the code + */ + public void setCode(Integer code) { + this.code = code; + } + + /** + * Code model api response. + * + * @param code the code + * @return the model api response + */ + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * + * @return type type + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * Sets type. + * + * @param type the type + */ + public void setType(String type) { + this.type = type; + } + + /** + * Type model api response. + * + * @param type the type + * @return the model api response + */ + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * + * @return message message + */ + @JsonProperty("message") + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * Message model api response. + * + * @param message the message + * @return the model api response + */ + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Order.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Order.java new file mode 100644 index 000000000..3f03494f0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Order.java @@ -0,0 +1,364 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Order. + */ +public class Order { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Pet id. + */ + @Schema(description = "") + private Long petId = null; + + /** + * The Quantity. + */ + @Schema(description = "") + private Integer quantity = null; + + /** + * The Ship date. + */ + @Schema(description = "") + private Date shipDate = null; + + /** + * The Status. + */ + @Schema(description = "Order Status") + /** + * Order Status + **/ + private StatusEnum status = null; + + /** + * The Complete. + */ + @Schema(description = "") + private Boolean complete = false; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id order. + * + * @param id the id + * @return the order + */ + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * + * @return petId pet id + */ + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + + /** + * Sets pet id. + * + * @param petId the pet id + */ + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + * Pet id order. + * + * @param petId the pet id + * @return the order + */ + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * + * @return quantity quantity + */ + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + + /** + * Sets quantity. + * + * @param quantity the quantity + */ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + * Quantity order. + * + * @param quantity the quantity + * @return the order + */ + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * + * @return shipDate ship date + */ + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + + /** + * Sets ship date. + * + * @param shipDate the ship date + */ + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Ship date order. + * + * @param shipDate the ship date + * @return the order + */ + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * + * @return status status + */ + @JsonProperty("status") + public String getStatus() { + if (status == null) { + return null; + } + return status.getValue(); + } + + /** + * Sets status. + * + * @param status the status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Status order. + * + * @param status the status + * @return the order + */ + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * + * @return complete boolean + */ + @JsonProperty("complete") + public Boolean isisComplete() { + return complete; + } + + /** + * Sets complete. + * + * @param complete the complete + */ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + /** + * Complete order. + * + * @param complete the complete + * @return the order + */ + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * The enum Status enum. + */ + public enum StatusEnum { + /** + *Placed status enum. + */ + PLACED("placed"), + /** + *Approved status enum. + */ + APPROVED("approved"), + /** + *Delivered status enum. + */ + DELIVERED("delivered"); + + /** + * The Value. + */ + private String value; + + /** + * Instantiates a new Status enum. + * + * @param value the value + */ + StatusEnum(String value) { + this.value = value; + } + + /** + * From value status enum. + * + * @param text the text + * @return the status enum + */ + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + /** + * Gets value. + * + * @return the value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Pet.java new file mode 100644 index 000000000..69def5ee0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Pet.java @@ -0,0 +1,392 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +/** + * The type Pet. + */ +public class Pet { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Category. + */ + @Schema(description = "") + private Category category = null; + + /** + * The Name. + */ + @Schema(example = "doggie", required = true, description = "") + private String name = null; + + /** + * The Photo urls. + */ + @Schema(required = true, description = "") + private List photoUrls = new ArrayList(); + + /** + * The Tags. + */ + @Schema(description = "") + private List tags = null; + + /** + * The Status. + */ + @Schema(description = "pet status in the store") + /** + * pet status in the store + **/ + private StatusEnum status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id pet. + * + * @param id the id + * @return the pet + */ + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * + * @return category category + */ + @JsonProperty("category") + public Category getCategory() { + return category; + } + + /** + * Sets category. + * + * @param category the category + */ + public void setCategory(Category category) { + this.category = category; + } + + /** + * Category pet. + * + * @param category the category + * @return the pet + */ + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name pet. + * + * @param name the name + * @return the pet + */ + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * + * @return photoUrls photo urls + */ + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + /** + * Sets photo urls. + * + * @param photoUrls the photo urls + */ + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + * Photo urls pet. + * + * @param photoUrls the photo urls + * @return the pet + */ + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + /** + * Add photo urls item pet. + * + * @param photoUrlsItem the photo urls item + * @return the pet + */ + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * + * @return tags tags + */ + @JsonProperty("tags") + public List getTags() { + return tags; + } + + /** + * Sets tags. + * + * @param tags the tags + */ + public void setTags(List tags) { + this.tags = tags; + } + + /** + * Tags pet. + * + * @param tags the tags + * @return the pet + */ + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + /** + * Add tags item pet. + * + * @param tagsItem the tags item + * @return the pet + */ + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * + * @return status status + */ + @JsonProperty("status") + public StatusEnum getStatus() { + if (status == null) { + return null; + } + return status; + } + + /** + * Sets status. + * + * @param status the status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Status pet. + * + * @param status the status + * @return the pet + */ + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * The enum Status enum. + */ + public enum StatusEnum { + /** + *Available status enum. + */ + AVAILABLE("available"), + /** + *Pending status enum. + */ + PENDING("pending"), + /** + *Sold status enum. + */ + SOLD("sold"); + + /** + * The Value. + */ + private String value; + + /** + * Instantiates a new Status enum. + * + * @param value the value + */ + StatusEnum(String value) { + this.value = value; + } + + /** + * From value status enum. + * + * @param text the text + * @return the status enum + */ + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + /** + * Gets value. + * + * @return the value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Tag.java new file mode 100644 index 000000000..56e1f4c50 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/Tag.java @@ -0,0 +1,137 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tag. + */ +class Tag { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Name. + */ + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id tag. + * + * @param id the id + * @return the tag + */ + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name tag. + * + * @param name the name + * @return the tag + */ + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/User.java new file mode 100644 index 000000000..ac272ef57 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app105/model/User.java @@ -0,0 +1,362 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app105.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type User. + */ +public class User { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Username. + */ + @Schema(description = "") + private String username = null; + + /** + * The First name. + */ + @Schema(description = "") + private String firstName = null; + + /** + * The Last name. + */ + @Schema(description = "") + private String lastName = null; + + /** + * The Email. + */ + @Schema(description = "") + private String email = null; + + /** + * The Password. + */ + @Schema(description = "") + private String password = null; + + /** + * The Phone. + */ + @Schema(description = "") + private String phone = null; + + /** + * The User status. + */ + @Schema(description = "User Status") + /** + * User Status + **/ + private Integer userStatus = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id user. + * + * @param id the id + * @return the user + */ + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * + * @return username username + */ + @JsonProperty("username") + public String getUsername() { + return username; + } + + /** + * Sets username. + * + * @param username the username + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * Username user. + * + * @param username the username + * @return the user + */ + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * + * @return firstName first name + */ + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * First name user. + * + * @param firstName the first name + * @return the user + */ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * + * @return lastName last name + */ + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Last name user. + * + * @param lastName the last name + * @return the user + */ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * + * @return email email + */ + @JsonProperty("email") + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Email user. + * + * @param email the email + * @return the user + */ + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * + * @return password password + */ + @JsonProperty("password") + public String getPassword() { + return password; + } + + /** + * Sets password. + * + * @param password the password + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * Password user. + * + * @param password the password + * @return the user + */ + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * + * @return phone phone + */ + @JsonProperty("phone") + public String getPhone() { + return phone; + } + + /** + * Sets phone. + * + * @param phone the phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * Phone user. + * + * @param phone the phone + * @return the user + */ + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * + * @return userStatus user status + */ + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + + /** + * Sets user status. + * + * @param userStatus the user status + */ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + /** + * User status user. + * + * @param userStatus the user status + * @return the user + */ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app106/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app106/HelloController.java new file mode 100644 index 000000000..458143bac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app106/HelloController.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app106; + +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Find articles response entity. + * + * @param modifiedSince the modified since + * @return the response entity + */ + @Operation(summary = "find-articles") + @GetMapping + @Parameter(name = HttpHeaders.IF_MODIFIED_SINCE, + description = "DateTime", + in = ParameterIn.HEADER, + schema = @Schema(type = "string", format = "date-time"), + example = "2020-01-01T00:00:00.000Z" + ) + public ResponseEntity findArticles(@RequestHeader(value = HttpHeaders.IF_MODIFIED_SINCE, required = false) Instant modifiedSince) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java new file mode 100644 index 000000000..e3097524a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app106/SpringDocApp106Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app106; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 106 test. + */ +class SpringDocApp106Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app107/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app107/HelloController.java new file mode 100644 index 000000000..3acf6f970 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app107/HelloController.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app107; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets entity b. + * + * @return the entity b + */ + @GetMapping(path = "/entity-b", produces = { "application/json", "application/xml" }) + public EntityB getEntityB() { + return new EntityB(); + } + + /** + * The type Entity b. + */ + class EntityB { + + /** + * The Field b. + */ + @Schema(required = true) + @JsonProperty("fieldB") + private String fieldB; + + /** + * The Entity a. + */ + @Schema(required = true) + @JsonProperty("entityA") + private EntityA entityA; + //Getters and setters... + } + + /** + * The type Entity a. + */ + class EntityA { + /** + * The Field a. + */ + @Schema(required = true) + @JsonProperty("fieldA") + private String fieldA; + //Getters and setters... + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java new file mode 100644 index 000000000..6d3dfd3e4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app107/SpringDocApp107Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app107; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 107 test. + */ +class SpringDocApp107Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/ActionResult.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/ActionResult.java new file mode 100644 index 000000000..b760324da --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/ActionResult.java @@ -0,0 +1,173 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app108; + +/** + * The type Action result. + * + * @param the type parameter + */ +class ActionResult { + + /** + * The Value. + */ + protected T value; + + /** + * The Success. + */ + protected boolean success; + + /** + * The Error code. + */ + protected String errorCode; + + /** + * The Message. + */ + protected String message; + + /** + * The Error value. + */ + protected Object errorValue; + + /** + * The Target url. + */ + protected String targetUrl; + + /** + * Gets value. + * + * @return the value + */ + public T getValue() { + return value; + } + + /** + * Sets value. + * + * @param value the value + */ + public void setValue(T value) { + this.value = value; + } + + /** + * Is success boolean. + * + * @return the boolean + */ + public boolean isSuccess() { + return success; + } + + /** + * Sets success. + * + * @param success the success + */ + public void setSuccess(boolean success) { + this.success = success; + } + + /** + * Gets error code. + * + * @return the error code + */ + public String getErrorCode() { + return errorCode; + } + + /** + * Sets error code. + * + * @param errorCode the error code + */ + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * Gets error value. + * + * @return the error value + */ + public Object getErrorValue() { + return errorValue; + } + + /** + * Sets error value. + * + * @param errorValue the error value + */ + public void setErrorValue(Object errorValue) { + this.errorValue = errorValue; + } + + /** + * Gets target url. + * + * @return the target url + */ + public String getTargetUrl() { + return targetUrl; + } + + /** + * Sets target url. + * + * @param targetUrl the target url + */ + public void setTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/HelloController.java new file mode 100644 index 000000000..1f10eddda --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app108; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Update action result. + * + * @param toto the toto + * @return the action result + */ + @PostMapping + public ActionResult update(String toto) { + return null; + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java new file mode 100644 index 000000000..e591a82eb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app108/SpringDocApp108Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app108; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 108 test. + */ +class SpringDocApp108Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app109/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app109/HelloController.java new file mode 100644 index 000000000..a2c93e7c7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app109/HelloController.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app109; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.core.io.ByteArrayResource; +import org.springframework.core.io.Resource; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets resource. + * + * @return the resource + */ + @GetMapping("/api/v1/resource") + public Resource getResource() { + return new ByteArrayResource(new byte[] {}); + } + + /** + * Get byte array byte [ ]. + * + * @return the byte [ ] + */ + @GetMapping("/api/v1/bytearray") + @ApiResponse(content = @Content(schema = @Schema(type = "string", format = "binary"))) + public byte[] getByteArray() { + return new byte[] {}; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java new file mode 100644 index 000000000..a26df7e27 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app109/SpringDocApp109Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app109; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 109 test. + */ +class SpringDocApp109Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java new file mode 100644 index 000000000..6205298ca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app11/HelloController.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import java.util.List; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Upload documents response entity. + * + * @param multipartFiles the multipart files + * @return the response entity + */ + @PostMapping(path = "/documents", consumes = "multipart/form-data") + public ResponseEntity uploadDocuments(@RequestPart("doc") List multipartFiles) { + return null; + } + + /** + * Post track string. + * + * @param file the file + * @return the string + */ + @RequestMapping(value = "/tracks", method = RequestMethod.POST, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + public @ResponseBody + String postTrack(@RequestParam("file") MultipartFile file) { + return "redirect:/"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..642923ed9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 11 test. + */ +class SpringDocApp11Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/ErrorMessage.java new file mode 100644 index 000000000..b47429778 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/ErrorMessage.java @@ -0,0 +1,94 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +/** + * The type Error message. + */ +class ErrorMessage { + + /** + * The Errors. + */ + private List errors; + + /** + * Instantiates a new Error message. + */ + public ErrorMessage() { + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(List errors) { + this.errors = errors; + } + + /** + * Instantiates a new Error message. + * + * @param error the error + */ + public ErrorMessage(String error) { + this(Collections.singletonList(error)); + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(String... errors) { + this(Arrays.asList(errors)); + } + + /** + * Gets errors. + * + * @return the errors + */ + public List getErrors() { + return errors; + } + + /** + * Sets errors. + * + * @param errors the errors + */ + public void setErrors(List errors) { + this.errors = errors; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/GlobalControllerAdvice.java new file mode 100644 index 000000000..8bad96bff --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/GlobalControllerAdvice.java @@ -0,0 +1,192 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.FieldError; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +/** + * The type Global controller advice. + */ +@ControllerAdvice(assignableTypes = PersonController.class) +class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +{ + /** + * Note use base class if you wish to leverage its handling. + * Some code will need changing. + */ + private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); + + /** + * Problem response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler(Throwable.class) + @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity problem(final Throwable e) { + String message = "Problem occured"; + UUID uuid = UUID.randomUUID(); + String logRef = uuid.toString(); + logger.error("logRef=" + logRef, message, e); + return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); + } + + + /** + * Handle method argument not valid response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex + ) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + List globalErrors = ex.getBindingResult().getGlobalErrors(); + List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); + String error; + for (FieldError fieldError : fieldErrors) { + error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); + errors.add(error); + } + for (ObjectError objectError : globalErrors) { + error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); + errors.add(error); + } + ErrorMessage errorMessage = new ErrorMessage(errors); + + //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle constraint violated exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex + ) { + Set> constraintViolations = ex.getConstraintViolations(); + + + List errors = new ArrayList<>(constraintViolations.size()); + String error; + for (ConstraintViolation constraintViolation : constraintViolations) { + + error = constraintViolation.getMessage(); + errors.add(error); + } + + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle missing servlet request parameter exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex + ) { + + List errors = new ArrayList<>(); + String error = ex.getParameterName() + ", " + ex.getMessage(); + errors.add(error); + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + + /** + * Handle http media type not supported response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMediaTypeNotSupportedException.class) + @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) + public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex + ) { + String unsupported = "Unsupported content type: " + ex.getContentType(); + String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); + ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); + return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); + } + + /** + * Handle http message not readable response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { + Throwable mostSpecificCause = ex.getMostSpecificCause(); + ErrorMessage errorMessage; + if (mostSpecificCause != null) { + String exceptionName = mostSpecificCause.getClass().getName(); + String message = mostSpecificCause.getMessage(); + errorMessage = new ErrorMessage(exceptionName, message); + } + else { + errorMessage = new ErrorMessage(ex.getMessage()); + } + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/Person.java new file mode 100644 index 000000000..82baf9544 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/Person.java @@ -0,0 +1,212 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import org.hibernate.validator.constraints.CreditCardNumber; + + +/** + * The type Person. + */ +class Person { + /** + * The Id. + */ + private long id; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + @NotNull + @NotBlank + @Size(max = 10) + private String lastName; + + /** + * The Email. + */ + @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") + private String email; + + /** + * The Email 1. + */ + @Email() + private String email1; + + /** + * The Age. + */ + @Min(18) + @Max(30) + private int age; + + /** + * The Credit card number. + */ + @CreditCardNumber + private String creditCardNumber; + + /** + * Gets credit card number. + * + * @return the credit card number + */ + public String getCreditCardNumber() { + return creditCardNumber; + } + + /** + * Sets credit card number. + * + * @param creditCardNumber the credit card number + */ + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } + + /** + * Gets email 1. + * + * @return the email 1 + */ + public String getEmail1() { + return email1; + } + + /** + * Sets email 1. + * + * @param email1 the email 1 + */ + public void setEmail1(String email1) { + this.email1 = email1; + } + + /** + * Gets first name. + * + * @return the first name + */ + @Size(min = 2) + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Gets age. + * + * @return the age + */ + public int getAge() { + return age; + } + + /** + * Sets age. + * + * @param age the age + */ + public void setAge(int age) { + this.age = age; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/PersonController.java new file mode 100644 index 000000000..ffcae50a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/PersonController.java @@ -0,0 +1,96 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller. + */ +@RestController +@Validated +class PersonController { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) throws HttpMediaTypeNotSupportedException { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) throws HttpMediaTypeNotSupportedException { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/PersonController2.java new file mode 100644 index 000000000..42f12befd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/PersonController2.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller 2. + */ +@RestController +@Validated +class PersonController2 { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person2", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/Problem.java new file mode 100644 index 000000000..7261c88ee --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/Problem.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +/** + * The type Problem. + */ +class Problem { + + /** + * The Log ref. + */ + private String logRef; + + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Problem. + * + * @param logRef the log ref + * @param message the message + */ + public Problem(String logRef, String message) { + super(); + this.logRef = logRef; + this.message = message; + } + + /** + * Instantiates a new Problem. + */ + public Problem() { + super(); + + } + + /** + * Gets log ref. + * + * @return the log ref + */ + public String getLogRef() { + return logRef; + } + + /** + * Sets log ref. + * + * @param logRef the log ref + */ + public void setLogRef(String logRef) { + this.logRef = logRef; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java new file mode 100644 index 000000000..347c96f54 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app110/SpringDocApp110Test.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app110; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 110 test. + */ +@TestPropertySource(properties = { + "application-description=description", + "application-version=v1" }) +class SpringDocApp110Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + + /** + * Custom open api open api. + * + * @param appDesciption the app desciption + * @param appVersion the app version + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { + + return new OpenAPI() + .info(new Info() + .title("sample application API") + .version(appVersion) + .description(appDesciption) + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/ErrorMessage.java new file mode 100644 index 000000000..72b7b278c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/ErrorMessage.java @@ -0,0 +1,94 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +/** + * The type Error message. + */ +class ErrorMessage { + + /** + * The Errors. + */ + private List errors; + + /** + * Instantiates a new Error message. + */ + public ErrorMessage() { + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(List errors) { + this.errors = errors; + } + + /** + * Instantiates a new Error message. + * + * @param error the error + */ + public ErrorMessage(String error) { + this(Collections.singletonList(error)); + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(String... errors) { + this(Arrays.asList(errors)); + } + + /** + * Gets errors. + * + * @return the errors + */ + public List getErrors() { + return errors; + } + + /** + * Sets errors. + * + * @param errors the errors + */ + public void setErrors(List errors) { + this.errors = errors; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/GlobalControllerAdvice.java new file mode 100644 index 000000000..29876131d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/GlobalControllerAdvice.java @@ -0,0 +1,192 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.FieldError; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +/** + * The type Global controller advice. + */ +@ControllerAdvice(basePackages = "test.org.springdoc.api.appzzz") +class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +{ + /** + * Note use base class if you wish to leverage its handling. + * Some code will need changing. + */ + private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); + + /** + * Problem response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler(Throwable.class) + @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity problem(final Throwable e) { + String message = "Problem occured"; + UUID uuid = UUID.randomUUID(); + String logRef = uuid.toString(); + logger.error("logRef=" + logRef, message, e); + return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); + } + + + /** + * Handle method argument not valid response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex + ) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + List globalErrors = ex.getBindingResult().getGlobalErrors(); + List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); + String error; + for (FieldError fieldError : fieldErrors) { + error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); + errors.add(error); + } + for (ObjectError objectError : globalErrors) { + error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); + errors.add(error); + } + ErrorMessage errorMessage = new ErrorMessage(errors); + + //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle constraint violated exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex + ) { + Set> constraintViolations = ex.getConstraintViolations(); + + + List errors = new ArrayList<>(constraintViolations.size()); + String error; + for (ConstraintViolation constraintViolation : constraintViolations) { + + error = constraintViolation.getMessage(); + errors.add(error); + } + + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle missing servlet request parameter exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex + ) { + + List errors = new ArrayList<>(); + String error = ex.getParameterName() + ", " + ex.getMessage(); + errors.add(error); + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + + /** + * Handle http media type not supported response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMediaTypeNotSupportedException.class) + @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) + public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex + ) { + String unsupported = "Unsupported content type: " + ex.getContentType(); + String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); + ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); + return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); + } + + /** + * Handle http message not readable response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { + Throwable mostSpecificCause = ex.getMostSpecificCause(); + ErrorMessage errorMessage; + if (mostSpecificCause != null) { + String exceptionName = mostSpecificCause.getClass().getName(); + String message = mostSpecificCause.getMessage(); + errorMessage = new ErrorMessage(exceptionName, message); + } + else { + errorMessage = new ErrorMessage(ex.getMessage()); + } + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/Person.java new file mode 100644 index 000000000..5dff6e9df --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/Person.java @@ -0,0 +1,212 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import org.hibernate.validator.constraints.CreditCardNumber; + + +/** + * The type Person. + */ +class Person { + /** + * The Id. + */ + private long id; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + @NotNull + @NotBlank + @Size(max = 10) + private String lastName; + + /** + * The Email. + */ + @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") + private String email; + + /** + * The Email 1. + */ + @Email() + private String email1; + + /** + * The Age. + */ + @Min(18) + @Max(30) + private int age; + + /** + * The Credit card number. + */ + @CreditCardNumber + private String creditCardNumber; + + /** + * Gets credit card number. + * + * @return the credit card number + */ + public String getCreditCardNumber() { + return creditCardNumber; + } + + /** + * Sets credit card number. + * + * @param creditCardNumber the credit card number + */ + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } + + /** + * Gets email 1. + * + * @return the email 1 + */ + public String getEmail1() { + return email1; + } + + /** + * Sets email 1. + * + * @param email1 the email 1 + */ + public void setEmail1(String email1) { + this.email1 = email1; + } + + /** + * Gets first name. + * + * @return the first name + */ + @Size(min = 2) + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Gets age. + * + * @return the age + */ + public int getAge() { + return age; + } + + /** + * Sets age. + * + * @param age the age + */ + public void setAge(int age) { + this.age = age; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/PersonController.java new file mode 100644 index 000000000..39d373733 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/PersonController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller. + */ +@RestController +@Validated +class PersonController { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/PersonController2.java new file mode 100644 index 000000000..65ea4a129 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/PersonController2.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller 2. + */ +@RestController +@Validated +class PersonController2 { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person2", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/Problem.java new file mode 100644 index 000000000..4a044c014 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/Problem.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +/** + * The type Problem. + */ +class Problem { + + /** + * The Log ref. + */ + private String logRef; + + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Problem. + * + * @param logRef the log ref + * @param message the message + */ + public Problem(String logRef, String message) { + super(); + this.logRef = logRef; + this.message = message; + } + + /** + * Instantiates a new Problem. + */ + public Problem() { + super(); + + } + + /** + * Gets log ref. + * + * @return the log ref + */ + public String getLogRef() { + return logRef; + } + + /** + * Sets log ref. + * + * @param logRef the log ref + */ + public void setLogRef(String logRef) { + this.logRef = logRef; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java new file mode 100644 index 000000000..edb95c812 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app111/SpringDocApp111Test.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app111; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 111 test. + */ +@TestPropertySource(properties = { + "application-description=description", + "application-version=v1" }) +class SpringDocApp111Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + + /** + * Custom open api open api. + * + * @param appDesciption the app desciption + * @param appVersion the app version + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { + return new OpenAPI() + .info(new Info() + .title("sample application API") + .version(appVersion) + .description(appDesciption) + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/ErrorMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/ErrorMessage.java new file mode 100644 index 000000000..5eab1a068 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/ErrorMessage.java @@ -0,0 +1,94 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +/** + * The type Error message. + */ +class ErrorMessage { + + /** + * The Errors. + */ + private List errors; + + /** + * Instantiates a new Error message. + */ + public ErrorMessage() { + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(List errors) { + this.errors = errors; + } + + /** + * Instantiates a new Error message. + * + * @param error the error + */ + public ErrorMessage(String error) { + this(Collections.singletonList(error)); + } + + /** + * Instantiates a new Error message. + * + * @param errors the errors + */ + public ErrorMessage(String... errors) { + this(Arrays.asList(errors)); + } + + /** + * Gets errors. + * + * @return the errors + */ + public List getErrors() { + return errors; + } + + /** + * Sets errors. + * + * @param errors the errors + */ + public void setErrors(List errors) { + this.errors = errors; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/GlobalControllerAdvice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/GlobalControllerAdvice.java new file mode 100644 index 000000000..5b271e298 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/GlobalControllerAdvice.java @@ -0,0 +1,192 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.FieldError; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + + +/** + * The type Global controller advice. + */ +@ControllerAdvice(basePackages = "test.org.springdoc.api.v31.app112.sample") +class GlobalControllerAdvice //extends ResponseEntityExceptionHandler +{ + /** + * Note use base class if you wish to leverage its handling. + * Some code will need changing. + */ + private static final Logger logger = LoggerFactory.getLogger(GlobalControllerAdvice.class); + + /** + * Problem response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler(Throwable.class) + @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR) + public ResponseEntity problem(final Throwable e) { + String message = "Problem occured"; + UUID uuid = UUID.randomUUID(); + String logRef = uuid.toString(); + logger.error("logRef=" + logRef, message, e); + return new ResponseEntity(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR); + } + + + /** + * Handle method argument not valid response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex + ) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + List globalErrors = ex.getBindingResult().getGlobalErrors(); + List errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); + String error; + for (FieldError fieldError : fieldErrors) { + error = fieldError.getField() + ", " + fieldError.getDefaultMessage(); + errors.add(error); + } + for (ObjectError objectError : globalErrors) { + error = objectError.getObjectName() + ", " + objectError.getDefaultMessage(); + errors.add(error); + } + ErrorMessage errorMessage = new ErrorMessage(errors); + + //Object result=ex.getBindingResult();//instead of above can allso pass the more detailed bindingResult + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle constraint violated exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleConstraintViolatedException(ConstraintViolationException ex + ) { + Set> constraintViolations = ex.getConstraintViolations(); + + + List errors = new ArrayList<>(constraintViolations.size()); + String error; + for (ConstraintViolation constraintViolation : constraintViolations) { + + error = constraintViolation.getMessage(); + errors.add(error); + } + + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + /** + * Handle missing servlet request parameter exception response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleMissingServletRequestParameterException(MissingServletRequestParameterException ex + ) { + + List errors = new ArrayList<>(); + String error = ex.getParameterName() + ", " + ex.getMessage(); + errors.add(error); + ErrorMessage errorMessage = new ErrorMessage(errors); + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + + + /** + * Handle http media type not supported response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMediaTypeNotSupportedException.class) + @ResponseStatus(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE) + public ResponseEntity handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex + ) { + String unsupported = "Unsupported content type: " + ex.getContentType(); + String supported = "Supported content types: " + MediaType.toString(ex.getSupportedMediaTypes()); + ErrorMessage errorMessage = new ErrorMessage(unsupported, supported); + return new ResponseEntity(errorMessage, HttpStatus.UNSUPPORTED_MEDIA_TYPE); + } + + /** + * Handle http message not readable response entity. + * + * @param ex the ex + * @return the response entity + */ + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex) { + Throwable mostSpecificCause = ex.getMostSpecificCause(); + ErrorMessage errorMessage; + if (mostSpecificCause != null) { + String exceptionName = mostSpecificCause.getClass().getName(); + String message = mostSpecificCause.getMessage(); + errorMessage = new ErrorMessage(exceptionName, message); + } + else { + errorMessage = new ErrorMessage(ex.getMessage()); + } + return new ResponseEntity(errorMessage, HttpStatus.BAD_REQUEST); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/Person.java new file mode 100644 index 000000000..5d56c6e15 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/Person.java @@ -0,0 +1,212 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; +import org.hibernate.validator.constraints.CreditCardNumber; + + +/** + * The type Person. + */ +public class Person { + /** + * The Id. + */ + private long id; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + @NotNull + @NotBlank + @Size(max = 10) + private String lastName; + + /** + * The Email. + */ + @Pattern(regexp = ".+@.+\\..+", message = "Please provide a valid email address") + private String email; + + /** + * The Email 1. + */ + @Email() + private String email1; + + /** + * The Age. + */ + @Min(18) + @Max(30) + private int age; + + /** + * The Credit card number. + */ + @CreditCardNumber + private String creditCardNumber; + + /** + * Gets credit card number. + * + * @return the credit card number + */ + public String getCreditCardNumber() { + return creditCardNumber; + } + + /** + * Sets credit card number. + * + * @param creditCardNumber the credit card number + */ + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } + + /** + * Gets email 1. + * + * @return the email 1 + */ + public String getEmail1() { + return email1; + } + + /** + * Sets email 1. + * + * @param email1 the email 1 + */ + public void setEmail1(String email1) { + this.email1 = email1; + } + + /** + * Gets first name. + * + * @return the first name + */ + @Size(min = 2) + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Gets age. + * + * @return the age + */ + public int getAge() { + return age; + } + + /** + * Sets age. + * + * @param age the age + */ + public void setAge(int age) { + this.age = age; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/PersonController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/PersonController.java new file mode 100644 index 000000000..80a4052a0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/PersonController.java @@ -0,0 +1,95 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller. + */ +@RestController +@Validated +class PersonController { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/Problem.java new file mode 100644 index 000000000..76979b170 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/Problem.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +/** + * The type Problem. + */ +class Problem { + + /** + * The Log ref. + */ + private String logRef; + + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Problem. + * + * @param logRef the log ref + * @param message the message + */ + public Problem(String logRef, String message) { + super(); + this.logRef = logRef; + this.message = message; + } + + /** + * Instantiates a new Problem. + */ + public Problem() { + super(); + + } + + /** + * Gets log ref. + * + * @return the log ref + */ + public String getLogRef() { + return logRef; + } + + /** + * Sets log ref. + * + * @param logRef the log ref + */ + public void setLogRef(String logRef) { + this.logRef = logRef; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java new file mode 100644 index 000000000..273f9ab8b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/SpringDocApp112Test.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 112 test. + */ +@TestPropertySource(properties = { + "application-description=description", + "application-version=v1" }) +class SpringDocApp112Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + + /** + * Custom open api open api. + * + * @param appDesciption the app desciption + * @param appVersion the app version + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) { + return new OpenAPI() + .info(new Info() + .title("sample application API") + .version(appVersion) + .description(appDesciption) + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/sample/PersonController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/sample/PersonController2.java new file mode 100644 index 000000000..e9671ca32 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app112/sample/PersonController2.java @@ -0,0 +1,97 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app112.sample; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import test.org.springdoc.api.v31.app112.Person; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Person controller 2. + */ +@RestController +@Validated +class PersonController2 { + /** + * The Ran. + */ + private Random ran = new Random(); + + /** + * Person person. + * + * @param person the person + * @return the person + */ + @RequestMapping(path = "/person2", method = RequestMethod.POST) + public Person person(@Valid @RequestBody Person person) throws HttpMediaTypeNotSupportedException { + + int nxt = ran.nextInt(10); + if (nxt >= 5) { + throw new RuntimeException("Breaking logic"); + } + return person; + } + + /** + * Find by last name list. + * + * @param lastName the last name + * @return the list + */ + @RequestMapping(path = "/personByLastName2", method = RequestMethod.GET) + public List findByLastName(@RequestParam(name = "lastName", required = true) @NotNull + @NotBlank + @Size(max = 10) String lastName) throws HttpMediaTypeNotSupportedException { + List hardCoded = new ArrayList<>(); + Person person = new Person(); + person.setAge(20); + person.setCreditCardNumber("4111111111111111"); + person.setEmail("abc@abc.com"); + person.setEmail1("abc1@abc.com"); + person.setFirstName("Somefirstname"); + person.setLastName(lastName); + person.setId(1); + hardCoded.add(person); + return hardCoded; + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app113/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app113/HelloController.java new file mode 100644 index 000000000..54367c21e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app113/HelloController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app113; + +import java.util.Optional; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param body the body + */ + @PostMapping("/lol") + public void test(@RequestBody(required = false) Body body) { + } + + /** + * Test 2. + * + * @param body the body + */ + @PostMapping("/lol2") + public void test2(@RequestBody Optional body) { + } + + /** + * The type Body. + */ + class Body { + /** + * The Field. + */ + public String field; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java new file mode 100644 index 000000000..6257df6cf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app113/SpringDocApp113Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app113; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 113 test. + */ +class SpringDocApp113Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app114/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app114/HelloController.java new file mode 100644 index 000000000..835a68f85 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app114/HelloController.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app114; + +import javax.money.MonetaryAmount; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets currency. + * + * @param carDTO the car dto + * @return the currency + */ + @PostMapping(value = "/foos1", consumes = MediaType.APPLICATION_JSON_VALUE) + MonetaryAmount getCurrency(@RequestBody CarDTO carDTO) { + return carDTO.price; + } + + /** + * The type Car dto. + */ + class CarDTO { + /** + * The Price. + */ + @JsonProperty("price") + MonetaryAmount price; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java new file mode 100644 index 000000000..559c6c985 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app114/SpringDocApp114Test.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app114; + +import javax.money.MonetaryAmount; + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 114 test. + */ +class SpringDocApp114Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().replaceWithClass(MonetaryAmount.class, org.springdoc.core.converters.models.MonetaryAmount.class); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/HelloController.java new file mode 100644 index 000000000..e17ecaa17 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app115; + +import java.time.Duration; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Timeouts duration. + * + * @return the duration + */ + @GetMapping(value = "/api/v2/timeout", + consumes = { MediaType.ALL_VALUE }, + produces = { MediaType.APPLICATION_JSON_VALUE }) + public Duration timeouts() { + return Duration.ofSeconds(5); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java new file mode 100644 index 000000000..161d18bd4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/JavaTimeOperationCustomizer.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app115; + +import java.time.Duration; +import java.util.Map; +import java.util.Set; + +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.Schema; +import org.springdoc.core.customizers.OperationCustomizer; + +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; + +/** + * The type Java time operation customizer. + */ +@Component +class JavaTimeOperationCustomizer implements OperationCustomizer { + /** + * Customize operation. + * + * @param operation the operation + * @param handlerMethod the handler method + * @return the operation + */ + @Override + public Operation customize(Operation operation, HandlerMethod handlerMethod) { + if (handlerMethod.getReturnType().getParameterType().isAssignableFrom(Duration.class)) { + for (Map.Entry entry : operation.getResponses().entrySet()) { + io.swagger.v3.oas.models.responses.ApiResponse response = entry.getValue(); + Content content = response.getContent(); + if (content.containsKey(MediaType.APPLICATION_JSON_VALUE)) { + Schema schema = content.get(MediaType.APPLICATION_JSON_VALUE).getSchema(); + schema.types(Set.of("string")); + schema.getProperties().clear(); + } + } + } + return operation; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java new file mode 100644 index 000000000..3565fd02f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app115; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 115 test. + */ +class SpringDocApp115Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/FooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/FooErrorHandler.java new file mode 100644 index 000000000..f3e5fd944 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/FooErrorHandler.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app116; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +/** + * The type Foo error handler. + */ +@ControllerAdvice(assignableTypes = HelloController.class) +class FooErrorHandler { + + /** + * Store assignment publishing error response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler + public ResponseEntity storeAssignmentPublishingError(Exception e) { + return new ResponseEntity<>("foo", HttpStatus.INTERNAL_SERVER_ERROR); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/HelloController.java new file mode 100644 index 000000000..358875905 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app116; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) +class HelloController { + + /** + * Create string. + * + * @param foo the foo + * @return the string + */ + @PostMapping("/foo") + public String create(@RequestBody String foo) { + return "foo"; + } +} + + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java new file mode 100644 index 000000000..b72c20e0f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app116/SpringDocApp116Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app116; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 116 test. + */ +class SpringDocApp116Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app117/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app117/HelloApplication.java new file mode 100644 index 000000000..354c45a84 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app117/HelloApplication.java @@ -0,0 +1,304 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app117; + +import java.io.IOException; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import jakarta.servlet.FilterChain; +import jakarta.servlet.GenericFilter; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.ServerRequest; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Hello application. + */ +@Configuration +class HelloApplication { + + /** + * Routes router function. + * + * @param ph the ph + * @return the router function + */ + @Bean + @RouterOperations({ @RouterOperation(path = "/people", method = RequestMethod.GET, beanClass = PersonService.class, beanMethod = "all"), + @RouterOperation(path = "/people/{id}", beanClass = PersonService.class, beanMethod = "byId"), + @RouterOperation(path = "/people", method = RequestMethod.POST, beanClass = PersonService.class, beanMethod = "save") }) + RouterFunction routes(PersonHandler ph) { + String root = ""; + return route() + .GET(root + "/people", ph::handleGetAllPeople) + .GET(root + "/people/{id}", ph::handleGetPersonById) + .POST(root + "/people", ph::handlePostPerson) + .filter((serverRequest, handlerFunction) -> { + return handlerFunction.handle(serverRequest); + }) + .build(); + } +} + +/** + * The type Simple filter. + */ +@Component +class SimpleFilter extends GenericFilter { + + /** + * Do filter. + * + * @param req the req + * @param res the res + * @param filterChain the filter chain + * @throws IOException the io exception + * @throws ServletException the servlet exception + */ + @Override + public void doFilter(ServletRequest req, ServletResponse res, + FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(req, res); + } +} + +/** + * The type Person handler. + */ +@Component +class PersonHandler { + + /** + * The Person service. + */ + private final PersonService personService; + + /** + * Instantiates a new Person handler. + * + * @param personService the person service + */ + PersonHandler(PersonService personService) { + this.personService = personService; + } + + /** + * Handle get all people server response. + * + * @param serverRequest the server request + * @return the server response + */ + ServerResponse handleGetAllPeople(ServerRequest serverRequest) { + return ok().body(personService.all()); + } + + /** + * Handle post person server response. + * + * @param r the r + * @return the server response + * @throws ServletException the servlet exception + * @throws IOException the io exception + */ + ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { + Person result = personService.save(new Person(null, r.body(Person.class).getName())); + URI uri = URI.create("/people/" + result.getId()); + return ServerResponse.created(uri).body(result); + } + + /** + * Handle get person by id server response. + * + * @param r the r + * @return the server response + */ + ServerResponse handleGetPersonById(ServerRequest r) { + return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); + } +} + +/** + * The type Greetings rest controller. + */ +@RestController +class GreetingsRestController { + + /** + * Greet string. + * + * @param name the name + * @return the string + */ + @GetMapping("/greet/{name}") + String greet(@PathVariable String name) { + return "hello " + name + "!"; + } +} + +/** + * The type Person service. + */ +@Service +class PersonService { + + /** + * The Counter. + */ + private final AtomicLong counter = new AtomicLong(); + + /** + * The People. + */ + private final Set people = Stream.of( + new Person(counter.incrementAndGet(), "Jane"), + new Person(counter.incrementAndGet(), "Josh"), + new Person(counter.incrementAndGet(), "Gordon")) + .collect(Collectors.toCollection(HashSet::new)); + + + /** + * Save person. + * + * @param p the p + * @return the person + */ + Person save(Person p) { + Person person = new Person(counter.incrementAndGet(), p.getName()); + this.people.add(person); + return person; + } + + /** + * All set. + * + * @return the set + */ + Set all() { + return this.people; + } + + /** + * By id person. + * + * @param id the id + * @return the person + */ + Person byId(@Parameter(in = ParameterIn.PATH) Long id) { + return this.people.stream() + .filter(p -> p.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); + } + +} + +/** + * The type Person. + */ +class Person { + + /** + * The Id. + */ + private Long id; + + /** + * The Name. + */ + private String name; + + /** + * Instantiates a new Person. + * + * @param id the id + * @param name the name + */ + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + + /** + * Gets id. + * + * @return the id + */ + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java new file mode 100644 index 000000000..2b33aba3c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app117/SpringDocApp117Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app117; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 117 test. + */ +class SpringDocApp117Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/AbstractParent.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/AbstractParent.java new file mode 100644 index 000000000..e5791e3f3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/AbstractParent.java @@ -0,0 +1,121 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app118; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +/** + * The type Abstract parent. + */ +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildOfAbstract1.class), + @Type(ChildOfAbstract2.class) +}) +public abstract class AbstractParent { + /** + * The Id. + */ + private int id; + + /** + * Gets id. + * + * @return the id + */ + public int getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(int id) { + this.id = id; + } +} + +/** + * The type Child of abstract 1. + */ +class ChildOfAbstract1 extends AbstractParent { + /** + * The Abstrach child 1 param. + */ + private String abstrachChild1Param; + + /** + * Gets abstrach child 1 param. + * + * @return the abstrach child 1 param + */ + public String getAbstrachChild1Param() { + return abstrachChild1Param; + } + + /** + * Sets abstrach child 1 param. + * + * @param abstrachChild1Param the abstrach child 1 param + */ + public void setAbstrachChild1Param(String abstrachChild1Param) { + this.abstrachChild1Param = abstrachChild1Param; + } +} + +/** + * The type Child of abstract 2. + */ +class ChildOfAbstract2 extends AbstractParent { + /** + * The Abstract child 2 param. + */ + private String abstractChild2Param; + + /** + * Gets abstract child 2 param. + * + * @return the abstract child 2 param + */ + public String getAbstractChild2Param() { + return abstractChild2Param; + } + + /** + * Sets abstract child 2 param. + * + * @param abstractChild2Param the abstract child 2 param + */ + public void setAbstractChild2Param(String abstractChild2Param) { + this.abstractChild2Param = abstractChild2Param; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/ConcreteParent.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/ConcreteParent.java new file mode 100644 index 000000000..40b62736b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/ConcreteParent.java @@ -0,0 +1,121 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app118; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +/** + * The type Concrete parent. + */ +@JsonTypeInfo(use = Id.NAME, property = "type") +@JsonSubTypes({ + @Type(ChildOfConcrete1.class), + @Type(ChildOfConcrete2.class) +}) +class ConcreteParent { + /** + * The Id. + */ + private int id; + + /** + * Gets id. + * + * @return the id + */ + public int getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(int id) { + this.id = id; + } +} + +/** + * The type Child of concrete 1. + */ +class ChildOfConcrete1 extends ConcreteParent { + /** + * The Concrete child 1 param. + */ + private String concreteChild1Param; + + /** + * Gets concrete child 1 param. + * + * @return the concrete child 1 param + */ + public String getConcreteChild1Param() { + return concreteChild1Param; + } + + /** + * Sets concrete child 1 param. + * + * @param concreteChild1Param the concrete child 1 param + */ + public void setConcreteChild1Param(String concreteChild1Param) { + this.concreteChild1Param = concreteChild1Param; + } +} + +/** + * The type Child of concrete 2. + */ +class ChildOfConcrete2 extends ConcreteParent { + /** + * The Concrete child 2 param. + */ + private String concreteChild2Param; + + /** + * Gets concrete child 2 param. + * + * @return the concrete child 2 param + */ + public String getConcreteChild2Param() { + return concreteChild2Param; + } + + /** + * Sets concrete child 2 param. + * + * @param concreteChild2Param the concrete child 2 param + */ + public void setConcreteChild2Param(String concreteChild2Param) { + this.concreteChild2Param = concreteChild2Param; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/Controller.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/Controller.java new file mode 100644 index 000000000..f4178cae8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/Controller.java @@ -0,0 +1,114 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app118; + +import java.util.List; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Controller. + */ +@RestController +@RequestMapping("class-hierarchy") +class Controller { + /** + * Abstract parent response. + * + * @param payload the payload + * @return the response + */ + @PostMapping("abstract-parent") + public Response abstractParent(@RequestBody AbstractParent payload) { + return null; + } + + /** + * Concrete parent response. + * + * @param payload the payload + * @return the response + */ + @PostMapping("concrete-parent") + public Response concreteParent(@RequestBody ConcreteParent payload) { + return null; + } +} + +/** + * The type Response. + */ +class Response { + /** + * The Abstract parent. + */ + AbstractParent abstractParent; + + /** + * The Concrete parents. + */ + List concreteParents; + + /** + * Gets abstract parent. + * + * @return the abstract parent + */ + public AbstractParent getAbstractParent() { + return abstractParent; + } + + /** + * Sets abstract parent. + * + * @param abstractParent the abstract parent + */ + public void setAbstractParent(AbstractParent abstractParent) { + this.abstractParent = abstractParent; + } + + /** + * Gets concrete parents. + * + * @return the concrete parents + */ + public List getConcreteParents() { + return concreteParents; + } + + /** + * Sets concrete parents. + * + * @param concreteParents the concrete parents + */ + public void setConcreteParents(List concreteParents) { + this.concreteParents = concreteParents; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java new file mode 100644 index 000000000..c73c4624d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app118/SpringDocApp118Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app118; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 118 test. + */ +class SpringDocApp118Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/HelloController.java new file mode 100644 index 000000000..4e62767ad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/HelloController.java @@ -0,0 +1,67 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app119; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Multi files in multi part string. + * + * @param jsonRequest the json request + * @param file1 the file 1 + * @param file2 the file 2 + * @return the string + */ + @Operation(summary = "Multiple files and JSON payloads as multi part request") + @PostMapping( + value = "multi", + consumes = MediaType.MULTIPART_FORM_DATA_VALUE, + produces = MediaType.TEXT_PLAIN_VALUE) + public String multiFilesInMultiPart( + @RequestPart("params") + @Parameter( + description = "This is the configuration", + content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)) final JsonRequest jsonRequest, + @RequestPart(value = "file1", required = false) @Parameter(description = "This is file1") final MultipartFile file1, + @RequestPart(value = "file2", required = false) @Parameter(description = "This is file2") final MultipartFile file2) { + return "Hello World " + jsonRequest.getName(); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/JsonRequest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/JsonRequest.java new file mode 100644 index 000000000..23283d513 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/JsonRequest.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app119; + +/** + * The type Json request. + */ +class JsonRequest { + + /** + * The Name. + */ + private String name; + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java new file mode 100644 index 000000000..179d5c641 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app119/SpringDocApp119Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app119; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 119 test. + */ +class SpringDocApp119Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java new file mode 100644 index 000000000..9b54d3ea1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app12/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping(value = "/persons") + @Operation(parameters = { + @Parameter(name = "name", in = ParameterIn.QUERY, schema = @Schema(implementation = String.class)) }) + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java new file mode 100644 index 000000000..af6fd5085 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app12/SpringDocApp12Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app12; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 12 test. + */ +class SpringDocApp12Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/AccountId.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/AccountId.java new file mode 100644 index 000000000..cd7a0ede9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/AccountId.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app120; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.core.annotation.AliasFor; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +/** + * The interface Account id. + */ +@Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Parameter(description = "non alias description") +public @interface AccountId { + + /** + * Name string. + * + * @return the string + */ + @AliasFor(annotation = Parameter.class, value = "name") + String name() default ""; + + /** + * Example string. + * + * @return the string + */ + @AliasFor(annotation = Parameter.class, value = "example") + String example() default "123456"; + + /** + * In parameter in. + * + * @return the parameter in + */ + @AliasFor(annotation = Parameter.class, value = "in") + ParameterIn in() default ParameterIn.DEFAULT; + + /** + * Schema schema. + * + * @return the schema + */ + @AliasFor(annotation = Parameter.class, value = "schema") + Schema schema() default @Schema(); +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/MetaAnnotationController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/MetaAnnotationController.java new file mode 100644 index 000000000..677f7c3b5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/MetaAnnotationController.java @@ -0,0 +1,301 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app120; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +import io.swagger.v3.oas.annotations.extensions.Extension; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; + +/** + * The type Meta annotation controller. + */ +@RestController +class MetaAnnotationController { + + /** + * Simple test string. + * + * @param accountId the account id + * @return the string + */ + @GetMapping(value = "/simpleTest/{accountId}") + String simpleTest(@PathVariable @AccountId String accountId) { + return accountId; + } + + /** + * When there is a top level {@code @Parameter} annotation it has precedence over the meta-annotation + * So the id parameter should have all the defaults, with a name of "id" + * @param accountId the account id + * @return the string + */ + @GetMapping(value = "/testTopLevelParamAnnotationOverrides/{id}") + String testTopLevelParamAnnotationOverrides(@PathVariable @AccountId @Parameter(name = "id") String accountId) { + return accountId; + } + + /** + * Test query param string. + * + * @param accountId the account id + * @return the string + */ + @GetMapping(value = "/testQueryParam") + String testQueryParam(@RequestParam @AccountId String accountId) { + return accountId; + } + + /** + * {@code @AliasFor} in the {@code @AccountId} annotation allows us to override the default it provides. + * @param accountId the account id + * @return the string + */ + @GetMapping(value = "/testAliasFor") + String testAliasFor(@RequestParam @AccountId(example = "OVERRIDDEN EXAMPLE") String accountId) { + return accountId; + } + + /** + * Test meta meta annotation string. + * + * @param queryAccountId the query account id + * @param accountId the account id + * @return the string + */ + @GetMapping(value = "/testMetaMetaAnnotation/{accountId}") + String testMetaMetaAnnotation( + @RequestParam @QueryAccountId String queryAccountId, + @PathVariable @AccountId String accountId) { + return accountId; + } + + /** + * Test all attributes as alias string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/testAllAttributesAsAlias/") + String testAllAttributesAsAlias( + @RequestParam @TestAllAttributesAsAlias String name) { + return name; + } + + /** + * Test no alias fors string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/testNoAliasFors/") + String testNoAliasFors( + @RequestParam @TestAllAttributesAsAlias String name) { + return name; + } + + /** + * This should inherent all the attributes of {@code @AccountId}, but give it a different name + */ + @Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) + @Retention(RetentionPolicy.RUNTIME) + @AccountId(name = "queryAccountId") + @interface QueryAccountId { + } + + /** + * The interface Test all attributes as alias. + */ + @Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) + @Retention(RetentionPolicy.RUNTIME) + @Parameter + @interface TestAllAttributesAsAlias { + + /** + * Name string. + * + * @return the string + */ + @AliasFor(annotation = Parameter.class, attribute = "name") + String name() default "name"; + + /** + * In parameter in. + * + * @return the parameter in + */ + @AliasFor(annotation = Parameter.class, attribute = "in") + ParameterIn in() default ParameterIn.QUERY; + + /** + * Description string. + * + * @return the string + */ + @AliasFor(annotation = Parameter.class, attribute = "description") + String description() default "desc"; + + /** + * Required boolean. + * + * @return the boolean + */ + @AliasFor(annotation = Parameter.class, attribute = "required") + boolean required() default true; + + /** + * Deprecated boolean. + * + * @return the boolean + */ + @AliasFor(annotation = Parameter.class, attribute = "deprecated") + boolean deprecated() default true; + + /** + * Allow empty value boolean. + * + * @return the boolean + */ + @AliasFor(annotation = Parameter.class, attribute = "allowEmptyValue") + boolean allowEmptyValue() default true; + + /** + * Style parameter style. + * + * @return the parameter style + */ + @AliasFor(annotation = Parameter.class, attribute = "style") + ParameterStyle style() default ParameterStyle.DEEPOBJECT; + + /** + * Explode explode. + * + * @return the explode + */ + @AliasFor(annotation = Parameter.class, attribute = "explode") + Explode explode() default Explode.TRUE; + + /** + * Allow reserved boolean. + * + * @return the boolean + */ + @AliasFor(annotation = Parameter.class, attribute = "allowReserved") + boolean allowReserved() default true; + + /** + * Schema schema. + * + * @return the schema + */ + @AliasFor(annotation = Parameter.class, attribute = "schema") + Schema schema() default @Schema(name = "special schema", implementation = Boolean.class); + + /** + * Array array schema. + * + * @return the array schema + */ + @AliasFor(annotation = Parameter.class, attribute = "array") + ArraySchema array() default @ArraySchema(); + + /** + * Content content [ ]. + * + * @return the content [ ] + */ + @AliasFor(annotation = Parameter.class, attribute = "content") + Content[] content() default {}; + + /** + * Hidden boolean. + * + * @return the boolean + */ + @AliasFor(annotation = Parameter.class, attribute = "hidden") + boolean hidden() default false; + + /** + * Examples example object [ ]. + * + * @return the example object [ ] + */ + @AliasFor(annotation = Parameter.class, attribute = "examples") + ExampleObject[] examples() default {}; + + /** + * Example string. + * + * @return the string + */ + @AliasFor(annotation = Parameter.class, attribute = "example") + String example() default "1234"; + + /** + * Extensions extension [ ]. + * + * @return the extension [ ] + */ + @AliasFor(annotation = Parameter.class, attribute = "extensions") + Extension[] extensions() default {}; + + /** + * Ref string. + * + * @return the string + */ + @AliasFor(annotation = Parameter.class, attribute = "ref") + String ref() default ""; + } + + /** + * The interface Test no alias fors. + */ + @Target({ PARAMETER, METHOD, ANNOTATION_TYPE }) + @Retention(RetentionPolicy.RUNTIME) + @Parameter(name = "name", description = "desc", schema = @Schema(implementation = Boolean.class)) + @interface TestNoAliasFors { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java new file mode 100644 index 000000000..af28211a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app120/SpringDocApp120Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app120; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp120Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/InheritedRequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/InheritedRequestParams.java new file mode 100644 index 000000000..b9d8d0394 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/InheritedRequestParams.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app121; + +import jakarta.validation.constraints.NotBlank; + +/** + * The type Inherited request params. + */ +class InheritedRequestParams extends RequestParams { + + /** + * parameter from child of RequestParams + */ + @NotBlank + private String childParam; + + /** + * Gets child param. + * + * @return the child param + */ + public String getChildParam() { + return childParam; + } + + /** + * Sets child param. + * + * @param childParam the child param + */ + public void setChildParam(String childParam) { + this.childParam = childParam; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/RequestParams.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/RequestParams.java new file mode 100644 index 000000000..1b095570b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/RequestParams.java @@ -0,0 +1,281 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app121; + +import java.math.BigInteger; +import java.util.List; +import java.util.Optional; + +import io.swagger.v3.oas.annotations.Parameter; + + +/** + * The type Request params. + */ +class RequestParams { + + /** + * The String param. + */ + @Parameter(description = "string parameter") + private String stringParam; + + /** + * The String param 1. + */ + @Deprecated + private String stringParam1; + + /** + * The String param 2. + */ + @Parameter(description = "string parameter2", required = true) + private String stringParam2; + + /** + * The Int param. + */ + @Parameter(description = "int parameter") + private int intParam; + + /** + * The Int param 2. + */ + private Optional intParam2; + + /** + * The Int param 3. + */ + private String intParam3; + + /** + * The Nested. + */ + private Nested nested; + + /** + * The Nested list. + */ + private List nestedList; + + /** + * Gets string param. + * + * @return the string param + */ + public String getStringParam() { + return stringParam; + } + + /** + * Sets string param. + * + * @param stringParam the string param + */ + public void setStringParam(String stringParam) { + this.stringParam = stringParam; + } + + /** + * Gets int param. + * + * @return the int param + */ + public int getIntParam() { + return intParam; + } + + /** + * Sets int param. + * + * @param intParam the int param + */ + public void setIntParam(int intParam) { + this.intParam = intParam; + } + + /** + * Gets int param 2. + * + * @return the int param 2 + */ + public Optional getIntParam2() { + return intParam2; + } + + /** + * Sets int param 2. + * + * @param intParam2 the int param 2 + */ + public void setIntParam2(Optional intParam2) { + this.intParam2 = intParam2; + } + + /** + * Gets int param 3. + * + * @return the int param 3 + */ + public String getIntParam3() { + return intParam3; + } + + /** + * Sets int param 3. + * + * @param intParam3 the int param 3 + */ + public void setIntParam3(String intParam3) { + this.intParam3 = intParam3; + } + + /** + * Gets string param 1. + * + * @return the string param 1 + */ + public String getStringParam1() { + return stringParam1; + } + + /** + * Sets string param 1. + * + * @param stringParam1 the string param 1 + */ + public void setStringParam1(String stringParam1) { + this.stringParam1 = stringParam1; + } + + /** + * Gets string param 2. + * + * @return the string param 2 + */ + public String getStringParam2() { + return stringParam2; + } + + /** + * Sets string param 2. + * + * @param stringParam2 the string param 2 + */ + public void setStringParam2(String stringParam2) { + this.stringParam2 = stringParam2; + } + + /** + * Gets nested. + * + * @return the nested + */ + public Nested getNested() { + return nested; + } + + /** + * Sets nested. + * + * @param nested the nested + */ + public void setNested(Nested nested) { + this.nested = nested; + } + + /** + * Gets nested list. + * + * @return the nested list + */ + public List getNestedList() { + return nestedList; + } + + /** + * Sets nested list. + * + * @param nestedList the nested list + */ + public void setNestedList(List nestedList) { + this.nestedList = nestedList; + } + + /** + * The type Nested. + */ + public static class Nested { + /** + * The Param 1. + */ + private String param1; + + /** + * The Param 2. + */ + private BigInteger param2; + + /** + * Gets param 1. + * + * @return the param 1 + */ + @Parameter(description = "nested string parameter") + public String getParam1() { + return param1; + } + + /** + * Sets param 1. + * + * @param param1 the param 1 + */ + public void setParam1(String param1) { + this.param1 = param1; + } + + /** + * Gets param 2. + * + * @return the param 2 + */ + @Parameter(description = "nested BigInteger parameter") + public BigInteger getParam2() { + return param2; + } + + /** + * Sets param 2. + * + * @param param2 the param 2 + */ + public void setParam2(BigInteger param2) { + this.param2 = param2; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java new file mode 100644 index 000000000..3d1fd7d92 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/SpringDocApp121Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app121; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp121Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/TestController.java new file mode 100644 index 000000000..790e56222 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app121/TestController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app121; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Test controller. + */ +@RestController +class TestController { + + /** + * Gets test. + * + * @param param the param + * @param requestParams the request params + * @return the test + */ + @PostMapping("test") + public InheritedRequestParams getTest(@RequestParam String param, @ParameterObject InheritedRequestParams requestParams) { + return requestParams; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/BaseController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/BaseController.java new file mode 100644 index 000000000..e15877baf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/BaseController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Base controller. + * + * @param the type parameter + */ +@RestController +public abstract class BaseController { + + /** + * Create response entity. + * + * @param payload the payload + * @return the response entity + */ + @PostMapping + @Operation(summary = "create") + public ResponseEntity create(@RequestBody Wrapper payload) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/BaseObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/BaseObject.java new file mode 100644 index 000000000..3c315d623 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/BaseObject.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Base object. + */ +class BaseObject { + + /** + * The Base str. + */ + @JsonProperty("baseStr") + private String baseStr; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/CustomerDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/CustomerDto.java new file mode 100644 index 000000000..bc537139b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/CustomerDto.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Customer dto. + */ +class CustomerDto extends BaseObject { + + /** + * The Customer name. + */ + @JsonProperty("customerName") + private String customerName; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/FirstController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/FirstController.java new file mode 100644 index 000000000..7eb2dcaa7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/FirstController.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.RestController; + +/** + * The type First controller. + */ +@RestController +@Tag(name = "example") +class FirstController extends BaseController { + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java new file mode 100644 index 000000000..49a49a132 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/SpringDocApp122Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app122; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp122Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/Wrapper.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/Wrapper.java new file mode 100644 index 000000000..2b1d94b3a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app122/Wrapper.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app122; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Wrapper. + * + * @param the type parameter + */ +class Wrapper { + + + /** + * The Wrapper. + */ + @JsonProperty("wrapper") + private String wrapper; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/HelloController.java new file mode 100644 index 000000000..514534398 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app123; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + /** + * Index t. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the t + */ + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/MyExceptionHandler.java new file mode 100644 index 000000000..3cddf30e4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/MyExceptionHandler.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app123; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * The type My exception handler. + */ +@RestControllerAdvice +class MyExceptionHandler { + + /** + * Bad. + * + * @param e the e + */ + @ExceptionHandler(IllegalArgumentException.class) + @ApiResponse(responseCode = "404", description = "Not here", content = @Content) + @ResponseStatus(HttpStatus.NOT_FOUND) + public void bad(IllegalArgumentException e) { + + } + + /** + * Gateway object. + * + * @param e the e + * @return the object + */ + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java new file mode 100644 index 000000000..c9e769330 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app123/SpringDocApp123Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app123; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp123Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/HelloController.java new file mode 100644 index 000000000..c894f9255 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/HelloController.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app124; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + /** + * Bad. + * + * @param e the e + */ + @ExceptionHandler(IllegalArgumentException.class) + @ApiResponse(responseCode = "404", description = "Not here", content = @Content) + @ResponseStatus(HttpStatus.NOT_FOUND) + public void bad(IllegalArgumentException e) { + + } + + /** + * Index t. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the t + */ + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + throw new IllegalArgumentException(); + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/MyExceptionHandler.java new file mode 100644 index 000000000..d94b1ddcb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/MyExceptionHandler.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app124; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * The type My exception handler. + */ +@RestControllerAdvice +class MyExceptionHandler { + + /** + * Gateway object. + * + * @param e the e + * @return the object + */ + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java new file mode 100644 index 000000000..a77177c79 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app124/SpringDocApp124Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app124; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp124Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/DeprecatedEntity.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/DeprecatedEntity.java new file mode 100644 index 000000000..41a29eb3c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/DeprecatedEntity.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app125; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Deprecated entity. + * @author bnasslahsen + */ +class DeprecatedEntity { + /** + * The My non deprecated field. + */ + @Schema(deprecated = false) + private String myNonDeprecatedField; + + /** + * The Mydeprecated field. + */ + @Schema(deprecated = true) + private String mydeprecatedField; + + /** + * Gets my non deprecated field. + * + * @return the my non deprecated field + */ + public String getMyNonDeprecatedField() { + return myNonDeprecatedField; + } + + /** + * Sets my non deprecated field. + * + * @param myNonDeprecatedField the my non deprecated field + * @return the my non deprecated field + */ + @Deprecated + public DeprecatedEntity setMyNonDeprecatedField(String myNonDeprecatedField) { + this.myNonDeprecatedField = myNonDeprecatedField; + return this; + } + + /** + * Gets mydeprecated field. + * + * @return the mydeprecated field + */ + public String getMydeprecatedField() { + return mydeprecatedField; + } + + /** + * Sets mydeprecated field. + * + * @param mydeprecatedField the mydeprecated field + */ + public void setMydeprecatedField(String mydeprecatedField) { + this.mydeprecatedField = mydeprecatedField; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/HelloController.java new file mode 100644 index 000000000..cdce5b128 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app125; + +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * @author bnasslahsen + */ +@RestController +class HelloController { + + /** + * Gets all pets. + * + * @param toto the toto + * @return the all pets + */ + @GetMapping(value = "/search", produces = { "application/xml", "application/json" }) + public DeprecatedEntity getAllPets(@NotNull String toto) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/SpringDocApp125Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/SpringDocApp125Test.java new file mode 100644 index 000000000..7e6380c6d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app125/SpringDocApp125Test.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app125; + +import java.util.Optional; + +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverters; +import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = "springdoc.model-converters.deprecating-converter.enabled=false") +class SpringDocApp125Test extends AbstractSpringDocTest { + + static { + Optional deprecatingConverterOptional = + ModelConverters.getInstance(true).getConverters() + .stream().filter(modelConverter -> modelConverter instanceof SchemaPropertyDeprecatingConverter).findAny(); + deprecatingConverterOptional.ifPresent(ModelConverters.getInstance(true)::removeConverter); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/HelloController.java new file mode 100644 index 000000000..a696c3cf1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/HelloController.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app126; + +import java.util.ArrayList; +import java.util.Collection; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.ResponseEntity.ok; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +@ApiResponses(value = { + @ApiResponse(responseCode = "401", ref = SecurityProblemResponsesConfiguration.UNAUTHORIZED_401_NO_TOKEN_RESPONSE_REF), + @ApiResponse(responseCode = "401", ref = SecurityProblemResponsesConfiguration.UNAUTHORIZED_401_BAD_TOKEN_RESPONSE_REF), + @ApiResponse(responseCode = "403", ref = SecurityProblemResponsesConfiguration.FORBIDDEN_403_RESPONSE_REF) }) +//@ApiResponses(value = { +// @ApiResponse(responseCode = "401", description = "Invalid authentication.", content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), +// @ApiResponse(responseCode = "401", description = "Invalid authentication.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}), +// @ApiResponse(responseCode = "403", description = "Missing authorities.",content = {@Content(schema = @Schema(implementation = Problem.class), mediaType = APPLICATION_PROBLEM_JSON_VALUE)}) }) +class HelloController { + + /** + * The constant CURRENCIES. + */ + private static final Collection CURRENCIES = new ArrayList<>(); + + static { + CURRENCIES.add("EUR"); + CURRENCIES.add("USD"); + } + + /** + * Gets all currencies. + * + * @return the all currencies + */ + @GetMapping + @Operation(description = "Get all currencies", summary = "getAllCurrencies") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "All currencies returned") }) + public ResponseEntity> getAllCurrencies() { + return ok(CURRENCIES); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/Problem.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/Problem.java new file mode 100644 index 000000000..c2bd815ec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/Problem.java @@ -0,0 +1,105 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app126; + +import java.net.URI; +import java.util.Collections; +import java.util.Map; + +/** + * The interface Problem. + */ +public interface Problem { + + /** + * The constant DEFAULT_TYPE. + */ + URI DEFAULT_TYPE = URI.create("about:blank"); + + /** + * An absolute URI that identifies the problem type. When dereferenced, + * it SHOULD provide human-readable documentation for the problem type + * (e.g., using HTML). When this member is not present, its value is + * assumed to be "about:blank". + * + * @return an absolute URI that identifies this problem's type + */ + default URI getType() { + return DEFAULT_TYPE; + } + + /** + * A short, human-readable summary of the problem type. It SHOULD NOT + * change from occurrence to occurrence of the problem, except for + * purposes of localisation. + * + * @return a short, human-readable summary of this problem + */ + default String getTitle() { + return null; + } + + /** + * The HTTP status code generated by the origin server for this + * occurrence of the problem. + * + * @return the HTTP status code + */ + default Integer getStatus() { + return null; + } + + /** + * A human readable explanation specific to this occurrence of the problem. + * + * @return A human readable explaination of this problem + */ + default String getDetail() { + return null; + } + + /** + * An absolute URI that identifies the specific occurrence of the problem. + * It may or may not yield further information if dereferenced. + * + * @return an absolute URI that identifies this specific problem + */ + default URI getInstance() { + return null; + } + + /** + * Optional, additional attributes of the problem. Implementations can choose to ignore this in favor of concrete, + * typed fields. + * + * @return additional parameters + */ + default Map getParameters() { + return Collections.emptyMap(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/SecurityProblemResponsesConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/SecurityProblemResponsesConfiguration.java new file mode 100644 index 000000000..e833187b2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/SecurityProblemResponsesConfiguration.java @@ -0,0 +1,129 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app126; + +import java.io.IOException; +import java.util.AbstractMap; +import java.util.Map; + +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.MediaType; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.responses.ApiResponse; + +import org.springframework.beans.factory.parsing.Problem; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import static org.springframework.http.MediaType.APPLICATION_PROBLEM_JSON_VALUE; + +/** + * Configuration class defining standard OpenAPI Specification for operations + */ +@Configuration +class SecurityProblemResponsesConfiguration { + + /** + * The constant HTTP_401_NO_TOKEN. + */ + private static final String HTTP_401_NO_TOKEN = "http401NoToken"; + + /** + * The constant UNAUTHORIZED_401_NO_TOKEN_RESPONSE_REF. + */ + public static final String UNAUTHORIZED_401_NO_TOKEN_RESPONSE_REF = "#/components/responses/" + HTTP_401_NO_TOKEN; + + /** + * The constant HTTP_401_BAD_TOKEN. + */ + private static final String HTTP_401_BAD_TOKEN = "http401BadToken"; + + /** + * The constant UNAUTHORIZED_401_BAD_TOKEN_RESPONSE_REF. + */ + public static final String UNAUTHORIZED_401_BAD_TOKEN_RESPONSE_REF = "#/components/responses/" + HTTP_401_BAD_TOKEN; + + /** + * The constant HTTP_403. + */ + private static final String HTTP_403 = "http403"; + + /** + * The constant FORBIDDEN_403_RESPONSE_REF. + */ + public static final String FORBIDDEN_403_RESPONSE_REF = "#/components/responses/" + HTTP_403; + + /** + * Http 401 no token response map . entry. + * + * @return the map . entry + * @throws IOException the io exception + */ + @Bean + public Map.Entry http401NoTokenResponse() throws IOException { + return simpleResponse(HTTP_401_NO_TOKEN, "Invalid authentication."); + } + + /** + * Http 401 bad token response map . entry. + * + * @return the map . entry + * @throws IOException the io exception + */ + @Bean + public Map.Entry http401BadTokenResponse() throws IOException { + return simpleResponse(HTTP_401_BAD_TOKEN, "Invalid authentication."); + } + + /** + * Http 403 example map . entry. + * + * @return the map . entry + * @throws IOException the io exception + */ + @Bean + public Map.Entry http403Example() throws IOException { + return simpleResponse(HTTP_403, "Missing authorities."); + } + + /** + * Simple response map . entry. + * + * @param code the code + * @param description the description + * @return the map . entry + * @throws IOException the io exception + */ + private Map.Entry simpleResponse(String code, String description) throws IOException { + ApiResponse response = new ApiResponse().description(description).content(new Content().addMediaType( + APPLICATION_PROBLEM_JSON_VALUE, + new MediaType() + .schema(new Schema().$ref("#/components/schemas/Problem")))); + return new AbstractMap.SimpleEntry<>(code, response); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java new file mode 100644 index 000000000..ddb92c0be --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app126/SpringDocApp126Test.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app126; + +import java.util.List; +import java.util.Map; + +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverters; +import io.swagger.v3.core.converter.ResolvedSchema; +import io.swagger.v3.oas.models.responses.ApiResponse; +import org.springdoc.core.customizers.OpenApiCustomizer; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp126Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + + /** + * Response registration customizer open api customiser. + * + * @param responsesToRegister the responses to register + * @return the open api customiser + */ + @Bean + public OpenApiCustomizer responseRegistrationCustomizer(List> responsesToRegister) { + ResolvedSchema resolvedSchema = ModelConverters.getInstance(true) + .resolveAsResolvedSchema(new AnnotatedType(Problem.class)); + return openApi -> { + openApi.getComponents().addSchemas("Problem", resolvedSchema.schema); + responsesToRegister.forEach(entry -> openApi.getComponents().addResponses(entry.getKey(), entry.getValue())); + }; + } + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/AbstractObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/AbstractObject.java new file mode 100644 index 000000000..6dfeafb8e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/AbstractObject.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** + * The type Abstract object. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "type", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ConcreteObjectA.class, name = "Type A") +}) +public abstract class AbstractObject { + + /** + * The Type. + */ + private final ConcreteType type; + + /** + * The Name. + */ + private final String name; + + /** + * Instantiates a new Abstract object. + * + * @param type the type + * @param name the name + */ + protected AbstractObject(ConcreteType type, String name) { + this.type = type; + this.name = name; + } + + /** + * Gets type. + * + * @return the type + */ + public ConcreteType getType() { + return type; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/ConcreteObjectA.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/ConcreteObjectA.java new file mode 100644 index 000000000..23006a170 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/ConcreteObjectA.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +/** + * The type Concrete object a. + */ +class ConcreteObjectA extends AbstractObject { + + /** + * The Description. + */ + private final String description; + + /** + * Instantiates a new Concrete object a. + * + * @param name the name + * @param description the description + */ + public ConcreteObjectA(String name, String description) { + super(ConcreteType.TYPE_A, name); + this.description = description; + } + + /** + * Gets description. + * + * @return the description + */ + public String getDescription() { + return description; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/ConcreteType.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/ConcreteType.java new file mode 100644 index 000000000..dd15b5ddd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/ConcreteType.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +/** + * The enum Concrete type. + */ +public enum ConcreteType { + /** + * The Type a. + */ + TYPE_A("Type A"), + /** + * The Type b. + */ + TYPE_B("Type B"); + + /** + * The Name. + */ + private final String name; + + /** + * Instantiates a new Concrete type. + * + * @param name the name + */ + ConcreteType(String name) { + this.name = name; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/Controller.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/Controller.java new file mode 100644 index 000000000..f75109cd5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/Controller.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Controller. + */ +@RestController +class Controller { + + /** + * Bug umbrella. + * + * @return the umbrella + */ + @Operation(summary = "Test Bug", responses = { + @ApiResponse(responseCode = "200", description = "OK", + content = @Content( + schema = @Schema(implementation = Umbrella.class), + examples = @ExampleObject(ref = "#/components/examples/umbrellaExample", name = "Example with weird YAML tag") + ) + ) + }) + @GetMapping(value = "/bug", produces = MediaType.APPLICATION_JSON_VALUE) + public Umbrella bug() { + return new Umbrella(new ConcreteObjectA("a", "b")); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java new file mode 100644 index 000000000..49ba546b8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/SpringDocApp127Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app127; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.web.servlet.MvcResult; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp127Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + ".yaml")).andExpect(status().isOk()).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Assertions.assertTrue(!result.contains("!")); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/Umbrella.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/Umbrella.java new file mode 100644 index 000000000..6c226d19d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app127/Umbrella.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app127; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Umbrella. + */ +class Umbrella { + + /** + * The Object. + */ + @Schema(description = "This reference to abstract class causes weird YAML tag to be added", anyOf = ConcreteObjectA.class) + private final AbstractObject object; + + /** + * Instantiates a new Umbrella. + * + * @param object the object + */ + public Umbrella(AbstractObject object) { + this.object = object; + } + + /** + * Gets object. + * + * @return the object + */ + public AbstractObject getObject() { + return object; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/ActualReturnedEntity.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/ActualReturnedEntity.java new file mode 100644 index 000000000..deae7559f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/ActualReturnedEntity.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app129; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Actual returned entity. + */ +class ActualReturnedEntity { + + /** + * The Result. + */ + @JsonProperty + String result; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java new file mode 100644 index 000000000..66d386c2b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app129; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.request.async.DeferredResult; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping(path = "/api", headers = { "userId", "registrationId" }) +class HelloController { + + /** + * Update deferred result. + * + * @param entity the entity + * @return the deferred result + * @throws Exception the exception + */ + @PostMapping("/test") + @ApiResponses({ @ApiResponse(responseCode = "200") }) + public DeferredResult> update( + @RequestBody ActualReturnedEntity entity) throws Exception { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/OperationResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/OperationResponse.java new file mode 100644 index 000000000..deeebd750 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/OperationResponse.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app129; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Operation response. + * + * @param the type parameter + */ +class OperationResponse { + + /** + * The Operation result. + */ + @JsonProperty + String operationResult; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java new file mode 100644 index 000000000..71c8abbec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app129/SpringDocApp129Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app129; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp129Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java new file mode 100644 index 000000000..eb0b07e62 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app13; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param dto the dto + * @return the string + */ + @GetMapping(value = "/persons") + public String persons(final PersonDTO dto) { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java new file mode 100644 index 000000000..98db80622 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/PersonDTO.java @@ -0,0 +1,124 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app13; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; + +/** + * The type Person dto. + */ +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java new file mode 100644 index 000000000..3065d5464 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app13; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 13 test. + */ +class SpringDocApp13Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/HelloController.java new file mode 100644 index 000000000..afba85c71 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/HelloController.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app130; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List tracker data. + * + * @param toto the toto + * @return the tracker data + */ + @PostMapping(value = "/values/data") + TrackerData list(TrackerData toto) { + return toto; + } + + /** + * Get tracker data. + * + * @param toto the toto + * @return the tracker data + */ + @GetMapping(value = "/values/datakk") + TrackerData get(TrackerData toto) { + return toto; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java new file mode 100644 index 000000000..885be4f01 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/SpringDocApp130Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app130; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp130Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/TrackerData.java new file mode 100644 index 000000000..dd09c0402 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app130/TrackerData.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app130; + +import java.time.Instant; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tracker data. + */ +@Hidden +class TrackerData { + + /** + * The Tracker id. + */ + @JsonProperty("trackerId") + String trackerId; + + /** + * The Timestamp. + */ + @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") + @JsonProperty("timestamp") + Instant timestamp; + + /** + * The Value. + */ + @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") + @JsonProperty("value") + Double value; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/HelloController.java new file mode 100644 index 000000000..0c1045994 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app131; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + + /** + * Create organization. + * + * @param organization the organization + */ + @Operation(summary = "Create the organization", description = "Create the organization") + @ApiResponses( + value = { + @ApiResponse( + responseCode = "204", + description = "The organization was created successfully"), + @ApiResponse( + responseCode = "400", + description = "Invalid argument", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "409", + description = "An organization with the specified ID already exists", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "500", + description = + "An error has occurred and the request could not be processed at this time", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))) + }) + @RequestMapping( + value = "/organizations", + method = RequestMethod.POST, + produces = "application/json") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void createOrganization( + @Parameter(name = "organization", required = true) + @RequestBody + Organization organization) { + + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/Organization.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/Organization.java new file mode 100644 index 000000000..309e3b55d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/Organization.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app131; + + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Organization. + */ +@Schema(description = + "This is the description being overwritten") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "id", "name" }) +class Organization { + + /** + * The Id. + */ + @Schema( + description = + "The Universally Unique Identifier (UUID) uniquely identifying the organization", + required = true) + @JsonProperty(required = true) + private UUID id; + + /** + * The Name. + */ + @Schema(description = "The name of the organization", required = true) + @JsonProperty(required = true) + private String name; + + /** + * Instantiates a new Organization. + */ + public Organization() { + } + + /** + * Gets id. + * + * @return the id + */ + public UUID getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(UUID id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/RestControllerError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/RestControllerError.java new file mode 100644 index 000000000..9d258443f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/RestControllerError.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app131; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Rest controller error. + */ +class RestControllerError { + + /** + * The Id. + */ + @JsonProperty + private String id; + + /** + * The Message. + */ + @JsonProperty + private String message; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java new file mode 100644 index 000000000..ada5828ce --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app131/SpringDocApp131Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app131; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp131Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/HelloController.java new file mode 100644 index 000000000..74e80592d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app132; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + + /** + * Create organization. + * + * @param organization the organization + */ + @Operation(summary = "Create the organization", description = "Create the organization") + @ApiResponses( + value = { + @ApiResponse( + responseCode = "204", + description = "The organization was created successfully"), + @ApiResponse( + responseCode = "400", + description = "Invalid argument", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "409", + description = "An organization with the specified ID already exists", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))), + @ApiResponse( + responseCode = "500", + description = + "An error has occurred and the request could not be processed at this time", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = RestControllerError.class))) + }) + @RequestMapping( + value = "/organizations", + method = RequestMethod.POST, + produces = "application/json") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void createOrganization( + @Parameter(name = "organization", description = "i want to override the description of this object", required = true) + @RequestBody + Organization organization) { + + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/Organization.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/Organization.java new file mode 100644 index 000000000..46bb692fd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/Organization.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app132; + + +import java.util.UUID; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Organization. + */ +@Schema(description = + "This is the description being overwritten") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "id", "name" }) +class Organization { + + /** + * The Id. + */ + @Schema( + description = + "The Universally Unique Identifier (UUID) uniquely identifying the organization", + required = true) + @JsonProperty(required = true) + private UUID id; + + /** + * The Name. + */ + @Schema(description = "The name of the organization", required = true) + @JsonProperty(required = true) + private String name; + + /** + * Instantiates a new Organization. + */ + public Organization() { + } + + /** + * Gets id. + * + * @return the id + */ + public UUID getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(UUID id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/RestControllerError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/RestControllerError.java new file mode 100644 index 000000000..ff831d670 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/RestControllerError.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app132; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Rest controller error. + */ +class RestControllerError { + + /** + * The Id. + */ + @JsonProperty + private String id; + + /** + * The Message. + */ + @JsonProperty + private String message; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java new file mode 100644 index 000000000..090a7d364 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app132/SpringDocApp132Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app132; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp132Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app133/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app133/HelloController.java new file mode 100644 index 000000000..986668df6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app133/HelloController.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app133; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets message from header 1. + * + * @param header the header + * @return the message from header 1 + */ + @GetMapping(path = "/test1", headers = { "myHeader" }) + public String getMessageFromHeader1( + @Parameter(name = "myHeader", description = "A header", schema = @Schema(allowableValues = { "foo", "bar" })) + @RequestHeader("myHeader") String header + ) { + return "bar " + header; + } + + /** + * Gets message from header 2. + * + * @param header the header + * @return the message from header 2 + */ + @GetMapping("/test2") + public String getMessageFromHeader2( + @Parameter(name = "myHeader", description = "A header", schema = @Schema(type = "integer")) + @RequestHeader("myHeader") Integer header + ) { + return "bar " + header; + } + + /** + * Gets message from header 3. + * + * @param header the header + * @return the message from header 3 + */ + @GetMapping(path = "/test3", headers = { "myHeader" }) + public String getMessageFromHeader3( + @Parameter(name = "myHeader", description = "A header", schema = @Schema(type = "integer")) + @RequestHeader("myHeader") Integer header + ) { + return "bar " + header; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java new file mode 100644 index 000000000..f0448d855 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app133/SpringDocApp133Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app133; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp133Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/HelloController.java new file mode 100644 index 000000000..82da5f9ba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/HelloController.java @@ -0,0 +1,228 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app134; + +import java.util.Collections; +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@SpringBootApplication +@RestController +@Tag(name = "The sample resource") +class HelloController { + + // ----------------------------------------------------------------------------------------------------------------- + + /** + * The constant VERSION_1. + */ + public static final String VERSION_1 = "application/vnd.samples.v1+json"; + + /** + * The constant VERSION_2. + */ + public static final String VERSION_2 = "application/vnd.samples.v2+json"; + + /** + * The constant HEADER_1. + */ + public static final String HEADER_1 = "X-API-VERSION=1"; + + /** + * The constant HEADER_2. + */ + public static final String HEADER_2 = "Accept-version=v2"; + + /** + * Gets sample v 1. + * + * @param id the id + * @return the sample v 1 + */ + @GetMapping(value = "/{id}", produces = VERSION_1, headers = HEADER_1) + @ResponseStatus(HttpStatus.OK) + @Operation(operationId = "getSampleV1", deprecated = true, description = "Get the sample by its id." + ) + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = SampleV1.class))) + public SampleV1 getSampleV1(@Parameter(description = "The sample's id", required = true) + @PathVariable final String id) { + return new SampleV1(id); + } + + /** + * Gets sample v 2. + * + * @param id the id + * @return the sample v 2 + */ + @GetMapping(value = "/{id}", produces = VERSION_2, headers = { HEADER_2, HEADER_1 }) + @ResponseStatus(HttpStatus.OK) + @Operation(operationId = "getSampleV2", description = "Get the sample by its id. This represents V2.") + @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = SampleV1.class))) + public SampleV2 getSampleV2(@Parameter(description = "The sample's id", required = true) + @PathVariable final Long id) { + return new SampleV2(id); + } + + /** + * Search samples list. + * + * @param searchRequest the search request + * @return the list + */ + @PostMapping(path = "/search", consumes = VERSION_2, produces = VERSION_2) + @Operation(description = "Searches for sample objects using the given search request.") + @ApiResponse(responseCode = "200", + content = @Content(array = @ArraySchema(schema = @Schema(implementation = SampleV2.class)))) + public List searchSamples(@RequestBody final SampleSearchRequest searchRequest) { + return Collections.singletonList(new SampleV2(searchRequest.getId())); + } + + + /** + * The type Sample v 1. + */ + private class SampleV1 { + + /** + * The Id. + */ + private String id; + + /** + * Instantiates a new Sample v 1. + * + * @param id the id + */ + public SampleV1(String id) { + this.id = id; + } + + /** + * Gets id. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + } + + /** + * The type Sample v 2. + */ + private class SampleV2 { + /** + * The Id. + */ + private long id; + + /** + * Instantiates a new Sample v 2. + * + * @param id the id + */ + public SampleV2(long id) { + this.id = id; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } + } + + /** + * The type Sample search request. + */ + private class SampleSearchRequest { + /** + * The Id. + */ + private final long id; + + /** + * Instantiates a new Sample search request. + * + * @param id the id + */ + public SampleSearchRequest(long id) { + this.id = id; + } + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/OpenApiConfig.java new file mode 100644 index 000000000..fd20ab7c6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/OpenApiConfig.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app134; + +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * The type Open api config. + */ +@Configuration +class OpenApiConfig { + + /** + * Group v 1 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV1OpenApi() { + return GroupedOpenApi.builder() + .group("v1-group").producesToMatch(HelloController.VERSION_1) + .build(); + } + + /** + * Group v 2 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV2OpenApi() { + return GroupedOpenApi.builder() + .group("v2-group").producesToMatch(HelloController.VERSION_2) + .build(); + } + + /** + * Group v 3 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV3OpenApi() { + return GroupedOpenApi.builder() + .group("v2-consumes-group").consumesToMatch(HelloController.VERSION_2) + .build(); + } + + /** + * Group v 4 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV4OpenApi() { + return GroupedOpenApi.builder() + .group("v1-headers-group").headersToMatch(HelloController.HEADER_1) + .build(); + } + + /** + * Group v 5 open api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi groupV5OpenApi() { + return GroupedOpenApi.builder() + .group("v1-v2-headers-group").headersToMatch(HelloController.HEADER_1, HelloController.HEADER_2) + .build(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java new file mode 100644 index 000000000..ef2f9bbb8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app134/SpringDocApp134Test.java @@ -0,0 +1,116 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app134; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp134Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-1.json"), true)); + } + + /** + * Test app 2. + * + * @throws Exception the exception + */ + @Test + void testApp2() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-2.json"), true)); + } + + /** + * Test app 3. + * + * @throws Exception the exception + */ + @Test + void testApp3() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-headers-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-3.json"), true)); + } + + /** + * Test app 4. + * + * @throws Exception the exception + */ + @Test + void testApp4() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v1-v2-headers-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-4.json"), true)); + } + + /** + * Test app 5. + * + * @throws Exception the exception + */ + @Test + void testApp5() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL + "/v2-consumes-group")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(content().json(getContent("results/3.1.0/app134-5.json"), true)); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/Book.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/Book.java new file mode 100644 index 000000000..3d7d48333 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/Book.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app135; + +/** + * The type Book. + */ +class Book { + + /** + * The Id. + */ + private String id; + + /** + * The Title. + */ + private String title; + + /** + * The Author. + */ + private String author; + + /** + * Instantiates a new Book. + * + * @param id the id + * @param title the title + * @param author the author + */ + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + /** + * Gets id. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + + /** + * Gets title. + * + * @return the title + */ + public String getTitle() { + return title; + } + + /** + * Sets title. + * + * @param title the title + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * Gets author. + * + * @return the author + */ + public String getAuthor() { + return author; + } + + /** + * Sets author. + * + * @param author the author + */ + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/BookRepository.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/BookRepository.java new file mode 100644 index 000000000..91c3a4ea9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/BookRepository.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app135; + +import java.util.Arrays; +import java.util.List; + +import org.springframework.stereotype.Component; + +/** + * The type Book repository. + */ +@Component +class BookRepository { + + /** + * Find by author list. + * + * @param author the author + * @return the list + */ + List findByAuthor(String author) { + Book[] books = { new Book("1", "title1", "author1") }; + return Arrays.asList(books); + } + + /** + * Find all list. + * + * @return the list + */ + List findAll() { + Book[] books = { new Book("2", "title2", "author2") }; + return Arrays.asList(books); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/BookRouter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/BookRouter.java new file mode 100644 index 000000000..008d3939f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/BookRouter.java @@ -0,0 +1,140 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app135; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springdoc.core.annotations.RouterOperation; +import org.springdoc.core.annotations.RouterOperations; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.servlet.function.RequestPredicates; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.RouterFunctions; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springframework.web.servlet.function.RouterFunctions.nest; +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Book router. + */ +@Configuration +class BookRouter { + + /** + * Routes router function. + * + * @param br the br + * @return the router function + */ + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes(BookRepository br) { + return + RouterFunctions.nest(RequestPredicates.path("/greeter").and(RequestPredicates.path("/greeter2")), + RouterFunctions.route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author"))))); + } + + /** + * Routes 1 router function. + * + * @param br the br + * @return the router function + */ + @Bean + @RouterOperations({ + @RouterOperation(path = "/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes1(BookRepository br) { + return + RouterFunctions.nest(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + RouterFunctions.route(RequestPredicates.GET("/books"), req -> ServerResponse.ok().body(br.findAll())) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ServerResponse.ok().body(br.findByAuthor(req.pathVariable("author"))))); + } + + /** + * Routes 3 router function. + * + * @param br the br + * @return the router function + */ + @Bean + @RouterOperations({ + @RouterOperation(path = "/greeter/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes3(BookRepository br) { + return + nest(RequestPredicates.path("/greeter").or(RequestPredicates.path("/greeter2")), + route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author"))))); + } + + /** + * Routes 4 router function. + * + * @param br the br + * @return the router function + */ + @Bean + @RouterOperations({ + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books", produces = { MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_XML_VALUE }, beanClass = BookRepository.class, beanMethod = "findAll"), + @RouterOperation(path = "/test/greeter/greeter2/books/{author}", beanClass = BookRepository.class, beanMethod = "findByAuthor", + operation = @Operation(operationId = "findByAuthor" + , parameters = { @Parameter(in = ParameterIn.PATH, name = "author") })) }) + RouterFunction routes4(BookRepository br) { + return + nest(RequestPredicates.path("/test"), + nest(RequestPredicates.path("/greeter").and(RequestPredicates.path("/greeter2")), + route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .and(route(RequestPredicates.GET("/books").and(RequestPredicates.accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll()))) + .andRoute(RequestPredicates.GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java new file mode 100644 index 000000000..3d0ada9da --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app135/SpringDocApp135Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app135; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp135Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/HelloController.java new file mode 100644 index 000000000..fcef107a9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app137; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@SecurityRequirement(name = "security_auth") +class HelloController { + + /** + * Test. + * + * @param hello the hello + */ + @GetMapping("/test") + public void test(String hello) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/OpenApiConfig.java new file mode 100644 index 000000000..f14230f86 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/OpenApiConfig.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app137; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.servers.Server; + +/** + * The type Open api config. + */ +@OpenAPIDefinition(servers = @Server(url = "${test.server}", description = "${test.desc}"), info = @Info(title = "My App", + description = "Some long and useful description", version = "v1")) +@SecurityScheme(name = "security_auth", type = SecuritySchemeType.OAUTH2, + flows = @OAuthFlows(authorizationCode = @OAuthFlow( + authorizationUrl = "http://authorization.url" + , tokenUrl = "http://token.url", scopes = {}))) +class OpenApiConfig {} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java new file mode 100644 index 000000000..038156fe8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app137/SpringDocApp137Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app137; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = { "test.server=http://test.toto.com", "test.desc=toto desc" }) +class SpringDocApp137Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app138/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app138/HelloController.java new file mode 100644 index 000000000..2748bb6b1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app138/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app138; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test a. + * + * @param hello the hello + */ + @GetMapping("/testA") + public void testA(String hello) { + } + + /** + * Test b. + * + * @param hello the hello + */ + @GetMapping("/testB") + public void testB(String hello) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java new file mode 100644 index 000000000..05758f756 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app138/SpringDocApp138Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app138; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = "springdoc.writer-with-order-by-keys=true") +class SpringDocApp138Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app139/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app139/HelloController.java new file mode 100644 index 000000000..63d6a28a2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app139/HelloController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app139; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Echo 1 string. + * + * @param text the text + * @return the string + */ + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test1") + public String echo1(@RequestParam(name = "${test.name}", defaultValue = "${test.default-value}") String text) { + return text; + } + + /** + * Echo 2 string. + * + * @param text the text + * @return the string + */ + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test2") + public String echo2(@RequestParam(value = "${test.value}", defaultValue = "${test.default-value}") String text) { + return text; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java new file mode 100644 index 000000000..0c016018e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app139/SpringDocApp139Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app139; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * Tests Spring meta-annotations as method parameters + */ +@TestPropertySource(properties = { "test.name=text", "test.value=text", "test.default-value=default-text" }) +class SpringDocApp139Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java new file mode 100644 index 000000000..fdcad2187 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app14; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.http.HttpEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping("/persons") + public void persons(@Valid @NotBlank String name) { + + } + + /** + * Demo 2 http entity. + * + * @return the http entity + */ + @GetMapping("/test") + public HttpEntity demo2() { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java new file mode 100644 index 000000000..f2a341dc9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app14/SpringDocApp14Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app14; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 14 test. + */ +class SpringDocApp14Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app140/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app140/HelloApplication.java new file mode 100644 index 000000000..1870c2deb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app140/HelloApplication.java @@ -0,0 +1,314 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app140; + +import java.io.IOException; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import jakarta.servlet.FilterChain; +import jakarta.servlet.GenericFilter; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.function.HandlerFunction; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.ServerRequest; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Hello application. + */ +@Configuration +class HelloApplication { + + /** + * Filter server response. + * + * @param serverRequest the server request + * @param handlerFunction the handler function + * @return the server response + * @throws Exception the exception + */ + private static ServerResponse filter(ServerRequest serverRequest, HandlerFunction handlerFunction) throws Exception { + return handlerFunction.handle(serverRequest); + } + + /** + * Routes router function. + * + * @param ph the ph + * @return the router function + */ + @Bean + RouterFunction routes(PersonHandler ph) { + String root = ""; + return route() + .GET(root + "/people", ph::handleGetAllPeople) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("all")) + .GET(root + "/people/{id}", ph::handleGetPersonById) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("byId")) + .POST(root + "/people", ph::handlePostPerson) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(PersonService.class).beanMethod("save")) + .filter(HelloApplication::filter) + .build(); + } +} + +/** + * The type Simple filter. + */ +@Component +class SimpleFilter extends GenericFilter { + + /** + * Do filter. + * + * @param req the req + * @param res the res + * @param filterChain the filter chain + * @throws IOException the io exception + * @throws ServletException the servlet exception + */ + @Override + public void doFilter(ServletRequest req, ServletResponse res, + FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(req, res); + } +} + +/** + * The type Person handler. + */ +@Component +class PersonHandler { + + /** + * The Person service. + */ + private final PersonService personService; + + /** + * Instantiates a new Person handler. + * + * @param personService the person service + */ + PersonHandler(PersonService personService) { + this.personService = personService; + } + + /** + * Handle get all people server response. + * + * @param serverRequest the server request + * @return the server response + */ + ServerResponse handleGetAllPeople(ServerRequest serverRequest) { + return ok().body(personService.all()); + } + + /** + * Handle post person server response. + * + * @param r the r + * @return the server response + * @throws ServletException the servlet exception + * @throws IOException the io exception + */ + ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { + Person result = personService.save(new Person(null, r.body(Person.class).getName())); + URI uri = URI.create("/people/" + result.getId()); + return ServerResponse.created(uri).body(result); + } + + /** + * Handle get person by id server response. + * + * @param r the r + * @return the server response + */ + ServerResponse handleGetPersonById(ServerRequest r) { + return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); + } +} + +/** + * The type Greetings rest controller. + */ +@RestController +class GreetingsRestController { + + /** + * Greet string. + * + * @param name the name + * @return the string + */ + @GetMapping("/greet/{name}") + String greet(@PathVariable String name) { + return "hello " + name + "!"; + } +} + +/** + * The type Person service. + */ +@Service +class PersonService { + + /** + * The Counter. + */ + private final AtomicLong counter = new AtomicLong(); + + /** + * The People. + */ + private final Set people = Stream.of( + new Person(counter.incrementAndGet(), "Jane"), + new Person(counter.incrementAndGet(), "Josh"), + new Person(counter.incrementAndGet(), "Gordon")) + .collect(Collectors.toCollection(HashSet::new)); + + + /** + * Save person. + * + * @param p the p + * @return the person + */ + Person save(Person p) { + Person person = new Person(counter.incrementAndGet(), p.getName()); + this.people.add(person); + return person; + } + + /** + * All set. + * + * @return the set + */ + Set all() { + return this.people; + } + + /** + * By id person. + * + * @param id the id + * @return the person + */ + Person byId(@Parameter(in = ParameterIn.PATH) Long id) { + return this.people.stream() + .filter(p -> p.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); + } + +} + +/** + * The type Person. + */ +class Person { + + /** + * The Id. + */ + private Long id; + + /** + * The Name. + */ + private String name; + + /** + * Instantiates a new Person. + * + * @param id the id + * @param name the name + */ + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + + /** + * Gets id. + * + * @return the id + */ + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java new file mode 100644 index 000000000..d694b7b65 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app140/SpringDocApp140Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app140; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 140 test. + */ +class SpringDocApp140Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/Book.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/Book.java new file mode 100644 index 000000000..53d34e09e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/Book.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app141; + +/** + * The type Book. + */ +class Book { + + /** + * The Id. + */ + private String id; + + /** + * The Title. + */ + private String title; + + /** + * The Author. + */ + private String author; + + /** + * Instantiates a new Book. + * + * @param id the id + * @param title the title + * @param author the author + */ + public Book(String id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + /** + * Gets id. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(String id) { + this.id = id; + } + + /** + * Gets title. + * + * @return the title + */ + public String getTitle() { + return title; + } + + /** + * Sets title. + * + * @param title the title + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * Gets author. + * + * @return the author + */ + public String getAuthor() { + return author; + } + + /** + * Sets author. + * + * @param author the author + */ + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/BookRepository.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/BookRepository.java new file mode 100644 index 000000000..e71f2630d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/BookRepository.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app141; + +import java.util.Arrays; +import java.util.List; + +import org.springframework.stereotype.Component; + +/** + * The type Book repository. + */ +@Component +class BookRepository { + + /** + * Find by author list. + * + * @param author the author + * @return the list + */ + List findByAuthor(String author) { + Book[] books = { new Book("1", "title1", "author1") }; + return Arrays.asList(books); + } + + /** + * Find all list. + * + * @return the list + */ + List findAll() { + Book[] books = { new Book("2", "title2", "author2") }; + return Arrays.asList(books); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/BookRouter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/BookRouter.java new file mode 100644 index 000000000..9058bc606 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/BookRouter.java @@ -0,0 +1,135 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app141; + +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.web.servlet.function.RouterFunction; + +import static org.springdoc.core.fn.builders.operation.Builder.operationBuilder; +import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder; +import static org.springdoc.core.utils.Constants.OPERATION_ATTRIBUTE; +import static org.springframework.web.servlet.function.RequestPredicates.GET; +import static org.springframework.web.servlet.function.RequestPredicates.accept; +import static org.springframework.web.servlet.function.RequestPredicates.path; +import static org.springframework.web.servlet.function.RouterFunctions.nest; +import static org.springframework.web.servlet.function.RouterFunctions.route; +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Book router. + */ +@Configuration +class BookRouter { + + + /** + * Routes router function. + * + * @param br the br + * @return the router function + */ + @Bean + RouterFunction routes(BookRepository br) { + return nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"))) + ); + } + + /** + * Routes 1 router function. + * + * @param br the br + * @return the router function + */ + @Bean + RouterFunction routes1(BookRepository br) { + return nest(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML), + route(GET("/books"), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor")))); + } + + /** + * Routes 3 router function. + * + * @param br the br + * @return the router function + */ + @Bean + RouterFunction routes3(BookRepository br) { + return nest(path("/greeter").or(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor")))); + } + + /** + * Routes 4 router function. + * + * @param br the br + * @return the router function + */ + @Bean + RouterFunction routes4(BookRepository br) { + return nest(path("/test"), nest(path("/greeter").and(path("/greeter2")), + route(GET("/books").and(accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll")) + + .and(route(GET("/books").and(accept(MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN)), req -> ok().body(br.findAll())) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder().beanClass(BookRepository.class).beanMethod("findAll"))) + + .and(route(GET("/books/{author}"), req -> ok().body(br.findByAuthor(req.pathVariable("author")))) + .withAttribute(OPERATION_ATTRIBUTE, operationBuilder() + .operationId("findByAuthor").parameter(parameterBuilder().name("author").in(ParameterIn.PATH)) + .beanClass(BookRepository.class).beanMethod("findByAuthor"))))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java new file mode 100644 index 000000000..b73704df6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app141/SpringDocApp141Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ +package test.org.springdoc.api.v31.app141; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp141Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app142/HelloApplication.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app142/HelloApplication.java new file mode 100644 index 000000000..60efd2058 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app142/HelloApplication.java @@ -0,0 +1,296 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app142; + +import java.io.IOException; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import jakarta.servlet.FilterChain; +import jakarta.servlet.GenericFilter; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import org.springdoc.webmvc.core.fn.SpringdocRouteBuilder; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.function.RouterFunction; +import org.springframework.web.servlet.function.ServerRequest; +import org.springframework.web.servlet.function.ServerResponse; + +import static org.springframework.web.servlet.function.ServerResponse.ok; + +/** + * The type Hello application. + */ +@Configuration +class HelloApplication { + + + /** + * Routes router function. + * + * @param ph the ph + * @return the router function + */ + @Bean + RouterFunction routes(PersonHandler ph) { + String root = ""; + return SpringdocRouteBuilder.route() + .GET(root + "/people", ph::handleGetAllPeople, ops -> ops.beanClass(PersonService.class).beanMethod("all")) + .GET(root + "/people/{id}", ph::handleGetPersonById, ops -> ops.beanClass(PersonService.class).beanMethod("byId")) + .POST(root + "/people", ph::handlePostPerson, ops -> ops.beanClass(PersonService.class).beanMethod("save")).build(); + } + +} + +/** + * The type Simple filter. + */ +@Component +class SimpleFilter extends GenericFilter { + + /** + * Do filter. + * + * @param req the req + * @param res the res + * @param filterChain the filter chain + * @throws IOException the io exception + * @throws ServletException the servlet exception + */ + @Override + public void doFilter(ServletRequest req, ServletResponse res, + FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(req, res); + } +} + +/** + * The type Person handler. + */ +@Component +class PersonHandler { + + /** + * The Person service. + */ + private final PersonService personService; + + /** + * Instantiates a new Person handler. + * + * @param personService the person service + */ + PersonHandler(PersonService personService) { + this.personService = personService; + } + + /** + * Handle get all people server response. + * + * @param serverRequest the server request + * @return the server response + */ + ServerResponse handleGetAllPeople(ServerRequest serverRequest) { + return ok().body(personService.all()); + } + + /** + * Handle post person server response. + * + * @param r the r + * @return the server response + * @throws ServletException the servlet exception + * @throws IOException the io exception + */ + ServerResponse handlePostPerson(ServerRequest r) throws ServletException, IOException { + Person result = personService.save(new Person(null, r.body(Person.class).getName())); + URI uri = URI.create("/people/" + result.getId()); + return ServerResponse.created(uri).body(result); + } + + /** + * Handle get person by id server response. + * + * @param r the r + * @return the server response + */ + ServerResponse handleGetPersonById(ServerRequest r) { + return ok().body(personService.byId(Long.parseLong(r.pathVariable("id")))); + } +} + +/** + * The type Greetings rest controller. + */ +@RestController +class GreetingsRestController { + + /** + * Greet string. + * + * @param name the name + * @return the string + */ + @GetMapping("/greet/{name}") + String greet(@PathVariable String name) { + return "hello " + name + "!"; + } +} + +/** + * The type Person service. + */ +@Service +class PersonService { + + /** + * The Counter. + */ + private final AtomicLong counter = new AtomicLong(); + + /** + * The People. + */ + private final Set people = Stream.of( + new Person(counter.incrementAndGet(), "Jane"), + new Person(counter.incrementAndGet(), "Josh"), + new Person(counter.incrementAndGet(), "Gordon")) + .collect(Collectors.toCollection(HashSet::new)); + + + /** + * Save person. + * + * @param p the p + * @return the person + */ + Person save(Person p) { + Person person = new Person(counter.incrementAndGet(), p.getName()); + this.people.add(person); + return person; + } + + /** + * All set. + * + * @return the set + */ + Set all() { + return this.people; + } + + /** + * By id person. + * + * @param id the id + * @return the person + */ + Person byId(@Parameter(in = ParameterIn.PATH) Long id) { + return this.people.stream() + .filter(p -> p.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("no " + Person.class.getName() + " with that ID found!")); + } + +} + +/** + * The type Person. + */ +class Person { + + /** + * The Id. + */ + private Long id; + + /** + * The Name. + */ + private String name; + + /** + * Instantiates a new Person. + * + * @param id the id + * @param name the name + */ + public Person(Long id, String name) { + this.id = id; + this.name = name; + } + + /** + * Gets id. + * + * @return the id + */ + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Gets name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java new file mode 100644 index 000000000..f81558d98 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app142/SpringDocApp142Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app142; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 142 test. + */ +class SpringDocApp142Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java new file mode 100644 index 000000000..b3e9fdaba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/HelloController.java @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +/** + * To test the case a user does not use @RestController but puts @Operation on handler methods + * and wants these methods to be exposed. + * + * @author Azige + */ +@Controller +class HelloController { + + /** + * Hello string. + * + * @return the string + */ + @GetMapping("/hello") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public String hello() { + return "forward:/message"; + } + + /** + * Message hello message. + * + * @return the hello message + */ + @GetMapping("/message") + @Operation + @ResponseBody + public HelloMessage message() { + return new HelloMessage("Lucky numbers!", 777); + } + + /** + * Hello model and view model and view. + * + * @return the model and view + */ + @GetMapping("/helloModelAndView") + @Operation(responses = @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(schema = @Schema(implementation = HelloMessage.class)) + )) + public ModelAndView helloModelAndView() { + ModelAndView mav = new ModelAndView(); + mav.setViewName("forward:/message"); + return mav; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java new file mode 100644 index 000000000..8592c6b1e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/HelloMessage.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +/** + * The type Hello message. + */ +class HelloMessage { + /** + * The Text. + */ + public String text; + + /** + * The Number. + */ + public int number; + + /** + * Instantiates a new Hello message. + * + * @param text the text + * @param number the number + */ + public HelloMessage(String text, int number) { + this.text = text; + this.number = number; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java new file mode 100644 index 000000000..978fccec9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app149/SpringDocApp149Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app149; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 149 test. + */ +@TestPropertySource(properties = "springdoc.model-and-view-allowed=true") +class SpringDocApp149Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java new file mode 100644 index 000000000..557c22542 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app15/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app15; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.json.JSONObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons json object. + * + * @return the json object + */ + @GetMapping(value = "/persons") + @Operation(description = "${springdoc.operation-descriptions.myOperation}", responses = @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(hidden = true)))) + public JSONObject persons() { + return new JSONObject(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java new file mode 100644 index 000000000..497473a55 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app15/SpringDocApp15Test.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app15; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Contact; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 15 test. + */ +@TestPropertySource(properties = { + "springdoc.operation-descriptions.myOperation=My Desc", + "springdoc.openapidefinition.info.title=My title", + "springdoc.openapidefinition.info.desc=My description", + "springdoc.openapidefinition.info.version=My version", + "springdoc.openapidefinition.info.terms=My terms", + "springdoc.openapidefinition.info.license.name=My license name", + "springdoc.openapidefinition.info.license.url=My license url", + "springdoc.openapidefinition.info.contact.name=My contact name", + "springdoc.openapidefinition.info.contact.email=My contact email", + "springdoc.openapidefinition.info.contact.url=My contact url" +}) +class SpringDocApp15Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + @OpenAPIDefinition(info = @Info( + title = "${springdoc.openapidefinition.info.title}", + description = "${springdoc.openapidefinition.info.desc}", + version = "${springdoc.openapidefinition.info.version}", + termsOfService = "${springdoc.openapidefinition.info.terms}", + license = @License( + name = "${springdoc.openapidefinition.info.license.name}", + url = "${springdoc.openapidefinition.info.license.url}" + ), + contact = @Contact( + name = "${springdoc.openapidefinition.info.contact.name}", + email = "${springdoc.openapidefinition.info.contact.email}", + url = "${springdoc.openapidefinition.info.contact.url}" + ) + )) + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app150/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app150/HelloController.java new file mode 100644 index 000000000..16830e515 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app150/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app150; + +import java.time.LocalDate; +import java.util.List; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.format.annotation.DateTimeFormat.ISO.DATE; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param toto the toto + */ + @GetMapping("/test/") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test(@RequestParam(defaultValue = "1") Integer toto) { + + } + + /** + * Test 1. + * + * @param toto the toto + */ + @GetMapping("/test1") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test1(@RequestParam @Parameter(schema = @Schema(defaultValue = "false", type = "boolean")) boolean toto) { + + } + + /** + * Test 3. + * + * @param toto the toto + */ + @GetMapping("/test3") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test3(@RequestParam(defaultValue = "users,123") List toto) { + + } + + /** + * Test 4. + * + * @param localDate the local date + */ + @GetMapping("/test4") + @ApiResponse(responseCode = "204", description = "No content") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void test4(@DateTimeFormat(iso = DATE) @RequestParam(defaultValue = "2021-03-08") LocalDate localDate) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java new file mode 100644 index 000000000..954253b08 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app150/SpringDocApp150Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app150; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp150Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app151/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app151/HelloController.java new file mode 100644 index 000000000..9cd5c001e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app151/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app151; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/test") +class HelloController { + + /** + * Test int. + * + * @return the int + */ + @GetMapping("") + /** + * A test endpoint mounted under `/test` + * @return 0 + */ + public int test() { + return 0; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java new file mode 100644 index 000000000..c62e734ac --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app151/SpringDocApp151Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app151; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp151Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java new file mode 100644 index 000000000..65eeda26c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app152/HelloController.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app152; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.util.pattern.PathPatternParser; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Hello world string. + * + * @return the string + */ + @GetMapping + public String helloWorld() { + return "ok"; + } + + /** + * The type Web config. + */ + @Configuration + class WebConfig implements WebMvcConfigurer { + + /** + * Configure path match. + * + * @param configurer the configurer + */ + @Override + public void configurePathMatch(PathMatchConfigurer configurer) { + configurer.setPatternParser(new PathPatternParser()); + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java new file mode 100644 index 000000000..96a82a7d7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app152/SpringDocApp152Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app152; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp152Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/OrderState.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/OrderState.java new file mode 100644 index 000000000..b18293602 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/OrderState.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import io.swagger.v3.oas.annotations.media.Schema; + + +/** + * The enum Order state. + */ +@Schema(type = "string", allowableValues = { "finished", "new" }) +public enum OrderState { + /** + *Finished order state. + */ + FINISHED("finished"), + /** + *New order state. + */ + NEW("new"); + + /** + * The Value. + */ + private final String value; + + /** + * Instantiates a new Order state. + * + * @param value the value + */ + OrderState(String value) { + this.value = value; + } + + /** + * Gets value. + * + * @return the value + */ + public String getValue() { + return value; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/OrderStateMapper.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/OrderStateMapper.java new file mode 100644 index 000000000..06f70cdee --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/OrderStateMapper.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import java.beans.PropertyEditorSupport; +import java.util.Arrays; + +import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; + +/** + * The type Order state mapper. + */ +class OrderStateMapper extends PropertyEditorSupport { + + /** + * Sets as text. + * + * @param text the text + */ + @Override + public void setAsText(String text) { + setValue( + Arrays.stream(OrderState.class.getEnumConstants()) + .filter(e -> e.getValue().equals(text)) + .findFirst() + .orElseThrow(() -> new MethodArgumentTypeMismatchException( + text, OrderState.class, "orderState", null, null))); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java new file mode 100644 index 000000000..9d2d97321 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/SpringDocApp153Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp153Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/TestController.java new file mode 100644 index 000000000..3771e2e3f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app153/TestController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app153; + +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.InitBinder; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Test controller. + */ +@RestController +class TestController { + + /** + * Init binder. + * + * @param dataBinder the data binder + */ + @InitBinder + public void initBinder(WebDataBinder dataBinder) { + dataBinder.registerCustomEditor(OrderState.class, new OrderStateMapper()); + } + + /** + * Method object. + * + * @param orderState the order state + * @return the object + */ + @GetMapping(value = { "/orders" }) + public Object method( + @RequestParam(value = "state", defaultValue = "finished") OrderState orderState) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/HelloController.java new file mode 100644 index 000000000..974ac26be --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/HelloController.java @@ -0,0 +1,97 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app154; + +import java.time.Instant; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Hello string. + * + * @return the string + */ + @GetMapping(path = "/") + public String hello() { + return "Hello world at " + Instant.now().toString(); + } + + /** + * Create. + * + * @param id the id + * @param o the o + */ + @PostMapping(value = "/persons") + public void create(@ParameterObject Long id, @RequestBody Object o) { + + } + + /** + * Createone. + * + * @param id the id + * @param o the o + */ + @PostMapping(value = "/personsone") + public void createone(Long id, @RequestBody Object o) { + + } + + /** + * Createtwo. + * + * @param id the id + */ + @PostMapping(value = "/createtwo") + public void createtwo(int id) { + + } + + /** + * Createthree. + * + * @param id the id + */ + @PostMapping(value = "/createthree") + public void createthree(Integer id) { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/OpenApiConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/OpenApiConfiguration.java new file mode 100644 index 000000000..59b8554cf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/OpenApiConfiguration.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app154; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.security.SecuritySchemes; + +/** + * The type Open api configuration. + */ +@OpenAPIDefinition(info = @Info(title = "toto", version = "1.0"), + security = { @SecurityRequirement(name = "basicAuth"), @SecurityRequirement(name = "bearerToken") } +) +@SecuritySchemes({ + @SecurityScheme( + name = "basicAuth", + type = SecuritySchemeType.HTTP, + scheme = "basic" + ), + @SecurityScheme( + name = "bearerToken", + type = SecuritySchemeType.HTTP, + scheme = "bearer", + bearerFormat = "JWT" + ) +}) +class OpenApiConfiguration { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java new file mode 100644 index 000000000..f058ba119 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app154/SpringDocApp154Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app154; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp154Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/AbstractIntParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/AbstractIntParameterObject.java new file mode 100644 index 000000000..21722d79a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/AbstractIntParameterObject.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +/** + * The type Abstract int parameter object. + * + * @param the type parameter + */ +class AbstractIntParameterObject { + + /** + * The Primitive base field. + */ + int primitiveBaseField; + + /** + * The Generic field. + */ + T genericField; + + /** + * Gets primitive base field. + * + * @return the primitive base field + */ + public int getPrimitiveBaseField() { + return primitiveBaseField; + } + + /** + * Sets primitive base field. + * + * @param primitiveBaseField the primitive base field + */ + public void setPrimitiveBaseField(int primitiveBaseField) { + this.primitiveBaseField = primitiveBaseField; + } + + /** + * Gets generic field. + * + * @return the generic field + */ + public T getGenericField() { + return genericField; + } + + /** + * Sets generic field. + * + * @param genericField the generic field + */ + public void setGenericField(T genericField) { + this.genericField = genericField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/AbstractParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/AbstractParameterObject.java new file mode 100644 index 000000000..641ae9161 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/AbstractParameterObject.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Abstract parameter object. + * + * @param the type parameter + */ +class AbstractParameterObject> { + + /** + * The Primitive base field. + */ + int primitiveBaseField; + + /** + * The Generic field. + */ + @Parameter(schema = @Schema(type = "string", allowableValues = { "ONE", "TWO" })) + T genericField; + + /** + * Gets primitive base field. + * + * @return the primitive base field + */ + public int getPrimitiveBaseField() { + return primitiveBaseField; + } + + /** + * Sets primitive base field. + * + * @param primitiveBaseField the primitive base field + */ + public void setPrimitiveBaseField(int primitiveBaseField) { + this.primitiveBaseField = primitiveBaseField; + } + + /** + * Gets generic field. + * + * @return the generic field + */ + public T getGenericField() { + return genericField; + } + + /** + * Sets generic field. + * + * @param genericField the generic field + */ + public void setGenericField(T genericField) { + this.genericField = genericField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteEnum.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteEnum.java new file mode 100644 index 000000000..dd1545bc5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteEnum.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + + +/** + * The enum Concrete enum. + */ +enum ConcreteEnum { + /** + *One concrete enum. + */ + ONE, + /** + *Two concrete enum. + */ + TWO + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteIntParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteIntParameterObject.java new file mode 100644 index 000000000..6dd625e79 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteIntParameterObject.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +/** + * The type Concrete int parameter object. + */ +class ConcreteIntParameterObject extends AbstractIntParameterObject { + + /** + * The Primitive concrete field. + */ + int primitiveConcreteField; + + /** + * Gets primitive concrete field. + * + * @return the primitive concrete field + */ + public int getPrimitiveConcreteField() { + return primitiveConcreteField; + } + + /** + * Sets primitive concrete field. + * + * @param primitiveConcreteField the primitive concrete field + */ + public void setPrimitiveConcreteField(int primitiveConcreteField) { + this.primitiveConcreteField = primitiveConcreteField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteParameterObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteParameterObject.java new file mode 100644 index 000000000..d42bc8242 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/ConcreteParameterObject.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +/** + * The type Concrete parameter object. + */ +class ConcreteParameterObject extends AbstractParameterObject { + + /** + * The Primitive concrete field. + */ + int primitiveConcreteField; + + /** + * Gets primitive concrete field. + * + * @return the primitive concrete field + */ + public int getPrimitiveConcreteField() { + return primitiveConcreteField; + } + + /** + * Sets primitive concrete field. + * + * @param primitiveConcreteField the primitive concrete field + */ + public void setPrimitiveConcreteField(int primitiveConcreteField) { + this.primitiveConcreteField = primitiveConcreteField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/HelloController.java new file mode 100644 index 000000000..713fb1679 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/HelloController.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Say hello response entity. + * + * @param test the test + * @return the response entity + */ + @GetMapping("/test1") + public ResponseEntity sayHello(@ParameterObject final ConcreteParameterObject test) { + System.out.println("Field B = " + test); + return new ResponseEntity("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + + /** + * Say hello response entity. + * + * @param test the test + * @return the response entity + */ + @GetMapping("/test2") + public ResponseEntity sayHello(@ParameterObject final ConcreteIntParameterObject test) { + System.out.println("Field B = " + test); + return new ResponseEntity("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java new file mode 100644 index 000000000..597ddf730 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app155/SpringDocApp155Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app155; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp155Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/HelloController.java new file mode 100644 index 000000000..c158e0eb4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/HelloController.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app156; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static io.swagger.v3.oas.annotations.enums.ParameterIn.QUERY; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + /** + * Hello string. + * + * @param user the user + * @return the string + */ + @GetMapping("/hello") + @Parameter(name = "someEnums", in = QUERY, description = "SomeEum decs", + array = @ArraySchema(schema = @Schema(implementation = SomeEnum.class))) + @Parameter(name = "textSet", in = QUERY, description = "First decs", + array = @ArraySchema(schema = @Schema(implementation = String.class))) + @Parameter(name = "someText", in = QUERY, description = "Second decs", + schema = @Schema(type = "string")) + public String hello(@Parameter(hidden = true) User user) { + String forReturn = "Hello "; + StringBuilder stringBuilder = new StringBuilder(forReturn); + + if (user.getSomeEnums() != null) { + for (SomeEnum some : user.getSomeEnums()) { + stringBuilder.append(some); + stringBuilder.append(" "); + } + } + + if (user.getSomeText() != null) { + for (String text : user.getTextSet()) { + stringBuilder.append(text); + stringBuilder.append(" "); + } + } + + if (user.getSomeText() != null) { + stringBuilder.append(user.getSomeText()); + } + + return stringBuilder.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/SomeEnum.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/SomeEnum.java new file mode 100644 index 000000000..c2b70fc2e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/SomeEnum.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app156; + +/** + * The enum Some enum. + */ +public enum SomeEnum { + /** + *First some enum. + */ + FIRST, + /** + *Second some enum. + */ + SECOND +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java new file mode 100644 index 000000000..c21e1b30a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/SpringDocApp156Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app156; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Tests Spring meta-annotations as method parameters + */ +class SpringDocApp156Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/User.java new file mode 100644 index 000000000..b9c97aec4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app156/User.java @@ -0,0 +1,103 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app156; + +import java.util.Set; + +/** + * The type User. + */ +class User { + /** + * The Some text. + */ + private String someText; + + /** + * The Text set. + */ + private Set textSet; + + /** + * The Some enums. + */ + private Set someEnums; + + /** + * Gets some text. + * + * @return the some text + */ + public String getSomeText() { + return someText; + } + + /** + * Sets some text. + * + * @param someText the some text + */ + public void setSomeText(String someText) { + this.someText = someText; + } + + /** + * Gets text set. + * + * @return the text set + */ + public Set getTextSet() { + return textSet; + } + + /** + * Sets text set. + * + * @param textSet the text set + */ + public void setTextSet(Set textSet) { + this.textSet = textSet; + } + + /** + * Gets some enums. + * + * @return the some enums + */ + public Set getSomeEnums() { + return someEnums; + } + + /** + * Sets some enums. + * + * @param someEnums the some enums + */ + public void setSomeEnums(Set someEnums) { + this.someEnums = someEnums; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/Bar.java new file mode 100644 index 000000000..60f2b7722 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/Bar.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +/** + * A class without a String in it + */ +class Bar { + /** + * The Child. + */ + private Object child; + + /** + * Gets child. + * + * @return the child + */ + public Object getChild() { + return this.child; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/Foo.java new file mode 100644 index 000000000..d46daa3d6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/Foo.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +/** + * A class with a String in it + */ +class Foo { + /** + * The Child. + */ + private String child; + + /** + * Gets child. + * + * @return the child + */ + public String getChild() { + return this.child; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/HelloController.java new file mode 100644 index 000000000..2dba96357 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Put Foo and Bar in the schema's components, make sure there is an ignored wrapper + * ({@code ResponseEntity}). + */ +@RestController +class HelloController { + + /** + * Gets foo. + * + * @return the foo + */ + @GetMapping("/foo") + public ResponseEntity getFoo() { + return new ResponseEntity(HttpStatus.OK); + } + + /** + * Gets bar. + * + * @return the bar + */ + @GetMapping("/bar") + public ResponseEntity getBar() { + return new ResponseEntity(HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java new file mode 100644 index 000000000..029eac331 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/SpringDocApp157Test.java @@ -0,0 +1,91 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +import java.util.ArrayList; + +import io.swagger.v3.core.converter.ModelConverters; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * This test is to make sure that a new model converter can access the parent of a type, even if + * the type is enclosed in an ignored wrapper. We test this by setting up a model converter which + * adds "stringy" to the "required" property of a schema's parent, when the sub schema is a String. + */ +class SpringDocApp157Test extends AbstractSpringDocTest { + + /** + * The Converters. + */ + private final ModelConverters converters = ModelConverters.getInstance(true); + + @Autowired + private StringyConverter stringyConverter; + + /** + * Unregister converter. + */ + @AfterEach + public void unregisterConverter() { + converters.removeConverter(stringyConverter); + } + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.components.schemas.Foo.required", is(new ArrayList() {{ + add("stringy"); + }}))) + .andExpect(jsonPath("$.components.schemas.Bar", not(hasProperty("required")))); + } + + /** + * The type Spring boot app. + */ + @SpringBootApplication + static class SpringBootApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/StringyConverter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/StringyConverter.java new file mode 100644 index 000000000..a3faba2a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app157/StringyConverter.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app157; + +import java.util.Iterator; + +import com.fasterxml.jackson.databind.JavaType; +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverterContext; +import io.swagger.v3.oas.models.media.Schema; +import org.springdoc.core.providers.ObjectMapperProvider; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + + +@Component +class StringyConverter implements ModelConverter { + + @Autowired + ObjectMapperProvider objectMapperProvider; + + public StringyConverter(ObjectMapperProvider objectMapperProvider) { + this.objectMapperProvider = objectMapperProvider; + } + + + @Override + public Schema resolve(AnnotatedType type, ModelConverterContext context, + Iterator chain) { + + JavaType javaType = objectMapperProvider.jsonMapper().constructType(type.getType()); + + if (javaType.getRawClass().equals(String.class)) { + type.getParent().addRequiredItem("stringy"); + } + return chain.next().resolve(type, context, chain); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/CommonFooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/CommonFooErrorHandler.java new file mode 100644 index 000000000..1c04b3c82 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/CommonFooErrorHandler.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * The type Common foo error handler. + */ +class CommonFooErrorHandler { + + /** + * On exception error dto. + * + * @param e the e + * @return the error dto + */ + @ExceptionHandler + @ResponseStatus(HttpStatus.CONFLICT) + public ErrorDTO onException(Exception e) { + return new ErrorDTO("Something wrong has happened"); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/ErrorDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/ErrorDTO.java new file mode 100644 index 000000000..1dad3f006 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/ErrorDTO.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +/** + * The type Error dto. + */ +class ErrorDTO { + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Error dto. + */ + public ErrorDTO() { + } + + /** + * Instantiates a new Error dto. + * + * @param message the message + */ + public ErrorDTO(String message) { + this.message = message; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/HelloController.java new file mode 100644 index 000000000..990de2b1d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) +class HelloController { + + /** + * Hello simple dto. + * + * @return the simple dto + */ + @GetMapping("/foo") + public SimpleDTO hello() { + return new SimpleDTO("foo"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SimpleDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SimpleDTO.java new file mode 100644 index 000000000..075abc466 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SimpleDTO.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +/** + * The type Simple dto. + */ +class SimpleDTO { + + /** + * The Payload. + */ + private String payload; + + /** + * Instantiates a new Simple dto. + */ + public SimpleDTO() { + } + + /** + * Instantiates a new Simple dto. + * + * @param payload the payload + */ + public SimpleDTO(String payload) { + this.payload = payload; + } + + /** + * Gets payload. + * + * @return the payload + */ + public String getPayload() { + return payload; + } + + /** + * Sets payload. + * + * @param payload the payload + */ + public void setPayload(String payload) { + this.payload = payload; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SpecificFooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SpecificFooErrorHandler.java new file mode 100644 index 000000000..0aa94ff4f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SpecificFooErrorHandler.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +import org.springframework.web.bind.annotation.ControllerAdvice; + +/** + * The type Specific foo error handler. + */ +@ControllerAdvice(assignableTypes = HelloController.class) +class SpecificFooErrorHandler extends CommonFooErrorHandler { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java new file mode 100644 index 000000000..e23eb73c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app158/SpringDocApp158Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app158; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 158 test. + */ +class SpringDocApp158Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/CustomException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/CustomException.java new file mode 100644 index 000000000..fdc74dbc0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/CustomException.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +/** + * The type Custom exception. + */ +class CustomException extends RuntimeException { + /** + * Instantiates a new Custom exception. + * + * @param message the message + */ + public CustomException(String message) { + super(message); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/FooBean.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/FooBean.java new file mode 100644 index 000000000..c9b722b99 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/FooBean.java @@ -0,0 +1,93 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +import com.fasterxml.jackson.annotation.JsonView; + +/** + * The type Foo bean. + */ +class FooBean { + /** + * The Message. + */ + @JsonView(Views.View2.class) + private String message; + + /** + * The Code. + */ + @JsonView(Views.View1.class) + private int code; + + /** + * Instantiates a new Foo bean. + * + * @param message the message + * @param code the code + */ + public FooBean(String message, int code) { + this.message = message; + this.code = code; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * Gets code. + * + * @return the code + */ + public int getCode() { + return code; + } + + /** + * Sets code. + * + * @param code the code + */ + public void setCode(int code) { + this.code = code; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/FooErrorHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/FooErrorHandler.java new file mode 100644 index 000000000..7e6939ebc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/FooErrorHandler.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +import com.fasterxml.jackson.annotation.JsonView; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * The type Foo error handler. + */ +@ControllerAdvice(assignableTypes = HelloController.class) +class FooErrorHandler { + + /** + * Store assignment publishing error response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler + @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR) + @JsonView(Views.View1.class) + public ResponseEntity storeAssignmentPublishingError(Exception e) { + return new ResponseEntity<>(new FooBean("INTERNAL_SERVER_ERROR", 500), HttpStatus.INTERNAL_SERVER_ERROR); + } + + /** + * Store assignment publishing error response entity. + * + * @param e the e + * @return the response entity + */ + @ExceptionHandler + @ResponseStatus(value = HttpStatus.BAD_REQUEST) + @JsonView(Views.View2.class) + public ResponseEntity storeAssignmentPublishingError(CustomException e) { + return new ResponseEntity<>(new FooBean("BAD Request", 400), HttpStatus.BAD_REQUEST); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/HelloController.java new file mode 100644 index 000000000..65dc96c49 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +@OpenAPIDefinition(info = @Info(title = "API Examples", version = "1.0"), tags = @Tag(name = "Operations")) +class HelloController { + + /** + * Create string. + * + * @param foo the foo + * @return the string + */ + @PostMapping("/foo") + public String create(@RequestBody String foo) { + return "foo"; + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java new file mode 100644 index 000000000..52307664d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/SpringDocApp159Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 159 test. + */ +class SpringDocApp159Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/Views.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/Views.java new file mode 100644 index 000000000..d8cac5486 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app159/Views.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app159; + +/** + * The type Views. + */ +class Views { + /** + * The type View 1. + */ + public static class View1 { + } + + /** + * The type View 2. + */ + public static class View2 extends View1 { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app16/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app16/HelloController.java new file mode 100644 index 000000000..0d65d30b8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app16/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java new file mode 100644 index 000000000..47e6ab3f8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app16/SpringDocApp16Test.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app16; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.test.context.TestPropertySource; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 16 test. + */ +@TestPropertySource(properties = "springdoc.api-docs.enabled=false") +class SpringDocApp16Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + .andExpect(status().isNotFound()); + } + + /** + * The type Spring doc test app. + */ + @SpringBootConfiguration + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app160/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app160/HelloController.java new file mode 100644 index 000000000..4bb82def1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app160/HelloController.java @@ -0,0 +1,111 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app160; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Do something interesting error response. + * + * @return the error response + */ + @PostMapping("test") + public ErrorResponse doSomethingInteresting() { + return null; + } + + /** + * Bundle api grouped open api. + * + * @return the grouped open api + */ + @Bean + public GroupedOpenApi bundleApi() { + return GroupedOpenApi.builder() + .group("test") + .pathsToMatch("/**") + .build(); + } + + /** + * Translator resource bundle message source. + * + * @return the resource bundle message source + */ + @Bean + public ResourceBundleMessageSource translator() { + ResourceBundleMessageSource source = new ResourceBundleMessageSource(); + source.setBasenames("swagger-message-160"); + source.setUseCodeAsDefaultMessage(true); + source.setDefaultEncoding("utf-8"); + return source; + } + + /** + * The type Swagger message. + */ + @PropertySource("classpath:swagger-message-160.properties") + @Configuration + class SwaggerMessage {} + + /** + * The type Error response. + */ + @Schema(description = "${ErrorResponse}") + class ErrorResponse { + + /** + * The Error code. + */ + @Schema(description = "${ErrorCode}", required = true) + @JsonProperty + private Integer errorCode; + + /** + * The Error message. + */ + @Schema(description = "${ErrorMessage}") + @JsonProperty + private String errorMessage; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java new file mode 100644 index 000000000..77aad6817 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app160/SpringDocApp160Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app160; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 160 test. + */ +@TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true") +class SpringDocApp160Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app161/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app161/HelloController.java new file mode 100644 index 000000000..640a7ba8c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app161/HelloController.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app161; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Add response entity. + * + * @param content the content + * @return the response entity + * @throws Exception the exception + */ + @Operation(summary = "add") + @PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ResponseEntity add(@Parameter(description = "content") @RequestPart(value = "content") String content) throws Exception { + return null; + } + + + /** + * Add 2 response entity. + * + * @param content the content + * @param type the type + * @return the response entity + */ + @Operation(summary = "add2") + @PostMapping(value = "/add2", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ResponseEntity add2( + @Parameter(description = "content") @RequestPart(value = "content") String content, + @RequestPart(value = "type") String type + ) { + return null; + } + + /** + * Test. + * + * @param strValue the str value + * @param intValue the int value + */ + @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Operation(summary = "test") + public void test(@RequestPart("strValue") String strValue, + @RequestPart("intValue") Integer intValue) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java new file mode 100644 index 000000000..93a326b63 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app161/SpringDocApp161Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app161; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 161 test. + */ +class SpringDocApp161Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java new file mode 100644 index 000000000..cc45b56be --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/SpringDocApp162Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app162; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 162 test. + */ +@TestPropertySource(properties = "springdoc.override-with-generic-response=true") +class SpringDocApp162Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("SpringShop API") + .version("v1") + .description("The description of the api")); + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/exception/NoResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/exception/NoResultException.java new file mode 100644 index 000000000..057134aa4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/exception/NoResultException.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app162.exception; + +public class NoResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/exception/NonUniqueResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/exception/NonUniqueResultException.java new file mode 100644 index 000000000..4dbb567ce --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/exception/NonUniqueResultException.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app162.exception; + +/** + * Multiple results found instead of a unique result. + */ +public class NonUniqueResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/JavadocOnlyRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/JavadocOnlyRestController.java new file mode 100644 index 000000000..acabc68b6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/JavadocOnlyRestController.java @@ -0,0 +1,116 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app162.rest; + +import java.util.List; + +import test.org.springdoc.api.v31.app162.exception.NoResultException; +import test.org.springdoc.api.v31.app162.exception.NonUniqueResultException; +import test.org.springdoc.api.v31.app162.rest.dto.JavadocOnlyRestDto; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * This is the {@code JavadocOnlyRestController} class javadoc. + */ +@RestController +@RequestMapping("/javadoc-only") +class JavadocOnlyRestController { + /** + * This is the create method's javadoc. + * The method's signature: {@code #create(JavadocOnlyRestDto)} + * + * @param input the {@code @param input} javadoc for the {@code #create(JavadocOnlyRestDto)} method + * @return the {@code @return} javadoc for the {@code #create(JavadocOnlyRestDto)} method + */ + @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.CREATED) + public ResponseEntity create(@RequestBody JavadocOnlyRestDto input) { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the update method's javadoc. + * The method's signature: {@code #update(String, JavadocOnlyRestDto)} + * + * @param guid the {@code @param input} javadoc for the {@code #update(String, JavadocOnlyRestDto)} method + * @return the {@code @return} javadoc for the {@code #update(String, JavadocOnlyRestDto)} method + */ + @PutMapping(path = "{guid}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.OK) + public ResponseEntity update(@PathVariable String guid, @RequestBody JavadocOnlyRestDto input) throws NoResultException { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the list method's javadoc. + * The method's signature: {@code #list()} + * + * @return the {@code @return} javadoc for the {@code #list()} method + */ + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity> list() { + return new ResponseEntity<>(HttpStatus.OK); + } + + /** + * This is the find method's javadoc. + * The method's signature: {@code #find(String)} + * + * @param guid the {@code @param guid} javadoc for the {@code #find(String)} method + * @return the {@code @return} javadoc for the {@code #find(String)} method + * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #find(String)} method + */ + @GetMapping(path = "{guid}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity find(@PathVariable String guid) throws NoResultException { + return new ResponseEntity<>(HttpStatus.OK); + } + + /** + * This is the findStartsBy method's javadoc. + * The method's signature: {@code #findStartsBy(String)} + * + * @param prefix the {@code @param prefix} javadoc for the {@code #findStartsBy(String)} method + * @return the {@code @return} javadoc for the {@code #findStartsBy(String)} method + * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #findStartsBy(String)} method + * @throws NonUniqueResultException the {@code @throws NonUniqueResultException} javadoc for the {@code #findStartsBy(String)} method + */ + @GetMapping(path = "startsBy/{prefix}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findStartsBy(@PathVariable String prefix) throws NoResultException, NonUniqueResultException { + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/dto/JavadocOnlyRestDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/dto/JavadocOnlyRestDto.java new file mode 100644 index 000000000..aaeb78393 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/dto/JavadocOnlyRestDto.java @@ -0,0 +1,85 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app162.rest.dto; + +/** + * This is the {@code JavadocOnlyRestDto} class javadoc. + */ +public class JavadocOnlyRestDto { + /** + * This is the private {@code #guid} field's javadoc. + */ + private String guid; + + /** + * This is the private {@code #inner} field's javadoc. + * + * This javadoc description is ignored by the REST documentation: + * the {@code $ref} can't have a description as any sibling elements of a $ref are ignored. + */ + private JavadocOnlyStaticInnerRestDto inner; + + public JavadocOnlyRestDto() { + } + + public String getGuid() { + return guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public JavadocOnlyStaticInnerRestDto getInner() { + return inner; + } + + public void setInner(JavadocOnlyStaticInnerRestDto inner) { + this.inner = inner; + } + + /** + * This is the {@code JavadocOnlyStaticInnerRestDto} class javadoc. + */ + public static class JavadocOnlyStaticInnerRestDto { + /** + * This is the private {@code #content} field's javadoc. + */ + private String content; + + public JavadocOnlyStaticInnerRestDto() { + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/util/RestExceptionHandler.java new file mode 100644 index 000000000..24a644d57 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app162/rest/util/RestExceptionHandler.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app162.rest.util; + +import test.org.springdoc.api.v31.app162.exception.NoResultException; +import test.org.springdoc.api.v31.app162.exception.NonUniqueResultException; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * REST exception handlers. + * + * This javadoc description is ignored by the REST documentation. + */ +@RestControllerAdvice +class RestExceptionHandler { + /** + * REST exception handler for {@code NoResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method + */ + @ExceptionHandler(NoResultException.class) + @ResponseStatus(code = HttpStatus.NOT_FOUND) + public ResponseEntity handleNotFoundException(NoResultException exception) { + return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); + } + + /** + * REST exception handler for {@code NonUniqueResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method + */ + @ExceptionHandler(NonUniqueResultException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { + return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java new file mode 100644 index 000000000..8fe6958b9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/SpringDocApp163Test.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 163 test. + */ +@TestPropertySource(properties = "springdoc.override-with-generic-response=true") +class SpringDocApp163Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("SpringShop API") + .version("v1") + .description("The description of the api")); + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/exception/NoResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/exception/NoResultException.java new file mode 100644 index 000000000..1c4fb94e1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/exception/NoResultException.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163.exception; + +public class NoResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/exception/NonUniqueResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/exception/NonUniqueResultException.java new file mode 100644 index 000000000..4bc6620cb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/exception/NonUniqueResultException.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163.exception; + +/** + * Multiple results found instead of a unique result. + */ +public class NonUniqueResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/AnnotationOverrideForJavadocRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/AnnotationOverrideForJavadocRestController.java new file mode 100644 index 000000000..c2a8968d6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/AnnotationOverrideForJavadocRestController.java @@ -0,0 +1,131 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163.rest; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; +import test.org.springdoc.api.v31.app163.exception.NoResultException; +import test.org.springdoc.api.v31.app163.exception.NonUniqueResultException; +import test.org.springdoc.api.v31.app163.rest.dto.AnnotationOverrideForJavadocRestDto; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * This is the {@code AnnotationOverrideForJavadocRestController} class javadoc. + */ +@Tag( + name = "annotation-override", + description = "Description for the tag." +) +@RestController +@RequestMapping("/annotation-override") +class AnnotationOverrideForJavadocRestController { + /** + * This is the update method's javadoc. + * The method's signature: {@code #update(String, AnnotationOverrideForJavadocRestDto)} + * + * @param guid the {@code @param input} javadoc for the {@code #update(String, AnnotationOverrideForJavadocRestDto)} method + * @return the {@code @return} javadoc for the {@code #update(String, AnnotationOverrideForJavadocRestDto)} method + */ + @Operation( + summary = "Summary for #update(String, AnnotationOverrideForJavadocRestDto)" + ) + @PutMapping(path = "{guid}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.OK) + public ResponseEntity update(@PathVariable String guid, @RequestBody AnnotationOverrideForJavadocRestDto input) throws NoResultException { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the create method's javadoc. + * The method's signature: {@code #create(AnnotationOverrideForJavadocRestDto)} + * + * @param input the {@code @param input} javadoc for the {@code #create(AnnotationOverrideForJavadocRestDto)} method + * @return the {@code @return} javadoc for the {@code #create(AnnotationOverrideForJavadocRestDto)} method + */ + @Operation( + summary = "Summary for #create(AnnotationOverrideForJavadocRestDto)", + description = "Description for #create(AnnotationOverrideForJavadocRestDto)", + requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "Request body for #create(AnnotationOverrideForJavadocRestDto)" + ), + responses = { + @ApiResponse( + description = "API Response 201 for #create(AnnotationOverrideForJavadocRestDto)" + ) + } + ) + @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.CREATED) + public ResponseEntity create(@RequestBody AnnotationOverrideForJavadocRestDto input) { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the findStartsBy method's javadoc. + * The method's signature: {@code #findStartsBy(String)} + * + * @param prefix the {@code @param prefix} javadoc for the {@code #findStartsBy(String)} method + * @return the {@code @return} javadoc for the {@code #findStartsBy(String)} method + * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #findStartsBy(String)} method + * @throws NonUniqueResultException the {@code @throws NonUniqueResultException} javadoc for the {@code #findStartsBy(String)} method + */ + @Operation( + parameters = { + @Parameter( + name = "prefix", + description = "Parameter prefix" + ) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "API Response 200 for #findStartsBy(prefix)" + ), + @ApiResponse( + responseCode = "400", + description = "API Response 400 for #findStartsBy(prefix)" + ) + } + ) + @GetMapping(path = "startsBy/{prefix}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findStartsBy(@PathVariable String prefix) throws NoResultException, NonUniqueResultException { + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java new file mode 100644 index 000000000..48eecb048 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java @@ -0,0 +1,86 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163.rest.dto; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * This is the {@code AnnotationOverrideForJavadocRestDto} class javadoc. + */ +@Schema( + title = "annotation-override-dto", + description = "Description for the tag." +) +public class AnnotationOverrideForJavadocRestDto { + /** + * This is the private {@code #guid} field's javadoc. + */ + @Schema(description = "Description for the #guid field") + private String guid; + + /** + * This is the private {@code #inner} field's javadoc. + *

+ * This javadoc description is ignored by the REST documentation: + * the {@code $ref} can't have a description as any sibling elements of a $ref are ignored. + */ + private AnnotationOverrideForJavadocStaticInnerRestDto inner; + + public String getGuid() { + return guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public AnnotationOverrideForJavadocStaticInnerRestDto getInner() { + return inner; + } + + public void setInner(AnnotationOverrideForJavadocStaticInnerRestDto inner) { + this.inner = inner; + } + + /** + * This is the {@code AnnotationOverrideForJavadocStaticInnerRestDto} class javadoc. + */ + public static class AnnotationOverrideForJavadocStaticInnerRestDto { + /** + * This is the private {@code #content} field's javadoc. + */ + private String content; + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java new file mode 100644 index 000000000..047522cc5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163.rest.dto; + +/** + * This is the {@code AnnotationOverrideForJavadocRestDto2} class javadoc. + */ +class AnnotationOverrideForJavadocRestDto2 { + /** + * This is the private {@code #guid3} field's javadoc. + */ + private String guid3; + + public String getGuid3() { + return guid3; + } + + public void setGuid3(String guid3) { + this.guid3 = guid3; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java new file mode 100644 index 000000000..6d476910e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163.rest.dto; + +/** + * This is the {@code AnnotationOverrideForJavadocRestDto3} class javadoc. + */ +class AnnotationOverrideForJavadocRestDto3 { + /** + * This is the private {@code #guid4} field's javadoc. + */ + private String guid4; + + public String getGuid4() { + return guid4; + } + + public void setGuid4(String guid4) { + this.guid4 = guid4; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/util/RestExceptionHandler.java new file mode 100644 index 000000000..980141e06 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app163/rest/util/RestExceptionHandler.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app163.rest.util; + +import test.org.springdoc.api.v31.app163.exception.NoResultException; +import test.org.springdoc.api.v31.app163.exception.NonUniqueResultException; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * REST exception handlers. + * + * This javadoc description is ignored by the REST documentation. + */ +@RestControllerAdvice +class RestExceptionHandler { + /** + * REST exception handler for {@code NoResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method + */ + @ExceptionHandler(NoResultException.class) + @ResponseStatus(code = HttpStatus.NOT_FOUND) + public ResponseEntity handleNotFoundException(NoResultException exception) { + return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); + } + + /** + * REST exception handler for {@code NonUniqueResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method + */ + @ExceptionHandler(NonUniqueResultException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { + return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java new file mode 100644 index 000000000..7b1b89953 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/SpringDocApp164Test.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app164; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc app 164 test. + */ +class SpringDocApp164Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("SpringShop API") + .version("v1") + .description("The description of the api")); + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/SpringDocJavadocProviderTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/SpringDocJavadocProviderTest.java new file mode 100644 index 000000000..7e914307d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/SpringDocJavadocProviderTest.java @@ -0,0 +1,87 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app164; + +import java.util.stream.Stream; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.springdoc.core.providers.JavadocProvider; +import org.springdoc.core.providers.SpringDocJavadocProvider; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +class SpringDocJavadocProviderTest { + private JavadocProvider javadocProvider; + + static Stream getFirstSentence() { + return Stream.of( + arguments(null, null), + arguments("", ""), + arguments("A b c. D e f", "A b c."), + arguments("A b c", "A b c"), + arguments("A b c

D e f", "A b c"), + arguments("A b c. D

e f", "A b c"), + arguments("A b c

D. e f", "A b c"), + arguments("

A b c

D e f", "A b c"), + arguments("

A b c. D

e f", "A b c"), + arguments("A b c.d e f", "A b c.d e f") + ); + } + + /** + * Edge cases not handled by the implementation. + */ + static Stream getFirstSentenceNotHandled() { + return Stream.of( + arguments("

A b c

d e f

", "A b c") + ); + } + + @BeforeEach + public void setup() { + javadocProvider = new SpringDocJavadocProvider(); + } + + @ParameterizedTest + @MethodSource + public void getFirstSentence(String javadoc, String expectedFirstSentence) { + assertThat(javadocProvider.getFirstSentence(javadoc)) + .isEqualTo(expectedFirstSentence); + } + + @ParameterizedTest + @MethodSource + public void getFirstSentenceNotHandled(String javadoc, String correctFirstSentence) { + assertThat(javadocProvider.getFirstSentence(javadoc)) + .isNotEqualTo(correctFirstSentence); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/exception/NoResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/exception/NoResultException.java new file mode 100644 index 000000000..f63a57ef5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/exception/NoResultException.java @@ -0,0 +1,30 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app164.exception; + +public class NoResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/exception/NonUniqueResultException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/exception/NonUniqueResultException.java new file mode 100644 index 000000000..7a247ff6e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/exception/NonUniqueResultException.java @@ -0,0 +1,33 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app164.exception; + +/** + * Multiple results found instead of a unique result. + */ +public class NonUniqueResultException extends RuntimeException { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/rest/NoGenericOverrideRestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/rest/NoGenericOverrideRestController.java new file mode 100644 index 000000000..1d4641525 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/rest/NoGenericOverrideRestController.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app164.rest; + +import test.org.springdoc.api.v31.app164.exception.NoResultException; +import test.org.springdoc.api.v31.app164.exception.NonUniqueResultException; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * This is the {@code JavadocOnlyRestController} class javadoc. + */ +@RestController +@RequestMapping("/no-generic-override") +class NoGenericOverrideRestController { + /** + * This is the create method's javadoc. + * The method's signature: {@code #create(JavadocOnlyRestDto)} + * + * @param input the {@code @param input} javadoc for the {@code #create(JavadocOnlyRestDto)} method + * @return the {@code @return} javadoc for the {@code #create(JavadocOnlyRestDto)} method + */ + @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.CREATED) + public ResponseEntity create(@RequestBody String input) { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the findStartsBy method's javadoc. + * The method's signature: {@code #findStartsBy(String)} + * + * @param prefix the {@code @param prefix} javadoc for the {@code #findStartsBy(String)} method + * @return the {@code @return} javadoc for the {@code #findStartsBy(String)} method + * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #findStartsBy(String)} method + * @throws NonUniqueResultException the {@code @throws NonUniqueResultException} javadoc for the {@code #findStartsBy(String)} method + */ + @GetMapping(path = "startsBy/{prefix}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findStartsBy(@PathVariable String prefix) throws NoResultException, NonUniqueResultException { + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/rest/util/RestExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/rest/util/RestExceptionHandler.java new file mode 100644 index 000000000..9cca4adcc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app164/rest/util/RestExceptionHandler.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app164.rest.util; + +import test.org.springdoc.api.v31.app164.exception.NoResultException; +import test.org.springdoc.api.v31.app164.exception.NonUniqueResultException; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * REST exception handlers. + * + * This javadoc description is ignored by the REST documentation. + */ +@RestControllerAdvice +class RestExceptionHandler { + /** + * REST exception handler for {@code NoResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method + */ + @ExceptionHandler(NoResultException.class) + @ResponseStatus(code = HttpStatus.NOT_FOUND) + public ResponseEntity handleNotFoundException(NoResultException exception) { + return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); + } + + /** + * REST exception handler for {@code NonUniqueResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method + */ + @ExceptionHandler(NonUniqueResultException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { + return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/ConcreteSubclassFromGeneric.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/ConcreteSubclassFromGeneric.java new file mode 100644 index 000000000..45fb20c50 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/ConcreteSubclassFromGeneric.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +class ConcreteSubclassFromGeneric extends SimpleGeneric { + + /** + * Return the top name + */ + private String topName; + + public String getTopName() { + return topName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/HelloController.java new file mode 100644 index 000000000..9e9a4451b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +class HelloController { + @GetMapping("/nested") + public ResponseEntity nested(@ParameterObject final SimpleOuterClass filter) { + return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + + @GetMapping("/nestedTypeErasureGeneric") + public ResponseEntity nestedTypeErasureGeneric(@ParameterObject final SimpleGeneric filter) { + return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); + } + + @GetMapping("/nestedReifiableGeneric") + public ResponseEntity nestedReifiableGeneric(@ParameterObject final ConcreteSubclassFromGeneric filter) { + return new ResponseEntity<>("{\"Say\": \"Hello\"}", HttpStatus.OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/MyData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/MyData.java new file mode 100644 index 000000000..e404105f7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/MyData.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +class MyData { + + /** + * Returns the first name + */ + private String firstName; + + /** + * Returns the max number + */ + private Integer maxNumber; + + public Integer getMaxNumber() { + return maxNumber; + } + + public String getFirstName() { + return firstName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleGeneric.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleGeneric.java new file mode 100644 index 000000000..28aab7f4a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleGeneric.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +class SimpleGeneric { + + /** + * Returns name + */ + private String name; + + /** + * Returns the generic child + */ + private T child; + + public T getChild() { + return child; + } + + public String getName() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleInnerClass.java new file mode 100644 index 000000000..cdf964cb5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleInnerClass.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +class SimpleInnerClass { + + /** + * Returns the inner inner class + */ + private SimpleInnerInnerClass innerInnerClass; + + /** + * Returns the boolean name + */ + private Boolean name; + + /** + * Returns the max number + */ + private Integer maxNumber; + + public Integer getMaxNumber() { + return maxNumber; + } + + public Boolean getName() { + return name; + } + + public SimpleInnerInnerClass getInnerInnerClass() { + return innerInnerClass; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleInnerInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleInnerInnerClass.java new file mode 100644 index 000000000..841adc1d5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleInnerInnerClass.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +class SimpleInnerInnerClass { + /** + * Returns the name of the inner inner class + */ + Boolean name; + + /** + * Returns the maxNumber of the inner inner class + */ + private Integer maxNumber; + + public Integer getMaxNumber() { + return maxNumber; + } + + public Boolean getName() { + return name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleOuterClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleOuterClass.java new file mode 100644 index 000000000..9d8a462a0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SimpleOuterClass.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +class SimpleOuterClass { + + /** + * Returns the name of the outer class + */ + private String name; + + /** + * Returns the inner class + */ + private SimpleInnerClass innerClass; + + public String getName() { + return name; + } + + public SimpleInnerClass getInnerClass() { + return innerClass; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java new file mode 100644 index 000000000..79fe0bb03 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app166/SpringDocApp166Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app166; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 165 test. + */ +class SpringDocApp166Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app167/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app167/HelloController.java new file mode 100644 index 000000000..e9c986755 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app167/HelloController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app167; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + @RequestMapping("/process") + public void process() { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java new file mode 100644 index 000000000..87b08a283 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app167/SpringDocApp167Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app167; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 167 test. + */ +class SpringDocApp167Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/DescriptionFieldInRequestBodyIsNullController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/DescriptionFieldInRequestBodyIsNullController.java new file mode 100644 index 000000000..2eb6efeca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/DescriptionFieldInRequestBodyIsNullController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app168; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * If the RequestBody description field is null, get the description from the javadoc. + */ +@RestController +@RequestMapping("description-in-requestbody-is-null") +class DescriptionFieldInRequestBodyIsNullController { + + /** + * Person person. + * + * @param person the person + */ + @PostMapping + public void person( + @io.swagger.v3.oas.annotations.parameters.RequestBody(content = @Content(schema = @Schema(implementation = Person.class))) @RequestBody Person person) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/Person.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/Person.java new file mode 100644 index 000000000..c7ee1fd9f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/Person.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app168; + +/** + * The type Person. + */ +class Person { + /** + * The Id. + */ + private long id; + + /** + * Gets id. + * + * @return the id + */ + public long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(long id) { + this.id = id; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java new file mode 100644 index 000000000..593383161 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app168/SpringDocApp168Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app168; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 168 test. + */ +class SpringDocApp168Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/RecordController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/RecordController.java new file mode 100644 index 000000000..b42b79b5a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/RecordController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app169; + +import org.springdoc.core.annotations.ParameterObject; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("record") +class RecordController { + @GetMapping + public SimpleOuterClass index(@ParameterObject SimpleOuterClass filter) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SimpleInnerClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SimpleInnerClass.java new file mode 100644 index 000000000..197b464c7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SimpleInnerClass.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app169; + +/** + * simple inner class + * + * @param name the boolean name + * @param maxNumber the max number + */ +public record SimpleInnerClass(Boolean name, Integer maxNumber) { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SimpleOuterClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SimpleOuterClass.java new file mode 100644 index 000000000..c91fa83f1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SimpleOuterClass.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app169; + +/** + * simple outer class + * + * @param name the name of the outer class + * @param simpleInnerClass the inner class + */ +public record SimpleOuterClass(String name, SimpleInnerClass simpleInnerClass) { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java new file mode 100644 index 000000000..c0d9ea89c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app169/SpringDocApp169Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app169; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 169 test. + */ +class SpringDocApp169Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app17/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app17/HelloController.java new file mode 100644 index 000000000..e2b6bb9c7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app17/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app17; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping(value = "/persons") + public void persons(@Valid @RequestParam @Size(min = 4, max = 6) String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java new file mode 100644 index 000000000..9bdca5cd7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app17/SpringDocApp17Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app17; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 17 test. + */ +class SpringDocApp17Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Animal.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Animal.java new file mode 100644 index 000000000..ab8e55e4f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Animal.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app170; + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Interface of the Animal. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "dog"), + @JsonSubTypes.Type(value = Cat.class, name = "cat"), +}) +@Schema(description = "Represents an Animal class.") +public interface Animal {} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/BasicController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/BasicController.java new file mode 100644 index 000000000..cd5141d80 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/BasicController.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app170; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(path = "/") +class BasicController { + + @GetMapping("/test1") + @Operation(summary = "get1", description = "Provides an animal.") + public Animal get1() { + + return new Dog("Foo", 12); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Cat.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Cat.java new file mode 100644 index 000000000..d141ceefd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Cat.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app170; + + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema +class Cat implements Animal { + + private Integer speed; + + public Cat(Integer speed) { + this.speed = speed; + } + + public Integer getSpeed() { + return speed; + } + + public void setSpeed(Integer speed) { + this.speed = speed; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Dog.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Dog.java new file mode 100644 index 000000000..d1b3b5da0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/Dog.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app170; + + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "Represents a Dog class.") +class Dog implements Animal { + + private String name; + + private Integer age; + + public Dog(String name, Integer age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java new file mode 100644 index 000000000..8d3c9b2a2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app170/SpringDocApp170Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app170; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 193 test. + */ +class SpringDocApp170Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/HelloController.java new file mode 100644 index 000000000..55dcac2c3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app171; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * PersonProjection interface. + * + * @return the PersonProjection + */ + @GetMapping(value = "/persons") + public PersonProjection persons() { + return new PersonDTO(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/PersonDTO.java new file mode 100644 index 000000000..7aae78084 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/PersonDTO.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app171; + +/** + * Simulate a dynamically generated class that implements the PersonProjection interface. + */ +class PersonDTO implements PersonProjection { + private String email; + + private String firstName; + + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(final String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/PersonProjection.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/PersonProjection.java new file mode 100644 index 000000000..a84ba422f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/PersonProjection.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app171; + +/** + * The type PersonProjection dto interface. + */ +public interface PersonProjection { + /** + * The Email. + * + */ + String getEmail(); + + /** + * The First name. + * + */ + String getFirstName(); + + /** + * The Last name. + * + */ + String getLastName(); +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java new file mode 100644 index 000000000..4d68deca3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app171/SpringDocApp171Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app171; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 193 test. + */ +class SpringDocApp171Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app172/JavadocPropertyCustomizerTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app172/JavadocPropertyCustomizerTest.java new file mode 100644 index 000000000..eef428098 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app172/JavadocPropertyCustomizerTest.java @@ -0,0 +1,144 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app172; + +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.lang.reflect.Field; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import javax.tools.JavaCompiler; +import javax.tools.ToolProvider; + +import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledForJreRange; +import org.junit.jupiter.api.condition.JRE; +import org.junit.jupiter.api.io.TempDir; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.springdoc.core.customizers.JavadocPropertyCustomizer; +import org.springdoc.core.providers.JavadocProvider; +import org.springdoc.core.providers.ObjectMapperProvider; +import org.springdoc.core.providers.SpringDocJavadocProvider; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Tests for {@link JavadocPropertyCustomizer}. + */ +class JavadocPropertyCustomizerTest { + @TempDir + private File tempDir; + + private JavadocProvider javadocProvider; + + @Mock + private ObjectMapperProvider objectMapperProvider; + + private JavadocPropertyCustomizer javadocPropertyCustomizer; + + @BeforeEach + void setup() { + MockitoAnnotations.openMocks(this); + this.javadocProvider = new SpringDocJavadocProvider(); + this.javadocPropertyCustomizer = new JavadocPropertyCustomizer(javadocProvider, objectMapperProvider); + } + + + /** + * Tests for {@link JavadocPropertyCustomizer#setJavadocDescription(Class, List, List, Schema)}. + */ + @Nested + class setJavadocDescription { + @Test + @EnabledForJreRange(min = JRE.JAVA_17) + void ifRecordObjectShouldGetField() throws IOException, ClassNotFoundException, IntrospectionException { + File recordObject = new File(tempDir, "RecordObject.java"); + try (PrintWriter writer = new PrintWriter(new FileWriter(recordObject))) { + writer.println("/**"); + writer.println(" * Record Object"); + writer.println(" *"); + writer.println(" * @param id the id"); + writer.println(" * @param name the name"); + writer.println(" */"); + writer.println("public record RecordObject(String id, String name){"); + writer.println("}"); + } + File recordObjectJavadocJson = new File(tempDir, "RecordObject__Javadoc.json"); + try (PrintWriter writer = new PrintWriter(new FileWriter(recordObjectJavadocJson))) { + writer.print("{"); + writer.print("\"doc\":\"Record Object\\n\\n @param id the id\\n @param name the name\","); + writer.print("\"fields\":[],"); + writer.print("\"methods\":[],"); + writer.print("\"constructors\":[]"); + writer.println("}"); + } + + String[] args = { + recordObject.getAbsolutePath() + }; + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + int r = compiler.run(null, null, null, args); + if (r != 0) { + throw new IllegalStateException("Compilation failed"); + } + URL[] urls = { tempDir.toURI().toURL() }; + ClassLoader loader = URLClassLoader.newInstance(urls); + + Class cls = loader.loadClass("RecordObject"); + + List fields = Arrays.asList(cls.getFields()); + + Schema existingSchema = new ObjectSchema().name("RecordObject") + .addProperty("id", new StringSchema().name("id")) + .addProperty("name", new StringSchema().name("name")); + + List propertyDescriptors = Arrays.asList(Introspector.getBeanInfo(cls).getPropertyDescriptors()); + javadocPropertyCustomizer.setJavadocDescription(cls, fields, propertyDescriptors, existingSchema,false); + + assertEquals("Record Object", existingSchema.getDescription()); + Map properties = existingSchema.getProperties(); + assertEquals(2, properties.size()); + assertEquals("the id", properties.get("id").getDescription()); + assertEquals("the name", properties.get("name").getDescription()); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/Example.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/Example.java new file mode 100644 index 000000000..5faa64638 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/Example.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app173; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The Example object + */ +@Schema +class Example { + + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/ExampleController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/ExampleController.java new file mode 100644 index 000000000..7b387cfae --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/ExampleController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app173; + +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.HttpStatus.OK; + +/** + * The Example Controller + */ +@RestController +class ExampleController { + + @PostMapping("/example") + @Operation(summary = "insert example", description = "Allows to insert an example") + public ResponseEntity postExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "${example.description}") @RequestBody Example example) { + return new ResponseEntity<>(UUID.randomUUID(), OK); + } + + @PutMapping("/example") + @Operation(summary = "update example", description = "Allows to update an example") + public ResponseEntity putExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "${example2.description:Default description for example}") @RequestBody Example example) { + return new ResponseEntity<>(UUID.randomUUID(), OK); + } + + @PatchMapping("/example") + @Operation(summary = "patch example", description = "Allows to patch an example") + public ResponseEntity patchExample(@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Description without the use of variables") @RequestBody Example example) { + return new ResponseEntity<>(UUID.randomUUID(), OK); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java new file mode 100644 index 000000000..a65457aa0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app173/SpringDocApp173Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app173; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 173 test. + */ +@TestPropertySource(properties = "example.description=The example object") +class SpringDocApp173Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/ExampleController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/ExampleController.java new file mode 100644 index 000000000..2bd1b3343 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/ExampleController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app174; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The Example Controller + */ +@RestController +class ExampleController { + + @PostMapping + public Test post(){ + return null; + } + +} + + + + + + + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/Question.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/Question.java new file mode 100644 index 000000000..c75a33fb5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/Question.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app174; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** + * The type Question. + * + * @author bnasslahsen base class for all questions in test with polymorphism + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = TestQuestion.class, name = "test"), + @JsonSubTypes.Type(value = TextQuestion.class, name = "text") +}) +public abstract class Question { + private final String question; + private final String type; + + public Question(String question, String type) { + this.question = question; + this.type = type; + } + + public String getQuestion() { + return question; + } + + public String getType() { + return type; + } + + @Override + public String toString() { + return "Question{" + + "question='" + question + '\'' + + ", type='" + type + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/SpringDocApp174Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/SpringDocApp174Test.java new file mode 100644 index 000000000..17aab26dc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/SpringDocApp174Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app174; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 174 test. + */ +class SpringDocApp174Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/Test.java new file mode 100644 index 000000000..2accb3611 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/Test.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app174; + +import java.io.Serializable; +import java.util.List; + +/** + * The type Test. + * + * @author bnasslahsen + */ + +class Test implements Serializable { + + private static final long serialVersionUID = 1L; // Recommended for Serializable classes + + private List questions; + + // No-argument constructor + public Test() { + } + + // Constructor with arguments + public Test(List questions) { + this.questions = questions; + } + + // Getter method for 'questions' + public List getQuestions() { + return questions; + } + + // Setter method for 'questions' + public void setQuestions(List questions) { + this.questions = questions; + } + + // Optionally, you can override toString, hashCode, equals, etc. + @Override + public String toString() { + return "Test{" + + "questions=" + questions + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/TestQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/TestQuestion.java new file mode 100644 index 000000000..d2dfc244a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/TestQuestion.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app174; + +import java.util.List; + +/** + * The type Test question. + * + * @author bnasslahsen test question + */ +class TestQuestion extends Question { + /** + * list of variants + */ + private final List variants; + /** + * correct answer + */ + private final int answer; + + public TestQuestion(String question, String type, List variants, int answer) { + super(question, type); + this.variants = variants; + this.answer = answer; + } + + public List getVariants() { + return variants; + } + + public int getAnswer() { + return answer; + } + + @Override + public String toString() { + return "TestQuestion{" + + "question='" + getQuestion() + '\'' + + ", variants=" + variants + + ", answer=" + answer + + '}'; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/TextQuestion.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/TextQuestion.java new file mode 100644 index 000000000..5e806f3e8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app174/TextQuestion.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app174; + +/** + * The type Text question. + * + * @author bnasslahsen + */ +class TextQuestion extends Question { + private final String answer; + + public TextQuestion(String question, String type, String answer) { + super(question, type); + this.answer = answer; + } + + public String getAnswer() { + return answer; + } + + @Override + public String toString() { + return "TextQuestion{" + + "question='" + getQuestion() + '\'' + + ", type='" + getType() + '\'' + + ", answer='" + answer + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java new file mode 100644 index 000000000..f02c5bc52 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app18/HelloController.java @@ -0,0 +1,111 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app18; + +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.validation.constraints.NegativeOrZero; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.PositiveOrZero; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/persons") + public String persons(@NotBlank String name) { + return "OK"; + } + + /** + * Persons 2 string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/persons2") + public String persons2(@NotBlank @Parameter(description = "persons name") String name) { + return "OK"; + } + + /** + * Persons 3 string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/persons3") + public String persons3(@NotBlank @Parameter(description = "persons name") @RequestParam String name) { + return "OK"; + } + + /** + * Persons 4 string. + * + * @param age the age + * @return the string + */ + @GetMapping(value = "/persons4") + public String persons4(@PositiveOrZero int age) { + return "OK"; + } + + /** + * Persons 5 string. + * + * @param age the age + * @return the string + */ + @GetMapping(value = "/persons5") + public String persons5(@NegativeOrZero int age) { + return "OK"; + } + + /** + * Persons 6 string. + * + * @param name the name + * @return the string + */ + @GetMapping(value = "/persons6") + public String persons6(@NotEmpty @Parameter(description = "persons name") String name) { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java new file mode 100644 index 000000000..11df9baa0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app18/SpringDocApp18Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app18; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 18 test. + */ +@TestPropertySource(properties = "springdoc.pre-loading-enabled=true") +class SpringDocApp18Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app19/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app19/HelloController.java new file mode 100644 index 000000000..34783925d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app19/HelloController.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app19; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param name the name + * @return the string + */ + @PostMapping(value = "/persons") + public String persons(@RequestBody(description = "requestBody description as parameter") String name) { + return "OK"; + } + + /** + * Persons 2 string. + * + * @param name the name + * @return the string + */ + @RequestBody(description = "requestBody description outside") + @PostMapping(value = "/persons2") + public String persons2(String name) { + return "OK"; + } + + /** + * Persons 3 string. + * + * @param name the name + * @return the string + */ + @Operation(requestBody = @RequestBody(description = "requestBody inside operation annotation")) + @PostMapping(value = "/persons3") + public String persons3(@NotBlank String name) { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java new file mode 100644 index 000000000..ff9d09593 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app19/SpringDocApp19Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app19; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 19 test. + */ +class SpringDocApp19Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java new file mode 100644 index 000000000..5d842a40a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/SpringDocApp2Test.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityScheme; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc app 2 test. + */ +class SpringDocApp2Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic"))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/ApiUtil.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/ApiUtil.java new file mode 100644 index 000000000..c222e7370 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/ApiUtil.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import java.io.IOException; + +import jakarta.servlet.http.HttpServletResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.server.ResponseStatusException; + +/** + * The type Api util. + */ +class ApiUtil { + + /** + * Sets example response. + * + * @param req the req + * @param contentType the content type + * @param example the example + */ + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType); + req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Check api key. + * + * @param req the req + */ + public static void checkApiKey(NativeWebRequest req) { + if (!"1".equals(System.getenv("DISABLE_API_KEY")) && !"special-key".equals(req.getHeader("api_key"))) { + throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing API key!"); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/ExceptionTranslator.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/ExceptionTranslator.java new file mode 100644 index 000000000..4dbf76309 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/ExceptionTranslator.java @@ -0,0 +1,74 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import java.util.Map; + +import jakarta.validation.ConstraintViolationException; + +import org.springframework.boot.web.error.ErrorAttributeOptions; +import org.springframework.boot.web.servlet.error.ErrorAttributes; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.WebRequest; + +/** + * The type Exception translator. + */ +@RestControllerAdvice +class ExceptionTranslator { + + /** + * The Error attributes. + */ + private final ErrorAttributes errorAttributes; + + /** + * Instantiates a new Exception translator. + * + * @param errorAttributes the error attributes + */ + public ExceptionTranslator(ErrorAttributes errorAttributes) { + this.errorAttributes = errorAttributes; + } + + /** + * Process constraint violation exception map. + * + * @param request the request + * @return the map + */ + @ExceptionHandler(ConstraintViolationException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Map processConstraintViolationException(WebRequest request) { + request.setAttribute("jakarta.servlet.error.status_code", HttpStatus.BAD_REQUEST.value(), RequestAttributes.SCOPE_REQUEST); + return errorAttributes.getErrorAttributes(request, ErrorAttributeOptions.defaults()); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/HomeController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/HomeController.java new file mode 100644 index 000000000..8012916e6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/HomeController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; +import static org.springframework.web.servlet.view.UrlBasedViewResolver.REDIRECT_URL_PREFIX; + +/** + * Home redirection to swagger api documentation + */ +@Controller +class HomeController { + + /** + * The Swagger ui path. + */ + @Value(SWAGGER_UI_PATH) + private String swaggerUiPath; + + /** + * Index string. + * + * @return the string + */ + @GetMapping(DEFAULT_PATH_SEPARATOR) + public String index() { + return REDIRECT_URL_PREFIX + swaggerUiPath; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApi.java new file mode 100644 index 000000000..06e129896 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApi.java @@ -0,0 +1,229 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app2.api; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v31.app2.model.ModelApiResponse; +import test.org.springdoc.api.v31.app2.model.Pet; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; + +/** + * The interface Pet api. + */ +@SecurityScheme(name = "petstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "http://petstore.swagger.io/oauth/dialog", scopes = { + @OAuthScope(name = "write:pets", description = "modify pets in your account"), + @OAuthScope(name = "read:pets", description = "read your pets") }))) +@Tag(name = "pet", description = "the pet API") +@ResponseBody +public interface PetApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default PetApiDelegate getDelegate() { + return new PetApiDelegate() { + }; + } + + /** + * Add pet. + * + * @param pet the pet + */ + @Operation(summary = "Add a new pet to the store", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default void addPet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + // return getDelegate().addPet(pet); + } + + /** + * Delete pet response entity. + * + * @param petId the pet id + * @param apiKey the api key + * @return the response entity + */ + @Operation(summary = "Deletes a pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @DeleteMapping(value = "/pet/{petId}") + default ResponseEntity deletePet( + @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "") @RequestHeader(value = "api_key", required = false) String apiKey) { + return getDelegate().deletePet(petId, apiKey); + } + + /** + * Find pets by status response entity. + * + * @param status the status + * @return the response entity + */ + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid status value") }) + @GetMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByStatus( + @NotNull @Parameter(description = "Status values that need to be considered for filter", required = true) @Valid @RequestParam(value = "status", required = true) List status) { + return getDelegate().findPetsByStatus(status); + } + + /** + * Find pets by tags response entity. + * + * @param tags the tags + * @return the response entity + */ + @Operation(summary = "Finds Pets by tags", description = "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))), + @ApiResponse(responseCode = "400", description = "Invalid tag value") }) + @GetMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }) + default ResponseEntity> findPetsByTags( + @NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + return getDelegate().findPetsByTags(tags); + } + + /** + * Gets pet by id. + * + * @param petId the pet id + * @return the pet by id + */ + @Operation(summary = "Find pet by ID", description = "Returns a single pet", security = { + @SecurityRequirement(name = "api_key") }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") }) + @GetMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }) + default ResponseEntity getPetById( + @Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") Long petId) { + return getDelegate().getPetById(petId); + } + + /** + * Update pet response entity. + * + * @param pet the pet + * @return the response entity + */ + @Operation(summary = "Update an existing pet", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") }) + @PutMapping(value = "/pet", consumes = { "application/json", "application/xml" }) + default ResponseEntity updatePet( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet) { + return getDelegate().updatePet(pet); + } + + /** + * Update pet with form response entity. + * + * @param petId the pet id + * @param name the name + * @param status the status + * @return the response entity + */ + @Operation(summary = "Updates a pet in the store with form data", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { @ApiResponse(responseCode = "405", description = "Invalid input") }) + @PostMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }) + default ResponseEntity updatePetWithForm( + @Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) String name, + @Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) String status) { + return getDelegate().updatePetWithForm(petId, name, status); + } + + /** + * Upload file response entity. + * + * @param petId the pet id + * @param additionalMetadata the additional metadata + * @param file the file + * @return the response entity + */ + @Operation(summary = "uploads an image", description = "", security = { + @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }, tags = { "pet" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) }) + @PostMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { + "multipart/form-data" }) + default ResponseEntity uploadFile( + @Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(description = "file detail") @Valid @RequestPart("file") MultipartFile file) { + return getDelegate().uploadFile(petId, additionalMetadata, file); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiController.java new file mode 100644 index 000000000..69e0d92e4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import java.util.Optional; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * The type Pet api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class PetApiController implements PetApi { + + /** + * The Delegate. + */ + private final PetApiDelegate delegate; + + /** + * Instantiates a new Pet api controller. + * + * @param delegate the delegate + */ + public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public PetApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegate.java new file mode 100644 index 000000000..dd5c111de --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegate.java @@ -0,0 +1,192 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import java.util.List; +import java.util.Optional; + +import jakarta.validation.Valid; +import test.org.springdoc.api.v31.app2.model.ModelApiResponse; +import test.org.springdoc.api.v31.app2.model.Pet; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface PetApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Add pet. + * + * @param pet the pet + * @see PetApi#addPet PetApi#addPet + */ + default void addPet(Pet pet) { + + } + + /** + * Delete pet response entity. + * + * @param petId the pet id + * @param apiKey the api key + * @return the response entity + * @see PetApi#deletePet PetApi#deletePet + */ + default ResponseEntity deletePet(Long petId, + String apiKey) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Find pets by status response entity. + * + * @param status the status + * @return the response entity + * @see PetApi#findPetsByStatus PetApi#findPetsByStatus + */ + default ResponseEntity> findPetsByStatus(List status) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Extract. + */ + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou"); + break; + } + } + }); + } + + /** + * Find pets by tags response entity. + * + * @param tags the tags + * @return the response entity + * @see PetApi#findPetsByTags PetApi#findPetsByTags + */ + default ResponseEntity> findPetsByTags(List tags) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets pet by id. + * + * @param petId the pet id + * @return the pet by id + * @see PetApi#getPetById PetApi#getPetById + */ + default ResponseEntity getPetById(Long petId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update pet response entity. + * + * @param pet the pet + * @return the response entity + * @see PetApi#updatePet PetApi#updatePet + */ + default ResponseEntity updatePet(Pet pet) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update pet with form response entity. + * + * @param petId the pet id + * @param name the name + * @param status the status + * @return the response entity + * @see PetApi#updatePetWithForm PetApi#updatePetWithForm + */ + default ResponseEntity updatePetWithForm(Long petId, + String name, + String status) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Upload file response entity. + * + * @param petId the pet id + * @param additionalMetadata the additional metadata + * @param file the file + * @return the response entity + * @see PetApi#uploadFile PetApi#uploadFile + */ + default ResponseEntity uploadFile(Long petId, + String additionalMetadata, + @Valid MultipartFile file) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegateImpl.java new file mode 100644 index 000000000..655a2b2c0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/PetApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import org.springframework.stereotype.Service; + +/** + * The type Pet api delegate. + */ +@Service +class PetApiDelegateImpl implements PetApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApi.java new file mode 100644 index 000000000..61e8e2533 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApi.java @@ -0,0 +1,143 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app2.api; + +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import test.org.springdoc.api.v31.app2.model.Order; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * The interface Store api. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() { + }; + } + + /** + * Delete order response entity. + * + * @param orderId the order id + * @return the response entity + */ + @Operation(summary = "Delete purchase order by ID", tags = { "store" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @DeleteMapping(value = "/store/order/{orderId}") + @ResponseBody + default ResponseEntity deleteOrder( + @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId) { + return getDelegate().deleteOrder(orderId); + } + + /** + * Gets inventory. + * + * @return the inventory + */ + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = { + @SecurityRequirement(name = "api_key") }, tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) }) + @GetMapping(value = "/store/inventory", produces = { "application/json" }) + @ResponseBody + default ResponseEntity> getInventory() { + return getDelegate().getInventory(); + } + + /** + * Gets order by id. + * + * @param orderId the order id + * @return the order by id + */ + @Operation(summary = "Find purchase order by ID", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") }) + @GetMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }) + @ResponseBody + default ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId) { + return getDelegate().getOrderById(orderId); + } + + /** + * Place order response entity. + * + * @param order the order + * @return the response entity + */ + @Operation(summary = "Place an order for a pet", tags = { "store" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid Order") }) + @PostMapping(value = "/store/order", produces = { "application/xml", "application/json" }, consumes = { + "application/json" }) + @ResponseBody + default ResponseEntity placeOrder( + @Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order) { + return getDelegate().placeOrder(order); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiController.java new file mode 100644 index 000000000..e95635ee0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import java.util.Optional; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * The type Store api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class StoreApiController implements StoreApi { + + /** + * The Delegate. + */ + private final StoreApiDelegate delegate; + + /** + * Instantiates a new Store api controller. + * + * @param delegate the delegate + */ + public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public StoreApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegate.java new file mode 100644 index 000000000..a63e1710d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegate.java @@ -0,0 +1,123 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import java.util.Map; +import java.util.Optional; + +import test.org.springdoc.api.v31.app2.model.Order; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface StoreApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Delete order response entity. + * + * @param orderId the order id + * @return the response entity + * @see StoreApi#deleteOrder StoreApi#deleteOrder + */ + default ResponseEntity deleteOrder(String orderId) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets inventory. + * + * @return the inventory + * @see StoreApi#getInventory StoreApi#getInventory + */ + default ResponseEntity> getInventory() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets order by id. + * + * @param orderId the order id + * @return the order by id + * @see StoreApi#getOrderById StoreApi#getOrderById + */ + default ResponseEntity getOrderById(Long orderId) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Extract. + */ + default void extract() { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true"); + break; + } + } + }); + } + + /** + * Place order response entity. + * + * @param order the order + * @return the response entity + * @see StoreApi#placeOrder StoreApi#placeOrder + */ + default ResponseEntity placeOrder(Order order) { + extract(); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegateImpl.java new file mode 100644 index 000000000..bc1c56a18 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/StoreApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import org.springframework.stereotype.Service; + +/** + * The type Store api delegate. + */ +@Service +class StoreApiDelegateImpl implements StoreApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApi.java new file mode 100644 index 000000000..2c48d2dd5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApi.java @@ -0,0 +1,197 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package test.org.springdoc.api.v31.app2.api; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import test.org.springdoc.api.v31.app2.model.User; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * The interface User api. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Tag(name = "user", description = "the user API") +public interface UserApi { + + /** + * Gets delegate. + * + * @return the delegate + */ + default UserApiDelegate getDelegate() { + return new UserApiDelegate() { + }; + } + + /** + * Create user response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Create user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user", consumes = { "application/json" }) + default ResponseEntity createUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Created user object", required = true) @Valid @RequestBody User user) { + return getDelegate().createUser(user); + } + + /** + * Create users with array input response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @PostMapping(value = "/user/createWithArray", consumes = { "application/json" }) + default ResponseEntity createUsersWithArrayInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithArrayInput(user); + } + + /** + * Create users with list input response entity. + * + * @param user the user + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @PostMapping(value = "/user/createWithList", consumes = { "application/json" }) + default ResponseEntity createUsersWithListInput( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "List of user object", required = true) @Valid @RequestBody List user) { + return getDelegate().createUsersWithListInput(user); + } + + /** + * Delete user response entity. + * + * @param username the username + * @return the response entity + */ + @Operation(summary = "Creates list of users with given input array", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + + @DeleteMapping(value = "/user/{username}") + default ResponseEntity deleteUser( + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The name that needs to be deleted", required = true) @PathVariable("username") String username) { + return getDelegate().deleteUser(username); + } + + /** + * Gets user by name. + * + * @param username the username + * @return the user by name + */ + @Operation(summary = "Get user by user name", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + + @GetMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }) + default ResponseEntity getUserByName( + @Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username) { + return getDelegate().getUserByName(username); + } + + /** + * Login user response entity. + * + * @param username the username + * @param password the password + * @return the response entity + */ + @Operation(summary = "Logs user into the system", tags = { "user" }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") }) + @GetMapping(value = "/user/login", produces = { "application/xml", "application/json" }) + default ResponseEntity loginUser( + @NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { + return getDelegate().loginUser(username, password); + } + + /** + * Logout user response entity. + * + * @return the response entity + */ + @Operation(summary = "Logs out current logged in user session", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "successful operation") }) + @GetMapping(value = "/user/logout") + default ResponseEntity logoutUser() { + return getDelegate().logoutUser(); + } + + /** + * Update user response entity. + * + * @param username the username + * @param user the user + * @return the response entity + */ + @Operation(summary = "Updated user", tags = { "user" }) + @ApiResponses(value = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") }) + @PutMapping(value = "/user/{username}", consumes = { "application/json" }) + default ResponseEntity updateUser( + @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") String username, + @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "Updated user object", required = true) @Valid @RequestBody User user) { + return getDelegate().updateUser(username, user); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiController.java new file mode 100644 index 000000000..de5f376fb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiController.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import java.util.Optional; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * The type User api controller. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +@Controller +@ResponseBody +@RequestMapping("${openapi.openAPIPetstore.base-path:/}") +class UserApiController implements UserApi { + + /** + * The Delegate. + */ + private final UserApiDelegate delegate; + + /** + * Instantiates a new User api controller. + * + * @param delegate the delegate + */ + public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() { + }); + } + + /** + * Gets delegate. + * + * @return the delegate + */ + @Override + public UserApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegate.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegate.java new file mode 100644 index 000000000..7cc7e9245 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegate.java @@ -0,0 +1,167 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import java.util.List; +import java.util.Optional; + +import test.org.springdoc.api.v31.app2.model.User; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = "org.springdoc.demo.app2.codegen.languages.SpringCodegen", date = "2019-07-11T00:09:29.839+02:00[Europe/Paris]") + +public interface UserApiDelegate { + + /** + * Gets request. + * + * @return the request + */ + default Optional getRequest() { + return Optional.empty(); + } + + /** + * Create user response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUser UserApi#createUser + */ + default ResponseEntity createUser(User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Create users with array input response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUsersWithArrayInput UserApi#createUsersWithArrayInput + */ + default ResponseEntity createUsersWithArrayInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Create users with list input response entity. + * + * @param user the user + * @return the response entity + * @see UserApi#createUsersWithListInput UserApi#createUsersWithListInput + */ + default ResponseEntity createUsersWithListInput(List user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Delete user response entity. + * + * @param username the username + * @return the response entity + * @see UserApi#deleteUser UserApi#deleteUser + */ + default ResponseEntity deleteUser(String username) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Gets user by name. + * + * @param username the username + * @return the user by name + * @see UserApi#getUserByName UserApi#getUserByName + */ + default ResponseEntity getUserByName(String username) { + getRequest().ifPresent(request -> { + for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123"); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Login user response entity. + * + * @param username the username + * @param password the password + * @return the response entity + * @see UserApi#loginUser UserApi#loginUser + */ + default ResponseEntity loginUser(String username, + String password) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Logout user response entity. + * + * @return the response entity + * @see UserApi#logoutUser UserApi#logoutUser + */ + default ResponseEntity logoutUser() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * Update user response entity. + * + * @param username the username + * @param user the user + * @return the response entity + * @see UserApi#updateUser UserApi#updateUser + */ + default ResponseEntity updateUser(String username, + User user) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegateImpl.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegateImpl.java new file mode 100644 index 000000000..e28deb1ba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/api/UserApiDelegateImpl.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.api; + +import org.springframework.stereotype.Service; + +/** + * The type User api delegate. + */ +@Service +class UserApiDelegateImpl implements UserApiDelegate { + + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Category.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Category.java new file mode 100644 index 000000000..2c6d0cf26 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Category.java @@ -0,0 +1,134 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Category. + */ +class Category { + + /** + * The Id. + */ + private Long id = null; + + /** + * The Name. + */ + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id category. + * + * @param id the id + * @return the category + */ + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name category. + * + * @param name the name + * @return the category + */ + public Category name(String name) { + this.name = name; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/ModelApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/ModelApiResponse.java new file mode 100644 index 000000000..f90368566 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/ModelApiResponse.java @@ -0,0 +1,170 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Model api response. + */ +public class ModelApiResponse { + + /** + * The Code. + */ + private Integer code = null; + + /** + * The Type. + */ + private String type = null; + + /** + * The Message. + */ + private String message = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get code + * + * @return code code + */ + @JsonProperty("code") + public Integer getCode() { + return code; + } + + /** + * Sets code. + * + * @param code the code + */ + public void setCode(Integer code) { + this.code = code; + } + + /** + * Code model api response. + * + * @param code the code + * @return the model api response + */ + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * + * @return type type + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * Sets type. + * + * @param type the type + */ + public void setType(String type) { + this.type = type; + } + + /** + * Type model api response. + * + * @param type the type + * @return the model api response + */ + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * + * @return message message + */ + @JsonProperty("message") + public String getMessage() { + return message; + } + + /** + * Sets message. + * + * @param message the message + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * Message model api response. + * + * @param message the message + * @return the model api response + */ + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Order.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Order.java new file mode 100644 index 000000000..3a41f1aeb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Order.java @@ -0,0 +1,360 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.model; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Order. + */ +public class Order { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Pet id. + */ + @Schema(description = "") + private Long petId = null; + + /** + * The Quantity. + */ + @Schema(description = "") + private Integer quantity = null; + + /** + * The Ship date. + */ + @Schema(description = "") + private Date shipDate = null; + + /** + * Order Status + */ + private StatusEnum status = null; + + /** + * The Complete. + */ + @Schema(description = "") + private Boolean complete = false; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id order. + * + * @param id the id + * @return the order + */ + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * + * @return petId pet id + */ + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + + /** + * Sets pet id. + * + * @param petId the pet id + */ + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + * Pet id order. + * + * @param petId the pet id + * @return the order + */ + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * + * @return quantity quantity + */ + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + + /** + * Sets quantity. + * + * @param quantity the quantity + */ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + * Quantity order. + * + * @param quantity the quantity + * @return the order + */ + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * + * @return shipDate ship date + */ + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + + /** + * Sets ship date. + * + * @param shipDate the ship date + */ + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Ship date order. + * + * @param shipDate the ship date + * @return the order + */ + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * + * @return status status + */ + @JsonProperty("status") + public String getStatus() { + if (status == null) { + return null; + } + return status.getValue(); + } + + /** + * Sets status. + * + * @param status the status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Status order. + * + * @param status the status + * @return the order + */ + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * + * @return complete boolean + */ + @JsonProperty("complete") + public Boolean isisComplete() { + return complete; + } + + /** + * Sets complete. + * + * @param complete the complete + */ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + /** + * Complete order. + * + * @param complete the complete + * @return the order + */ + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * The enum Status enum. + */ + public enum StatusEnum { + /** + *Placed status enum. + */ + PLACED("placed"), + /** + *Approved status enum. + */ + APPROVED("approved"), + /** + *Delivered status enum. + */ + DELIVERED("delivered"); + + /** + * The Value. + */ + private String value; + + /** + * Instantiates a new Status enum. + * + * @param value the value + */ + StatusEnum(String value) { + this.value = value; + } + + /** + * From value status enum. + * + * @param text the text + * @return the status enum + */ + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + /** + * Gets value. + * + * @return the value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Pet.java new file mode 100644 index 000000000..f131d6e77 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Pet.java @@ -0,0 +1,392 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.model; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +/** + * The type Pet. + */ +public class Pet { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Category. + */ + @Schema(description = "") + private Category category = null; + + /** + * The Name. + */ + @Schema(example = "doggie", required = true, description = "") + private String name = null; + + /** + * The Photo urls. + */ + @Schema(required = true, description = "") + private List photoUrls = new ArrayList(); + + /** + * The Tags. + */ + @Schema(description = "") + private List tags = null; + + /** + * The Status. + */ + @Schema(description = "pet status in the store") + /** + * pet status in the store + **/ + private StatusEnum status = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id pet. + * + * @param id the id + * @return the pet + */ + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * + * @return category category + */ + @JsonProperty("category") + public Category getCategory() { + return category; + } + + /** + * Sets category. + * + * @param category the category + */ + public void setCategory(Category category) { + this.category = category; + } + + /** + * Category pet. + * + * @param category the category + * @return the pet + */ + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + @NotNull + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name pet. + * + * @param name the name + * @return the pet + */ + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * + * @return photoUrls photo urls + */ + @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + /** + * Sets photo urls. + * + * @param photoUrls the photo urls + */ + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + * Photo urls pet. + * + * @param photoUrls the photo urls + * @return the pet + */ + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + /** + * Add photo urls item pet. + * + * @param photoUrlsItem the photo urls item + * @return the pet + */ + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * + * @return tags tags + */ + @JsonProperty("tags") + public List getTags() { + return tags; + } + + /** + * Sets tags. + * + * @param tags the tags + */ + public void setTags(List tags) { + this.tags = tags; + } + + /** + * Tags pet. + * + * @param tags the tags + * @return the pet + */ + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + /** + * Add tags item pet. + * + * @param tagsItem the tags item + * @return the pet + */ + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * + * @return status status + */ + @JsonProperty("status") + public StatusEnum getStatus() { + if (status == null) { + return null; + } + return status; + } + + /** + * Sets status. + * + * @param status the status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Status pet. + * + * @param status the status + * @return the pet + */ + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * The enum Status enum. + */ + public enum StatusEnum { + /** + *Available status enum. + */ + AVAILABLE("available"), + /** + *Pending status enum. + */ + PENDING("pending"), + /** + *Sold status enum. + */ + SOLD("sold"); + + /** + * The Value. + */ + private String value; + + /** + * Instantiates a new Status enum. + * + * @param value the value + */ + StatusEnum(String value) { + this.value = value; + } + + /** + * From value status enum. + * + * @param text the text + * @return the status enum + */ + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + /** + * Gets value. + * + * @return the value + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + return String.valueOf(value); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Tag.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Tag.java new file mode 100644 index 000000000..b5f3a80ef --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/Tag.java @@ -0,0 +1,137 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tag. + */ +class Tag { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Name. + */ + @Schema(description = "") + private String name = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id tag. + * + * @param id the id + * @return the tag + */ + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * + * @return name name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * Sets name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Name tag. + * + * @param name the name + * @return the tag + */ + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/User.java new file mode 100644 index 000000000..ae89052a3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app2/model/User.java @@ -0,0 +1,358 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app2.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type User. + */ +public class User { + + /** + * The Id. + */ + @Schema(description = "") + private Long id = null; + + /** + * The Username. + */ + @Schema(description = "") + private String username = null; + + /** + * The First name. + */ + @Schema(description = "") + private String firstName = null; + + /** + * The Last name. + */ + @Schema(description = "") + private String lastName = null; + + /** + * The Email. + */ + @Schema(description = "") + private String email = null; + + /** + * The Password. + */ + @Schema(description = "") + private String password = null; + + /** + * The Phone. + */ + @Schema(description = "") + private String phone = null; + + /** + * User Status + */ + private Integer userStatus = null; + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Get id + * + * @return id id + */ + @JsonProperty("id") + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Id user. + * + * @param id the id + * @return the user + */ + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * + * @return username username + */ + @JsonProperty("username") + public String getUsername() { + return username; + } + + /** + * Sets username. + * + * @param username the username + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * Username user. + * + * @param username the username + * @return the user + */ + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * + * @return firstName first name + */ + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * First name user. + * + * @param firstName the first name + * @return the user + */ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * + * @return lastName last name + */ + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Last name user. + * + * @param lastName the last name + * @return the user + */ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * + * @return email email + */ + @JsonProperty("email") + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Email user. + * + * @param email the email + * @return the user + */ + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * + * @return password password + */ + @JsonProperty("password") + public String getPassword() { + return password; + } + + /** + * Sets password. + * + * @param password the password + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * Password user. + * + * @param password the password + * @return the user + */ + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * + * @return phone phone + */ + @JsonProperty("phone") + public String getPhone() { + return phone; + } + + /** + * Sets phone. + * + * @param phone the phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * Phone user. + * + * @param phone the phone + * @return the user + */ + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * + * @return userStatus user status + */ + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + + /** + * Sets user status. + * + * @param userStatus the user status + */ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + /** + * User status user. + * + * @param userStatus the user status + * @return the user + */ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app20/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app20/HelloController.java new file mode 100644 index 000000000..8978a9b0d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app20/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import io.swagger.v3.oas.annotations.Hidden; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping(value = "/persons") + @Hidden + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java new file mode 100644 index 000000000..42680d7ad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app20/SpringDocApp20Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app20; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 20 test. + */ +class SpringDocApp20Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java new file mode 100644 index 000000000..bc7c700a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app21/HelloController.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app21; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.OAuthFlow; +import io.swagger.v3.oas.annotations.security.OAuthFlows; +import io.swagger.v3.oas.annotations.security.OAuthScope; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@SecurityScheme(name = "personstore_auth", type = SecuritySchemeType.OAUTH2, flows = @OAuthFlows(implicit = @OAuthFlow(authorizationUrl = "${springdoc.oAuthFlow.authorizationUrl}", scopes = { + @OAuthScope(name = "write:persons", description = "modify persons in your account"), + @OAuthScope(name = "read:persons", description = "read your persons") }))) +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @Operation(summary = "Add a new person to the store", description = "", security = { + @SecurityRequirement(name = "personstore_auth", scopes = { "write:persons", "read:persons" }) }, tags = { + "person" }) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java new file mode 100644 index 000000000..a1b4ed732 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app21/SpringDocApp21Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app21; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 21 test. + */ +@TestPropertySource(properties = "springdoc.oAuthFlow.authorizationUrl=http://personstore.swagger.io/oauth/dialog") +class SpringDocApp21Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/HelloController.java new file mode 100644 index 000000000..436695a3a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +import java.util.List; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Do get response entity. + * + * @return the response entity + */ + @GetMapping(value = "/persons") + public ResponseEntity>> doGet() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonDTO.java new file mode 100644 index 000000000..788ceaf13 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java new file mode 100644 index 000000000..7f5028b5a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app22/SpringDocApp22Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app22; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 22 test. + */ +class SpringDocApp22Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app23/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app23/HelloController.java new file mode 100644 index 000000000..dc3eb1225 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app23/HelloController.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app23; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", paramName = "JWT", description = "A core-auth Bearer token") +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @Operation(summary = "Add a new person to the store", description = "", security = { + @SecurityRequirement(name = "Authorization") }) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java new file mode 100644 index 000000000..7fb60a75e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app23/SpringDocApp23Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app23; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 23 test. + */ +class SpringDocApp23Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/HelloController.java new file mode 100644 index 000000000..1adb6ecd7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/HelloController.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = "Authorization", description = "A core-auth Bearer token") +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @Operation(summary = "Add a new person to the store", description = "", security = { + @SecurityRequirement(name = "Authorization") }) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java new file mode 100644 index 000000000..cf71627c4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocApp24Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +/** + * The type Spring doc app 24 test. + */ +class SpringDocApp24Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocTestApp.java new file mode 100644 index 000000000..ba0cb7c28 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app24/SpringDocTestApp.java @@ -0,0 +1,77 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app24; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.headers.Header; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.security.SecurityScheme; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The entry point of application. + * + * @param args the input arguments + */ + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components() + .addSecuritySchemes("basicScheme", + new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic")) + .addParameters("myHeader1", + new Parameter().in("header").schema(new StringSchema()).name("myHeader1")) + .addHeaders("myHeader2", + new Header().description("myHeader2 header").schema(new StringSchema()))) + .info(new Info().title("Petstore API").version("v0").description( + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.") + .termsOfService("http://swagger.io/terms/") + .license(new License().name("Apache 2.0").url("http://springdoc.org"))); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app25/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app25/HelloController.java new file mode 100644 index 000000000..3de3fd55f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app25/HelloController.java @@ -0,0 +1,109 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25; + +import java.time.Instant; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Check. + */ + @GetMapping(value = "/check") + @ResponseStatus(HttpStatus.OK) + void check() { + } + + /** + * List. + * + * @param trackerId the tracker id + * @param startDate the start date + * @param endDate the end date + */ + @GetMapping(value = "/list/{trackerId}") + void list( + + @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")) @PathVariable String trackerId, + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, + @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")) @RequestParam(value = "end", required = false) Instant endDate) { + } + + /** + * Secondlist. + * + * @param trackerId the tracker id + * @param startDate the start date + * @param endDate the end date + */ + @GetMapping(value = "/secondlist/{trackerId}") + void secondlist( + @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")) @PathVariable String trackerId, + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")) @RequestParam(value = "start", required = false) Instant startDate, + @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")) @RequestParam(value = "end", required = false) Instant endDate) { + + } + + /** + * Third list. + * + * @param trackerId the tracker id + * @param start the start + * @param end the end + * @param limit the limit + */ + @Operation(description = "Get last data from a tracker", parameters = { + @Parameter(name = "trackerId", in = ParameterIn.PATH, required = true, schema = @Schema(type = "string", example = "the-tracker-id")), + @Parameter(name = "start", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:00:00.000Z")), + @Parameter(name = "end", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "string", format = "date-time", required = false, example = "1970-01-01T00:10:00.000Z")), + @Parameter(name = "limit", in = ParameterIn.QUERY, required = false, schema = @Schema(type = "number", required = false, example = "10")) }, responses = { + @ApiResponse(responseCode = "200") }) + + @GetMapping(value = "/values/{trackerId}/data") + void thirdList(@PathVariable String trackerId, @RequestParam(value = "start", required = false) Instant start, + @RequestParam(value = "end", required = false) Instant end, + @RequestParam(value = "limit", required = false) Integer limit) { + + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java new file mode 100644 index 000000000..55ddeee1e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app25/SpringDocApp25Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app25; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 25 test. + */ +class SpringDocApp25Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/Bar.java new file mode 100644 index 000000000..380124398 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/Bar.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +/** + * The type Bar. + */ +class Bar { + /** + * The Bar. + */ + private String bar; + + /** + * Gets bar. + * + * @return the bar + */ + public String getBar() { + return bar; + } + + /** + * Sets bar. + * + * @param bar the bar + */ + public void setBar(String bar) { + this.bar = bar; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/Foo.java new file mode 100644 index 000000000..67ea50630 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/Foo.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +/** + * The type Foo. + */ +class Foo { + + /** + * The Foo. + */ + private String foo; + + /** + * Gets foo. + * + * @return the foo + */ + public String getFoo() { + return foo; + } + + /** + * Sets foo. + * + * @param foo the foo + */ + public void setFoo(String foo) { + this.foo = foo; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/HelloController.java new file mode 100644 index 000000000..8fb5d7ec4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons my model. + * + * @param myModel the my model + * @return the my model + */ + @PostMapping(value = "/persons") + public MyModel persons(MyModel myModel) { + return new MyModel(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/MyModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/MyModel.java new file mode 100644 index 000000000..3ce6f8bd5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/MyModel.java @@ -0,0 +1,59 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type My model. + */ +class MyModel { + + /** + * The Thing. + */ + @Schema(description = "Hello", type = "object", oneOf = { Foo.class, Bar.class }) + private Object thing; + + /** + * Gets thing. + * + * @return the thing + */ + public Object getThing() { + return thing; + } + + /** + * Sets thing. + * + * @param thing the thing + */ + public void setThing(Object thing) { + this.thing = thing; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java new file mode 100644 index 000000000..1cc622d7b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app26/SpringDocApp26Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app26; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 26 test. + */ +class SpringDocApp26Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Advice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Advice.java new file mode 100644 index 000000000..e7a4309a2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Advice.java @@ -0,0 +1,82 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.context.request.WebRequest; + +/** + * The type Advice. + */ +@RestControllerAdvice +class Advice { + + /** + * Handle exception foo. + * + * @param ex the ex + * @param request the request + * @return the foo + */ + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + public Foo handleException(Exception ex, WebRequest request) { + return new Foo(); + } + + /** + * Handle my exception bar. + * + * @param ex the ex + * @param request the request + * @return the bar + */ + @ExceptionHandler(MyException.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + public Bar handleMyException(MyException ex, WebRequest request) { + return new Bar(); + } + + /** + * Handle my exception 2 bar. + * + * @param ex the ex + * @param request the request + * @return the bar + */ + @Hidden + @ExceptionHandler(Throwable.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + public Bar handleMyException2(MyException ex, WebRequest request) { + return new Bar(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Bar.java new file mode 100644 index 000000000..373ed987e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Bar.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +/** + * The type Bar. + */ +class Bar { + /** + * The Bar. + */ + public String bar = "bar"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Foo.java new file mode 100644 index 000000000..e529033ed --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/Foo.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +/** + * The type Foo. + */ +class Foo { + /** + * The Foo. + */ + public String foo = "foo"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java new file mode 100644 index 000000000..14bcfc64f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/HelloController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * The Flag. + */ + private boolean flag = false; + + /** + * Index string. + * + * @return the string + */ + @RequestMapping("/") + public String index() { + return ""; + } + + /** + * Test string. + * + * @return the string + */ + @GetMapping("/test") + public String test() { + flag = !flag; + throw flag ? new MyException() : new RuntimeException(); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/MyException.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/MyException.java new file mode 100644 index 000000000..565f89f70 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/MyException.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +/** + * The type My exception. + */ +class MyException extends RuntimeException { + + /** + * The constant serialVersionUID. + */ + private static final long serialVersionUID = 1L; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java new file mode 100644 index 000000000..270ef4af5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app27/SpringDocApp27Test.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app27; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 27 test. + */ +class SpringDocApp27Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./test.get.responses.500.content.['*/*'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/Bar", + "#/components/schemas/Foo"))); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java new file mode 100644 index 000000000..b781ecce0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app28/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app28; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Upload 2 string. + * + * @param one the one + * @param two the two + * @return the string + */ + @PostMapping(value = "/upload2", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String upload2(@RequestPart("one") MultipartFile one, @RequestPart("two") MultipartFile two) { + return "Ok"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java new file mode 100644 index 000000000..330f4dd78 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app28/SpringDocApp28Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app28; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 28 test. + */ +class SpringDocApp28Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/HelloController.java new file mode 100644 index 000000000..554764b72 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/HelloController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Post entity list. + * + * @param postEntity the post entity + * @return the list + */ + @PostMapping(value = "/post-entity") + @Operation(description = "Post entity", + requestBody = @RequestBody(content = @Content(mediaType = "application/json", schema = @Schema(implementation = TrackerData.class))), + responses = + { @ApiResponse(responseCode = "200", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = TrackerData.class)))) }) + List postEntity(@RequestBody TrackerData postEntity) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java new file mode 100644 index 000000000..c0b1381fe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/SpringDocApp29Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 29 test. + */ +class SpringDocApp29Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/TrackerData.java new file mode 100644 index 000000000..e76eeb89c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app29/TrackerData.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app29; + +import java.time.Instant; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tracker data. + */ +@Schema(name = "TrackerData") +class TrackerData { + + /** + * The Tracker id. + */ + @Schema(name = "trackerId", type = "string", required = true, example = "the-tracker-id") + @JsonProperty("trackerId") + String trackerId; + + /** + * The Timestamp. + */ + @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") + @JsonProperty("timestamp") + Instant timestamp; + + /** + * The Value. + */ + @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") + @JsonProperty("value") + Double value; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/HelloController.java new file mode 100644 index 000000000..b27de8ee1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/HelloController.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Echo playing card. + * + * @param card the card baby + * @param toto the toto baby + * @return the playing card baby + */ + @PostMapping + public PersonDTO echo(@RequestBody PlayingCard card, @RequestParam String toto) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/PersonDTO.java new file mode 100644 index 000000000..961d50fad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/PersonDTO.java @@ -0,0 +1,121 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +/** + * The type Person dto. + */ +class PersonDTO { + + /** + * The email + */ + private String email; + + /** + * The firstName + */ + private String firstName; + + /** + * The lastName + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/PlayingCard.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/PlayingCard.java new file mode 100644 index 000000000..ed40e6d9c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/PlayingCard.java @@ -0,0 +1,151 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The type Playing card. + */ +class PlayingCard { + /** + * The Suit. + */ + private Suit suit; + + /** + * The Value. + */ + private Integer value; + + /** + * The Toto. + */ + private Date toto; + + /** + * Gets toto. + * + * @return the toto + */ + public Date getToto() { + return toto; + } + + /** + * Sets toto. + * + * @param toto the toto + */ + public void setToto(Date toto) { + this.toto = toto; + } + + /** + * Gets suit. + * + * @return the suit + */ + public Suit getSuit() { + return suit; + } + + /** + * Sets suit. + * + * @param suit the suit + */ + public void setSuit(Suit suit) { + this.suit = suit; + } + + /** + * Gets value. + * + * @return the value + */ + public Integer getValue() { + return value; + } + + /** + * Sets value. + * + * @param value the value + */ + public void setValue(Integer value) { + this.value = value; + } + + /** + * The enum Suit. + */ + public enum Suit { + /** + *Hearts suit. + */ + HEARTS("Hearts"), + /** + *Diamonds suit. + */ + DIAMONDS("Diamonds"), + /** + *Clubs suit. + */ + CLUBS("Clubs"), + /** + *Spades suit. + */ + SPADES("Spades"); + + /** + * The Json value. + */ + private final String jsonValue; + + /** + * Instantiates a new Suit. + * + * @param jsonValue the json value + */ + Suit(String jsonValue) { + this.jsonValue = jsonValue; + } + + /** + * Gets json value. + * + * @return the json value + */ + @JsonValue + public String getJsonValue() { + return jsonValue; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java new file mode 100644 index 000000000..9019092bc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app3/SpringDocApp3Test.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app3; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 3 test. + */ +class SpringDocApp3Test extends AbstractSpringDocTest { + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java new file mode 100644 index 000000000..01b850cb6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app30/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app30; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Echo string. + * + * @param text the text + * @return the string + */ + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test") + public String echo(@RequestParam(name = "text", defaultValue = "Hello, World!") String text) { + return text; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java new file mode 100644 index 000000000..880ea67c9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app30/SpringDocApp30Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app30; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 30 test. + */ +class SpringDocApp30Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java new file mode 100644 index 000000000..30586d903 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app31/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app31; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.callbacks.Callback; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Subscribe subscription response. + * + * @param token the token + * @param url the url + * @return the subscription response + */ + @PostMapping("/test") + @Callback(callbackUrlExpression = "http://$request.query.url", name = "subscription", operation = { + @Operation(method = "post", description = "payload data will be sent", parameters = { + @Parameter(in = ParameterIn.PATH, name = "subscriptionId", required = true, schema = @Schema(type = "string", format = "uuid", description = "the generated UUID", accessMode = Schema.AccessMode.READ_ONLY)) }, responses = { + @ApiResponse(responseCode = "200", description = "Return this code if the callback was received and processed successfully"), + @ApiResponse(responseCode = "205", description = "Return this code to unsubscribe from future data updates"), + @ApiResponse(responseCode = "default", description = "All other response codes will disable this callback subscription") }) }) + @Operation(description = "subscribes a client to updates relevant to the requestor's account, as " + + "identified by the input token. The supplied url will be used as the delivery address for response payloads") + public SubscriptionResponse subscribe(@Schema(required = true, description = "the authentication token " + + "provided after initially authenticating to the application") @RequestHeader("x-auth-token") String token, + @Schema(required = true, description = "the URL to call with response " + + "data") @RequestParam("url") String url) { + return null; + } + + /** + * The type Subscription response. + */ + static class SubscriptionResponse { + /** + * The Subscription uuid. + */ + private String subscriptionUuid; + + /** + * Gets subscription uuid. + * + * @return the subscription uuid + */ + public String getSubscriptionUuid() { + return subscriptionUuid; + } + + /** + * Sets subscription uuid. + * + * @param subscriptionUuid the subscription uuid + */ + public void setSubscriptionUuid(String subscriptionUuid) { + this.subscriptionUuid = subscriptionUuid; + } + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java new file mode 100644 index 000000000..8c7ad8400 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app31/SpringDocApp31Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app31; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 31 test. + */ +class SpringDocApp31Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java new file mode 100644 index 000000000..f8f970d68 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app32/HelloController.java @@ -0,0 +1,75 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app32; + +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Filter post string. + * + * @param filter the filter + * @return the string + */ + @RequestMapping(value = "/filter", method = RequestMethod.POST) + @ResponseStatus(value = HttpStatus.OK) + public String filterPost(@RequestBody final MyTestDto filter) { + return "OK"; + } + + /** + * The type My test dto. + */ + class MyTestDto { + /** + * The Object 1. + */ + public String object1; + + /** + * The Object 2. + */ + public String object2; + + /** + * The Object 3. + */ + public String object3; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java new file mode 100644 index 000000000..7fe71b1bb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app32/SpringDocApp32Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app32; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 32 test. + */ +class SpringDocApp32Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java new file mode 100644 index 000000000..20e91c3fc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app33/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app33; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + /** + * Index t. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the t + */ + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java new file mode 100644 index 000000000..de945d6a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app33/SpringDocApp33Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app33; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 33 test. + */ +class SpringDocApp33Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/HelloController.java new file mode 100644 index 000000000..0151eeb43 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + * + * @param the type parameter + */ +@RestController +class HelloController { + + /** + * Index t. + * + * @param numTel the num tel + * @param adresse the adresse + * @return the t + */ + @GetMapping(value = "/hello/{numTelco}") + @Operation(summary = "GET Persons", responses = @ApiResponse(responseCode = "418")) + public T index(@PathVariable("numTelco") String numTel, String adresse) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/MyExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/MyExceptionHandler.java new file mode 100644 index 000000000..b732bb1be --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/MyExceptionHandler.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; + +/** + * The type My exception handler. + */ +@RestControllerAdvice +@Hidden +class MyExceptionHandler extends ResponseEntityExceptionHandler { + /** + * Bad object. + * + * @param e the e + * @return the object + */ + @ExceptionHandler(IllegalArgumentException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + public Object bad(IllegalArgumentException e) { + return null; + } + + /** + * Gateway object. + * + * @param e the e + * @return the object + */ + @ExceptionHandler(RuntimeException.class) + @ResponseStatus(HttpStatus.BAD_GATEWAY) + public Object gateway(RuntimeException e) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java new file mode 100644 index 000000000..7350ac83b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app34/SpringDocApp34Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app34; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 34 test. + */ +class SpringDocApp34Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app35/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app35/HelloController.java new file mode 100644 index 000000000..ae49d2967 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app35/HelloController.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app35; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +/** + * The type Hello controller. + */ +@Controller +@RequestMapping("/api/v1/poc/") +class HelloController { + + /** + * Testme response entity. + * + * @return the response entity + */ + @Operation(summary = "Get thing", responses = { + @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "404", description = "Not found", content = @Content), + @ApiResponse(responseCode = "401", description = "Authentication Failure", content = @Content(schema = @Schema(hidden = true))) }) + @RequestMapping(path = "/testme", method = RequestMethod.GET) + ResponseEntity testme() { + return ResponseEntity.ok("Hello"); + } + + /** + * Test response entity. + * + * @return the response entity + */ + @Operation(summary = "Get thing", responses = { + @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "404", description = "Not found", content = @Content(schema = @Schema(hidden = true))), + @ApiResponse(responseCode = "401", description = "Authentication Failure", content = @Content(schema = @Schema(hidden = true))) }) + @RequestMapping(path = "/test", method = RequestMethod.GET) + ResponseEntity test() { + return ResponseEntity.ok("Hello"); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java new file mode 100644 index 000000000..fced6caca --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app35/SpringDocApp35Test.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app35; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.springdoc.core.utils.SpringDocUtils.getConfig; + +/** + * The type Spring doc app 35 test. + */ +class SpringDocApp35Test extends AbstractSpringDocTest { + + static { + getConfig().addRestControllers(HelloController.class); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Bar.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Bar.java new file mode 100644 index 000000000..918128fec --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Bar.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +/** + * The type Bar. + */ +class Bar { + /** + * The Bar. + */ + public String bar = "bar"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Car.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Car.java new file mode 100644 index 000000000..b6619cb90 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Car.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +/** + * The type Car. + */ +class Car { + /** + * The Car. + */ + public String car = "car"; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Foo.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Foo.java new file mode 100644 index 000000000..6c2032280 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Foo.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +/** + * The type Foo. + */ +class Foo { + /** + * The Foo. + */ + public String foo = "foo"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/HelloController.java new file mode 100644 index 000000000..9ebaee7bd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/HelloController.java @@ -0,0 +1,99 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import jakarta.validation.Valid; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Process foo. + * + * @param a the a + * @return the foo + */ + @PostMapping(path = "/bar/baz", consumes = "application/x.a+json", produces = MediaType.TEXT_PLAIN_VALUE) + public Foo process(@RequestBody Foo a) { + return a; + } + + /** + * Process bar. + * + * @param b the b + * @return the bar + */ + @PostMapping(path = "/bar/baz", consumes = "application/x.b+json", produces = MediaType.TEXT_PLAIN_VALUE) + public Bar process(@RequestBody Bar b) { + return b; + } + + /** + * Process car. + * + * @param c the c + * @return the car + */ + @PostMapping(path = "/bar/baz", consumes = "application/x.c+json", produces = MediaType.APPLICATION_JSON_VALUE) + public Car process(@RequestBody Car c) { + return c; + } + + + /** + * Pets post response entity. + * + * @param pet the pet + * @return the response entity + */ + @PostMapping(value = "/pets1", consumes = "text/plain") + public ResponseEntity petsPost1(@Valid @RequestBody String pet) { + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } + + /** + * Pets post response entity. + * + * @param pet the pet + * @return the response entity + */ + @PostMapping(value = "/pets2", consumes = "application/json") + public ResponseEntity petsPost2(@Valid @RequestBody Pet pet) { + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Pet.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Pet.java new file mode 100644 index 000000000..a850b0449 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/Pet.java @@ -0,0 +1,38 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +/** + * The type Pet. + */ +class Pet { + /** + * The Pet. + */ + public String pet = "pet"; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java new file mode 100644 index 000000000..7becb66d9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app37/SpringDocApp37Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app37; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 37 test. + */ +class SpringDocApp37Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app38/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app38/HelloController.java new file mode 100644 index 000000000..aeb946bb5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app38/HelloController.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app38; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Gets model resource. + * + * @return the model resource + */ + @RequestMapping(value = "/npe_error", method = RequestMethod.GET) + public ResponseEntity getModelResource() { + return new ResponseEntity<>(new byte[0], HttpStatus.OK); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java new file mode 100644 index 000000000..868f68d93 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app38/SpringDocApp38Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app38; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 38 test. + */ +class SpringDocApp38Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java new file mode 100644 index 000000000..53331dcf8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/HelloController.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app39; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Search employee. + * + * @param test the test + */ + @Operation(summary = "test Request") + @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) + @PostMapping("/test") + public void searchEmployee(String test) { + } + + /** + * Hello string. + * + * @return the string + */ + @GetMapping("/hello") + public String hello() { + return "hello"; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java new file mode 100644 index 000000000..749a8459f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/SpringDocApp39Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app39; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +/** + * The type Spring doc app 39 test. + */ +class SpringDocApp39Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java new file mode 100644 index 000000000..24d355c1e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app39/SpringDocTestApp.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app39; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.HeaderParameter; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The entry point of application. + * + * @param args the input arguments + */ + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + StringSchema schema = new StringSchema(); + return new OpenAPI() + .components(new Components().addParameters("myGlobalHeader", new HeaderParameter().required(true).name("My-Global-Header").description("My Global Header").schema(schema))); + } + + /** + * Customer global header open api customiser open api customiser. + * + * @return the open api customiser + */ + @Bean + public OpenApiCustomizer customerGlobalHeaderOpenApiCustomizer() { + return openApi -> openApi.getPaths().values().stream().flatMap(pathItem -> pathItem.readOperations().stream()) + .forEach(operation -> operation.addParametersItem(new HeaderParameter().$ref("#/components/parameters/myGlobalHeader"))); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java new file mode 100644 index 000000000..5d6c56414 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List tracker data. + * + * @param toto the toto + * @return the tracker data + */ + @PostMapping(value = "/values/data") + TrackerData list(TrackerData toto) { + return toto; + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java new file mode 100644 index 000000000..2d1fa8037 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/SpringDocApp4Test.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import io.swagger.v3.core.jackson.TypeNameResolver; +import org.junit.jupiter.api.AfterAll; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 4 test. + */ +@TestPropertySource(properties = "springdoc.use-fqn=true") +class SpringDocApp4Test extends AbstractSpringDocTest { + + /** + * Restore. + */ + @AfterAll + static void restore() { + TypeNameResolver.std.setUseFqn(false); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/TrackerData.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/TrackerData.java new file mode 100644 index 000000000..206bed595 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app4/TrackerData.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app4; + +import java.time.Instant; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Tracker data. + */ +class TrackerData { + + /** + * The Tracker id. + */ + @Schema(name = "trackerId", type = "string", required = true, example = "the-tracker-id") + @JsonProperty("trackerId") + String trackerId; + + /** + * The Timestamp. + */ + @Schema(name = "timestamp", type = "string", format = "date-time", required = true, example = "2018-01-01T00:00:00Z") + @JsonProperty("timestamp") + Instant timestamp; + + /** + * The Value. + */ + @Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0") + @JsonProperty("value") + Double value; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app40/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app40/HelloController.java new file mode 100644 index 000000000..b41b528d3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app40/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app40; + +import com.fasterxml.jackson.databind.node.ObjectNode; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Gets start form properties. + * + * @return the start form properties + */ + @RequestMapping(value = "/iae_error", method = RequestMethod.GET) + public ObjectNode getStartFormProperties() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java new file mode 100644 index 000000000..ceb14ac59 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app40/SpringDocApp40Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app40; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 40 test. + */ +class SpringDocApp40Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/HelloController.java new file mode 100644 index 000000000..e7ca6b814 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/HelloController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app41; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Gets file. + * + * @param path the path + * @return the file + */ + @Operation(description = "Download file") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "File resource", content = @Content(schema = @Schema(implementation = java.io.File.class))), + @ApiResponse(responseCode = "400", description = "Wrong request", content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) }) + @GetMapping(value = "/file", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity getFile( + @NotNull @Parameter(description = "File path", required = true) @Valid @RequestParam(value = "path") String path) { + return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java new file mode 100644 index 000000000..a6ad70be7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp411Test.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app41; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 411 test. + */ +class SpringDocApp411Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + // Test result consistency + mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.1.0/app41.json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, false); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java new file mode 100644 index 000000000..bc43882a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app41/SpringDocApp41Test.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app41; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 41 test. + */ +@TestPropertySource(properties = "springdoc.cache.disabled=true") +class SpringDocApp41Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + // Test result consistency + mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + Path path = Paths.get(getClass().getClassLoader().getResource("results/3.1.0/app" + testNumber + ".json").toURI()); + byte[] fileBytes = Files.readAllBytes(path); + String expected = new String(fileBytes); + assertEquals(expected, result, false); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/HelloController.java new file mode 100644 index 000000000..70805316a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/HelloController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app42; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Tweets. + * + * @param id the id + */ + @GetMapping(value = "/tweets/{id}") + public void tweets(@PathVariable TweetId id) { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java new file mode 100644 index 000000000..2a6ff46bc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/SpringDocApp42Test.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app42; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.StringSchema; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc app 42 test. + */ +class SpringDocApp42Test extends AbstractSpringDocTest { + + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI().components(new Components().addSchemas("TweetId", new StringSchema())); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/TweetId.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/TweetId.java new file mode 100644 index 000000000..c8afcde6a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app42/TweetId.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app42; + +/** + * The type Tweet id. + */ +class TweetId { + /** + * The Value. + */ + private final String value; + + /** + * Instantiates a new Tweet id. + * + * @param value the value + */ + public TweetId(String value) { + this.value = value; + } + + /** + * Gets value. + * + * @return the value + */ + public String getValue() { + return value; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app43/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app43/HelloController.java new file mode 100644 index 000000000..a3b6f2310 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app43/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app43; + +import java.util.List; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Upload documents response entity. + * + * @param multipartFiles the multipart files + * @return the response entity + */ + @PostMapping(path = "/documents", consumes = "multipart/form-data") + public ResponseEntity uploadDocuments(@RequestPart("doc") List multipartFiles) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java new file mode 100644 index 000000000..4dafc1a19 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app43/SpringDocApp43Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app43; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 43 test. + */ +class SpringDocApp43Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app44/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app44/HelloController.java new file mode 100644 index 000000000..47c4dd70f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app44/HelloController.java @@ -0,0 +1,234 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app44; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController("/api") +class HelloController { + + /** + * Hello response entity. + * + * @param request the request + * @return the response entity + */ + @PostMapping(value = "/helloworld", produces = "application/json", consumes = "application/vnd.v1+json") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "Successful operation", content = @Content(schema = @Schema(implementation = HelloDTO1.class))), + @ApiResponse(responseCode = "400", description = "Bad name", content = @Content(schema = @Schema(implementation = ErrorDTO.class))) }) + public ResponseEntity hello(@RequestBody RequestV1 request) { + final String name = request.getNameV1(); + if ("error".equalsIgnoreCase(name)) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ErrorDTO("invalid name: " + name)); + } + return ResponseEntity.ok(new HelloDTO1("Greetings from Spring Boot v1! " + name)); + } + + /** + * Hello response entity. + * + * @param request the request + * @return the response entity + */ + @PostMapping(value = "/helloworld", produces = "application/json", consumes = "application/vnd.v2+json") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "Successful operation", content = @Content(schema = @Schema(implementation = HelloDTO2.class))), + @ApiResponse(responseCode = "400", description = "Bad name", content = @Content(schema = @Schema(implementation = ErrorDTO.class))) }) + public ResponseEntity hello(@RequestBody RequestV2 request) { + final String name = request.getNameV2(); + if ("error".equalsIgnoreCase(name)) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ErrorDTO("invalid name: " + name)); + } + return ResponseEntity.ok(new HelloDTO2("Greetings from Spring Boot v2! " + name)); + } + + /** + * The type Request v 1. + */ + static class RequestV1 { + /** + * The Name v 1. + */ + private String nameV1; + + /** + * Instantiates a new Request v 1. + */ + public RequestV1() { + } + + /** + * Gets name v 1. + * + * @return the name v 1 + */ + public String getNameV1() { + return nameV1; + } + + /** + * Sets name v 1. + * + * @param nameV1 the name v 1 + */ + public void setNameV1(String nameV1) { + this.nameV1 = nameV1; + } + } + + /** + * The type Request v 2. + */ + static class RequestV2 { + /** + * The Name v 2. + */ + private String nameV2; + + /** + * Instantiates a new Request v 2. + */ + public RequestV2() { + } + + /** + * Gets name v 2. + * + * @return the name v 2 + */ + public String getNameV2() { + return nameV2; + } + + /** + * Sets name v 2. + * + * @param nameV2 the name v 2 + */ + public void setNameV2(String nameV2) { + this.nameV2 = nameV2; + } + } + + /** + * The type Hello dto 1. + */ + class HelloDTO1 { + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Hello dto 1. + * + * @param message the message + */ + public HelloDTO1(String message) { + this.message = message; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + } + + /** + * The type Hello dto 2. + */ + class HelloDTO2 { + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Hello dto 2. + * + * @param message the message + */ + public HelloDTO2(String message) { + this.message = message; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + } + + /** + * The type Error dto. + */ + class ErrorDTO { + /** + * The Error message. + */ + private String errorMessage; + + /** + * Instantiates a new Error dto. + * + * @param errorMessage the error message + */ + public ErrorDTO(String errorMessage) { + this.errorMessage = errorMessage; + } + + /** + * Gets error message. + * + * @return the error message + */ + public String getErrorMessage() { + return errorMessage; + } + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java new file mode 100644 index 000000000..c3ea040a9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app44/SpringDocApp44Test.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app44; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 44 test. + */ +class SpringDocApp44Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf").isArray()).andExpect(jsonPath("$.paths./helloworld.post.responses.200.content.['application/json'].schema.oneOf[*].$ref", containsInAnyOrder("#/components/schemas/HelloDTO2", + "#/components/schemas/HelloDTO1"))) + .andExpect(jsonPath("$.paths./helloworld.post.requestBody.content.['application/vnd.v1+json'].schema.$ref", is("#/components/schemas/RequestV1"))) + .andExpect(jsonPath("$.paths./helloworld.post.requestBody.content.['application/vnd.v2+json'].schema.$ref", is("#/components/schemas/RequestV2"))) + .andExpect(jsonPath("$.paths./helloworld.post.responses.400.content.['application/json'].schema.$ref", is("#/components/schemas/ErrorDTO"))); + + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/HelloController.java new file mode 100644 index 000000000..af78a50c9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/HelloController.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +import java.util.Collections; +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@Tag(name = "People", description = "Use this resource to serve all requests and initiate all operations related to people") +@RestController +@RequestMapping(value = "/v1/people") +class HelloController { + + + /** + * List list. + * + * @return the list + */ + @Operation(description = "List all persons") + @SecurityRequirement(name = "bearer") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/list", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List list() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + + /** + * List two list. + * + * @return the list + */ + @Operation(description = "List all persons") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/listTwo", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List listTwo() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/HelloController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/HelloController2.java new file mode 100644 index 000000000..f3fd8b513 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/HelloController2.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +import java.util.Collections; +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller 2. + */ +@Tag(name = "People", description = "Use this resource to serve all requests and initiate all operations related to people") +@SecurityRequirement(name = "bearer") +@RestController +@RequestMapping(value = "/v1/people2") +class HelloController2 { + + + /** + * List list. + * + * @return the list + */ + @Operation(description = "List all persons") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/list", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List list() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + + /** + * List two list. + * + * @return the list + */ + @Operation(description = "List all persons") + @ApiResponse(responseCode = "200", description = "", content = @Content(array = @ArraySchema(schema = @Schema(implementation = PersonDTO.class)))) + @GetMapping(path = "/listTwo", consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public List listTwo() { + PersonDTO person = new PersonDTO(); + person.setFirstName("Nass"); + return Collections.singletonList(person); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/OpenApiConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/OpenApiConfig.java new file mode 100644 index 000000000..d1b5e4b94 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/OpenApiConfig.java @@ -0,0 +1,41 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.security.SecurityScheme; + +/** + * The type Open api config. + */ +@OpenAPIDefinition(info = @Info(title = "My App", description = "Some long and useful description", version = "v1", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0"))) +@SecurityScheme(name = "bearer", type = SecuritySchemeType.HTTP, scheme = "bearer", bearerFormat = "JWT") +class OpenApiConfig { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/PersonDTO.java new file mode 100644 index 000000000..bd943d434 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java new file mode 100644 index 000000000..98c7355a0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app45/SpringDocApp45Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app45; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 45 test. + */ +class SpringDocApp45Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app46/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app46/HelloController.java new file mode 100644 index 000000000..9ad99155b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app46/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app46; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param subscriptionId the subscription id + * @return the string + */ + @GetMapping("/persons/{subscriptionId}") + @Operation(operationId = "operationId", summary = "Operation Summary", description = "Operation Description", tags = { + "Example Tag" }, externalDocs = @ExternalDocumentation(description = "External documentation description", url = "http://url.com"), parameters = { + @Parameter(in = ParameterIn.PATH, name = "subscriptionId", required = true, description = "parameter description", allowEmptyValue = true, allowReserved = true, schema = @Schema(type = "string", format = "uuid", description = "the generated UUID", accessMode = Schema.AccessMode.READ_ONLY)) }, responses = { + @ApiResponse(responseCode = "200", description = "voila!", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) }) + public String persons(String subscriptionId) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java new file mode 100644 index 000000000..06490f5a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app46/SpringDocApp46Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app46; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 46 test. + */ +class SpringDocApp46Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app47/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app47/HelloController.java new file mode 100644 index 000000000..52f79e1bd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app47/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app47; + +import java.util.Locale; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + /** + * Gets documents with locale. + * + * @param locale the locale + * @return the documents with locale + */ + @GetMapping(path = "/documents/{locale}") + public ResponseEntity getDocumentsWithLocale( + @Parameter(schema = @Schema(type = "string")) @PathVariable("locale") Locale locale) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java new file mode 100644 index 000000000..7882cd709 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app47/SpringDocApp47Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app47; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 47 test. + */ +class SpringDocApp47Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/AbstractHelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/AbstractHelloController.java new file mode 100644 index 000000000..ed8119cb1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/AbstractHelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app48; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; + +/** + * The type Abstract hello controller. + */ +@ApiResponse(responseCode = "410") +@ApiResponses({ + @ApiResponse(responseCode = "411") +}) +class AbstractHelloController { + + /** + * Gets documents. + * + * @return the documents + */ + @GetMapping(path = "/documents/{locale}") + @ApiResponse(responseCode = "412") + @ApiResponses({ + @ApiResponse(responseCode = "413") + }) + public ResponseEntity getDocuments() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/HelloController.java new file mode 100644 index 000000000..edb352534 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app48; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController + +@ApiResponse(responseCode = "400") +@ApiResponses({ + @ApiResponse(responseCode = "401") +}) +class HelloController extends AbstractHelloController { + + /** + * Gets documents. + * + * @return the documents + */ + @Override + @GetMapping(path = "/documents/{locale}") + @ApiResponse(responseCode = "402") + @ApiResponses({ + @ApiResponse(responseCode = "403") + }) + public ResponseEntity getDocuments() { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java new file mode 100644 index 000000000..0d5db3517 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app48/SpringDocApp48Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app48; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 48 test. + */ +class SpringDocApp48Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/HelloController.java new file mode 100644 index 000000000..72442d74d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app49; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List list. + * + * @return the list + */ + @Operation(description = "Obtain the list of services available in the system") + @ApiResponses({ @ApiResponse(responseCode = "401", ref = "Unauthorized") }) + @GetMapping(value = "/hello", produces = MediaType.APPLICATION_JSON_VALUE) + List list() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java new file mode 100644 index 000000000..bafdc085c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/SpringDocApp49Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app49; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +/** + * The type Spring doc app 49 test. + */ +class SpringDocApp49Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/SpringDocTestApp.java new file mode 100644 index 000000000..2bda19fb3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app49/SpringDocTestApp.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app49; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.responses.ApiResponse; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The entry point of application. + * + * @param args the input arguments + */ + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + /** + * Define open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI defineOpenApi() { + OpenAPI api = new OpenAPI(); + api.components(new Components().addResponses("Unauthorized", + new ApiResponse().description("Unauthorized") + .content(new Content().addMediaType(MediaType.APPLICATION_JSON_VALUE, + new io.swagger.v3.oas.models.media.MediaType().schema(new StringSchema()))))); + return api; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/CustomOpenAPIConfig.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/CustomOpenAPIConfig.java new file mode 100644 index 000000000..e1622cd5e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/CustomOpenAPIConfig.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.tags.Tag; + +import org.springframework.context.annotation.Bean; + +/** + * The type Custom open api config. + */ +public class CustomOpenAPIConfig { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .components(new Components()) + .info(new Info().title("Custom API").version("100")).addTagsItem(new Tag().name("mytag")); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java new file mode 100644 index 000000000..d960a556c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest.java @@ -0,0 +1,174 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5.sample; + +import java.util.ArrayList; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.security.OAuthFlow; +import io.swagger.v3.oas.models.security.OAuthFlows; +import io.swagger.v3.oas.models.security.Scopes; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Open api resource bean configuration components security schemes test. + */ +@TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") +class OpenAPIResourceBeanConfigurationComponentsSecuritySchemesTest extends AbstractSpringDocTest { + + /** + * Given: Bean configuration with security scheme http basic (shouldDefineComponentsSecuritySchemesForHttpBasic) + * When: Get api-docs + * Then: Return security definitions http basic + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc + .perform(get("/api-docs")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.security[0].basicScheme", is(new ArrayList()))) + .andExpect(jsonPath("$.components.securitySchemes.basicScheme.type", is("http"))) + .andExpect(jsonPath("$.components.securitySchemes.basicScheme.scheme", is("basic"))) + ; + } + + /** + * Given: Bean configuration with security scheme API key + * When: Get api-docs + * Then: Return security definitions with API key + * @throws Exception the exception + */ + @Test + void shouldDefineComponentsSecuritySchemesForApiKey() throws Exception { + mockMvc + .perform(get("/api-docs")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.security[1].apiKeyScheme", is(new ArrayList()))) + .andExpect(jsonPath("$.components.securitySchemes.apiKeyScheme.type", is("apiKey"))) + .andExpect(jsonPath("$.components.securitySchemes.apiKeyScheme.in", is("header"))) + ; + } + + /** + * Given: Bean configuration with security scheme OAuth2 + * When: Get api-docs + * Then: Return security definitions with OAuth + * @throws Exception the exception + */ + @Test + void shouldDefineComponentsSecuritySchemesForOAuth2() throws Exception { + mockMvc + .perform(get("/api-docs")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.security[2].oAuthScheme", is(new ArrayList()))) + .andExpect(jsonPath("$.components.securitySchemes.oAuthScheme.type", is("oauth2"))) + .andExpect(jsonPath("$.components.securitySchemes.oAuthScheme.description", is("This API uses OAuth 2 with the implicit grant flow. [More info](https://api.example.com/docs/auth)"))) + .andExpect(jsonPath("$.components.securitySchemes.oAuthScheme.flows.implicit.authorizationUrl", is("https://api.example.com/oauth2/authorize"))) + .andExpect(jsonPath("$.components.securitySchemes.oAuthScheme.flows.implicit.scopes.read_pets", is("read your pets"))) + .andExpect(jsonPath("$.components.securitySchemes.oAuthScheme.flows.implicit.scopes.write_pets", is("modify pets in your account"))) + ; + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + + /** + * The type Config. + */ + @TestConfiguration + static class Config { + + /** + * Open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI openApi() { + return new OpenAPI() + .components(new Components() + + //HTTP Basic, see: https://swagger.io/docs/specification/authentication/basic-authentication/ + .addSecuritySchemes("basicScheme", new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("basic") + ) + + //API Key, see: https://swagger.io/docs/specification/authentication/api-keys/ + .addSecuritySchemes("apiKeyScheme", new SecurityScheme() + .type(SecurityScheme.Type.APIKEY) + .in(SecurityScheme.In.HEADER) + .name("X-API-KEY") + ) + + //OAuth 2.0, see: https://swagger.io/docs/specification/authentication/oauth2/ + .addSecuritySchemes("oAuthScheme", new SecurityScheme() + .type(SecurityScheme.Type.OAUTH2) + .description("This API uses OAuth 2 with the implicit grant flow. [More info](https://api.example.com/docs/auth)") + .flows(new OAuthFlows() + .implicit(new OAuthFlow() + .authorizationUrl("https://api.example.com/oauth2/authorize") + .scopes(new Scopes() + .addString("read_pets", "read your pets") + .addString("write_pets", "modify pets in your account") + ) + ) + ) + ) + ) + .addSecurityItem(new SecurityRequirement() + .addList("basicScheme") + ) + .addSecurityItem(new SecurityRequirement() + .addList("apiKeyScheme") + ) + .addSecurityItem(new SecurityRequirement() + .addList("oAuthScheme") + ) + ; + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenApiResourceCustomConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenApiResourceCustomConfigurationTest.java new file mode 100644 index 000000000..ad7c317fd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenApiResourceCustomConfigurationTest.java @@ -0,0 +1,73 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5.sample; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; +import test.org.springdoc.api.v31.app5.CustomOpenAPIConfig; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Import; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Open api resource custom configuration test. + */ +@Import(CustomOpenAPIConfig.class) +@TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") +class OpenApiResourceCustomConfigurationTest extends AbstractSpringDocTest { + + /** + * givenNoConfiguration_whenGetApiJson_returnsDefaultEmptyDocs - should return + * {"openapi":"3.1.0","info":{"title":"Custom API","version":"100"},"paths":{},"components":{}} + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc + .perform(get("/api-docs")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.info.title", is("Custom API"))) + .andExpect(jsonPath("$.info.version", is("100"))) + .andExpect(jsonPath("$.paths").isEmpty()) + .andExpect(jsonPath("$.components").isEmpty()) + .andExpect(jsonPath("$.tags").isNotEmpty()) + .andExpect(jsonPath("$.tags[0].name", is("mytag"))); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenApiResourceNoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenApiResourceNoConfigurationTest.java new file mode 100644 index 000000000..639f7aa00 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app5/sample/OpenApiResourceNoConfigurationTest.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app5.sample; + +import org.junit.jupiter.api.Test; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +import static org.hamcrest.Matchers.is; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Open api resource no configuration test. + */ +@TestPropertySource(properties = "springdoc.api-docs.path=/api-docs") +class OpenApiResourceNoConfigurationTest extends AbstractSpringDocTest { + + /** + * givenNoConfiguration_whenGetApiJson_returnsDefaultEmptyDocs - should return + * {"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"paths":{},"components":{}} + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc + .perform(get("/api-docs")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.info.title", is("OpenAPI definition"))) + .andExpect(jsonPath("$.info.version", is("v0"))) + .andExpect(jsonPath("$.paths").isEmpty()) + .andExpect(jsonPath("$.components").isEmpty()); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/HelloController.java new file mode 100644 index 000000000..1365038ad --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app50; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List list. + * + * @return the list + */ + @Operation(description = "Some operation", responses = { @ApiResponse(responseCode = "401") }) + //@ApiResponse(responseCode = "401", content = @Content()) + @GetMapping(value = "/hello", produces = MediaType.APPLICATION_JSON_VALUE) + List list() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java new file mode 100644 index 000000000..1e77b933d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/SpringDocApp50Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app50; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +/** + * The type Spring doc app 50 test. + */ +class SpringDocApp50Test extends AbstractSpringDocTest { + + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/SpringDocTestApp.java new file mode 100644 index 000000000..65c4c4631 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app50/SpringDocTestApp.java @@ -0,0 +1,70 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app50; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.responses.ApiResponse; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The entry point of application. + * + * @param args the input arguments + */ + public static void main(String[] args) { + SpringApplication.run(SpringDocTestApp.class, args); + } + + /** + * Define open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI defineOpenApi() { + OpenAPI api = new OpenAPI(); + api.components(new Components().addResponses("Unauthorized", + new ApiResponse().description("Unauthorized") + .content(new Content().addMediaType(MediaType.APPLICATION_JSON_VALUE, + new io.swagger.v3.oas.models.media.MediaType().schema(new StringSchema()))))); + return api; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app51/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app51/HelloController.java new file mode 100644 index 000000000..c166fe506 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app51/HelloController.java @@ -0,0 +1,115 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app51; + +import java.util.HashMap; +import java.util.Map; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test 1 string. + * + * @return the string + */ + @Operation(parameters = { + @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")) }) + @GetMapping("/test1") + public String test1() { + return "test"; + } + + /** + * Test 2 string. + * + * @param param1 the param 1 + * @return the string + */ + @Operation(parameters = { + @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")) }) + @GetMapping("/test2") + public String test2(@RequestParam(name = "param1") String param1) { + return "test"; + } + + /** + * Test 3 string. + * + * @param param1 the param 1 + * @return the string + */ + @Operation(parameters = { + @Parameter(in = ParameterIn.HEADER, name = "test_header", required = true, schema = @Schema(type = "string", example = "rherherherherh")), + @Parameter(description = "desc1", in = ParameterIn.QUERY, name = "param1", required = true, schema = @Schema(type = "string", example = "something")) }) + @GetMapping("/test3") + public String test3( + @RequestParam(name = "param1") @Parameter(description = "desc2", in = ParameterIn.QUERY) String param1) { + return "test"; + } + + /** + * Get string. + * + * @param path the path + * @param params the params + * @return the string + */ + @GetMapping("/test/{path}") + public String get( + @PathVariable String path, + @RequestParam(required = false) Map params) { + return null; + } + + /** + * Hello response entity. + * + * @param map the map + * @return the response entity + */ + @PostMapping + public ResponseEntity> hello(@RequestBody HashMap map) { + return ResponseEntity.ok(map); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java new file mode 100644 index 000000000..0be77d21c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app51/SpringDocApp51Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app51; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 51 test. + */ +class SpringDocApp51Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app52/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app52/HelloController.java new file mode 100644 index 000000000..3034ad0f5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app52/HelloController.java @@ -0,0 +1,104 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app52; + +import java.util.List; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Create test 1 string. + * + * @param username the username + * @param test the test + * @param imageFile the image file + * @return the string + */ + @PostMapping(value = "/test1/{username}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String createTest1(@PathVariable String username, @RequestPart("test") MyTestDto test, + @RequestPart("image") MultipartFile imageFile) { + return null; + } + + /** + * Create test 2 string. + * + * @param username the username + * @param imageFile the image file + * @param test the test + * @return the string + */ + @PostMapping(value = "/test2/{username}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String createTest2(@PathVariable String username, @RequestPart("image") MultipartFile imageFile, + @RequestPart("test") MyTestDto test) { + return null; + } + + /** + * Create test 3 string. + * + * @param test the test + * @param multipartFiles the multipart files + * @return the string + */ + @PostMapping(value = "/test3", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public String createTest3(@RequestPart("test") MyTestDto test, + @RequestPart("doc") List multipartFiles) { + return null; + } + + /** + * The type My test dto. + */ + class MyTestDto { + /** + * The Object 1. + */ + public String object1; + + /** + * The Object 2. + */ + public String object2; + + /** + * The Object 3. + */ + public String object3; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java new file mode 100644 index 000000000..0da503eb2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app52/SpringDocApp52Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app52; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 52 test. + */ +class SpringDocApp52Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/HelloController.java new file mode 100644 index 000000000..2ad6f5a94 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/HelloController.java @@ -0,0 +1,155 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app53; + + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List with no api response list. + * + * @return the list + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello1", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithNoApiResponse() { + return null; + } + + /** + * List with empty api response list. + * + * @return the list + */ + @Operation(description = "Some operation") + @ApiResponse + @GetMapping(value = "/hello2", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithEmptyApiResponse() { + return null; + } + + /** + * List with explicit response status list. + * + * @return the list + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello3", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.NO_CONTENT) + List listWithExplicitResponseStatus() { + return null; + } + + /** + * Gets dto with explicit response status. + * + * @return the dto with explicit response status + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello4", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.NO_CONTENT) + HelloDTO1 getDTOWithExplicitResponseStatus() { + return null; + } + + /** + * List with default response status list. + * + * @return the list + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello5", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithDefaultResponseStatus() { + return null; + } + + /** + * Gets dto with default response status. + * + * @return the dto with default response status + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello6", produces = MediaType.APPLICATION_JSON_VALUE) + HelloDTO1 getDTOWithDefaultResponseStatus() { + return null; + } + + /** + * Gets nested dto with default response status. + * + * @return the nested dto with default response status + */ + @Operation(description = "Some operation") + @GetMapping(value = "/hello7", produces = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity getNestedDTOWithDefaultResponseStatus() { + return null; + } + + /** + * The type Hello dto 1. + */ + static class HelloDTO1 { + /** + * The Message. + */ + private String message; + + /** + * Instantiates a new Hello dto 1. + * + * @param message the message + */ + public HelloDTO1(String message) { + this.message = message; + } + + /** + * Gets message. + * + * @return the message + */ + public String getMessage() { + return message; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/HelloControllerWithGlobalApiResponse.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/HelloControllerWithGlobalApiResponse.java new file mode 100644 index 000000000..7b57433d9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/HelloControllerWithGlobalApiResponse.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app53; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller with global api response. + */ +@RestController +@RequestMapping(path = "/global") +class HelloControllerWithGlobalApiResponse { + + /** + * List with no api response list. + * + * @return the list + */ + @Operation(description = "Some operation", responses = { + @ApiResponse(responseCode = "204", description = "Explicit description for this response") }) + @ResponseStatus(HttpStatus.NO_CONTENT) + @GetMapping(value = "/hello1", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithNoApiResponse() { + return null; + } + + /** + * List with default response status list. + * + * @return the list + */ + @Operation(description = "Some operation") + @ApiResponse(responseCode = "200", description = "Explicit description for this response") + @GetMapping(value = "/hello2", produces = MediaType.APPLICATION_JSON_VALUE) + List listWithDefaultResponseStatus() { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java new file mode 100644 index 000000000..91ffba758 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app53/SpringDocApp53Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app53; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 53 test. + */ +class SpringDocApp53Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/HelloController.java new file mode 100644 index 000000000..8822520e2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/HelloController.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app54; + +import com.fasterxml.jackson.annotation.JsonView; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets meal party. + * + * @param mealPartyId the meal party id + * @return the meal party + */ + @GetMapping(value = "/parties/{id}") + @JsonView(Views.Public.class) + @Operation(summary = "Gets meal party details [Meal party admin restricted]") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Successfully retrieved the meal party") }) + public MealParty getMealParty(@PathVariable("id") long mealPartyId) { + return null; + } + + /** + * Save meal party response entity. + * + * @param p the p + * @return the response entity + */ + @JsonView(Views.MealPartyAdmin.class) + @PostMapping(value = "/parties") + public ResponseEntity saveMealParty(@JsonView(Views.Public.class) @RequestBody MealParty p) { + return null; + } + + /** + * Save meal new party response entity. + * + * @param p the p + * @return the response entity + */ + @JsonView(Views.MealPartyAdmin.class) + @PostMapping(value = "/new-parties") + public ResponseEntity saveMealNewParty(@JsonView(Views.Public.class) @org.springframework.web.bind.annotation.RequestBody MealParty p) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/MealParty.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/MealParty.java new file mode 100644 index 000000000..19e4df19a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/MealParty.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app54; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonView; + +/** + * The type Meal party. + */ +class MealParty { + /** + * The Name. + */ + @JsonView(Views.Public.class) + private String name; + + /** + * The Members. + */ + @JsonView(Views.MealPartyAdmin.class) + private List members = new ArrayList<>(); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java new file mode 100644 index 000000000..47a45d231 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/SpringDocApp54Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app54; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 54 test. + */ +class SpringDocApp54Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/Views.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/Views.java new file mode 100644 index 000000000..7e37781a1 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app54/Views.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app54; + +/** + * The interface Views. + */ +public interface Views { + /** + * The interface Public. + */ + public interface Public { + } + + /** + * The interface Meal party admin. + */ + public interface MealPartyAdmin extends Public { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app55/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app55/HelloController.java new file mode 100644 index 000000000..86cc786b4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app55/HelloController.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app55; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * The type Hello controller. + */ +@Controller +@Tag(name = "health") +class HelloController { + + /** + * Ping endpoint used for health checks. + * @return the boolean + */ + @RequestMapping(value = "/ping", method = RequestMethod.GET) + @Operation(summary = "Simple health check") + @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK") }) + @ResponseBody + @ResponseStatus(HttpStatus.OK) + public Boolean ping() { + return true; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java new file mode 100644 index 000000000..cc4a756f0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app55/SpringDocApp55Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app55; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 55 test. + */ +class SpringDocApp55Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/GlobalExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/GlobalExceptionHandler.java new file mode 100644 index 000000000..d651df665 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/GlobalExceptionHandler.java @@ -0,0 +1,90 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app56; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * The type Global exception handler. + */ +@RestControllerAdvice +class GlobalExceptionHandler { + /** + * Handle unhandled error error dto. + * + * @return the error dto + */ + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ApiResponse( + responseCode = "500", + description = "Internal server error", + content = @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ErrorDTO.class) + ) + ) + ErrorDTO handleUnhandledError() { + return new ErrorDTO("internal error: "); + } + + /** + * The type Error dto. + */ + class ErrorDTO { + /** + * The Error message. + */ + private String errorMessage; + + /** + * Instantiates a new Error dto. + * + * @param errorMessage the error message + */ + ErrorDTO(String errorMessage) { + this.errorMessage = errorMessage; + } + + /** + * Gets error message. + * + * @return the error message + */ + public String getErrorMessage() { + return errorMessage; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/HelloController.java new file mode 100644 index 000000000..5c8e8a991 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app56; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping("/persons") + public String persons() { + return "OK"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java new file mode 100644 index 000000000..7b34847a2 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app56/SpringDocApp56Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app56; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 56 test. + */ +class SpringDocApp56Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app57/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app57/HelloController.java new file mode 100644 index 000000000..bf6d9085b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app57/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app57; + +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets text. + * + * @param name the name + * @return the text + */ + @GetMapping("/{name:.+}") + public ResponseEntity getText(@Parameter(description = "desc", required = true) @PathVariable String name) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java new file mode 100644 index 000000000..5cdc79e9d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app57/SpringDocApp57Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app57; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 57 test. + */ +class SpringDocApp57Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app58/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app58/HelloController.java new file mode 100644 index 000000000..c181b92fe --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app58/HelloController.java @@ -0,0 +1,183 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app58; + +import com.fasterxml.jackson.databind.JsonNode; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Example object. + * + * @param json the json + * @return the object + */ + @PostMapping("/examplePost") + @Operation(summary = "schema example") + public Object example(@Parameter(schema = @Schema(hidden = true)) JsonNode json) { + return null; + } + + /** + * Test. + * + * @param json the json + */ + @GetMapping("/example") + public void test(@Parameter(schema = @Schema(hidden = true)) JsonNode json) { + } + + /** + * Foobar. + * + * @param bar the bar + */ + @GetMapping(value = "/foo") + public void foobar(@Parameter(description = "User", name = "user", + schema = @Schema(implementation = PersonDTO.class)) @RequestParam("bar") String bar) { + + } + + /** + * Foobar 1. + * + * @param bar the bar + */ + @GetMapping(value = "/foo1") + public void foobar1(@Parameter(description = "User", name = "user", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PersonDTO.class))) @RequestParam("bar") String bar) { + + } + + /** + * The type Person dto. + */ + class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java new file mode 100644 index 000000000..07676f642 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app58/SpringDocApp58Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app58; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 58 test. + */ +class SpringDocApp58Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app59/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app59/HelloController.java new file mode 100644 index 000000000..e84dcf92f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app59/HelloController.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app59; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + /** + * Test. + */ + @Deprecated + @GetMapping("/example") + public void test() { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java new file mode 100644 index 000000000..ff32d078d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app59/SpringDocApp59Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app59; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 59 test. + */ +class SpringDocApp59Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app6/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app6/HelloController.java new file mode 100644 index 000000000..51d789bc3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app6/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Say hello response entity. + * + * @return the response entity + */ + @Operation(summary = "Get Something by key", responses = { + @ApiResponse(description = "Successful Operation", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(oneOf = { + String.class, Integer.class }), examples = { + @ExampleObject(name = "The String example", value = "urgheiurgheirghieurg"), + @ExampleObject(name = "The Integer example", value = "311414") })), + @ApiResponse(responseCode = "404", description = "Thing not found"), + @ApiResponse(responseCode = "401", description = "Authentication Failure") }) + @GetMapping(value = "/hello") + ResponseEntity sayHello() { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java new file mode 100644 index 000000000..822927bd7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app6/SpringDocApp6Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app6; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 6 test. + */ +class SpringDocApp6Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/HelloController.java new file mode 100644 index 000000000..e4623cb87 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/HelloController.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app60; + +import java.util.List; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * List 1 list. + * + * @param page the page + * @param size the size + * @return the list + */ + @GetMapping("/hello1") + @Operation(summary = "summary1") + @Parameters({ + @Parameter(name = "page", description = "The page"), + @Parameter(name = "size", description = "The size") + }) + public List list1(String page, String size) { + return null; + } + + /** + * List 2 list. + * + * @param page the page + * @param size the size + * @param sort the sort + * @return the list + */ + @GetMapping("/hello2") + @Operation(summary = "summary2") + @QuerySort + @QueryPaging + public List list2(String page, String size, String sort) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/QueryPaging.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/QueryPaging.java new file mode 100644 index 000000000..f80fb53c8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/QueryPaging.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app60; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; + +/** + * The interface Query paging. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.METHOD }) +@Parameters({ + @Parameter(name = "page", description = "desc page from Annotated interface"), + @Parameter(name = "size", description = "desc page from Annotated interface") +}) +public @interface QueryPaging { +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/QuerySort.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/QuerySort.java new file mode 100644 index 000000000..1e958b1b3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/QuerySort.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app60; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Parameter; + +/** + * The interface Query sort. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.METHOD }) +@Parameter(name = "sort", description = "desc sort from Annotated interface") +public @interface QuerySort { +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java new file mode 100644 index 000000000..6a200d274 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app60/SpringDocApp60Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app60; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 60 test. + */ +class SpringDocApp60Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app61/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app61/HelloController.java new file mode 100644 index 000000000..1bf5498d9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app61/HelloController.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app61; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Persons string. + * + * @param name the name + * @param phone the phone + * @param createdFrom the created from + * @param createdRange the created range + * @return the string + */ + @Operation(description = "List", parameters = { + @Parameter(description = "Name", name = "name", in = ParameterIn.QUERY), + @Parameter(description = "Phone", name = "phone", in = ParameterIn.QUERY), + @Parameter(description = "createdFrom", name = "createdFrom", in = ParameterIn.QUERY, content = @Content(array = @ArraySchema(schema = @Schema(type = "string")))), + @Parameter(description = "createdRange", name = "createdRange", in = ParameterIn.QUERY, array = @ArraySchema(schema = @Schema(type = "string", format = "date"), minItems = 2, maxItems = 2)) + }) + @GetMapping(value = "/persons-with-user") + public String persons(String name, String phone, String createdFrom, String createdRange) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java new file mode 100644 index 000000000..cad6e2c20 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app61/SpringDocApp61Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app61; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 61 test. + */ +class SpringDocApp61Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/BaseController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/BaseController.java new file mode 100644 index 000000000..4bcbdafa5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/BaseController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app62; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The interface Base controller. + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@RestController +@RequestMapping +public @interface BaseController { + /** + * Value string [ ]. + * + * @return the string [ ] + */ + @AliasFor(annotation = RequestMapping.class) + String[] value() default {}; + + /** + * Produces string [ ]. + * + * @return the string [ ] + */ + @AliasFor(annotation = RequestMapping.class) + String[] produces() default { MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE }; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java new file mode 100644 index 000000000..ecc033658 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/SpringDocApp62Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app62; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 62 test. + */ +class SpringDocApp62Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/TestController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/TestController.java new file mode 100644 index 000000000..e439ecde9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app62/TestController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app62; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +/** + * The type Test controller. + */ +@BaseController +@Tag(name = "Test Controller") +class TestController { + + /** + * Test string. + * + * @param accept the accept + * @return the string + */ + @RequestMapping(value = "/test", method = RequestMethod.GET) + @Operation(summary = "This is the test endpoint") + public String test(@RequestHeader("Accept") String accept) { + return "This is a test"; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java new file mode 100644 index 000000000..5e802b243 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app63/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app63; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param header the header + * @param request the request + * @param response the response + * @param locale the locale + * @param hello the hello + */ + @GetMapping("/test") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java new file mode 100644 index 000000000..d772a9e33 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app63/SpringDocApp63Test.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app63; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + + +/** + * The type Spring doc app 63 test. + */ +@TestPropertySource(properties = { + "springdoc.packagesToScan=hell,hello1, hello.me", + "springdoc.packagesToExclude=test.org.springdoc.api.app63.65" }) +class SpringDocApp63Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java new file mode 100644 index 000000000..d9c64e48c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app64/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app64; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test 1. + * + * @param hello the hello + */ + @GetMapping("/v1/test") + public void test1(String hello) { + } + + /** + * Test 2 string. + * + * @param from the from + * @return the string + */ + @GetMapping(value = "/api/balance/abcd") + @Operation(summary = "This is the test endpoint") + public String test2(String from) { + return "This is a fake test"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java new file mode 100644 index 000000000..9bd6a6ade --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app64/SpringDocApp64Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app64; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 64 test. + */ +@TestPropertySource(properties = "springdoc.paths-to-match=/v1, /api/**") +class SpringDocApp64Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java new file mode 100644 index 000000000..71f28af06 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app65/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app65; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@Tag(name = "Health", description = "Health check / ping API") +@RestController +class HelloController { + + /** + * Ping response entity. + * + * @return the response entity + */ + @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") + @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) + public ResponseEntity ping() { + return ResponseEntity.ok("Healthy"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java new file mode 100644 index 000000000..a8f366b63 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app65/SpringDocApp65Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app65; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 65 test. + */ +class SpringDocApp65Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/DefaultHealthCheckApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/DefaultHealthCheckApi.java new file mode 100644 index 000000000..bff94f38d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/DefaultHealthCheckApi.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import java.time.LocalDate; + +import io.swagger.v3.oas.annotations.Hidden; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Default health check api. + */ +@RestController +@Hidden +class DefaultHealthCheckApi { + + /** + * Test date echo string. + * + * @param date the date + * @return the string + */ + @GetMapping("/test/date/echo/{date}") + public String testDateEcho(@DateTimeFormat(pattern = "yyyyMMdd") @PathVariable LocalDate date) { + return date.toString(); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/HelloController.java new file mode 100644 index 000000000..f5351936e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/HelloController.java @@ -0,0 +1,56 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@Tag(name = "Health", description = "Health check / ping API") +@RestController +class HelloController { + + /** + * Ping response entity. + * + * @param possiblyInjectedByAspect the possibly injected by aspect + * @return the response entity + */ + @Operation(summary = "Check server status", description = "Check server status, will return 200 with simple string if alive. Do nothing else.") + @GetMapping(value = { "/ping", "/health", "/" }, produces = MediaType.TEXT_PLAIN_VALUE) + public ResponseEntity ping(UndocumentedClass possiblyInjectedByAspect) { + return ResponseEntity.ok("Healthy"); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java new file mode 100644 index 000000000..39b64bddd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/SpringDocApp66Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 66 test. + */ +class SpringDocApp66Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/UndocumentedClass.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/UndocumentedClass.java new file mode 100644 index 000000000..85e133dea --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app66/UndocumentedClass.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app66; + +import io.swagger.v3.oas.annotations.Hidden; + +/** + * The type Undocumented class. + */ +@Hidden +class UndocumentedClass { + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java new file mode 100644 index 000000000..3dd8f832a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app67/HelloController.java @@ -0,0 +1,141 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app67; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping(path = "/demo", + produces = MediaType.TEXT_PLAIN_VALUE) +class HelloController { + + /** + * Operation 1 string. + * + * @return the string + */ + @GetMapping("operation1") + @Operation(summary = "Operation 1 (expected result - no parameters)") + public String operation1() { + return "operation1"; + } + + /** + * Operation 2 string. + * + * @return the string + */ + @GetMapping("operation2") + @Operation(summary = "Operation 2 (expected result - 3 parameters)", parameters = { + @Parameter(name = "pageNumber", description = "page number", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "pageSize", description = "page size", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "sort", description = "sort specification", + in = ParameterIn.QUERY, schema = @Schema(type = "string")) + }) + public String operation2() { + return "operation2"; + } + + /** + * Operation 3 string. + * + * @return the string + */ + @GetMapping("operation3") + @Operation(summary = "Operation 3 (expected result - 3 parameters)") + @Parameters({ + @Parameter(name = "pageNumber", description = "page number", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "pageSize", description = "page size", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "sort", description = "sort specification", + in = ParameterIn.QUERY, schema = @Schema(type = "string")) + }) + public String operation3() { + return "operation3"; + } + + /** + * Operation 4 string. + * + * @return the string + */ + @GetMapping("operation4") + @Operation(summary = "Operation 4 (expected result - 3 parameters)") + @QueryPaging + @QuerySort + public String operation4() { + return "operation4"; + } + + /** + * The interface Query paging. + */ + @Retention(RetentionPolicy.RUNTIME) + @Target({ ElementType.METHOD }) + @Parameters({ + @Parameter(name = "pageNumber", description = "page number", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "pageSize", description = "page size", + in = ParameterIn.QUERY, schema = @Schema(type = "integer")) + }) + public @interface QueryPaging { + + } + + /** + * The interface Query sort. + */ + @Retention(RetentionPolicy.RUNTIME) + @Target({ ElementType.METHOD }) + @Parameters({ + @Parameter(name = "sort", description = "sort specification", + in = ParameterIn.QUERY, schema = @Schema(type = "string")) + }) + public @interface QuerySort { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java new file mode 100644 index 000000000..4bc3c0dbf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app67/SpringDocApp67Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app67; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 67 test. + */ +class SpringDocApp67Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/HelloController.java new file mode 100644 index 000000000..a3e473485 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +import java.util.concurrent.Callable; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets tasks. + * + * @param str the str + * @return the tasks + */ + @RequestMapping(value = "/tasks", method = RequestMethod.GET) + private Callable> getTasks(String str) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/PersonDTO.java new file mode 100644 index 000000000..f238d47cb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java new file mode 100644 index 000000000..fc36283cb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app69/SpringDocApp69Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app69; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 69 test. + */ +class SpringDocApp69Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java new file mode 100644 index 000000000..906770a6b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app7/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Search employee. + * + * @param test the test + */ + @Operation(summary = "test Request") + @RequestBody(description = "test value", required = true, content = @Content(schema = @Schema(implementation = String.class))) + @PostMapping("/test") + public void searchEmployee(String test) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java new file mode 100644 index 000000000..6d134378a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app7/SpringDocApp7Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app7; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 7 test. + */ +class SpringDocApp7Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/HelloController.java new file mode 100644 index 000000000..ef1f1428e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/HelloController.java @@ -0,0 +1,57 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import test.org.springdoc.api.v31.app70.customizer.CustomizedOperation; +import test.org.springdoc.api.v31.app70.customizer.CustomizedParameter; +import test.org.springdoc.api.v31.app70.model.ApiType; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test api type. + * + * @param test the test + * @return the api type + */ + @CustomizedOperation + @Operation(description = "Some operation") + @GetMapping("/example/{test}") + public ApiType test(@PathVariable @CustomizedParameter @Parameter(description = "Parameter description") String test) { + return new ApiType(); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java new file mode 100644 index 000000000..19940db3f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/SpringDocApp70Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 70 test. + */ +class SpringDocApp70Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedOperation.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedOperation.java new file mode 100644 index 000000000..62dbfd165 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedOperation.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * The interface Customized operation. + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedOperation { + /** + * Addition string. + * + * @return the string + */ + String addition() default "customized operation!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedParameter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedParameter.java new file mode 100644 index 000000000..811717b4a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedParameter.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * The interface Customized parameter. + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedParameter { + /** + * Addition string. + * + * @return the string + */ + String addition() default "customized parameter!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedProperty.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedProperty.java new file mode 100644 index 000000000..0e43ed629 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/CustomizedProperty.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * The interface Customized property. + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface CustomizedProperty { + /** + * Addition string. + * + * @return the string + */ + String addition() default "customized property!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/OperationCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/OperationCustomizer.java new file mode 100644 index 000000000..c79543eb6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/OperationCustomizer.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import io.swagger.v3.oas.models.Operation; + +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; + +/** + * The type Operation customizer. + */ +@Component +class OperationCustomizer implements org.springdoc.core.customizers.OperationCustomizer { + /** + * Customize operation. + * + * @param operation the operation + * @param handlerMethod the handler method + * @return the operation + */ + @Override + public Operation customize(Operation operation, HandlerMethod handlerMethod) { + CustomizedOperation annotation = handlerMethod.getMethodAnnotation(CustomizedOperation.class); + if (annotation != null) { + operation.description(operation.getDescription() + ", " + annotation.addition()); + } + return operation; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/ParameterCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/ParameterCustomizer.java new file mode 100644 index 000000000..97e2c69b8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/ParameterCustomizer.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import io.swagger.v3.oas.models.parameters.Parameter; + +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; + +/** + * The type Parameter customizer. + */ +@Component +class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { + /** + * Customize parameter. + * + * @param parameterModel the parameter model + * @param methodParameter the method parameter + * @return the parameter + */ + @Override + public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { + CustomizedParameter annotation = methodParameter.getParameterAnnotation(CustomizedParameter.class); + if (annotation != null) { + parameterModel.description(parameterModel.getDescription() + ", " + annotation.addition()); + } + return parameterModel; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/PropertyCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/PropertyCustomizer.java new file mode 100644 index 000000000..bd4056588 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/customizer/PropertyCustomizer.java @@ -0,0 +1,78 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.customizer; + +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.Collections; +import java.util.Optional; +import java.util.stream.Stream; + +import com.fasterxml.jackson.databind.JavaType; +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; +import org.springdoc.core.providers.ObjectMapperProvider; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * The type Property customizer. + */ +@Component +class PropertyCustomizer implements org.springdoc.core.customizers.PropertyCustomizer { + + @Autowired + ObjectMapperProvider objectMapperProvider; + + /** + * Customize schema. + * + * @param property the property + * @param type the type + * @return the schema + */ + @Override + public Schema customize(Schema property, AnnotatedType type) { + Annotation[] ctxAnnotations = type.getCtxAnnotations(); + if (ctxAnnotations == null) { + return property; + } + + Optional propertyAnnotation = Stream.of(ctxAnnotations) + .filter(CustomizedProperty.class::isInstance) + .findFirst() + .map(CustomizedProperty.class::cast); + + JavaType javaType = objectMapperProvider.jsonMapper().constructType(type.getType()); + if (javaType.getRawClass().equals(Duration.class)) { + property = new StringSchema().format("duration").properties(Collections.emptyMap()); + } + return property; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/model/ApiType.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/model/ApiType.java new file mode 100644 index 000000000..8122e6b3e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app70/model/ApiType.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app70.model; + +import java.time.Duration; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import test.org.springdoc.api.v31.app70.customizer.CustomizedProperty; + +/** + * The type Api type. + */ +public class ApiType { + /** + * The Some property. + */ + @CustomizedProperty + @Schema(description = "Test description") + @JsonProperty("someProperty") + private Duration someProperty; + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/Dog.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/Dog.java new file mode 100644 index 000000000..15edf4069 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/Dog.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + + +/** + * The type Dog. + */ +@Schema(name = "Dog") +class Dog { + + /** + * The Display name. + */ + @JsonProperty("display_name") + @Schema( + name = "display_name", + description = "A name given to the Dog", + example = "Fido" + ) + String displayName; + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/HelloController.java new file mode 100644 index 000000000..62c58d4ce --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @param dog the dog + * @return the string + */ + @PostMapping("/persons") + public String persons(Dog dog) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java new file mode 100644 index 000000000..9be9c164f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app71/SpringDocApp71Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app71; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 71 test. + */ +class SpringDocApp71Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java new file mode 100644 index 000000000..3a97833ba --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/BlockingAutoConfigurationTest.java @@ -0,0 +1,130 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.FilteredClassLoader; +import org.springframework.boot.test.context.runner.ApplicationContextRunner; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * The type Blocking auto configuration test. + */ +class BlockingAutoConfigurationTest { + + /** + * The Context runner. + */ + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + + /** + * Configurations not loaded when application is not web. + */ + @Test + void configurations_not_loaded_when_application_is_not_web() { + new ApplicationContextRunner() + .withUserConfiguration(TestApp.class) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Actuator configuration not loaded when not enabled explicitly. + */ + @Test + void actuator_configuration_not_loaded_when_not_enabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("actuatorPprrovider") + .hasBean("multipleOpenApiResource") + ); + } + + /** + * Configurations not loaded when disabled. + */ + @Test + void configurations_not_loaded_when_disabled() { + contextRunner + .withPropertyValues("springdoc.api-docs.enabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Configurations not loaded when mvc is not on class path. + */ + @Test + void configurations_not_loaded_when_mvc_is_not_on_class_path() { + contextRunner + .withClassLoader(new FilteredClassLoader("org.springframework.web.context.support.GenericWebApplicationContext")) + .run(context -> assertThat(context) + .hasNotFailed() + .doesNotHaveBean("openApiResource") + .doesNotHaveBean("actuatorProvider") + .doesNotHaveBean("multipleOpenApiResource") + ); + + } + + /** + * The type Test app. + */ + @SpringBootApplication + static class TestApp { + /** + * Test grouped open api grouped open api. + * + * @return the grouped open api + */ + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java new file mode 100644 index 000000000..2079aabdd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/CacheAutoConfigurationTest1.java @@ -0,0 +1,114 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import org.junit.jupiter.api.Test; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * The type Cache auto configuration test 1. + */ +class CacheAutoConfigurationTest1 { + + /** + * The Context runner. + */ + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + /** + * Cache configuration loaded when not disabled explicitly. + */ + @Test + void cache_configuration_loaded_when_not_disabled_explicitly() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Cache configuration loaded when disabled explicitly. + */ + @Test + void cache_configuration_loaded_when_disabled_explicitly() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=false") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .doesNotHaveBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Cache configurations successfully disabled. + */ + @Test + void cache_configurations_successfully_disabled() { + contextRunner + .withPropertyValues("springdoc.cache.disabled=true") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .doesNotHaveBean("multipleOpenApiResource") + ); + } + + /** + * Group configuration loaded. + */ + @Test + void group_configuration_loaded() { + contextRunner + .withPropertyValues("springdoc.group-configs[0].group=stores", "springdoc.group-configs[0].paths-to-match=/store/**") + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("multipleOpenApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + ); + } + + + /** + * The type Test app. + */ + @EnableAutoConfiguration + static class TestApp { + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java new file mode 100644 index 000000000..11bfec015 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app72/GroupAutoConfigurationTest.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app72; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.models.GroupedOpenApi; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.context.annotation.Bean; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * The type Group auto configuration test. + */ +class GroupAutoConfigurationTest { + + /** + * The Context runner. + */ + private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() + .withUserConfiguration(TestApp.class); + + /** + * Group configuration loaded. + */ + @Test + void group_configuration_loaded() { + contextRunner + .run(context -> assertThat(context) + .hasNotFailed() + .hasBean("openApiResource") + .hasBean("springdocBeanFactoryPostProcessor") + .hasBean("multipleOpenApiResource") + ); + } + + /** + * The type Test app. + */ + @EnableAutoConfiguration + static class TestApp { + /** + * Test grouped open api grouped open api. + * + * @return the grouped open api + */ + @Bean + GroupedOpenApi testGroupedOpenApi() { + return GroupedOpenApi.builder() + .group("test-group") + .packagesToScan("org.test") + .build(); + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app73/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app73/HelloController.java new file mode 100644 index 000000000..c2d6ec353 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app73/HelloController.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app73; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping({ "/{country_code}/persons/", "/persons" }) +class HelloController { + + /** + * Delete. + * + * @param countryCode the country code + * @param id the id + */ + @DeleteMapping("/{id}") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void delete(@Parameter(name = "country_code", in = ParameterIn.QUERY) String countryCode, @PathVariable("id") String id) { + + } + + /** + * Get string. + * + * @param countryCode the country code + * @param id the id + * @return the string + */ + @GetMapping("/{id}") + public String get(@Parameter(name = "country_code", in = ParameterIn.QUERY) String countryCode, @PathVariable("id") String id) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java new file mode 100644 index 000000000..7d51c391e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app73/SpringDocApp73Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app73; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 73 test. + */ +class SpringDocApp73Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app74/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app74/HelloController.java new file mode 100644 index 000000000..1379be33a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app74/HelloController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app74; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Post my request body string. + * + * @param myRequestBody the my request body + * @return the string + */ + @PostMapping("/test") + @RequestBody( + content = @Content( + examples = @ExampleObject( + value = "sample" + ) + ) + ) + public String postMyRequestBody( + String myRequestBody) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java new file mode 100644 index 000000000..238d0ec21 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app74/SpringDocApp74Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app74; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 74 test. + */ +class SpringDocApp74Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/HelloController.java new file mode 100644 index 000000000..da4f15d72 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/HelloController.java @@ -0,0 +1,127 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Post my request body 1 string. + * + * @return the string + */ + @PostMapping("/test1/{uuid}") + @Operation(summary = "Example api that realize an ECHO operation", + description = "The result of the echo is the input value of the api", + parameters = { @Parameter(in = ParameterIn.PATH, + name = "uuid", + required = true, + description = "Is the identification of the document", + schema = @Schema(type = "string", + example = "uuid")) } + + + ) + @ApiResponses(value = { + @ApiResponse(description = "Successful Operation", + responseCode = "200", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PersonDTO.class))), + @ApiResponse(responseCode = "201", + description = "other possible response") + }) + public String postMyRequestBody1() { + return null; + } + + /** + * Post my request body 2 string. + * + * @return the string + */ + @PostMapping("/test2/{uuid}") + @Operation(summary = "Example api that realize an ECHO operation", + description = "The result of the echo is the input value of the api", + responses = { + @ApiResponse(description = "Successful Operation", + responseCode = "200", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PersonDTO.class))), + @ApiResponse(responseCode = "201", + description = "other possible response") + }, + parameters = { @Parameter(in = ParameterIn.PATH, + name = "uuid", + required = true, + description = "Is the identification of the document", + schema = @Schema(type = "string", + example = "uuid")) } + + + ) + public String postMyRequestBody2() { + return null; + } + + /** + * Post my request body 3 string. + * + * @return the string + */ + @PostMapping("/test3/{uuid}") + @Operation(summary = "Example api that realize an ECHO operation", + description = "The result of the echo is the input value of the api", + parameters = { @Parameter(in = ParameterIn.PATH, + name = "uuid", + required = true, + description = "Is the identification of the document", + schema = @Schema(type = "string", + example = "uuid")) } + + + ) + @ApiResponse(responseCode = "201", + description = "other possible response") + public String postMyRequestBody3() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/PersonDTO.java new file mode 100644 index 000000000..f50704efb --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/RestResponseEntityExceptionHandler.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/RestResponseEntityExceptionHandler.java new file mode 100644 index 000000000..f481b5fe8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/RestResponseEntityExceptionHandler.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import java.util.List; + +import jakarta.servlet.http.HttpServletRequest; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; + +/** + * The type Rest response entity exception handler. + */ +@ControllerAdvice +class RestResponseEntityExceptionHandler + extends ResponseEntityExceptionHandler { + /** + * Bad request response entity. + * + * @param req the req + * @param exception the exception + * @return the response entity + */ + @ResponseStatus(value = HttpStatus.OK) + @ExceptionHandler({ Exception.class }) + public ResponseEntity> badRequest(HttpServletRequest req, Exception exception) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java new file mode 100644 index 000000000..663f68f88 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app75/SpringDocApp75Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app75; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 75 test. + */ +class SpringDocApp75Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java new file mode 100644 index 000000000..bd1a4a97f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app76/HelloController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app76; + +import io.swagger.v3.oas.annotations.security.SecurityRequirements; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Secured string. + * + * @return the string + */ + @GetMapping("/secure") + @ResponseBody + public String secured() { + return "It works!"; + } + + /** + * Open string. + * + * @return the string + */ + @GetMapping("/open") + @ResponseBody + @SecurityRequirements + public String open() { + return "It works!"; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java new file mode 100644 index 000000000..073191476 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app76/SpringDocApp76Test.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app76; + +import java.util.Arrays; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +/** + * The type Spring doc app 76 test. + */ +class SpringDocApp76Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI openAPI() { + return new OpenAPI() + .components(new Components().addSecuritySchemes("bearer-jwt", + new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT")) + ) + .addSecurityItem( + new SecurityRequirement().addList("bearer-jwt", Arrays.asList("read", "write"))); + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app77/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app77/HelloController.java new file mode 100644 index 000000000..9e072c0fa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app77/HelloController.java @@ -0,0 +1,71 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app77; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.extensions.Extension; +import io.swagger.v3.oas.annotations.extensions.ExtensionProperty; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import org.hibernate.validator.constraints.NotBlank; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @ApiResponse(content = @Content(schema = @Schema(type = "string")), extensions = @Extension(properties = @ExtensionProperty(name = "x-is-file", value = "true"))) + @GetMapping(value = "/persons") + public void persons(@Valid @NotBlank String name) { + + } + + + /** + * Persons 2. + * + * @param name the name + */ + @Operation(responses = @ApiResponse(content = @Content(schema = @Schema(type = "string")), extensions = @Extension(properties = @ExtensionProperty(name = "x-is-file", value = "true")))) + @GetMapping(value = "/persons2") + public void persons2(@Valid @NotBlank String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java new file mode 100644 index 000000000..c8032fb24 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app77/SpringDocApp77Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app77; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 77 test. + */ +class SpringDocApp77Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java new file mode 100644 index 000000000..e977fdf89 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/HelloController.java @@ -0,0 +1,65 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app78; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets person 1. + * + * @param str the str + * @return the person 1 + */ + @RequestMapping(value = "/person1", method = RequestMethod.GET) + private CompletionStage> getPerson1(String str) { + return null; + } + + /** + * Gets person 2. + * + * @param str the str + * @return the person 2 + */ + @RequestMapping(value = "/person2", method = RequestMethod.GET) + private CompletableFuture getPerson2(String str) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/PersonDTO.java new file mode 100644 index 000000000..280e22b31 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app78; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java new file mode 100644 index 000000000..be8a419fa --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app78/SpringDocApp78Test.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app78; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 78 test. + */ +class SpringDocApp78Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app79/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app79/HelloController.java new file mode 100644 index 000000000..077c8536e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app79/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app79; + +import java.util.Optional; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Echo string. + * + * @param text the text + * @return the string + */ + @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test") + public String echo(@RequestParam Optional text) { + return text.orElse("not-specified"); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java new file mode 100644 index 000000000..1377e4759 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app79/SpringDocApp79Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app79; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +/** + * The type Spring doc app 79 test. + */ +class SpringDocApp79Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app8/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app8/HelloController.java new file mode 100644 index 000000000..cdbda9a24 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app8/HelloController.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app8; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param hello the hello + */ + @GetMapping("/test") + public void test(String hello) { + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java new file mode 100644 index 000000000..e210ed251 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app8/SpringDocApp8Test.java @@ -0,0 +1,60 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app8; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + + +/** + * The type Spring doc app 8 test. + */ +class SpringDocApp8Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get("/myapp" + Constants.DEFAULT_API_DOCS_URL).contextPath("/myapp")) + .andExpect(status().isOk()); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/HelloController.java new file mode 100644 index 000000000..aa5d16e1c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/HelloController.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +import java.net.URISyntaxException; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + + /** + * Testpost 1 response entity. + * + * @param dto the dto + * @return the response entity + * @throws URISyntaxException the uri syntax exception + */ + @RequestMapping(value = "/testpost1", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity testpost1(@RequestBody TestObject dto) throws URISyntaxException { + return ResponseEntity.ok(dto); + } + + /** + * Testpost 2 response entity. + * + * @param dto the dto + * @return the response entity + * @throws URISyntaxException the uri syntax exception + */ + @RequestMapping(value = "/testpost2", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity testpost2(@RequestBody TestObject dto) throws URISyntaxException { + return ResponseEntity.ok(dto); + } + + /** + * Hello response entity. + * + * @return the response entity + * @throws URISyntaxException the uri syntax exception + */ + @RequestMapping(value = "/hello", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity hello() throws URISyntaxException { + return ResponseEntity.ok("Hello World"); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java new file mode 100644 index 000000000..954b4a88b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/SpringDocApp80Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +/** + * The type Spring doc app 80 test. + */ +@ActiveProfiles("80") +class SpringDocApp80Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/TestObject.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/TestObject.java new file mode 100644 index 000000000..0cd8ecc1f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app80/TestObject.java @@ -0,0 +1,80 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app80; + +import java.time.LocalDateTime; + +/** + * The type Test object. + */ +class TestObject { + /** + * The String value. + */ + public String stringValue; + + /** + * The Local date time. + */ + public LocalDateTime localDateTime; + + /** + * Gets string value. + * + * @return the string value + */ + public String getStringValue() { + return stringValue; + } + + /** + * Sets string value. + * + * @param stringValue the string value + */ + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + /** + * Gets local date time. + * + * @return the local date time + */ + public LocalDateTime getLocalDateTime() { + return localDateTime; + } + + /** + * Sets local date time. + * + * @param localDateTime the local date time + */ + public void setLocalDateTime(LocalDateTime localDateTime) { + this.localDateTime = localDateTime; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app81/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app81/HelloController.java new file mode 100644 index 000000000..cbf695ba8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app81/HelloController.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app81; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Test string. + * + * @return the string + */ + @RequestMapping + public String test() { + return "ok"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java new file mode 100644 index 000000000..d05f5977b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app81/SpringDocApp81Test.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app81; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.startsWith; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * The type Spring doc app 81 test. + */ +class SpringDocApp81Test extends AbstractSpringDocTest { + + /** + * Test app. + * + * @throws Exception the exception + */ + @Test + protected void testApp() throws Exception { + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andExpect(jsonPath("$.paths./api.get.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.get.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.get.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.post.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.post.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.post.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.put.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.put.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.put.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.patch.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.patch.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.patch.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.delete.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.delete.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.delete.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.options.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.options.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.options.responses.200.content.['*/*'].schema.type", is("string"))) + .andExpect(jsonPath("$.paths./api.head.tags[0]", containsString("hello-controller"))) + .andExpect(jsonPath("$.paths./api.head.operationId", startsWith("test"))) + .andExpect(jsonPath("$.paths./api.head.responses.200.content.['*/*'].schema.type", is("string"))); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/HelloController.java new file mode 100644 index 000000000..5172ba8e8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Put response entity. + * + * @param configuration the configuration + * @param second the second + * @param personDTO the person dto + * @return the response entity + */ + @PutMapping(value = "/test") + public ResponseEntity put( + String configuration, + String second, PersonDTO personDTO) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/PersonDTO.java new file mode 100644 index 000000000..97f98c040 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java new file mode 100644 index 000000000..e61d1eae8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app82/SpringDocApp82Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app82; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 82 test. + */ +class SpringDocApp82Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/HelloController.java new file mode 100644 index 000000000..c4aa38cdc --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/HelloController.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Put response entity. + * + * @param config the config + * @param configuration the configuration + * @param aFile the a file + * @return the response entity + */ + @RequestMapping(value = "/{config}", + method = RequestMethod.PUT, + consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }, + produces = { MediaType.APPLICATION_JSON_VALUE } + ) + public ResponseEntity put( + @PathVariable("config") final String config, + @Parameter(name = "configuration", schema = @Schema(name = "configuration", type = "string", format = "binary")) @RequestPart(value = "configuration") final PersonDTO configuration, + @RequestPart(value = "file") final MultipartFile aFile) { + return null; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/PersonDTO.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/PersonDTO.java new file mode 100644 index 000000000..a56295e75 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/PersonDTO.java @@ -0,0 +1,120 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +/** + * The type Person dto. + */ +class PersonDTO { + /** + * The Email. + */ + private String email; + + /** + * The First name. + */ + private String firstName; + + /** + * The Last name. + */ + private String lastName; + + /** + * Instantiates a new Person dto. + */ + public PersonDTO() { + } + + /** + * Instantiates a new Person dto. + * + * @param email the email + * @param firstName the first name + * @param lastName the last name + */ + public PersonDTO(final String email, final String firstName, final String lastName) { + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + } + + /** + * Gets email. + * + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(final String email) { + this.email = email; + } + + /** + * Gets first name. + * + * @return the first name + */ + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** + * Gets last name. + * + * @return the last name + */ + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java new file mode 100644 index 000000000..6325d986d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app83/SpringDocApp83Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app83; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 83 test. + */ +class SpringDocApp83Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app84/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app84/HelloController.java new file mode 100644 index 000000000..c3918c93e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app84/HelloController.java @@ -0,0 +1,61 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app84; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping("/persons") + public String persons() { + return "OK"; + } + + /** + * Persons string. + * + * @param toto the toto + * @return the string + */ + @GetMapping("/persons1") + public String persons(String toto) { + return "OK"; + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java new file mode 100644 index 000000000..22a65f3a8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app84/SpringDocApp84Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app84; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 84 test. + */ +class SpringDocApp84Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app85/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app85/HelloController.java new file mode 100644 index 000000000..b42ba38b8 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app85/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Testme. + * + * @param id the id + */ + @PostMapping("/test/{id}") + @Operation( + parameters = { + @Parameter(ref = "#/components/parameters/paramA"), + @Parameter(ref = "#/components/parameters/paramB") + } + ) + public void testme(@PathVariable("id") String id) { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java new file mode 100644 index 000000000..f193f7508 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app85/SpringDocApp85Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app85; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 85 test. + */ +class SpringDocApp85Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/HelloController.java new file mode 100644 index 000000000..9578d20ff --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/HelloController.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test. + * + * @param header the header + * @param request the request + * @param response the response + * @param locale the locale + * @param hello the hello + */ + @GetMapping("/test") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java new file mode 100644 index 000000000..065a4a620 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/SpringDocApp86Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 86 test. + */ +@TestPropertySource(properties = { + "springdoc.packagesToScan=test.org.springdoc.api.v31.app86", + "springdoc.packagesToExclude=test.org.springdoc.api.v31.app86.test" }) +class SpringDocApp86Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/test/HelloController2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/test/HelloController2.java new file mode 100644 index 000000000..1e1a530a3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app86/test/HelloController2.java @@ -0,0 +1,58 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app86.test; + +import java.util.Locale; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller 2. + */ +@RestController +class HelloController2 { + + /** + * Test. + * + * @param header the header + * @param request the request + * @param response the response + * @param locale the locale + * @param hello the hello + */ + @GetMapping("/test2") + public void test(HttpSession header, HttpServletRequest request, HttpServletResponse response, Locale locale, + String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app87/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app87/HelloController.java new file mode 100644 index 000000000..e22461209 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app87/HelloController.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app87; + +import java.util.UUID; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.parameters.RequestBody; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * The type Hello controller. + */ +@RestController("cookie") +class HelloController { + + /** + * Put item response entity. + * + * @param cookie the cookie + * @param itemId the item id + * @param item the item + * @return the response entity + */ + @PutMapping("/{itemId}") + @Operation + public ResponseEntity putItem( + @CookieValue( + name = "cookie" + ) String cookie, + @PathVariable UUID itemId, + @RequestBody Item item + ) { + return ResponseEntity.ok(item); + } + + /** + * The type Item. + */ + public static class Item { + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java new file mode 100644 index 000000000..10f9e894a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app87/SpringDocApp87Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app87; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 87 test. + */ +class SpringDocApp87Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app88/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app88/HelloController.java new file mode 100644 index 000000000..0b35d6d30 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app88/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app88; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons string. + * + * @return the string + */ + @GetMapping(value = "/persons") + public String persons() { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java new file mode 100644 index 000000000..4a6a6a41e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app88/SpringDocApp88Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app88; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 88 test. + */ +@TestPropertySource(properties = "springdoc.auto-tag-classes=false") +class SpringDocApp88Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app89/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app89/HelloController.java new file mode 100644 index 000000000..8cfb08cd4 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app89/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app89; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Gets address. + * + * @param id the id + * @return the address + */ + @Operation(summary = "Get Status") + @GetMapping(value = "/status/{id}", produces = MediaType.TEXT_HTML_VALUE) + public ModelAndView getAddress(@PathVariable String id) { + return null; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java new file mode 100644 index 000000000..1a280cc1d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app89/SpringDocApp89Test.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app89; + + +import io.swagger.v3.oas.models.media.ObjectSchema; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.servlet.ModelAndView; + +import static org.springdoc.core.utils.SpringDocUtils.getConfig; + +/** + * The type Spring doc app 89 test. + */ +@TestPropertySource(properties = "springdoc.model-and-view-allowed=true") +class SpringDocApp89Test extends AbstractSpringDocTest { + + static { + getConfig().replaceWithSchema(ModelAndView.class, new ObjectSchema()); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/MyApi.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/MyApi.java new file mode 100644 index 000000000..a68771497 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/MyApi.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * The interface My api. + */ +@RequestMapping("/myapi") +public interface MyApi { + + /** + * Get string. + * + * @param language the language + * @return the string + */ + @Operation(description = "Annotations from interfaces test") + @GetMapping + String get( + @Parameter(hidden = true, in = ParameterIn.HEADER, name = HttpHeaders.ACCEPT_LANGUAGE) @RequestHeader(value = HttpHeaders.ACCEPT_LANGUAGE, required = false) String language); +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/MyApiController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/MyApiController.java new file mode 100644 index 000000000..0b0f20f5e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/MyApiController.java @@ -0,0 +1,62 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type My api controller. + */ +@RestController +class MyApiController implements MyApi { + /** + * Get string. + * + * @param language the language + * @return the string + */ + public String get(String language) { + return language; + } + + + /** + * Gets code. + * + * @param code the code + * @return the code + */ + @Operation(description = "Annotations from class with hidden parameter code") + @GetMapping("/getCode") + public String getCode(@Parameter(hidden = true) String code) { + return code; + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java new file mode 100644 index 000000000..0e58cc04e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app9/SpringDocApp9Test.java @@ -0,0 +1,44 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app9; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 9 test. + */ +class SpringDocApp9Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/HelloController.java new file mode 100644 index 000000000..917a21704 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/HelloController.java @@ -0,0 +1,81 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Test 1. + * + * @param hello the hello + */ + @GetMapping("/test") + @ApiResponses(value = { @ApiResponse(description = "successful operation", content = { @Content(examples = @ExampleObject(name = "500", ref = "#/components/examples/http500Example"), mediaType = "application/json", schema = @Schema(implementation = User.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)) }) }) + public void test1(String hello) { + } + + /** + * Test 2. + * + * @param hello the hello + */ + @PostMapping("/test2") + @RequestBody( + description = "Details of the Item to be created", + required = true, + content = @Content( + schema = @Schema(implementation = User.class), + mediaType = MediaType.APPLICATION_JSON_VALUE, + examples = { + @ExampleObject( + name = "An example request with the minimum required fields to create.", + value = "min", + summary = "Minimal request"), + @ExampleObject( + name = "An example request with all fields provided with example values.", + value = "full", + summary = "Full request") })) + public void test2(String hello) { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java new file mode 100644 index 000000000..eea3cd9f3 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/SpringDocApp90Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +/** + * The type Spring doc app 90 test. + */ +class SpringDocApp90Test extends AbstractSpringDocTest { + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/SpringDocTestApp.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/SpringDocTestApp.java new file mode 100644 index 000000000..edfa88b49 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/SpringDocTestApp.java @@ -0,0 +1,103 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.util.AbstractMap; +import java.util.Collection; +import java.util.Map.Entry; + +import io.swagger.v3.oas.models.examples.Example; +import org.springdoc.core.customizers.OpenApiCustomizer; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.core.io.Resource; +import org.springframework.util.FileCopyUtils; + +/** + * The type Spring doc test app. + */ +@SpringBootApplication +class SpringDocTestApp { + + /** + * The Http 500 example resource. + */ + @Value("classpath:/500-90.txt") + private Resource http500ExampleResource; + + /** + * As string string. + * + * @param resource the resource + * @return the string + */ + public static String asString(Resource resource) { + try (Reader reader = new InputStreamReader(resource.getInputStream())) { + return FileCopyUtils.copyToString(reader); + } + catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + /** + * Open api customiser open api customiser. + * + * @param examples the examples + * @return the open api customiser + */ + @Bean + public OpenApiCustomizer openApiCustomizer(Collection> examples) { + return openAPI -> { + examples.forEach(example -> { + openAPI.getComponents().addExamples(example.getKey(), example.getValue()); + }); + }; + } + + /** + * Http 500 example entry. + * + * @return the entry + */ + @Bean + public Entry http500Example() { + Example http500Example = new Example(); + Entry entry = new AbstractMap.SimpleEntry("http500Example", http500Example); + http500Example.setSummary("HTTP 500 JSON Body response example"); + http500Example.setDescription( + "An example of HTTP response in case an error occurs on server side. instance attribute reference a traceId to ease server side analysis."); + http500Example.setValue(asString(http500ExampleResource)); + return entry; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/User.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/User.java new file mode 100644 index 000000000..5285d7377 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app90/User.java @@ -0,0 +1,448 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app90; + +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * User + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-11-30T09:49:26.034469-01:00[Atlantic/Azores]") + + +class User { + + /** + * The Id. + */ + @JsonProperty("id") + + private Long id; + + + /** + * The Username. + */ + @JsonProperty("username") + + private String username; + + + /** + * The First name. + */ + @JsonProperty("firstName") + + private String firstName; + + + /** + * The Last name. + */ + @JsonProperty("lastName") + + private String lastName; + + + /** + * The Email. + */ + @JsonProperty("email") + + private String email; + + + /** + * The Password. + */ + @JsonProperty("password") + + private String password; + + + /** + * The Phone. + */ + @JsonProperty("phone") + + private String phone; + + + /** + * The User status. + */ + @JsonProperty("userStatus") + + private Integer userStatus; + + + /** + * Id user. + * + * @param id the id + * @return the user + */ + public User id(Long id) { + this.id = id; + return this; + } + + + /** + * Get id + * + * @return id id + */ + @Schema(example = "10", description = "") + + + public Long getId() { + return id; + } + + /** + * Sets id. + * + * @param id the id + */ + public void setId(Long id) { + this.id = id; + } + + + /** + * Username user. + * + * @param username the username + * @return the user + */ + public User username(String username) { + this.username = username; + return this; + } + + + /** + * Get username + * + * @return username username + */ + @Schema(example = "theUser", description = "") + + + public String getUsername() { + return username; + } + + /** + * Sets username. + * + * @param username the username + */ + public void setUsername(String username) { + this.username = username; + } + + + /** + * First name user. + * + * @param firstName the first name + * @return the user + */ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + /** + * Get firstName + * + * @return firstName first name + */ + @Schema(example = "John", description = "") + + + public String getFirstName() { + return firstName; + } + + /** + * Sets first name. + * + * @param firstName the first name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + /** + * Last name user. + * + * @param lastName the last name + * @return the user + */ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + + /** + * Get lastName + * + * @return lastName last name + */ + @Schema(example = "James", description = "") + + + public String getLastName() { + return lastName; + } + + /** + * Sets last name. + * + * @param lastName the last name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + /** + * Email user. + * + * @param email the email + * @return the user + */ + public User email(String email) { + this.email = email; + return this; + } + + + /** + * Get email + * + * @return email email + */ + @Schema(example = "john@email.com", description = "") + + + public String getEmail() { + return email; + } + + /** + * Sets email. + * + * @param email the email + */ + public void setEmail(String email) { + this.email = email; + } + + + /** + * Password user. + * + * @param password the password + * @return the user + */ + public User password(String password) { + this.password = password; + return this; + } + + + /** + * Get password + * + * @return password password + */ + @Schema(example = "12345", description = "") + + + public String getPassword() { + return password; + } + + /** + * Sets password. + * + * @param password the password + */ + public void setPassword(String password) { + this.password = password; + } + + + /** + * Phone user. + * + * @param phone the phone + * @return the user + */ + public User phone(String phone) { + this.phone = phone; + return this; + } + + + /** + * Get phone + * + * @return phone phone + */ + @Schema(example = "12345", description = "") + + + public String getPhone() { + return phone; + } + + /** + * Sets phone. + * + * @param phone the phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + + + /** + * User status user. + * + * @param userStatus the user status + * @return the user + */ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + /** + * User Status + * + * @return userStatus user status + */ + @Schema(example = "1", description = "User Status") + + + public Integer getUserStatus() { + return userStatus; + } + + /** + * Sets user status. + * + * @param userStatus the user status + */ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + /** + * Equals boolean. + * + * @param o the o + * @return the boolean + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + /** + * Hash code int. + * + * @return the int + */ + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + /** + * To string string. + * + * @return the string + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + * @param o the o + * @return the string + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/Advice.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/Advice.java new file mode 100644 index 000000000..e2b311cb6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/Advice.java @@ -0,0 +1,110 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.servlet.http.HttpServletRequest; + +import org.springframework.beans.TypeMismatchException; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * The type Advice. + */ +@RestControllerAdvice +class Advice { + + /** + * Bad request response entity. + * + * @param req the req + * @param exception the exception + * @return the response entity + */ + @ExceptionHandler(TypeMismatchException.class) + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ApiResponse( + responseCode = "400", + description = "Bad Request", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ApiError.class), + examples = { + @ExampleObject( + name = "Service-400", + summary = "400 from the service directly", + value = + "{\"status\": 400," + + "\"errorCode\": \"ERROR_001\"," + + "\"message\": \"An example message...\"" + + "}") + })) + public ResponseEntity badRequest(HttpServletRequest req, Exception exception) { + ApiError erroObj = new ApiError(400, "A code", "A message"); + return new ResponseEntity<>(erroObj, HttpStatus.BAD_REQUEST); + } + + /** + * Internal server error response entity. + * + * @param req the req + * @param exception the exception + * @return the response entity + */ + @ExceptionHandler(Exception.class) + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ApiResponse( + responseCode = "500", + description = "Internal Server Error", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ApiError.class), + examples = { + @ExampleObject( + name = "Service-500", + summary = "500 from the service directly", + value = + "{\"status\": 500," + + "\"errorCode\": \"ERROR_002\"," + + "\"message\": \"Another example message...\"" + + "}") + })) + public ResponseEntity internalServerError(HttpServletRequest req, Exception exception) { + ApiError erroObj = new ApiError(500, "A different code", "A different message"); + return new ResponseEntity<>(erroObj, HttpStatus.INTERNAL_SERVER_ERROR); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/ApiError.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/ApiError.java new file mode 100644 index 000000000..266139103 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/ApiError.java @@ -0,0 +1,79 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Api error. + */ +@Schema( + type = "object", + name = "ApiError", + title = "ApiError", + description = "A consistent response object for sending errors over the wire.") +class ApiError { + + /** + * The Status. + */ + @Schema(name = "status", description = "The Http Status value", type = "int", nullable = true) + @JsonProperty("status") + private int status; + + /** + * The Error code. + */ + @Schema( + name = "errorCode", + description = "An Error Code which can help with identifying issues.", + type = "string", + nullable = true) + @JsonProperty("errorCode") + private String errorCode; + + /** + * The Message. + */ + @Schema(name = "message", description = "The Error Message.", type = "string", nullable = false) + @JsonProperty("message") + private String message; + + /** + * Instantiates a new Api error. + * + * @param status the status + * @param errorCode the error code + * @param message the message + */ + public ApiError(int status, String errorCode, String message) { + this.status = status; + this.errorCode = errorCode; + this.message = message; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/Greeting.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/Greeting.java new file mode 100644 index 000000000..448a59c42 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/Greeting.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Greeting. + */ +@Schema( + type = "object", + name = "Greeting", + title = "Greeting", + description = "An object containing a greeting message") +class Greeting { + + + /** + * The Payload. + */ + @Schema( + name = "payload", + description = "The greeting value", + type = "string", + nullable = false, + example = "sdfsdfs") + @JsonProperty("payload") + private String payload; + + /** + * Instantiates a new Greeting. + * + * @param payload the payload + */ + public Greeting(String payload) { + this.payload = payload; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/GreetingController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/GreetingController.java new file mode 100644 index 000000000..eb5093235 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/GreetingController.java @@ -0,0 +1,72 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.apache.commons.lang3.RandomStringUtils; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; + +/** + * The type Greeting controller. + */ +@RestController +@Tag(name = "Demo", description = "The Demo API") +class GreetingController { + + /** + * Say hello response entity. + * + * @return the response entity + */ + @GetMapping(produces = APPLICATION_JSON_VALUE) + @Operation(summary = "This API will return a random greeting.") + public ResponseEntity sayHello() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + + /** + * Say hello 2 response entity. + * + * @return the response entity + */ + @GetMapping("/test") + @ApiResponses(value = { @ApiResponse(responseCode = "201", description = "item created"), + @ApiResponse(responseCode = "400", description = "invalid input, object invalid"), + @ApiResponse(responseCode = "409", description = "an existing item already exists") }) + public ResponseEntity sayHello2() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java new file mode 100644 index 000000000..be13c4450 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app91/SpringDocApp91Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app91; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +/** + * The type Spring doc app 91 test. + */ +@TestPropertySource(properties = "springdoc.override-with-generic-response=false") +class SpringDocApp91Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/HelloController.java new file mode 100644 index 000000000..d84ac0882 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/HelloController.java @@ -0,0 +1,53 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app92; + +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/test") +class HelloController { + + /** + * Index string. + * + * @param test the test + * @return the string + */ + @GetMapping + String index(@NotNull String test) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/ParameterCustomizer.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/ParameterCustomizer.java new file mode 100644 index 000000000..8385d851c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/ParameterCustomizer.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app92; + +import io.swagger.v3.oas.models.parameters.Parameter; +import jakarta.validation.constraints.NotNull; + +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; + +/** + * The type Parameter customizer. + */ +@Component +class ParameterCustomizer implements org.springdoc.core.customizers.ParameterCustomizer { + /** + * Customize parameter. + * + * @param parameterModel the parameter model + * @param methodParameter the method parameter + * @return the parameter + */ + @Override + public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) { + NotNull annotation = methodParameter.getParameterAnnotation(NotNull.class); + if (annotation != null) { + parameterModel.required(false); + } + return parameterModel; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java new file mode 100644 index 000000000..af4afcb39 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app92/SpringDocApp92Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app92; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 92 test. + */ +class SpringDocApp92Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/BaseClientModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/BaseClientModel.java new file mode 100644 index 000000000..e19822f3c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/BaseClientModel.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Base client model. + */ +public abstract class BaseClientModel { + /** + * The Id. + */ + @JsonProperty("id") + int id; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/BaseController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/BaseController.java new file mode 100644 index 000000000..88bdc0393 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/BaseController.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + +import io.swagger.v3.oas.annotations.Operation; + +import org.springframework.web.bind.annotation.GetMapping; + +/** + * The type Base controller. + * + * @param the type parameter + */ +public abstract class BaseController { + /** + * Get t client model. + * + * @param param the param + * @return the t client model + */ + @Operation + @GetMapping + TClientModel get(TClientModel param) { + return null; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpecificClientModel.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpecificClientModel.java new file mode 100644 index 000000000..132a4334f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpecificClientModel.java @@ -0,0 +1,40 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Specific client model. + */ +class SpecificClientModel extends BaseClientModel { + /** + * The Name. + */ + @JsonProperty("name") + String name; +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpecificController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpecificController.java new file mode 100644 index 000000000..f5854fce0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpecificController.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Specific controller. + */ +@RestController +class SpecificController extends BaseController {} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java new file mode 100644 index 000000000..e3f138de5 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app93/SpringDocApp93Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app93; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 93 test. + */ +class SpringDocApp93Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app94/Greeting.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app94/Greeting.java new file mode 100644 index 000000000..d14d9896c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app94/Greeting.java @@ -0,0 +1,63 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app94; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The type Greeting. + */ +@Schema( + type = "object", + name = "Greeting", + title = "Greeting", + description = "An object containing a greeting message") +class Greeting { + + + /** + * The Payload. + */ + @Schema( + name = "payload", + description = "The greeting value", + type = "string", + nullable = false, + example = "sdfsdfs") + @JsonProperty("payload") + private String payload; + + /** + * Instantiates a new Greeting. + * + * @param payload the payload + */ + public Greeting(String payload) { + this.payload = payload; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java new file mode 100644 index 000000000..90a78859c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app94/SpringDocApp94Test.java @@ -0,0 +1,186 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app94; + +import java.util.Collections; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.apache.commons.lang3.RandomStringUtils; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.SpringDocCustomizers; +import org.springdoc.core.properties.SpringDocConfigProperties; +import org.springdoc.core.providers.SpringDocProviders; +import org.springdoc.core.service.AbstractRequestService; +import org.springdoc.core.service.GenericResponseService; +import org.springdoc.core.service.OpenAPIService; +import org.springdoc.core.service.OperationService; +import org.springdoc.webmvc.api.OpenApiWebMvcResource; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.ObjectFactory; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.TestPropertySource; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import static org.springdoc.core.utils.Constants.DEFAULT_GROUP_NAME; +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; + +/** + * The type Spring doc app 94 test. + */ +@TestPropertySource(properties = "springdoc.default-produces-media-type=application/json") +class SpringDocApp94Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp implements ApplicationContextAware { + + /** + * The Application context. + */ + private ApplicationContext applicationContext; + + /** + * Greeting controller greeting controller. + * + * @return the greeting controller + */ + @Bean + public GreetingController greetingController() { + return new GreetingController(); + } + + /** + * Custom open api open api builder customizer. + * + * @return the open api builder customizer + */ + @Bean + public OpenApiBuilderCustomizer customOpenAPI() { + return openApiBuilder -> openApiBuilder.addMappings(Collections.singletonMap("greetingController", new GreetingController())); + } + + /** + * Default test handler mapping request mapping handler mapping. + * + * @param greetingController the greeting controller + * @return the request mapping handler mapping + * @throws NoSuchMethodException the no such method exception + */ + @Bean + public RequestMappingHandlerMapping defaultTestHandlerMapping(GreetingController greetingController) throws NoSuchMethodException { + RequestMappingHandlerMapping result = new RequestMappingHandlerMapping(); + RequestMappingInfo requestMappingInfo = + RequestMappingInfo.paths("/test").methods(RequestMethod.GET).produces(MediaType.APPLICATION_JSON_VALUE).build(); + + result.setApplicationContext(this.applicationContext); + result.registerMapping(requestMappingInfo, "greetingController", GreetingController.class.getDeclaredMethod("sayHello2")); + //result.handlerme + return result; + } + + /** + * Open api resource open api web mvc resource. + * + * @param openAPIBuilderObjectFactory the open api builder object factory + * @param requestBuilder the request builder + * @param responseBuilder the response builder + * @param operationParser the operation parser + * @param springDocConfigProperties the spring doc config properties + * @param springDocProviders the spring doc providers + * @param springDocCustomizers the spring doc customizers + * @return the open api web mvc resource + */ + @Bean(name = "openApiResource") + public OpenApiWebMvcResource openApiResource(ObjectFactory openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, + OperationService operationParser, + SpringDocConfigProperties springDocConfigProperties, + SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers) { + return new OpenApiWebMvcResource(DEFAULT_GROUP_NAME, openAPIBuilderObjectFactory, requestBuilder, responseBuilder, operationParser, + springDocConfigProperties, springDocProviders, springDocCustomizers); + } + + /** + * Sets application context. + * + * @param applicationContext the application context + * @throws BeansException the beans exception + */ + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } + } + + /** + * The type Greeting controller. + */ + @ResponseBody + @Tag(name = "Demo", description = "The Demo API") + public static class GreetingController { + + /** + * Say hello response entity. + * + * @return the response entity + */ + @GetMapping(produces = APPLICATION_JSON_VALUE) + @Operation(summary = "This API will return a random greeting.") + public ResponseEntity sayHello() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + + /** + * Say hello 2 response entity. + * + * @return the response entity + */ + @GetMapping("/test") + @ApiResponses(value = { @ApiResponse(responseCode = "201", description = "item created"), + @ApiResponse(responseCode = "400", description = "invalid input, object invalid"), + @ApiResponse(responseCode = "409", description = "an existing item already exists") }) + public ResponseEntity sayHello2() { + return ResponseEntity.ok(new Greeting(RandomStringUtils.randomAlphanumeric(10))); + } + + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app95/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app95/HelloController.java new file mode 100644 index 000000000..686725a6f --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app95/HelloController.java @@ -0,0 +1,55 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app95; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/persons") +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping + @Operation(summary = "${test.app95.operation.persons.summary}", + description = "${test.app95.operation.persons.description}") + public void persons(@Parameter(description = "${test.app95.param.name.description}") String name) { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java new file mode 100644 index 000000000..e2fd97ecf --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app95/SpringDocApp95Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app95; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +/** + * The type Spring doc app 95 test. + */ +@ActiveProfiles("95") +class SpringDocApp95Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app96/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app96/HelloController.java new file mode 100644 index 000000000..c130d2c11 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app96/HelloController.java @@ -0,0 +1,76 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app96; + +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + + /** + * Test 1 string. + * + * @param test the test + * @return the string + */ + @PostMapping("/api1") + String test1(@RequestBody @Min(2) int test) { + return null; + } + + /** + * Test 2 string. + * + * @param test the test + * @return the string + */ + @PostMapping("/api2") + String test2(@RequestBody String test) { + return null; + } + + /** + * Test 3 string. + * + * @param test the test + * @return the string + */ + @PostMapping("/api3") + String test3(@NotNull String test) { + return null; + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java new file mode 100644 index 000000000..c169ae6bd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app96/SpringDocApp96Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app96; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 96 test. + */ +class SpringDocApp96Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/HelloController.java new file mode 100644 index 000000000..b17b89a8d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/HelloController.java @@ -0,0 +1,69 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/api") +class HelloController { + + /** + * Header v 1 student v 1. + * + * @return the student v 1 + */ + @GetMapping(value = "/student/header1", headers = "X-API-VERSION=1") + public StudentV1 headerV1() { + return new StudentV1("Bob Charlie"); + } + + /** + * Header v 2 student v 2. + * + * @return the student v 2 + */ + @GetMapping(value = "/student/header2", headers = "X-API-VERSION=2") + public StudentV2 headerV2() { + return new StudentV2("Charlie"); + } + + /** + * Header v 3 student v 3. + * + * @return the student v 3 + */ + @GetMapping(value = "/student/header3", headers = "X-API-VERSION") + public StudentV3 headerV3() { + return new StudentV3("Tom Charlie"); + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java new file mode 100644 index 000000000..d99c7cadd --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/SpringDocApp97Test.java @@ -0,0 +1,45 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 97 test. + */ +class SpringDocApp97Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV1.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV1.java new file mode 100644 index 000000000..44ef3060b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV1.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Student v 1. + */ +class StudentV1 { + + /** + * The Name. + */ + @JsonProperty("name") + private String name; + + /** + * Instantiates a new Student v 1. + * + * @param name the name + */ + public StudentV1(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV2.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV2.java new file mode 100644 index 000000000..5d9453388 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV2.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Student v 2. + */ +class StudentV2 { + + /** + * The Name. + */ + @JsonProperty("bb") + private String name; + + /** + * Instantiates a new Student v 2. + * + * @param name the name + */ + public StudentV2(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV3.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV3.java new file mode 100644 index 000000000..f6955323e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app97/StudentV3.java @@ -0,0 +1,50 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app97; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type Student v 3. + */ +class StudentV3 { + + /** + * The Name. + */ + @JsonProperty("name") + private String name; + + /** + * Instantiates a new Student v 3. + * + * @param name the name + */ + public StudentV3(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/HelloController.java new file mode 100644 index 000000000..5f7c8e19e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/HelloController.java @@ -0,0 +1,48 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app98; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +class HelloController { + + /** + * Persons. + * + * @param name the name + */ + @GetMapping("/persons") + public void persons(@IgnoredAnnotationParameter String name) { + + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/IgnoredAnnotationParameter.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/IgnoredAnnotationParameter.java new file mode 100644 index 000000000..dafbf0a85 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/IgnoredAnnotationParameter.java @@ -0,0 +1,43 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app98; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * The interface Ignored annotation parameter. + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface IgnoredAnnotationParameter { + /** + * Addition string. + * + * @return the string + */ + String addition() default "customized parameter!"; +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java new file mode 100644 index 000000000..a5cf82342 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app98/SpringDocApp98Test.java @@ -0,0 +1,49 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app98; + + +import org.springdoc.core.utils.SpringDocUtils; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * The type Spring doc app 98 test. + */ +class SpringDocApp98Test extends AbstractSpringDocTest { + + static { + SpringDocUtils.getConfig().addAnnotationsToIgnore(IgnoredAnnotationParameter.class); + } + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app99/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app99/HelloController.java new file mode 100644 index 000000000..aea7efbe0 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app99/HelloController.java @@ -0,0 +1,54 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app99; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The type Hello controller. + */ +@RestController +@RequestMapping("/persons") +class HelloController { + + /** + * Persons. + */ + @GetMapping + @ApiResponses({ + @ApiResponse(responseCode = "202", description = "${test.app99.operation.persons.response.202.description}") + }) + public void persons() { + + } + +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java new file mode 100644 index 000000000..98f3e942d --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app99/SpringDocApp99Test.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app99; + + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ActiveProfiles; + +/** + * The type Spring doc app 99 test. + */ +@ActiveProfiles("99") +class SpringDocApp99Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocTest.kt index 6ce0c9f84..51c1660e8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocTest.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocTest.kt @@ -34,7 +34,6 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest import org.springframework.test.context.ActiveProfiles -import org.springframework.test.context.TestPropertySource import org.springframework.test.web.reactive.server.WebTestClient import java.nio.charset.StandardCharsets import java.nio.file.Files From 0b11833e48af8d9b530093d325bfd961782f48b9 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 12 Jan 2025 01:56:42 +0100 Subject: [PATCH 156/226] Provide better compatibility for projects migrating from OAS 3.0 to OAS 3.1. Fixes #2849 --- .../api/v30/app12/EnumController.java | 18 ------------------ .../api/v30/app12/SpringDocApp12Test.kt | 2 +- .../api/v31/app12/EnumController.java | 18 ------------------ .../api/v31/app12/SpringDocApp12Test.kt | 2 +- 4 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java deleted file mode 100644 index d66aa497f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.v30.app12; - -import jakarta.annotation.Nullable; -import test.org.springdoc.api.v30.app12.SpringDocApp12Test.MyEnum; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author bnasslahsen - */ -@RestController -public class EnumController { - @GetMapping("/test-enum-2") - String testEnum2(@Nullable MyEnum e) { - return ""; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt index b64b2d186..448192da6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt @@ -25,7 +25,7 @@ import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest class SpringDocApp12Test : AbstractKotlinSpringDocMVCTest() { @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app12"]) + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app12", "test.org.springdoc.api.app12"]) class DemoApplication enum class MyEnum { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java deleted file mode 100644 index 84bd951a6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.v31.app12; - -import jakarta.annotation.Nullable; -import test.org.springdoc.api.v30.app12.SpringDocApp12Test.MyEnum; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author bnasslahsen - */ -@RestController -public class EnumController { - @GetMapping("/test-enum-2") - String testEnum2(@Nullable MyEnum e) { - return ""; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt index 1eb24c835..a5c7ad736 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt @@ -25,7 +25,7 @@ import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest class SpringDocApp12Test : AbstractKotlinSpringDocMVCTest() { @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app12"]) + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app12", "test.org.springdoc.api.app12"]) class DemoApplication enum class MyEnum { From a61c048874032421e984f37fc4e5a2af584a5e8d Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 12 Jan 2025 10:53:46 +0100 Subject: [PATCH 157/226] CHANGELOG.md update --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8e3f96e0..6aa47ee35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.8.2] - 2025-01-12 + +### Added +- #2849 - Provide better compatibility for projects migrating from OAS 3.0 to OAS 3.1 + +### Fixed +- #2846 - ClassCastException with spring-data-rest and openapi version 3.1 bug +- #2844 - PageableObject and SortObject are called Pageablenull and Sortnull i + ## [2.8.1] - 2025-01-06 ### Fixed From 94220b0e75da1e2d4c215b19673c219e803830c5 Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 12 Jan 2025 09:55:48 +0000 Subject: [PATCH 158/226] [maven-release-plugin] prepare release v2.8.2 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 2c33dd7bc..ea992c2c9 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.2-SNAPSHOT + 2.8.2 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.8.2 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 3a8925e08..a355db7d5 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2-SNAPSHOT + 2.8.2 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 72cf5ee33..7c13c829b 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2-SNAPSHOT + 2.8.2 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 06e18b587..1893687d5 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2-SNAPSHOT + 2.8.2 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 16845e4ae..ba30771db 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2-SNAPSHOT + 2.8.2 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 5805fe4a7..6e79cc8ea 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2-SNAPSHOT + 2.8.2 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 316da2ea6..6da52c0cd 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.2-SNAPSHOT + 2.8.2 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 1302837c5..a9115f87a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2-SNAPSHOT + 2.8.2 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 04a4a874c..c1864832e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2-SNAPSHOT + 2.8.2 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 5783c7975..a4e997646 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2-SNAPSHOT + 2.8.2 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index a734361c8..01fd244fa 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2-SNAPSHOT + 2.8.2 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index 0b988b00f..b247d1d08 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2-SNAPSHOT + 2.8.2 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index ac722d583..a0634cf53 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.2-SNAPSHOT + 2.8.2 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 035c372b4..159fb82cd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2-SNAPSHOT + 2.8.2 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 106a37f9a..f39da3113 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.2-SNAPSHOT + 2.8.2 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 66edd10d0..60f82a007 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2-SNAPSHOT + 2.8.2 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 16a712c1f..a29e4d2bc 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2-SNAPSHOT + 2.8.2 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 744e14ddb..1b56ed4e5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.2-SNAPSHOT + 2.8.2 springdoc-openapi-security-tests From b1b0b8437a94416af796061e90b36bda0deb7264 Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 12 Jan 2025 09:55:52 +0000 Subject: [PATCH 159/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index ea992c2c9..6bfb44c2a 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.2 + 2.8.3-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.8.2 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index a355db7d5..0add5334a 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2 + 2.8.3-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 7c13c829b..967e3f26b 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2 + 2.8.3-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 1893687d5..5011223aa 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2 + 2.8.3-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index ba30771db..ce506d180 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2 + 2.8.3-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 6e79cc8ea..fe946c1c2 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.2 + 2.8.3-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 6da52c0cd..ebf356f52 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.2 + 2.8.3-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index a9115f87a..449f4278c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2 + 2.8.3-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index c1864832e..8fc90b031 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2 + 2.8.3-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index a4e997646..106c2a174 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2 + 2.8.3-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 01fd244fa..67056235f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2 + 2.8.3-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index b247d1d08..3ed28704c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2 + 2.8.3-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index a0634cf53..d7289379e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.2 + 2.8.3-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 159fb82cd..b126c34e8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2 + 2.8.3-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index f39da3113..6cd9443bf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.2 + 2.8.3-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 60f82a007..8774f2661 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2 + 2.8.3-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index a29e4d2bc..7398bd15c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.2 + 2.8.3-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 1b56ed4e5..2e3f80adf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.2 + 2.8.3-SNAPSHOT springdoc-openapi-security-tests From aea694a22076e157a225f4e5831053e4c023a420 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 12 Jan 2025 11:04:17 +0100 Subject: [PATCH 160/226] CHANGELOG.md update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aa47ee35..4b7f90579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - #2846 - ClassCastException with spring-data-rest and openapi version 3.1 bug -- #2844 - PageableObject and SortObject are called Pageablenull and Sortnull i +- #2844 - PageableObject and SortObject are called Pageablenull and Sortnull ## [2.8.1] - 2025-01-06 From 8648879e51fc8a65c8417006c802daf530247dee Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 12 Jan 2025 22:30:52 +0100 Subject: [PATCH 161/226] Refine condition, for ignoring types when using PolymorphicModelConverter. Fixes #2851 --- .../core/converters/PolymorphicModelConverter.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 2a8b57b41..893971491 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -44,6 +44,7 @@ import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.ObjectSchema; import io.swagger.v3.oas.models.media.Schema; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.reflect.FieldUtils; import org.springdoc.core.providers.ObjectMapperProvider; @@ -68,7 +69,7 @@ public class PolymorphicModelConverter implements ModelConverter { * The constant PARENT_TYPES_TO_IGNORE. */ private static final List TYPES_TO_SKIP = Collections.synchronizedList(new ArrayList<>()); - + static { PARENT_TYPES_TO_IGNORE.add("JsonSchema"); PARENT_TYPES_TO_IGNORE.add("Pageable"); @@ -121,7 +122,10 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); } else if (field.isAnnotationPresent(io.swagger.v3.oas.annotations.media.Schema.class)) { - TYPES_TO_SKIP.add(field.getType().getSimpleName()); + io.swagger.v3.oas.annotations.media.Schema declaredSchema = field.getDeclaredAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); + if (ArrayUtils.isNotEmpty(declaredSchema.oneOf()) || ArrayUtils.isNotEmpty(declaredSchema.allOf())) { + TYPES_TO_SKIP.add(field.getType().getSimpleName()); + } } } if (chain.hasNext()) { @@ -133,7 +137,7 @@ else if (field.isAnnotationPresent(io.swagger.v3.oas.annotations.media.Schema.cl if (resolvedSchema == null || resolvedSchema.get$ref() == null) { return resolvedSchema; } - if(resolvedSchema.get$ref().contains(Components.COMPONENTS_SCHEMAS_REF)) { + if (resolvedSchema.get$ref().contains(Components.COMPONENTS_SCHEMAS_REF)) { String schemaName = resolvedSchema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); Schema existingSchema = context.getDefinedModels().get(schemaName); if (existingSchema != null && (existingSchema.getOneOf() != null || existingSchema.getAllOf() != null)) { @@ -162,7 +166,7 @@ private Schema composePolymorphicSchema(AnnotatedType type, Schema schema, Colle if (isConcreteClass(type)) result.addOneOfItem(schema); JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); Class clazz = javaType.getRawClass(); - if(TYPES_TO_SKIP.stream().noneMatch(typeToSkip -> typeToSkip.equals(clazz.getSimpleName()))) + if (TYPES_TO_SKIP.stream().noneMatch(typeToSkip -> typeToSkip.equals(clazz.getSimpleName()))) composedSchemas.forEach(result::addOneOfItem); return result; } From 1f33ed4844b5608bba5dd9dae4833c43f76fb8bd Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 12 Jan 2025 22:34:23 +0100 Subject: [PATCH 162/226] code review --- CHANGELOG.md | 5 +++++ .../org/springdoc/core/converters/HateoasLinksConverter.java | 4 +--- .../org/springdoc/core/utils/SpringDocDataRestUtils.java | 3 +-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b7f90579..7a099d201 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.8.3] - 2025-01-12 + +### Added +- #2851 - Refine condition, for ignoring types when using PolymorphicModelConverter + ## [2.8.2] - 2025-01-12 ### Added diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java index 929115c4e..7fbfa420b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java @@ -69,8 +69,7 @@ public Schema resolve( Iterator chain ) { JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); - if (javaType != null) { - if (RepresentationModel.class.isAssignableFrom(javaType.getRawClass())) { + if (javaType != null && RepresentationModel.class.isAssignableFrom(javaType.getRawClass())) { Schema schema = chain.next().resolve(type, context, chain); String schemaName = schema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); Schema original = context.getDefinedModels().get(schemaName); @@ -84,7 +83,6 @@ public Schema resolve( arraySchema.set$ref(AnnotationsUtils.COMPONENTS_REF + "Links"); } return schema; - } } return chain.hasNext() ? chain.next().resolve(type, context, chain) : null; } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java index 636ccc229..281fd4eda 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java @@ -249,8 +249,7 @@ private void updateRequestBodySchemaProperties(String key, Schema referencedSche if (entry.getValue().getItems()!=null) referencedSchema.addProperty(propId, new ArraySchema().items(new StringSchema())); else - referencedSchema.addProperty(propId, new StringSchema()); { - } + referencedSchema.addProperty(propId, new StringSchema()); } } } From db6455e4858e7093a0e43c7c3c24c1c5559f2fb1 Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 12 Jan 2025 21:43:49 +0000 Subject: [PATCH 163/226] [maven-release-plugin] prepare release v2.8.3 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 6bfb44c2a..d75d95c4e 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.3-SNAPSHOT + 2.8.3 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.8.3 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 0add5334a..fdf0c891f 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3-SNAPSHOT + 2.8.3 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 967e3f26b..893cb8a49 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3-SNAPSHOT + 2.8.3 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 5011223aa..53149fb6d 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3-SNAPSHOT + 2.8.3 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index ce506d180..15d4e81a2 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3-SNAPSHOT + 2.8.3 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index fe946c1c2..d6e5c5012 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3-SNAPSHOT + 2.8.3 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index ebf356f52..3a0f7742e 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.3-SNAPSHOT + 2.8.3 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 449f4278c..a2e88373c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3-SNAPSHOT + 2.8.3 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 8fc90b031..a7d466bbe 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3-SNAPSHOT + 2.8.3 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 106c2a174..928a2ec12 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3-SNAPSHOT + 2.8.3 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 67056235f..330302a8e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3-SNAPSHOT + 2.8.3 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index 3ed28704c..2006bc868 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3-SNAPSHOT + 2.8.3 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index d7289379e..06038d67d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.3-SNAPSHOT + 2.8.3 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index b126c34e8..34d96b765 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3-SNAPSHOT + 2.8.3 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 6cd9443bf..8f9f984cd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.3-SNAPSHOT + 2.8.3 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 8774f2661..9f40a8eb4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3-SNAPSHOT + 2.8.3 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 7398bd15c..1611223f7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3-SNAPSHOT + 2.8.3 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 2e3f80adf..313d51cd2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.3-SNAPSHOT + 2.8.3 springdoc-openapi-security-tests From 4bff24bce7900a0cdd755e1f4909448edc7658ef Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 12 Jan 2025 21:43:52 +0000 Subject: [PATCH 164/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index d75d95c4e..64e079984 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.3 + 2.8.4-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.8.3 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index fdf0c891f..58ed856d9 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3 + 2.8.4-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 893cb8a49..fb8967a81 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3 + 2.8.4-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 53149fb6d..8bdb42cc6 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3 + 2.8.4-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 15d4e81a2..9d1a65579 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3 + 2.8.4-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index d6e5c5012..83c07aac4 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.3 + 2.8.4-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 3a0f7742e..45bc2ea08 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.3 + 2.8.4-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index a2e88373c..d393a6d9e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3 + 2.8.4-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index a7d466bbe..0bd20ee75 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3 + 2.8.4-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 928a2ec12..0bb104c60 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3 + 2.8.4-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 330302a8e..c3d441d6c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3 + 2.8.4-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index 2006bc868..cbe3e9923 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3 + 2.8.4-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index 06038d67d..aa4e5f333 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.3 + 2.8.4-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 34d96b765..a12191bed 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3 + 2.8.4-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 8f9f984cd..4fb673014 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.3 + 2.8.4-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 9f40a8eb4..9c7676dea 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3 + 2.8.4-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 1611223f7..8239dc1e0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.3 + 2.8.4-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 313d51cd2..d9426bf60 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.3 + 2.8.4-SNAPSHOT springdoc-openapi-security-tests From 06b297ae558ea94b5819a57164e18be7bfc6c6a7 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 13 Jan 2025 12:47:12 +0100 Subject: [PATCH 165/226] @Schema(types = "xxx") does not work for multipart param with enabled springdoc.default-support-form-data config option. Fixes #2852 --- .../core/service/AbstractRequestService.java | 42 +++++++++++-------- .../test/resources/results/3.0.1/app189.json | 2 + .../test/resources/results/3.1.0/app189.json | 10 +++-- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index c0a19ed07..c232d7e79 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.service; @@ -333,7 +333,7 @@ public Operation build(HandlerMethod handlerMethod, RequestMethod requestMethod, if (!isParamToIgnore(methodParameter)) { parameter = buildParams(parameterInfo, components, requestMethod, methodAttributes, openAPI.getOpenapi()); List parameterAnnotations = List.of(getParameterAnnotations(methodParameter)); - if (isValidParameter(parameter,methodAttributes)) { + if (isValidParameter(parameter, methodAttributes)) { // Merge with the operation parameters parameter = GenericParameterService.mergeParameter(operationParameters, parameter); // Add param javadoc @@ -368,12 +368,20 @@ else if (!RequestMethod.GET.equals(requestMethod) || OpenApiVersion.OPENAPI_3_1. Parameter parameter = entry.getValue(); if (!ParameterIn.PATH.toString().equals(parameter.getIn()) && !ParameterIn.HEADER.toString().equals(parameter.getIn()) && !ParameterIn.COOKIE.toString().equals(parameter.getIn())) { - Schema itemSchema = new Schema<>(); - itemSchema.setName(entry.getKey().getpName()); - itemSchema.setDescription(parameter.getDescription()); - itemSchema.setDeprecated(parameter.getDeprecated()); + Schema itemSchema; + if (parameter.getSchema() != null) { + itemSchema = parameter.getSchema(); + } + else { + itemSchema = new Schema<>(); + itemSchema.setName(entry.getKey().getpName()); + } + if (StringUtils.isNotEmpty(parameter.getDescription())) + itemSchema.setDescription(parameter.getDescription()); if (parameter.getExample() != null) itemSchema.setExample(parameter.getExample()); + if (parameter.getDeprecated() != null) + itemSchema.setDeprecated(parameter.getDeprecated()); requestBodyInfo.addProperties(entry.getKey().getpName(), itemSchema); it.remove(); } @@ -525,7 +533,7 @@ private void setParams(Operation operation, List operationParameters, * @param methodAttributes the method attributes * @return the boolean */ - public boolean isValidParameter(Parameter parameter, MethodAttributes methodAttributes ) { + public boolean isValidParameter(Parameter parameter, MethodAttributes methodAttributes) { return parameter != null && (parameter.getName() != null || parameter.get$ref() != null) && !(Arrays.asList(methodAttributes.getMethodConsumes()).contains(APPLICATION_FORM_URLENCODED_VALUE) && ParameterIn.QUERY.toString().equals(parameter.getIn())); } @@ -842,14 +850,14 @@ else if (requestBody.content().length > 0) return false; } - /** - * Check if the parameter has any of the annotations that make it non-optional - * - * @param annotationSimpleNames the annotation simple class named, e.g. NotNull - * @return whether any of the known NotNull annotations are present - */ - public static boolean hasNotNullAnnotation(Collection annotationSimpleNames) { - return Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annotationSimpleNames::contains); - } - + /** + * Check if the parameter has any of the annotations that make it non-optional + * + * @param annotationSimpleNames the annotation simple class named, e.g. NotNull + * @return whether any of the known NotNull annotations are present + */ + public static boolean hasNotNullAnnotation(Collection annotationSimpleNames) { + return Arrays.stream(ANNOTATIONS_FOR_REQUIRED).anyMatch(annotationSimpleNames::contains); + } + } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app189.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app189.json index e4a831798..ed04c4d73 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app189.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app189.json @@ -31,9 +31,11 @@ "format": "binary" }, "title": { + "type": "string", "description": "title" }, "content": { + "type": "string", "description": "content" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app189.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app189.json index d2010242b..06a617464 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app189.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app189.json @@ -21,9 +21,6 @@ "content": { "multipart/form-data": { "schema": { - "required": [ - "file" - ], "type": "object", "properties": { "file": { @@ -31,12 +28,17 @@ "format": "binary" }, "title": { + "type": "string", "description": "title" }, "content": { + "type": "string", "description": "content" } - } + }, + "required": [ + "file" + ] } } } From fb92709fec6463d2ea4f27c8eeac3e27248dc61b Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 14 Jan 2025 20:46:43 +0100 Subject: [PATCH 166/226] @JsonUnwrapped is ignored in new version of lib. Fixes #2856 --- .../converters/PolymorphicModelConverter.java | 12 ++- .../api/v30/app237/OpenApiConfiguration.java | 32 ++++++++ .../api/v30/app237/SpringDocApp237Test.java | 46 +++++++++++ .../api/v30/app237/UnwrappedController.java | 24 ++++++ .../springdoc/api/v30/app237/dto/Example.java | 19 +++++ .../api/v31/app237/OpenApiConfiguration.java | 32 ++++++++ .../api/v31/app237/SpringDocApp237Test.java | 46 +++++++++++ .../api/v31/app237/UnwrappedController.java | 24 ++++++ .../springdoc/api/v31/app237/dto/Example.java | 19 +++++ .../test/resources/results/3.0.1/app237.json | 78 ++++++++++++++++++ .../test/resources/results/3.1.0/app237.json | 80 +++++++++++++++++++ 11 files changed, 409 insertions(+), 3 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/OpenApiConfiguration.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/SpringDocApp237Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/UnwrappedController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/dto/Example.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/OpenApiConfiguration.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/SpringDocApp237Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/UnwrappedController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/dto/Example.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app237.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app237.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 893971491..8cdbd65a6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -31,14 +31,17 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Set; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.databind.JavaType; import io.swagger.v3.core.converter.AnnotatedType; import io.swagger.v3.core.converter.ModelConverter; import io.swagger.v3.core.converter.ModelConverterContext; +import io.swagger.v3.core.jackson.TypeNameResolver; import io.swagger.v3.core.util.AnnotationsUtils; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.media.ComposedSchema; @@ -63,12 +66,12 @@ public class PolymorphicModelConverter implements ModelConverter { /** * The constant PARENT_TYPES_TO_IGNORE. */ - private static final List PARENT_TYPES_TO_IGNORE = Collections.synchronizedList(new ArrayList<>()); + private static final Set PARENT_TYPES_TO_IGNORE = Collections.synchronizedSet(new HashSet<>()); /** * The constant PARENT_TYPES_TO_IGNORE. */ - private static final List TYPES_TO_SKIP = Collections.synchronizedList(new ArrayList<>()); + private static final Set TYPES_TO_SKIP = Collections.synchronizedSet(new HashSet<>()); static { PARENT_TYPES_TO_IGNORE.add("JsonSchema"); @@ -119,7 +122,10 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if (javaType != null) { for (Field field : FieldUtils.getAllFields(javaType.getRawClass())) { if (field.isAnnotationPresent(JsonUnwrapped.class)) { - PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); + if (!TypeNameResolver.std.getUseFqn()) + PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); + else + PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getName()); } else if (field.isAnnotationPresent(io.swagger.v3.oas.annotations.media.Schema.class)) { io.swagger.v3.oas.annotations.media.Schema declaredSchema = field.getDeclaredAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/OpenApiConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/OpenApiConfiguration.java new file mode 100644 index 000000000..37fd00048 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/OpenApiConfiguration.java @@ -0,0 +1,32 @@ +package test.org.springdoc.api.v30.app237; + +import io.swagger.v3.core.util.PrimitiveType; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class OpenApiConfiguration { + + public OpenApiConfiguration() { + // LocalTime support + PrimitiveType.enablePartialTime(); + } + + private OpenAPI standardOpenApi() { + String title = getClass().getPackage().getImplementationTitle(); + String version = getClass().getPackage().getImplementationVersion(); + return new OpenAPI() + .info(new Info() + .title(title == null ? "DEV" : title) + .version(version == null ? "local" : version)); + } + + @Bean + public OpenAPI devOpenApi() { + return standardOpenApi(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/SpringDocApp237Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/SpringDocApp237Test.java new file mode 100644 index 000000000..8c13dd0df --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/SpringDocApp237Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app237; + +import io.swagger.v3.core.jackson.TypeNameResolver; +import org.junit.jupiter.api.AfterAll; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.use-fqn=true") +public class SpringDocApp237Test extends AbstractSpringDocV30Test { + + @AfterAll + static void restore() { + TypeNameResolver.std.setUseFqn(false); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/UnwrappedController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/UnwrappedController.java new file mode 100644 index 000000000..adad005ab --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/UnwrappedController.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v30.app237; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import test.org.springdoc.api.v30.app237.dto.Example; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class UnwrappedController { + + @GetMapping("/") + @ResponseStatus(HttpStatus.OK) + @Operation(summary = "Simple get task") + @ApiResponse(responseCode = "200", description = "Task has been started") + @ApiResponse(responseCode = "404", description = "Task was not found") + @ApiResponse(responseCode = "409", description = "Task is already running") + public Example exampleGet() { + return new Example(new Example.Wrapped("Some value"), 1); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/dto/Example.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/dto/Example.java new file mode 100644 index 000000000..b75ba666e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app237/dto/Example.java @@ -0,0 +1,19 @@ +package test.org.springdoc.api.v30.app237.dto; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import io.swagger.v3.oas.annotations.media.Schema; + +public record Example( + @JsonUnwrapped + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) + Wrapped unwrapped, + + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Some description") + Integer number +) { + public record Wrapped( + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Some description of value") + String value + ) { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/OpenApiConfiguration.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/OpenApiConfiguration.java new file mode 100644 index 000000000..ecd0a79d5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/OpenApiConfiguration.java @@ -0,0 +1,32 @@ +package test.org.springdoc.api.v31.app237; + +import io.swagger.v3.core.util.PrimitiveType; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class OpenApiConfiguration { + + public OpenApiConfiguration() { + // LocalTime support + PrimitiveType.enablePartialTime(); + } + + private OpenAPI standardOpenApi() { + String title = getClass().getPackage().getImplementationTitle(); + String version = getClass().getPackage().getImplementationVersion(); + return new OpenAPI() + .info(new Info() + .title(title == null ? "DEV" : title) + .version(version == null ? "local" : version)); + } + + @Bean + public OpenAPI devOpenApi() { + return standardOpenApi(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/SpringDocApp237Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/SpringDocApp237Test.java new file mode 100644 index 000000000..0e0c406c6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/SpringDocApp237Test.java @@ -0,0 +1,46 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app237; + +import io.swagger.v3.core.jackson.TypeNameResolver; +import org.junit.jupiter.api.AfterAll; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.use-fqn=true") +public class SpringDocApp237Test extends AbstractSpringDocTest { + + @AfterAll + static void restore() { + TypeNameResolver.std.setUseFqn(false); + } + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/UnwrappedController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/UnwrappedController.java new file mode 100644 index 000000000..41290dc02 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/UnwrappedController.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v31.app237; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import test.org.springdoc.api.v31.app237.dto.Example; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class UnwrappedController { + + @GetMapping("/") + @ResponseStatus(HttpStatus.OK) + @Operation(summary = "Simple get task") + @ApiResponse(responseCode = "200", description = "Task has been started") + @ApiResponse(responseCode = "404", description = "Task was not found") + @ApiResponse(responseCode = "409", description = "Task is already running") + public Example exampleGet() { + return new Example(new Example.Wrapped("Some value"), 1); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/dto/Example.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/dto/Example.java new file mode 100644 index 000000000..2f63b07ae --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app237/dto/Example.java @@ -0,0 +1,19 @@ +package test.org.springdoc.api.v31.app237.dto; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import io.swagger.v3.oas.annotations.media.Schema; + +public record Example( + @JsonUnwrapped + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) + Wrapped unwrapped, + + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Some description") + Integer number +) { + public record Wrapped( + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Some description of value") + String value + ) { + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app237.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app237.json new file mode 100644 index 000000000..6902e6a30 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app237.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "DEV", + "version": "local" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "unwrapped-controller" + ], + "summary": "Simple get task", + "operationId": "exampleGet", + "responses": { + "200": { + "description": "Task has been started", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v30.app237.dto.Example" + } + } + } + }, + "404": { + "description": "Task was not found", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v30.app237.dto.Example" + } + } + } + }, + "409": { + "description": "Task is already running", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v30.app237.dto.Example" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "test.org.springdoc.api.v30.app237.dto.Example": { + "required": [ + "number", + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Some description of value" + }, + "number": { + "type": "integer", + "description": "Some description", + "format": "int32" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app237.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app237.json new file mode 100644 index 000000000..cb8a02ef1 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app237.json @@ -0,0 +1,80 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "DEV", + "version": "local" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/": { + "get": { + "tags": [ + "unwrapped-controller" + ], + "summary": "Simple get task", + "operationId": "exampleGet", + "responses": { + "200": { + "description": "Task has been started", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v31.app237.dto.Example" + } + } + } + }, + "404": { + "description": "Task was not found", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v31.app237.dto.Example" + } + } + } + }, + "409": { + "description": "Task is already running", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/test.org.springdoc.api.v31.app237.dto.Example" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "test.org.springdoc.api.v31.app237.dto.Example": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Some description of value" + }, + "unwrapped": {}, + "number": { + "type": "integer", + "format": "int32", + "description": "Some description" + } + }, + "required": [ + "number", + "unwrapped", + "value" + ] + } + } + } +} From 174e4d8c9296e11c3dacafe0a5c0deb6978bd939 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 16 Jan 2025 15:33:57 +0100 Subject: [PATCH 167/226] swagger-core update to 2.2.28 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64e079984..097b61f46 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.6 2.5.3 1.6.8 - 2.2.27 + 2.2.28 5.18.2 1.13.1 0.9.1 From 3ae776357005f117cab32253d13b6ba5e2a32fce Mon Sep 17 00:00:00 2001 From: Sahil Kumar <45749746+sahil-ramagiri@users.noreply.github.com> Date: Fri, 17 Jan 2025 22:39:37 +0000 Subject: [PATCH 168/226] Do not require JsonSubType annotation for sealed classes. --- .../configuration/SpringDocConfiguration.java | 2 +- .../SpringDocSealedClassModule.java | 64 +++++ .../api/v30/app238/AbstractParent.java | 66 +++++ .../api/v30/app238/ConcreteParent.java | 66 +++++ .../springdoc/api/v30/app238/Controller.java | 68 ++++++ .../api/v30/app238/SpringDocApp238Test.java | 36 +++ .../api/v30/app239/HelloController.java | 51 ++++ .../api/v30/app239/SpringDocApp239Test.java | 35 +++ .../test/resources/results/3.0.1/app238.json | 227 ++++++++++++++++++ .../test/resources/results/3.0.1/app239.json | 132 ++++++++++ 10 files changed, 746 insertions(+), 1 deletion(-) create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/AbstractParent.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/ConcreteParent.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/Controller.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/SpringDocApp238Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app239.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 4c39763c9..7e6bc4889 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -423,7 +423,7 @@ SpringDocProviders springDocProviders(Optional actuatorProvide Optional repositoryRestResourceProvider, Optional routerFunctionProvider, Optional springWebProvider, ObjectMapperProvider objectMapperProvider) { - objectMapperProvider.jsonMapper().registerModule(new SpringDocRequiredModule()); + objectMapperProvider.jsonMapper().registerModules(new SpringDocRequiredModule(), new SpringDocSealedClassModule()); return new SpringDocProviders(actuatorProvider, springCloudFunctionProvider, springSecurityOAuth2Provider, repositoryRestResourceProvider, routerFunctionProvider, springWebProvider, objectMapperProvider); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java new file mode 100644 index 000000000..37b7a7290 --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java @@ -0,0 +1,64 @@ +/* + * + * * + * * * + * * * * Copyright 2025 the original author or authors. + * * * * + * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * you may not use this file except in compliance with the License. + * * * * You may obtain a copy of the License at + * * * * + * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * + * * * * Unless required by applicable law or agreed to in writing, software + * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * See the License for the specific language governing permissions and + * * * * limitations under the License. + * * * + * * + * + */ + +package org.springdoc.core.configuration; + +import com.fasterxml.jackson.databind.introspect.Annotated; +import com.fasterxml.jackson.databind.jsontype.NamedType; +import com.fasterxml.jackson.databind.module.SimpleModule; +import io.swagger.v3.core.jackson.SwaggerAnnotationIntrospector; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * The type Spring doc sealed class module. + * + * @author sahil-ramagiri + */ +public class SpringDocSealedClassModule extends SimpleModule { + + @Override + public void setupModule(SetupContext context) { + context.insertAnnotationIntrospector(new RespectSealedClassAnnotationIntrospector()); + } + + /** + * The type sealed class annotation introspector. + */ + private static class RespectSealedClassAnnotationIntrospector extends SwaggerAnnotationIntrospector { + + @Override + public List findSubtypes(Annotated annotated) { + ArrayList subTypes = new ArrayList<>(); + + if (annotated.getAnnotated() instanceof Class clazz && clazz.isSealed()) { + Class[] permittedSubClasses = clazz.getPermittedSubclasses(); + if (permittedSubClasses.length > 0) { + Arrays.stream(permittedSubClasses).map(NamedType::new).forEach(subTypes::add); + } + } + + return subTypes; + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/AbstractParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/AbstractParent.java new file mode 100644 index 000000000..5ef6af397 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/AbstractParent.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2025 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app238; + + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +@JsonTypeInfo(use = Id.NAME, property = "type") +public abstract sealed class AbstractParent { + private int id; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + +final class ChildOfAbstract1 extends AbstractParent { + private String abstrachChild1Param; + + public String getAbstrachChild1Param() { + return abstrachChild1Param; + } + + public void setAbstrachChild1Param(String abstrachChild1Param) { + this.abstrachChild1Param = abstrachChild1Param; + } +} + +final class ChildOfAbstract2 extends AbstractParent { + private String abstractChild2Param; + + public String getAbstractChild2Param() { + return abstractChild2Param; + } + + public void setAbstractChild2Param(String abstractChild2Param) { + this.abstractChild2Param = abstractChild2Param; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/ConcreteParent.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/ConcreteParent.java new file mode 100644 index 000000000..de49b5ab3 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/ConcreteParent.java @@ -0,0 +1,66 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2025 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app238; + + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; + +@JsonTypeInfo(use = Id.NAME, property = "type") +public sealed class ConcreteParent { + private int id; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} + +final class ChildOfConcrete1 extends ConcreteParent { + private String concreteChild1Param; + + public String getConcreteChild1Param() { + return concreteChild1Param; + } + + public void setConcreteChild1Param(String concreteChild1Param) { + this.concreteChild1Param = concreteChild1Param; + } +} + +final class ChildOfConcrete2 extends ConcreteParent { + private String concreteChild2Param; + + public String getConcreteChild2Param() { + return concreteChild2Param; + } + + public void setConcreteChild2Param(String concreteChild2Param) { + this.concreteChild2Param = concreteChild2Param; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/Controller.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/Controller.java new file mode 100644 index 000000000..7fa6c0302 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/Controller.java @@ -0,0 +1,68 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2025 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app238; + +import java.util.List; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("class-hierarchy") +public class Controller { + @PostMapping("abstract-parent") + public Response abstractParent(@RequestBody AbstractParent payload) { + return null; + } + + @PostMapping("concrete-parent") + public Response concreteParent(@RequestBody ConcreteParent payload) { + return null; + } +} + +class Response { + AbstractParent abstractParent; + + List concreteParents; + + public AbstractParent getAbstractParent() { + return abstractParent; + } + + public void setAbstractParent(AbstractParent abstractParent) { + this.abstractParent = abstractParent; + } + + public List getConcreteParents() { + return concreteParents; + } + + public void setConcreteParents(List concreteParents) { + this.concreteParents = concreteParents; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/SpringDocApp238Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/SpringDocApp238Test.java new file mode 100644 index 000000000..396c2c68b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/SpringDocApp238Test.java @@ -0,0 +1,36 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2025 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app238; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +public class SpringDocApp238Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/HelloController.java new file mode 100644 index 000000000..8f74c1227 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/HelloController.java @@ -0,0 +1,51 @@ +package test.org.springdoc.api.v30.app239; + + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/parent") + public void parentEndpoint(@RequestBody Superclass parent) { + + } + +} + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +sealed class Superclass permits IntermediateClass { + + public Superclass() {} +} + +@Schema(name = IntermediateClass.SCHEMA_NAME) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +sealed class IntermediateClass extends Superclass permits FirstChildClass, SecondChildClass { + + public static final String SCHEMA_NAME = "IntermediateClass"; +} + +@Schema(name = FirstChildClass.SCHEMA_NAME) +final class FirstChildClass extends IntermediateClass { + + public static final String SCHEMA_NAME = "Image"; +} + +@Schema(name = SecondChildClass.SCHEMA_NAME) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +sealed class SecondChildClass extends IntermediateClass { + + public static final String SCHEMA_NAME = "Mail"; +} + +@Schema(name = ThirdChildClass.SCHEMA_NAME) +final class ThirdChildClass extends SecondChildClass { + + public static final String SCHEMA_NAME = "Home"; +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java new file mode 100644 index 000000000..d80d2caa0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java @@ -0,0 +1,35 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2025 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app239; + +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp239Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238.json new file mode 100644 index 000000000..1f5dfa891 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238.json @@ -0,0 +1,227 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/class-hierarchy/concrete-parent": { + "post": { + "tags": [ + "controller" + ], + "operationId": "concreteParent", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete1" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + }, + "/class-hierarchy/abstract-parent": { + "post": { + "tags": [ + "controller" + ], + "operationId": "abstractParent", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildOfAbstract1" + }, + { + "$ref": "#/components/schemas/ChildOfAbstract2" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ChildOfConcrete1": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "type": "object", + "properties": { + "concreteChild1Param": { + "type": "string" + } + } + } + ] + }, + "ChildOfConcrete2": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "type": "object", + "properties": { + "concreteChild2Param": { + "type": "string" + } + } + } + ] + }, + "ConcreteParent": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "type" + } + }, + "AbstractParent": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "type" + } + }, + "ChildOfAbstract1": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "abstrachChild1Param": { + "type": "string" + } + } + } + ] + }, + "ChildOfAbstract2": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/AbstractParent" + }, + { + "type": "object", + "properties": { + "abstractChild2Param": { + "type": "string" + } + } + } + ] + }, + "Response": { + "type": "object", + "properties": { + "abstractParent": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChildOfAbstract1" + }, + { + "$ref": "#/components/schemas/ChildOfAbstract2" + } + ] + }, + "concreteParents": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConcreteParent" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete1" + }, + { + "$ref": "#/components/schemas/ChildOfConcrete2" + } + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app239.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app239.json new file mode 100644 index 000000000..de2244501 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app239.json @@ -0,0 +1,132 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/parent": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "parentEndpoint", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Superclass" + }, + { + "$ref": "#/components/schemas/IntermediateClass" + }, + { + "$ref": "#/components/schemas/Image" + }, + { + "$ref": "#/components/schemas/Mail" + }, + { + "$ref": "#/components/schemas/Home" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Home": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Mail" + } + ] + }, + "Image": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/IntermediateClass" + } + ] + }, + "IntermediateClass": { + "required": [ + "@type" + ], + "type": "object", + "discriminator": { + "propertyName": "@type" + }, + "allOf": [ + { + "$ref": "#/components/schemas/Superclass" + }, + { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + } + } + ] + }, + "Mail": { + "required": [ + "@type" + ], + "type": "object", + "discriminator": { + "propertyName": "@type" + }, + "allOf": [ + { + "$ref": "#/components/schemas/IntermediateClass" + }, + { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + } + } + ] + }, + "Superclass": { + "required": [ + "@type" + ], + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "@type" + } + } + } + } +} From 3a15bcd65a531b12359dcbe6c98fb0cb47ebcea5 Mon Sep 17 00:00:00 2001 From: Abdelmoez GUETAT Date: Tue, 12 Dec 2023 16:18:39 +0100 Subject: [PATCH 169/226] fix swagger webjars prefix path --- .../org/springdoc/core/utils/Constants.java | 2 +- .../core/providers/SpringWebFluxProvider.java | 20 +++---- .../springdoc/webflux/ui/SwaggerConfig.java | 11 ++-- .../webflux/ui/SwaggerWebFluxConfigurer.java | 18 +++--- .../webflux/ui/SwaggerWelcomeActuator.java | 49 +++++------------ .../webflux/ui/SwaggerWelcomeCommon.java | 55 +++++++++++++------ .../webflux/ui/SwaggerWelcomeWebFlux.java | 19 ++----- .../core/providers/SpringWebMvcProvider.java | 20 +++---- .../springdoc/webmvc/ui/SwaggerConfig.java | 10 ++-- .../webmvc/ui/SwaggerWebMvcConfigurer.java | 29 +++++----- .../webmvc/ui/SwaggerWelcomeWebMvc.java | 7 ++- 11 files changed, 119 insertions(+), 121 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java index e8dbf962e..5c808ec39 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java @@ -175,7 +175,7 @@ public final class Constants { /** * The constant DEFAULT_WEB_JARS_PREFIX_URL. */ - public static final String DEFAULT_WEB_JARS_PREFIX_URL = "/webjars"; + public static final String DEFAULT_WEB_JARS_PREFIX_URL = "/webjars/swagger-ui/5.18.2"; /** * The constant CLASSPATH_RESOURCE_LOCATION. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java index 2c2bd5bd1..536f4169b 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java @@ -25,17 +25,10 @@ */ package org.springdoc.webflux.core.providers; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.stream.Collectors; - import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.providers.SpringWebProvider; - +import org.springdoc.core.utils.Constants; import org.springframework.util.CollectionUtils; import org.springframework.web.method.HandlerMethod; import org.springframework.web.reactive.result.condition.PatternsRequestCondition; @@ -44,6 +37,13 @@ import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; import org.springframework.web.util.pattern.PathPattern; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; + /** * The type Spring webflux provider. @@ -66,8 +66,8 @@ public String findPathPrefix(SpringDocConfigProperties springDocConfigProperties Set patterns = getActivePatterns(requestMappingInfo); if (!CollectionUtils.isEmpty(patterns)) { for (String operationPath : patterns) { - if (operationPath.endsWith(springDocConfigProperties.getApiDocs().getPath())) - return operationPath.replace(springDocConfigProperties.getApiDocs().getPath(), StringUtils.EMPTY); + if (operationPath.endsWith(Constants.DEFAULT_API_DOCS_URL)) + return operationPath.replace(Constants.DEFAULT_API_DOCS_URL, StringUtils.EMPTY); } } } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java index cbabe6642..4d74abbf1 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java @@ -26,8 +26,6 @@ package org.springdoc.webflux.ui; -import java.util.Optional; - import org.springdoc.core.configuration.SpringDocConfiguration; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigProperties; @@ -36,7 +34,6 @@ import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.providers.SpringWebProvider; import org.springdoc.webflux.core.providers.SpringWebFluxProvider; - import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType; @@ -54,6 +51,8 @@ import org.springframework.context.annotation.Lazy; import org.springframework.web.reactive.config.WebFluxConfigurer; +import java.util.Optional; + import static org.springdoc.core.utils.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; import static org.springdoc.core.utils.Constants.SPRINGDOC_USE_MANAGEMENT_PORT; import static org.springdoc.core.utils.Constants.SPRINGDOC_USE_ROOT_PATH; @@ -129,9 +128,9 @@ SwaggerUiHome swaggerUiHome(Optional optionalWebFluxPropertie @ConditionalOnMissingBean @Lazy(false) SwaggerWebFluxConfigurer swaggerWebFluxConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, - SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, + SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { - return new SwaggerWebFluxConfigurer(swaggerUiConfigProperties,springDocConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); + return new SwaggerWebFluxConfigurer(swaggerUiConfigProperties, springDocConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); } /** @@ -207,7 +206,7 @@ static class SwaggerActuatorWelcomeConfiguration { @Lazy(false) SwaggerWelcomeActuator swaggerActuatorWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, WebEndpointProperties webEndpointProperties, ManagementServerProperties managementServerProperties) { - return new SwaggerWelcomeActuator(swaggerUiConfig, springDocConfigProperties, webEndpointProperties, managementServerProperties); + return new SwaggerWelcomeActuator(swaggerUiConfig, springDocConfigProperties, webEndpointProperties); } } } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java index eefa9f798..67779ca3a 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java @@ -21,23 +21,22 @@ * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; -import java.util.Optional; - import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.ActuatorProvider; - import org.springframework.web.reactive.config.ResourceHandlerRegistry; import org.springframework.web.reactive.config.WebFluxConfigurer; +import java.util.Optional; + import static org.springdoc.core.utils.Constants.ALL_PATTERN; import static org.springdoc.core.utils.Constants.CLASSPATH_RESOURCE_LOCATION; -import static org.springdoc.core.utils.Constants.DEFAULT_WEB_JARS_PREFIX_URL; +import static org.springdoc.core.utils.Constants.SWAGGER_UI_PREFIX; import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; /** @@ -82,8 +81,8 @@ public class SwaggerWebFluxConfigurer implements WebFluxConfigurer { * @param swaggerResourceResolver the swagger resource resolver */ public SwaggerWebFluxConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, - SpringDocConfigProperties springDocConfigProperties, - SwaggerIndexTransformer swaggerIndexTransformer, + SpringDocConfigProperties springDocConfigProperties, + SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { this.swaggerIndexTransformer = swaggerIndexTransformer; this.actuatorProvider = actuatorProvider; @@ -100,8 +99,9 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) { uiRootPath.append(swaggerPath, 0, swaggerPath.lastIndexOf(DEFAULT_PATH_SEPARATOR)); if (actuatorProvider.isPresent() && actuatorProvider.get().isUseManagementPort()) uiRootPath.append(actuatorProvider.get().getBasePath()); - registry.addResourceHandler(uiRootPath + springDocConfigProperties.getWebjars().getPrefix() + ALL_PATTERN) - .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + DEFAULT_WEB_JARS_PREFIX_URL + DEFAULT_PATH_SEPARATOR) + + registry.addResourceHandler(uiRootPath + SWAGGER_UI_PREFIX + ALL_PATTERN) + .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + springDocConfigProperties.getWebjars().getPrefix() + DEFAULT_PATH_SEPARATOR) .resourceChain(false) .addResolver(swaggerResourceResolver) .addTransformer(swaggerIndexTransformer); diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java index e3f71dcd3..aeee37fea 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java @@ -26,24 +26,20 @@ package org.springdoc.webflux.ui; -import java.util.Map; - import io.swagger.v3.oas.annotations.Operation; -import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; -import reactor.core.publisher.Mono; - import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; -import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties; import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpoint; import org.springframework.http.MediaType; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.util.UriComponentsBuilder; +import reactor.core.publisher.Mono; + +import java.util.Map; import static org.springdoc.core.utils.Constants.DEFAULT_API_DOCS_ACTUATOR_URL; import static org.springdoc.core.utils.Constants.DEFAULT_SWAGGER_UI_ACTUATOR_PATH; @@ -68,26 +64,18 @@ public class SwaggerWelcomeActuator extends SwaggerWelcomeCommon { */ private final WebEndpointProperties webEndpointProperties; - /** - * The Management server properties. - */ - private final ManagementServerProperties managementServerProperties; - /** * Instantiates a new Swagger welcome. * - * @param swaggerUiConfig the swagger ui config - * @param springDocConfigProperties the spring doc config properties - * @param webEndpointProperties the web endpoint properties - * @param managementServerProperties the management server properties + * @param swaggerUiConfig the swagger ui config + * @param springDocConfigProperties the swagger ui config parameters + * @param webEndpointProperties the web endpoint properties */ public SwaggerWelcomeActuator(SwaggerUiConfigProperties swaggerUiConfig , SpringDocConfigProperties springDocConfigProperties, - WebEndpointProperties webEndpointProperties, - ManagementServerProperties managementServerProperties) { + WebEndpointProperties webEndpointProperties) { super(swaggerUiConfig, springDocConfigProperties); this.webEndpointProperties = webEndpointProperties; - this.managementServerProperties = managementServerProperties; } /** @@ -104,39 +92,30 @@ public Mono redirectToUi(ServerHttpRequest request, ServerHttpResponse res return super.redirectToUi(request, response); } - /** - * Gets swagger ui config. + * Openapi yaml map. * * @param request the request - * @return the swagger ui config + * @return the map */ @Operation(hidden = true) @GetMapping(value = SWAGGER_CONFIG_ACTUATOR_URL, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody @Override - public Map getSwaggerUiConfig(ServerHttpRequest request) { - return super.getSwaggerUiConfig(request); + public Map openapiJson(ServerHttpRequest request) { + return super.openapiJson(request); } @Override - protected void calculateUiRootPath(SwaggerUiConfigParameters swaggerUiConfigParameters,StringBuilder... sbUrls) { + protected void calculateUiRootPath(SwaggerUiConfigParameters swaggerUiConfigParameters, StringBuilder... sbUrls) { StringBuilder sbUrl = new StringBuilder(); sbUrl.append(webEndpointProperties.getBasePath()); - calculateUiRootCommon(swaggerUiConfigParameters,sbUrl, sbUrls); - } - - @Override - protected void calculateOauth2RedirectUrl(SwaggerUiConfigParameters swaggerUiConfigParameters, UriComponentsBuilder uriComponentsBuilder) { - if (StringUtils.isBlank(swaggerUiConfig.getOauth2RedirectUrl()) || !swaggerUiConfigParameters.isValidUrl(swaggerUiConfig.getOauth2RedirectUrl())) { - UriComponentsBuilder oauthPrefix = uriComponentsBuilder.path(managementServerProperties.getBasePath() + swaggerUiConfigParameters.getUiRootPath()).path(webJarsPrefixUrl); - swaggerUiConfigParameters.setOauth2RedirectUrl(oauthPrefix.path(getOauth2RedirectUrl()).build().toString()); - } + calculateUiRootCommon(swaggerUiConfigParameters, sbUrl, sbUrls); } @Override protected void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { - swaggerUiConfigParameters.setApiDocsUrl( buildUrl(swaggerUiConfigParameters.getContextPath() + webEndpointProperties.getBasePath(), DEFAULT_API_DOCS_ACTUATOR_URL)); + swaggerUiConfigParameters.setApiDocsUrl(buildUrl(swaggerUiConfigParameters.getContextPath() + webEndpointProperties.getBasePath(), DEFAULT_API_DOCS_ACTUATOR_URL)); } @Override diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java index a7e4d1d8b..0e815af3c 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java @@ -21,25 +21,24 @@ * * * * * * * * * - * + * */ package org.springdoc.webflux.ui; -import java.net.URI; -import java.util.Map; - +import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.ui.AbstractSwaggerWelcome; -import reactor.core.publisher.Mono; - import org.springframework.http.HttpStatus; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; -import org.springframework.util.AntPathMatcher; import org.springframework.web.util.UriComponentsBuilder; +import reactor.core.publisher.Mono; + +import java.net.URI; +import java.util.Map; /** * The type Swagger welcome common. @@ -48,11 +47,6 @@ */ public abstract class SwaggerWelcomeCommon extends AbstractSwaggerWelcome { - /** - * The Web jars prefix url. - */ - protected String webJarsPrefixUrl; - /** * Instantiates a new Abstract swagger welcome. @@ -62,7 +56,6 @@ public abstract class SwaggerWelcomeCommon extends AbstractSwaggerWelcome { */ protected SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties) { super(swaggerUiConfig, springDocConfigProperties); - this.webJarsPrefixUrl = springDocConfigProperties.getWebjars().getPrefix(); } /** @@ -74,14 +67,39 @@ protected SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, Spring */ protected Mono redirectToUi(ServerHttpRequest request, ServerHttpResponse response) { SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); - this.buildFromCurrentContextPath(swaggerUiConfigParameters, request); - String sbUrl = this.buildUrl(swaggerUiConfigParameters.getContextPath(), swaggerUiConfigParameters.getUiRootPath() + springDocConfigProperties.getWebjars().getPrefix() + getSwaggerUiUrl()); + buildFromCurrentContextPath(swaggerUiConfigParameters, request); + String sbUrl = swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getUiRootPath() + getSwaggerUiUrl(); UriComponentsBuilder uriBuilder = getUriComponentsBuilder(swaggerUiConfigParameters, sbUrl); + + // forward all queryParams from original request + request.getQueryParams().forEach(uriBuilder::queryParam); + response.setStatusCode(HttpStatus.FOUND); response.getHeaders().setLocation(URI.create(uriBuilder.build().encode().toString())); return response.setComplete(); } + /** + * Openapi json map. + * + * @param request the request + * @return the map + */ + protected Map openapiJson(ServerHttpRequest request) { + SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); + buildFromCurrentContextPath(swaggerUiConfigParameters, request); + return swaggerUiConfigParameters.getConfigParameters(); + } + + @Override + protected void calculateOauth2RedirectUrl(SwaggerUiConfigParameters swaggerUiConfigParameters, UriComponentsBuilder uriComponentsBuilder) { + if (StringUtils.isBlank(swaggerUiConfig.getOauth2RedirectUrl()) || !swaggerUiConfigParameters.isValidUrl(swaggerUiConfig.getOauth2RedirectUrl())) { + swaggerUiConfigParameters.setOauth2RedirectUrl(uriComponentsBuilder + .path(swaggerUiConfigParameters.getUiRootPath()) + .path(getOauth2RedirectUrl()).build().toString()); + } + } + /** * Gets swagger ui config. * @@ -105,8 +123,13 @@ void buildFromCurrentContextPath(SwaggerUiConfigParameters swaggerUiConfigParame super.init(swaggerUiConfigParameters); swaggerUiConfigParameters.setContextPath(request.getPath().contextPath().value()); String url = UriComponentsBuilder.fromHttpRequest(request).toUriString(); - if (!AntPathMatcher.DEFAULT_PATH_SEPARATOR.equals(request.getPath().toString())) + String target = UriComponentsBuilder.fromPath(request.getPath().contextPath().value()).toUriString(); + int endIndex = url.indexOf(target) + target.length(); + if (endIndex > 0) { + url = url.substring(0, endIndex); + } else { url = url.replace(request.getPath().toString(), ""); + } buildConfigUrl(swaggerUiConfigParameters, UriComponentsBuilder.fromUriString(url)); } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java index bcc3a0119..8ee781d92 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java @@ -27,18 +27,15 @@ package org.springdoc.webflux.ui; import io.swagger.v3.oas.annotations.Operation; -import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.SpringWebProvider; -import reactor.core.publisher.Mono; - import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.util.UriComponentsBuilder; +import reactor.core.publisher.Mono; import static org.springdoc.core.utils.Constants.SWAGGER_CONFIG_FILE; import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; @@ -90,14 +87,6 @@ protected void calculateUiRootPath(SwaggerUiConfigParameters swaggerUiConfigPara calculateUiRootCommon(swaggerUiConfigParameters,sbUrl, sbUrls); } - @Override - protected void calculateOauth2RedirectUrl(SwaggerUiConfigParameters swaggerUiConfigParameters, UriComponentsBuilder uriComponentsBuilder) { - if (StringUtils.isBlank(swaggerUiConfig.getOauth2RedirectUrl()) || !swaggerUiConfigParameters.isValidUrl(swaggerUiConfig.getOauth2RedirectUrl())) { - UriComponentsBuilder oauthPrefix = uriComponentsBuilder.path(swaggerUiConfigParameters.getContextPath()).path(swaggerUiConfigParameters.getUiRootPath()).path(webJarsPrefixUrl); - swaggerUiConfigParameters.setOauth2RedirectUrl(oauthPrefix.path(getOauth2RedirectUrl()).build().toString()); - } - } - @Override protected void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameters) { swaggerUiConfigParameters.setApiDocsUrl(buildUrlWithContextPath(swaggerUiConfigParameters, springDocConfigProperties.getApiDocs().getPath())); @@ -107,7 +96,11 @@ protected void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameter protected String buildUrlWithContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, String swaggerUiUrl) { if (swaggerUiConfigParameters.getPathPrefix() == null) swaggerUiConfigParameters.setPathPrefix(springWebProvider.findPathPrefix(springDocConfigProperties)); - return buildUrl(swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getPathPrefix(), swaggerUiUrl); + if (swaggerUiUrl.startsWith(swaggerUiConfigParameters.getPathPrefix())) { + return buildUrl(swaggerUiConfigParameters.getContextPath(), swaggerUiUrl); + } else { + return buildUrl(swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getPathPrefix(), swaggerUiUrl); + } } @Override diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java index e64e17e4d..51f6bde2d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java @@ -25,17 +25,10 @@ */ package org.springdoc.webmvc.core.providers; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.stream.Collectors; - import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.providers.SpringWebProvider; - +import org.springdoc.core.utils.Constants; import org.springframework.util.CollectionUtils; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.handler.AbstractHandlerMethodMapping; @@ -44,6 +37,13 @@ import org.springframework.web.servlet.mvc.method.RequestMappingInfo; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; + /** * The type Spring web mvc provider. * @@ -65,8 +65,8 @@ public String findPathPrefix(SpringDocConfigProperties springDocConfigProperties Set patterns = getActivePatterns(requestMappingInfo); if (!CollectionUtils.isEmpty(patterns)) { for (String operationPath : patterns) { - if (operationPath.endsWith(springDocConfigProperties.getApiDocs().getPath())) - return operationPath.replace(springDocConfigProperties.getApiDocs().getPath(), StringUtils.EMPTY); + if (operationPath.endsWith(Constants.DEFAULT_API_DOCS_URL)) + return operationPath.replace(Constants.DEFAULT_API_DOCS_URL, StringUtils.EMPTY); } } } diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java index 8d5eb953c..bdd48be0b 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java @@ -26,8 +26,6 @@ package org.springdoc.webmvc.ui; -import java.util.Optional; - import org.springdoc.core.configuration.SpringDocConfiguration; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigProperties; @@ -36,7 +34,6 @@ import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.providers.SpringWebProvider; import org.springdoc.webmvc.core.providers.SpringWebMvcProvider; - import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType; @@ -51,6 +48,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; +import java.util.Optional; + import static org.springdoc.core.utils.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; import static org.springdoc.core.utils.Constants.SPRINGDOC_USE_MANAGEMENT_PORT; import static org.springdoc.core.utils.Constants.SPRINGDOC_USE_ROOT_PATH; @@ -153,8 +152,9 @@ SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUi @ConditionalOnMissingBean @Lazy(false) SwaggerWebMvcConfigurer swaggerWebMvcConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, - SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { - return new SwaggerWebMvcConfigurer(swaggerUiConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); + SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, + Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { + return new SwaggerWebMvcConfigurer(swaggerUiConfigProperties, springDocConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); } /** diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java index 1399e0857..c83403a3d 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java @@ -26,12 +26,9 @@ package org.springdoc.webmvc.ui; -import java.util.List; -import java.util.Optional; - +import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.ActuatorProvider; - import org.springframework.format.FormatterRegistry; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.lang.Nullable; @@ -51,9 +48,11 @@ import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import java.util.List; +import java.util.Optional; + +import static org.springdoc.core.utils.Constants.ALL_PATTERN; import static org.springdoc.core.utils.Constants.CLASSPATH_RESOURCE_LOCATION; -import static org.springdoc.core.utils.Constants.DEFAULT_WEB_JARS_PREFIX_URL; -import static org.springdoc.core.utils.Constants.SWAGGER_INITIALIZER_JS; import static org.springdoc.core.utils.Constants.SWAGGER_UI_PREFIX; import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; @@ -84,21 +83,29 @@ public class SwaggerWebMvcConfigurer implements WebMvcConfigurer { */ private final SwaggerResourceResolver swaggerResourceResolver; + /** + * The Spring doc config properties. + */ + private final SpringDocConfigProperties springDocConfigProperties; + /** * Instantiates a new Swagger web mvc configurer. * * @param swaggerUiConfigProperties the swagger ui calculated config + * @param springDocConfigProperties * @param swaggerIndexTransformer the swagger index transformer * @param actuatorProvider the actuator provider * @param swaggerResourceResolver the swagger resource resolver */ public SwaggerWebMvcConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, + SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { this.swaggerIndexTransformer = swaggerIndexTransformer; this.actuatorProvider = actuatorProvider; this.swaggerResourceResolver = swaggerResourceResolver; this.swaggerUiConfigProperties = swaggerUiConfigProperties; + this.springDocConfigProperties = springDocConfigProperties; } @Override @@ -110,18 +117,12 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) { if (actuatorProvider.isPresent() && actuatorProvider.get().isUseManagementPort()) uiRootPath.append(actuatorProvider.get().getBasePath()); - registry.addResourceHandler(uiRootPath + SWAGGER_UI_PREFIX + "*/*" + SWAGGER_INITIALIZER_JS) - .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + DEFAULT_WEB_JARS_PREFIX_URL + DEFAULT_PATH_SEPARATOR) + registry.addResourceHandler(uiRootPath + SWAGGER_UI_PREFIX + ALL_PATTERN) + .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + springDocConfigProperties.getWebjars().getPrefix() + DEFAULT_PATH_SEPARATOR) .setCachePeriod(0) .resourceChain(false) .addResolver(swaggerResourceResolver) .addTransformer(swaggerIndexTransformer); - - registry.addResourceHandler(uiRootPath + SWAGGER_UI_PREFIX + "*/**") - .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + DEFAULT_WEB_JARS_PREFIX_URL + DEFAULT_PATH_SEPARATOR) - .resourceChain(false) - .addResolver(swaggerResourceResolver) - .addTransformer(swaggerIndexTransformer); } @Override diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java index 00f485938..de248dea0 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java @@ -33,7 +33,6 @@ import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.SpringWebProvider; import org.springdoc.core.utils.SpringDocUtils; - import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; @@ -107,7 +106,11 @@ protected void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameter protected String buildUrlWithContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, String swaggerUiUrl) { if (swaggerUiConfigParameters.getPathPrefix() == null) swaggerUiConfigParameters.setPathPrefix(springWebProvider.findPathPrefix(springDocConfigProperties)); - return buildUrl(swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getPathPrefix(), swaggerUiUrl); + if (swaggerUiUrl.startsWith(swaggerUiConfigParameters.getPathPrefix())) { + return buildUrl(swaggerUiConfigParameters.getContextPath(), swaggerUiUrl); + } else { + return buildUrl(swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getPathPrefix(), swaggerUiUrl); + } } @Override From bb0405c0e3fb44593b810c14bc438ef21285f224 Mon Sep 17 00:00:00 2001 From: Abdelmoez GUETAT Date: Mon, 20 Jan 2025 11:27:15 +0100 Subject: [PATCH 170/226] fix tests --- .../org/springdoc/ui/AbstractSpringDocTest.java | 3 +-- .../ui/app1/SpringDocApp1RedirecFilterTest.java | 5 ++--- .../SpringDocApp1RedirectConfigUrlTest.java | 5 ++--- .../app1/SpringDocApp1RedirectDefaultTest.java | 5 ++--- .../app1/SpringDocApp1RedirectLayoutTest.java | 5 ++--- .../SpringDocApp1RedirectWithConfigTest.java | 5 ++--- .../springdoc/ui/app13/SpringDocApp13Test.java | 7 +++---- .../springdoc/ui/app14/SpringDocApp14Test.java | 7 +++---- .../springdoc/ui/app15/SpringDocApp15Test.java | 7 +++---- .../springdoc/ui/app16/SpringDocApp16Test.java | 7 +++---- .../springdoc/ui/app17/SpringDocApp17Test.java | 5 ++--- .../springdoc/ui/app18/SpringDocApp18Test.java | 10 ++++------ .../springdoc/ui/app19/SpringDocApp19Test.java | 7 +++---- .../springdoc/ui/app20/SpringDocApp20Test.java | 7 +++---- .../springdoc/ui/app24/SpringDocApp24Test.java | 5 ++--- .../app3/SpringDocApp3RedirectDefaultTest.java | 9 ++++----- .../SpringDocApp3RedirectWithPrefixTest.java | 10 ++++------ .../springdoc/ui/app3/SpringDocApp3Test.java | 5 ++--- .../ui/app32/SpringDocBehindProxyTest.java | 17 ++++++++--------- ...pringDocBehindProxyWithCustomUIPathTest.java | 7 +++---- ...indProxyWithCustomUIPathWithApiDocsTest.java | 7 +++---- .../app33/SpringDocBehindProxyBasePathTest.java | 10 ++++------ .../ui/app4/SpringDocOauthPathsTest.java | 5 ++--- ...pringDocOauthRedirectUrlRecalculateTest.java | 7 +++---- .../ui/app4/SpringDocOauthServletPathsTest.java | 9 ++++----- .../springdoc/ui/app6/SpringDocApp6Test.java | 5 ++--- .../springdoc/ui/app7/SpringDocApp7Test.java | 5 ++--- .../src/test/resources/results/app13-1.json | 2 +- .../src/test/resources/results/app14-1.json | 2 +- .../src/test/resources/results/app15-1.json | 2 +- .../src/test/resources/results/app16-1.json | 2 +- .../src/test/resources/results/app18-1.json | 2 +- .../src/test/resources/results/app19-1.json | 2 +- .../src/test/resources/results/app20-1.json | 2 +- .../src/test/resources/results/app32-1.json | 2 +- .../src/test/resources/results/app33.json | 2 +- .../SpringDocAppRedirectWithPrefixTest.java | 6 ++---- .../springdoc/ui/app21/SpringDocApp21Test.java | 3 +-- 38 files changed, 90 insertions(+), 123 deletions(-) diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java index 18cea3fd7..a5d62e29a 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java @@ -27,7 +27,6 @@ import org.springdoc.core.utils.Constants; import org.springdoc.webflux.core.configuration.SpringDocWebFluxConfiguration; import org.springdoc.webflux.ui.SwaggerConfig; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.test.context.ContextConfiguration; @@ -44,7 +43,7 @@ SwaggerConfig.class, SwaggerUiOAuthProperties.class, SpringDocUIConfiguration.class }) public abstract class AbstractSpringDocTest extends AbstractCommonTest { - private static final String DEFAULT_SWAGGER_INITIALIZER_URL = Constants.DEFAULT_WEB_JARS_PREFIX_URL + Constants.SWAGGER_INITIALIZER_URL; + private static final String DEFAULT_SWAGGER_INITIALIZER_URL = Constants.SWAGGER_INITIALIZER_URL; @Autowired protected WebTestClient webTestClient; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java index 8609d5015..59c4a37e4 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java @@ -20,11 +20,10 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = "springdoc.swagger-ui.filter=false") @@ -36,7 +35,7 @@ void shouldRedirectWithConfigUrlIgnoringQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() - .value("Location", Matchers.is("/webjars/swagger-ui/index.html")); + .value("Location", Matchers.is("/swagger-ui/index.html")); super.checkJS("index1-filter"); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java index 753f50363..4ef6e58cf 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java @@ -20,11 +20,10 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { @@ -39,7 +38,7 @@ void shouldRedirectWithConfigUrlIgnoringQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() - .value("Location", Matchers.is("/webjars/swagger-ui/index.html")); + .value("Location", Matchers.is("/swagger-ui/index.html")); super.checkJS("index1-configurl"); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java index f9e3795ba..d1df612cd 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java @@ -20,10 +20,9 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.web.reactive.server.WebTestClient; +import test.org.springdoc.ui.AbstractSpringDocTest; public class SpringDocApp1RedirectDefaultTest extends AbstractSpringDocTest { @@ -33,7 +32,7 @@ void shouldRedirectWithDefaultQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() - .value("Location", Matchers.is("/webjars/swagger-ui/index.html")); + .value("Location", Matchers.is("/swagger-ui/index.html")); webTestClient.get().uri("/v3/api-docs/swagger-config").exchange() .expectStatus().isOk().expectBody().jsonPath("$.validatorUrl").isEqualTo(""); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java index 0c99df952..31ba1f13e 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java @@ -20,11 +20,10 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = "springdoc.swagger-ui.layout=BaseLayout") @@ -36,7 +35,7 @@ void shouldRedirectWithConfigUrlIgnoringQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() - .value("Location", Matchers.is("/webjars/swagger-ui/index.html")); + .value("Location", Matchers.is("/swagger-ui/index.html")); super.checkJS("index1-layout"); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java index e663aefd9..039d1e114 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java @@ -20,11 +20,10 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.validatorUrl=/foo/validate", @@ -38,7 +37,7 @@ void shouldRedirectWithConfiguredParams() { .expectStatus().isFound(); responseSpec.expectHeader() - .value("Location", Matchers.is("/webjars/swagger-ui/index.html")); + .value("Location", Matchers.is("/swagger-ui/index.html")); webTestClient.get().uri("/baf/batz/swagger-config").exchange() .expectStatus().isOk().expectBody().jsonPath("$.validatorUrl").isEqualTo("/foo/validate"); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java index 1597a1130..c977787fd 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java @@ -25,14 +25,13 @@ package test.org.springdoc.ui.app13; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.test.web.reactive.server.EntityExchangeResult; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -47,7 +46,7 @@ class SpringDocApp13Test extends AbstractSpringDocActuatorTest { @Test void testIndex() { - EntityExchangeResult getResult = webTestClient.get().uri("/application/webjars/swagger-ui/index.html") + EntityExchangeResult getResult = webTestClient.get().uri("/application/swagger-ui/index.html") .exchange() .expectStatus().isOk() .expectBody().returnResult(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java index 60b08be10..1752b16f4 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java @@ -25,14 +25,13 @@ package test.org.springdoc.ui.app14; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.test.web.reactive.server.EntityExchangeResult; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -45,7 +44,7 @@ class SpringDocApp14Test extends AbstractSpringDocActuatorTest { @Test void testIndex() { - EntityExchangeResult getResult = webTestClient.get().uri("/application/webjars/swagger-ui/index.html") + EntityExchangeResult getResult = webTestClient.get().uri("/application/swagger-ui/index.html") .exchange() .expectStatus().isOk() .expectBody().returnResult(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java index 1f8b2a135..743791d00 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java @@ -25,14 +25,13 @@ package test.org.springdoc.ui.app15; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.test.web.reactive.server.EntityExchangeResult; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -48,7 +47,7 @@ class SpringDocApp15Test extends AbstractSpringDocActuatorTest { @Test void testIndex() { - EntityExchangeResult getResult = webTestClient.get().uri("/application/webjars/swagger-ui/index.html") + EntityExchangeResult getResult = webTestClient.get().uri("/application/swagger-ui/index.html") .exchange() .expectStatus().isOk() .expectBody().returnResult(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java index 189643268..7a81538d0 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java @@ -25,14 +25,13 @@ package test.org.springdoc.ui.app16; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.test.web.reactive.server.EntityExchangeResult; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -48,7 +47,7 @@ class SpringDocApp16Test extends AbstractSpringDocActuatorTest { @Test void testIndex() { - EntityExchangeResult getResult = webTestClient.get().uri("/application/webjars/swagger-ui/index.html") + EntityExchangeResult getResult = webTestClient.get().uri("/application/swagger-ui/index.html") .exchange() .expectStatus().isOk() .expectBody().returnResult(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java index 85e466a53..a3e0b520a 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java @@ -19,11 +19,10 @@ package test.org.springdoc.ui.app17; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.web.reactive.server.EntityExchangeResult; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -38,7 +37,7 @@ class SpringDocApp17Test extends AbstractSpringDocActuatorTest { @Test void testIndex() { - EntityExchangeResult getResult = webTestClient.get().uri("/webjars/swagger-ui/index.html") + EntityExchangeResult getResult = webTestClient.get().uri("/swagger-ui/index.html") .exchange() .expectStatus().isOk() .expectBody().returnResult(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java index 1a16f01e3..240ef7b1d 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java @@ -26,9 +26,6 @@ import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractCommonTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -36,6 +33,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractCommonTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -45,8 +44,7 @@ properties = { "spring.webflux.base-path=/test", "server.port=9218", "springdoc.swagger-ui.path=/documentation/swagger-ui.html", - "springdoc.api-docs.path=/documentation/v3/api-docs", - "springdoc.webjars.prefix= /webjars-pref" }) + "springdoc.api-docs.path=/documentation/v3/api-docs"}) class SpringDocApp18Test extends AbstractCommonTest { @LocalServerPort @@ -66,7 +64,7 @@ void testIndex() throws Exception { .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); - httpStatusMono = webClient.get().uri("/test/documentation/webjars-pref/swagger-ui/index.html") + httpStatusMono = webClient.get().uri("/test/documentation/swagger-ui/index.html") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.OK); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java index a9b7219dc..f1930b98c 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java @@ -26,9 +26,6 @@ import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractCommonTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -36,6 +33,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractCommonTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -63,7 +62,7 @@ void testIndex() throws Exception { .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); - httpStatusMono = webClient.get().uri("/webjars/swagger-ui/index.html") + httpStatusMono = webClient.get().uri("/swagger-ui/index.html") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.OK); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java index c529460d7..c3b692bb8 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java @@ -27,9 +27,6 @@ import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractCommonTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -37,6 +34,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractCommonTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -63,7 +62,7 @@ void testIndex() throws Exception { .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); - httpStatusMono = webClient.get().uri("/webjars/swagger-ui/index.html") + httpStatusMono = webClient.get().uri("/swagger-ui/index.html") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.OK); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java index 0eace46d3..dcfb7aa98 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java @@ -19,11 +19,10 @@ package test.org.springdoc.ui.app24; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.api-docs.enabled=false", @@ -40,7 +39,7 @@ void test_apidocs_disabled() { .jsonPath("$.url").isEqualTo("/api-docs/xxx/v1/openapi.yml") .jsonPath("$.configUrl").isEqualTo("/api-docs/swagger-config") .jsonPath("$.validatorUrl").isEqualTo("") - .jsonPath("$.oauth2RedirectUrl").isEqualTo("/webjars/swagger-ui/oauth2-redirect.html"); + .jsonPath("$.oauth2RedirectUrl").isEqualTo("/swagger-ui/oauth2-redirect.html"); } @SpringBootApplication diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java index bcfc081d9..f867d847e 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java @@ -21,11 +21,10 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { @@ -39,14 +38,14 @@ void shouldRedirectWithDefaultQueryParams() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/documentation/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() - .value("Location", Matchers.is("/documentation/webjars/swagger-ui/index.html")); + .value("Location", Matchers.is("/documentation/swagger-ui/index.html")); webTestClient.get().uri("/documentation/v3/api-docs/swagger-config").exchange() .expectStatus().isOk().expectBody() .jsonPath("$.validatorUrl").isEqualTo("") - .jsonPath("$.oauth2RedirectUrl").isEqualTo("/documentation/webjars/swagger-ui/oauth2-redirect.html"); + .jsonPath("$.oauth2RedirectUrl").isEqualTo("/documentation/swagger-ui/oauth2-redirect.html"); - super.checkJS("index3", "/documentation/webjars" + Constants.SWAGGER_INITIALIZER_URL); + super.checkJS("index3", "/documentation" + Constants.SWAGGER_INITIALIZER_URL); } @SpringBootApplication diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java index c93d0744d..f59021214 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java @@ -20,16 +20,14 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.path=/documentation/swagger-ui.html", - "springdoc.api-docs.path=/documentation/v3/api-docs", - "springdoc.webjars.prefix= /webjars-pref" + "springdoc.api-docs.path=/documentation/v3/api-docs" }) public class SpringDocApp3RedirectWithPrefixTest extends AbstractSpringDocTest { @@ -38,8 +36,8 @@ void shouldRedirectWithPrefix() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/documentation/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() - .value("Location", Matchers.is("/documentation/webjars-pref/swagger-ui/index.html")); - webTestClient.get().uri("/documentation/webjars-pref/swagger-ui/index.html").exchange() + .value("Location", Matchers.is("/documentation/swagger-ui/index.html")); + webTestClient.get().uri("/documentation/swagger-ui/index.html").exchange() .expectStatus().isOk(); webTestClient.get().uri("/documentation/v3/api-docs/swagger-config").exchange() .expectStatus().isOk().expectBody().jsonPath("$.validatorUrl").isEqualTo(""); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java index 18030ea5d..429a8e5f4 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java @@ -19,10 +19,9 @@ package test.org.springdoc.ui.app3; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.path=/documentation/swagger-ui.html", @@ -34,7 +33,7 @@ public class SpringDocApp3Test extends AbstractSpringDocTest { void shouldDisplaySwaggerUiPage() { webTestClient.get().uri("/documentation/swagger-ui.html").exchange() .expectStatus().isFound(); - webTestClient.get().uri("/documentation/webjars/swagger-ui/index.html").exchange() + webTestClient.get().uri("/documentation/swagger-ui/index.html").exchange() .expectStatus().isOk(); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java index d5f5c013c..19e251bef 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java @@ -18,15 +18,14 @@ package test.org.springdoc.ui.app32; -import java.util.concurrent.CompletableFuture; -import java.util.stream.IntStream; - import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.ui.AbstractSpringDocTest; + +import java.util.concurrent.CompletableFuture; +import java.util.stream.IntStream; import static org.assertj.core.api.Assertions.assertThat; @@ -40,14 +39,14 @@ public class SpringDocBehindProxyTest extends AbstractSpringDocTest { @Test void shouldServeSwaggerUIAtDefaultPath() { - webTestClient.get().uri("/webjars/swagger-ui/index.html").exchange() + webTestClient.get().uri("/swagger-ui/index.html").exchange() .expectStatus().isOk(); } @Test void shouldReturnCorrectInitializerJS() throws Exception { webTestClient - .get().uri("/webjars/swagger-ui/swagger-initializer.js") + .get().uri("/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchange() .expectStatus().isOk() @@ -67,7 +66,7 @@ void shouldCalculateOauthRedirectBehindProxy() throws Exception { .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchange() .expectStatus().isOk().expectBody() - .jsonPath("$.oauth2RedirectUrl").isEqualTo("https://proxy-host/path/prefix/webjars/swagger-ui/oauth2-redirect.html"); + .jsonPath("$.oauth2RedirectUrl").isEqualTo("https://proxy-host/path/prefix/swagger-ui/oauth2-redirect.html"); } @Test @@ -87,7 +86,7 @@ void shouldCalculateUrlsBehindProxy() throws Exception { void shouldReturnCorrectInitializerJSWhenChangingForwardedPrefixHeader() throws Exception { var tasks = IntStream.range(0, 10).mapToObj(i -> CompletableFuture.runAsync(() -> { try { - webTestClient.get().uri("/webjars/swagger-ui/swagger-initializer.js") + webTestClient.get().uri("/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", "/path/prefix" + i) .exchange() .expectStatus().isOk() diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java index 3c1cf2bdd..0aab83865 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java @@ -19,11 +19,10 @@ package test.org.springdoc.ui.app32; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.ui.AbstractSpringDocTest; import static org.assertj.core.api.Assertions.assertThat; @@ -43,13 +42,13 @@ void shouldRedirectSwaggerUIFromCustomPath() { .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchange() .expectStatus().isFound() - .expectHeader().location("/path/prefix/foo/documentation/webjars/swagger-ui/index.html"); + .expectHeader().location("/path/prefix/foo/documentation/swagger-ui/index.html"); } @Test void shouldReturnCorrectInitializerJS() { webTestClient - .get().uri("/foo/documentation/webjars/swagger-ui/swagger-initializer.js") + .get().uri("/foo/documentation/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchange() .expectStatus().isOk() diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java index 4ce4ec5d7..10163b7de 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java @@ -19,11 +19,10 @@ package test.org.springdoc.ui.app32; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.ui.AbstractSpringDocTest; import static org.assertj.core.api.Assertions.assertThat; @@ -44,13 +43,13 @@ void shouldRedirectSwaggerUIFromCustomPath() { .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchange() .expectStatus().isFound() - .expectHeader().location("/path/prefix/foo/documentation/webjars/swagger-ui/index.html"); + .expectHeader().location("/path/prefix/foo/documentation/swagger-ui/index.html"); } @Test void shouldReturnCorrectInitializerJS() { webTestClient - .get().uri("/foo/documentation/webjars/swagger-ui/swagger-initializer.js") + .get().uri("/foo/documentation/swagger-ui/swagger-initializer.js") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchange() .expectStatus().isOk() diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java index 32b2f2196..bc3daf005 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java @@ -20,9 +20,6 @@ import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractCommonTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -31,6 +28,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractCommonTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -41,8 +40,7 @@ "server.forward-headers-strategy=framework", "server.port=9318", "springdoc.swagger-ui.path=/documentation/swagger-ui.html", - "springdoc.api-docs.path=/documentation/v3/api-docs", - "springdoc.webjars.prefix= /webjars-pref" }) + "springdoc.api-docs.path=/documentation/v3/api-docs"}) @Import(SpringDocConfig.class) public class SpringDocBehindProxyBasePathTest extends AbstractCommonTest { @@ -68,7 +66,7 @@ void testIndex() throws Exception { .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); - httpStatusMono = webClient.get().uri(WEBFLUX_BASE_PATH+"/documentation/webjars-pref/swagger-ui/index.html") + httpStatusMono = webClient.get().uri(WEBFLUX_BASE_PATH + "/documentation/swagger-ui/index.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.OK); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java index 83cb385c0..ec14f0ecf 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java @@ -19,9 +19,8 @@ package test.org.springdoc.ui.app4; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; +import test.org.springdoc.ui.AbstractSpringDocTest; public class SpringDocOauthPathsTest extends AbstractSpringDocTest { @@ -29,7 +28,7 @@ public class SpringDocOauthPathsTest extends AbstractSpringDocTest { void oauth2_redirect_url_calculated() throws Exception { webTestClient.get().uri("/v3/api-docs/swagger-config").exchange() .expectStatus().isOk().expectBody() - .jsonPath("$.oauth2RedirectUrl").isEqualTo("/webjars/swagger-ui/oauth2-redirect.html"); + .jsonPath("$.oauth2RedirectUrl").isEqualTo("/swagger-ui/oauth2-redirect.html"); } @SpringBootApplication diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java index f141d05fe..80137cf0b 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java @@ -19,10 +19,9 @@ package test.org.springdoc.ui.app4; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "server.forward-headers-strategy=framework" }) public class SpringDocOauthRedirectUrlRecalculateTest extends AbstractSpringDocTest { @@ -36,7 +35,7 @@ void oauth2_redirect_url_recalculation() throws Exception { .exchange() .expectStatus().isOk() .expectBody() - .jsonPath("$.oauth2RedirectUrl").isEqualTo("https://host1/webjars/swagger-ui/oauth2-redirect.html"); + .jsonPath("$.oauth2RedirectUrl").isEqualTo("https://host1/swagger-ui/oauth2-redirect.html"); webTestClient.get().uri("/v3/api-docs/swagger-config") @@ -45,7 +44,7 @@ void oauth2_redirect_url_recalculation() throws Exception { .exchange() .expectStatus().isOk() .expectBody() - .jsonPath("$.oauth2RedirectUrl").isEqualTo("http://host2:8080/webjars/swagger-ui/oauth2-redirect.html"); + .jsonPath("$.oauth2RedirectUrl").isEqualTo("http://host2:8080/swagger-ui/oauth2-redirect.html"); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java index aa7fa86ca..c1fe1954f 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java @@ -19,10 +19,9 @@ package test.org.springdoc.ui.app4; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.path=/test/swagger.html" @@ -30,13 +29,13 @@ public class SpringDocOauthServletPathsTest extends AbstractSpringDocTest { @Test - void should_display_oauth2_redirect_page() throws Exception { - webTestClient.get().uri("/test/webjars/swagger-ui/oauth2-redirect.html").exchange() + void should_display_oauth2_redirect_page() { + webTestClient.get().uri("/test/swagger-ui/oauth2-redirect.html").exchange() .expectStatus().isOk(); } @Test - void oauth2_redirect_url_calculated_with_context_path_and_servlet_path() throws Exception { + void oauth2_redirect_url_calculated_with_context_path_and_servlet_path() { webTestClient.get().uri("/v3/api-docs/swagger-config").exchange() .expectStatus().isOk(); } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java index a5f7980a9..ef6e4fa62 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java @@ -25,18 +25,17 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.EntityExchangeResult; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.oauth.clientId=myClientId", "springdoc.swagger-ui.disable-swagger-default-url=true" }) public class SpringDocApp6Test extends AbstractSpringDocTest { @Test void transformed_index_with_oauth() throws Exception { - EntityExchangeResult getResult = webTestClient.get().uri("/webjars" + Constants.SWAGGER_INITIALIZER_URL) + EntityExchangeResult getResult = webTestClient.get().uri(Constants.SWAGGER_INITIALIZER_URL) .exchange() .expectStatus().isOk() .expectBody().returnResult(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java index 019fc372c..2dab18e42 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java @@ -25,18 +25,17 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.EntityExchangeResult; +import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = "springdoc.swagger-ui.disable-swagger-default-url=true") public class SpringDocApp7Test extends AbstractSpringDocTest { @Test void transformed_index_with_oauth() throws Exception { - EntityExchangeResult getResult = webTestClient.get().uri("/webjars" + Constants.SWAGGER_INITIALIZER_URL) + EntityExchangeResult getResult = webTestClient.get().uri(Constants.SWAGGER_INITIALIZER_URL) .exchange() .expectStatus().isOk() .expectBody().returnResult(); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app13-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app13-1.json index cc2a96ecc..324ce7cb0 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app13-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app13-1.json @@ -1,6 +1,6 @@ { "configUrl": "/application/swagger-ui/swagger-config", - "oauth2RedirectUrl": "http://localhost:9292/application/webjars/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9292/application/swagger-ui/oauth2-redirect.html", "url": "/application/openapi", "validatorUrl": "" } \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app14-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app14-1.json index 6b023b222..8a0e78ae8 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app14-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app14-1.json @@ -1,6 +1,6 @@ { "configUrl": "/application/swagger-ui/swagger-config", - "oauth2RedirectUrl": "http://localhost:9293/application/webjars/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9293/application/swagger-ui/oauth2-redirect.html", "urls": [ { "url": "/application/openapi/users", diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app15-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app15-1.json index 904cbbc03..e4a59fac8 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app15-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app15-1.json @@ -1,6 +1,6 @@ { "configUrl": "/test/application/swagger-ui/swagger-config", - "oauth2RedirectUrl": "http://localhost:9294/test/application/webjars/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9294/test/application/swagger-ui/oauth2-redirect.html", "url": "/test/application/openapi", "validatorUrl": "" } \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app16-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app16-1.json index 7de5abf41..e8f48875b 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app16-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app16-1.json @@ -1,6 +1,6 @@ { "configUrl": "/test/application/swagger-ui/swagger-config", - "oauth2RedirectUrl": "http://localhost:9295/test/application/webjars/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9295/test/application/swagger-ui/oauth2-redirect.html", "urls": [ { "url": "/test/application/openapi/users", diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app18-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app18-1.json index e9cf64c6e..305529a92 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app18-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app18-1.json @@ -1,6 +1,6 @@ { "configUrl": "/test/documentation/v3/api-docs/swagger-config", - "oauth2RedirectUrl": "http://localhost:9218/test/documentation/webjars-pref/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9218/test/documentation/swagger-ui/oauth2-redirect.html", "urls": [ { "url": "/test/documentation/v3/api-docs/users", diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app19-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app19-1.json index c893a6362..a861f58e0 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app19-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app19-1.json @@ -1,6 +1,6 @@ { "configUrl": "/v3/api-docs/swagger-config", - "oauth2RedirectUrl": "http://localhost:9219/webjars/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9219/swagger-ui/oauth2-redirect.html", "urls": [ { "url": "/v3/api-docs/users", diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app20-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app20-1.json index b9f841e7d..e7906a2fb 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app20-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app20-1.json @@ -1,6 +1,6 @@ { "configUrl": "/test/v3/api-docs/swagger-config", - "oauth2RedirectUrl": "http://localhost:9220/webjars/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9220/swagger-ui/oauth2-redirect.html", "url": "/test/v3/api-docs", "validatorUrl": "" } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json index c6f06f1f6..f811db83f 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json @@ -1,6 +1,6 @@ { "configUrl": "/path/prefix/documentation/v3/api-docs/swagger-config", - "oauth2RedirectUrl": "http://localhost:9318/path/prefix/documentation/webjars-pref/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9318/path/prefix/documentation/swagger-ui/oauth2-redirect.html", "url": "/path/prefix/documentation/v3/api-docs", "validatorUrl": "" } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json index 9d03a31f8..eef083258 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json @@ -1,6 +1,6 @@ { "configUrl": "/path/prefix/test/documentation/v3/api-docs/swagger-config", - "oauth2RedirectUrl": "http://localhost:9318/path/prefix/test/documentation/webjars-pref/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9318/path/prefix/test/documentation/swagger-ui/oauth2-redirect.html", "url": "/path/prefix/test/documentation/v3/api-docs", "validatorUrl": "" } diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java index 36d909224..7ff2bf816 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java @@ -21,10 +21,9 @@ import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.ui.AbstractSpringDocTest; import static org.hamcrest.CoreMatchers.equalTo; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -33,8 +32,7 @@ @TestPropertySource(properties = { "springdoc.swagger-ui.path=/documentation/swagger-ui.html", - "springdoc.api-docs.path=/documentation/v3/api-docs", - "springdoc.webjars.prefix= /webjars-pref" + "springdoc.api-docs.path=/documentation/v3/api-docs" }) public class SpringDocAppRedirectWithPrefixTest extends AbstractSpringDocTest { diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java index acb8278d0..492fe638f 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java @@ -19,9 +19,8 @@ package test.org.springdoc.ui.app21; import org.junit.jupiter.api.Test; -import test.org.springdoc.ui.AbstractSpringDocTest; - import org.springframework.boot.autoconfigure.SpringBootApplication; +import test.org.springdoc.ui.AbstractSpringDocTest; import static org.hamcrest.CoreMatchers.equalTo; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; From 02ed05f9ba62275334f4d3609f22ad4acc67bc4a Mon Sep 17 00:00:00 2001 From: Marco Brakmann Date: Wed, 22 Jan 2025 09:11:30 +0100 Subject: [PATCH 171/226] Improve performance of getGenericMapResponse --- .../core/service/GenericResponseService.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index ed87e8947..ea41fee6f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -145,14 +145,14 @@ public class GenericResponseService implements ApplicationContextAware { private final Lock reentrantLock = new ReentrantLock(); /** - * The Context. + * The constant LOGGER. */ - private ApplicationContext applicationContext; + private static final Logger LOGGER = LoggerFactory.getLogger(GenericResponseService.class); /** - * The constant LOGGER. + * A list of all beans annotated with {@code @ControllerAdvice} */ - private static final Logger LOGGER = LoggerFactory.getLogger(GenericResponseService.class); + private List controllerAdviceBeans; /** * Instantiates a new Generic response builder. @@ -702,8 +702,6 @@ private Map getGenericMapResponse(HandlerMethod handlerMeth .map(ControllerAdviceInfo::getApiResponseMap) .collect(LinkedHashMap::new, Map::putAll, Map::putAll); - List controllerAdviceBeans = ControllerAdviceBean.findAnnotatedBeans(applicationContext); - List controllerAdviceInfosNotInThisBean = controllerAdviceInfos.stream() .filter(controllerAdviceInfo -> getControllerAdviceBean(controllerAdviceBeans, controllerAdviceInfo.getControllerAdvice()) @@ -834,6 +832,6 @@ private boolean isGlobalException(Class exceptionClass) { @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - this.applicationContext = applicationContext; + controllerAdviceBeans = ControllerAdviceBean.findAnnotatedBeans(applicationContext); } } From e3b4311a8611cd8a20fc8b9ffd0d013810f1bcb6 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 24 Jan 2025 21:45:57 +0100 Subject: [PATCH 172/226] PR review --- .../org/springdoc/core/utils/Constants.java | 2 +- .../core/providers/SpringWebFluxProvider.java | 20 ++++----- .../springdoc/webflux/ui/SwaggerConfig.java | 5 +-- .../webflux/ui/SwaggerWebFluxConfigurer.java | 25 ++++++++--- .../webflux/ui/SwaggerWelcomeActuator.java | 4 +- .../webflux/ui/SwaggerWelcomeCommon.java | 43 ++++++++++--------- .../springdoc/ui/AbstractSpringDocTest.java | 1 + .../ui/app18/SpringDocApp18Test.java | 10 +++-- .../SpringDocApp3RedirectWithPrefixTest.java | 10 +++-- .../SpringDocBehindProxyBasePathTest.java | 5 ++- .../src/test/resources/results/app18-1.json | 2 +- .../src/test/resources/results/app32-1.json | 2 +- .../src/test/resources/results/app33.json | 2 +- .../core/providers/SpringWebMvcProvider.java | 20 ++++----- .../springdoc/webmvc/ui/SwaggerConfig.java | 10 ++--- .../webmvc/ui/SwaggerWebMvcConfigurer.java | 29 ++++++------- .../webmvc/ui/SwaggerWelcomeWebMvc.java | 7 +-- 17 files changed, 106 insertions(+), 91 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java index 5c808ec39..e8dbf962e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java @@ -175,7 +175,7 @@ public final class Constants { /** * The constant DEFAULT_WEB_JARS_PREFIX_URL. */ - public static final String DEFAULT_WEB_JARS_PREFIX_URL = "/webjars/swagger-ui/5.18.2"; + public static final String DEFAULT_WEB_JARS_PREFIX_URL = "/webjars"; /** * The constant CLASSPATH_RESOURCE_LOCATION. diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java index 536f4169b..2c2bd5bd1 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java @@ -25,10 +25,17 @@ */ package org.springdoc.webflux.core.providers; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; + import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.providers.SpringWebProvider; -import org.springdoc.core.utils.Constants; + import org.springframework.util.CollectionUtils; import org.springframework.web.method.HandlerMethod; import org.springframework.web.reactive.result.condition.PatternsRequestCondition; @@ -37,13 +44,6 @@ import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; import org.springframework.web.util.pattern.PathPattern; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.stream.Collectors; - /** * The type Spring webflux provider. @@ -66,8 +66,8 @@ public String findPathPrefix(SpringDocConfigProperties springDocConfigProperties Set patterns = getActivePatterns(requestMappingInfo); if (!CollectionUtils.isEmpty(patterns)) { for (String operationPath : patterns) { - if (operationPath.endsWith(Constants.DEFAULT_API_DOCS_URL)) - return operationPath.replace(Constants.DEFAULT_API_DOCS_URL, StringUtils.EMPTY); + if (operationPath.endsWith(springDocConfigProperties.getApiDocs().getPath())) + return operationPath.replace(springDocConfigProperties.getApiDocs().getPath(), StringUtils.EMPTY); } } } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java index 4d74abbf1..885beae47 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java @@ -128,7 +128,7 @@ SwaggerUiHome swaggerUiHome(Optional optionalWebFluxPropertie @ConditionalOnMissingBean @Lazy(false) SwaggerWebFluxConfigurer swaggerWebFluxConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, - SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, + SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { return new SwaggerWebFluxConfigurer(swaggerUiConfigProperties, springDocConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); } @@ -198,14 +198,13 @@ static class SwaggerActuatorWelcomeConfiguration { * @param swaggerUiConfig the swagger ui config * @param springDocConfigProperties the spring doc config properties * @param webEndpointProperties the web endpoint properties - * @param managementServerProperties the management server properties * @return the swagger welcome actuator */ @Bean @ConditionalOnMissingBean @Lazy(false) SwaggerWelcomeActuator swaggerActuatorWelcome(SwaggerUiConfigProperties swaggerUiConfig, SpringDocConfigProperties springDocConfigProperties, - WebEndpointProperties webEndpointProperties, ManagementServerProperties managementServerProperties) { + WebEndpointProperties webEndpointProperties) { return new SwaggerWelcomeActuator(swaggerUiConfig, springDocConfigProperties, webEndpointProperties); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java index 67779ca3a..6eae1425d 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWebFluxConfigurer.java @@ -26,16 +26,18 @@ package org.springdoc.webflux.ui; +import java.util.Optional; + import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.ActuatorProvider; + import org.springframework.web.reactive.config.ResourceHandlerRegistry; import org.springframework.web.reactive.config.WebFluxConfigurer; -import java.util.Optional; - import static org.springdoc.core.utils.Constants.ALL_PATTERN; import static org.springdoc.core.utils.Constants.CLASSPATH_RESOURCE_LOCATION; +import static org.springdoc.core.utils.Constants.DEFAULT_WEB_JARS_PREFIX_URL; import static org.springdoc.core.utils.Constants.SWAGGER_UI_PREFIX; import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; @@ -81,8 +83,8 @@ public class SwaggerWebFluxConfigurer implements WebFluxConfigurer { * @param swaggerResourceResolver the swagger resource resolver */ public SwaggerWebFluxConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, - SpringDocConfigProperties springDocConfigProperties, - SwaggerIndexTransformer swaggerIndexTransformer, + SpringDocConfigProperties springDocConfigProperties, + SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { this.swaggerIndexTransformer = swaggerIndexTransformer; this.actuatorProvider = actuatorProvider; @@ -100,8 +102,19 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) { if (actuatorProvider.isPresent() && actuatorProvider.get().isUseManagementPort()) uiRootPath.append(actuatorProvider.get().getBasePath()); - registry.addResourceHandler(uiRootPath + SWAGGER_UI_PREFIX + ALL_PATTERN) - .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + springDocConfigProperties.getWebjars().getPrefix() + DEFAULT_PATH_SEPARATOR) + String webjarsPrefix = springDocConfigProperties.getWebjars().getPrefix(); + String resourcePath,swaggerUiPrefix; + + if (DEFAULT_WEB_JARS_PREFIX_URL.equals(webjarsPrefix)) { + swaggerUiPrefix = SWAGGER_UI_PREFIX; + resourcePath = webjarsPrefix + SWAGGER_UI_PREFIX + DEFAULT_PATH_SEPARATOR + swaggerUiConfigProperties.getVersion(); + } else { + swaggerUiPrefix = webjarsPrefix; + resourcePath = DEFAULT_WEB_JARS_PREFIX_URL + DEFAULT_PATH_SEPARATOR; + } + + registry.addResourceHandler(uiRootPath + swaggerUiPrefix + ALL_PATTERN) + .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + resourcePath) .resourceChain(false) .addResolver(swaggerResourceResolver) .addTransformer(swaggerIndexTransformer); diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java index aeee37fea..b744b89e7 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java @@ -102,8 +102,8 @@ public Mono redirectToUi(ServerHttpRequest request, ServerHttpResponse res @GetMapping(value = SWAGGER_CONFIG_ACTUATOR_URL, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody @Override - public Map openapiJson(ServerHttpRequest request) { - return super.openapiJson(request); + public Map getSwaggerUiConfig(ServerHttpRequest request) { + return super.getSwaggerUiConfig(request); } @Override diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java index 0e815af3c..4bf3ae22e 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeCommon.java @@ -26,19 +26,22 @@ package org.springdoc.webflux.ui; +import java.net.URI; +import java.util.Map; + import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.ui.AbstractSwaggerWelcome; +import reactor.core.publisher.Mono; + import org.springframework.http.HttpStatus; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.web.util.UriComponentsBuilder; -import reactor.core.publisher.Mono; -import java.net.URI; -import java.util.Map; +import static org.springdoc.core.utils.Constants.DEFAULT_WEB_JARS_PREFIX_URL; /** * The type Swagger welcome common. @@ -68,35 +71,33 @@ protected SwaggerWelcomeCommon(SwaggerUiConfigProperties swaggerUiConfig, Spring protected Mono redirectToUi(ServerHttpRequest request, ServerHttpResponse response) { SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); buildFromCurrentContextPath(swaggerUiConfigParameters, request); - String sbUrl = swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getUiRootPath() + getSwaggerUiUrl(); + String webjarsPrefix = springDocConfigProperties.getWebjars().getPrefix(); + String additionalPrefix = DEFAULT_WEB_JARS_PREFIX_URL.equals(webjarsPrefix) ? "" : webjarsPrefix; + String sbUrl = swaggerUiConfigParameters.getContextPath() + + swaggerUiConfigParameters.getUiRootPath() + + additionalPrefix + + getSwaggerUiUrl(); UriComponentsBuilder uriBuilder = getUriComponentsBuilder(swaggerUiConfigParameters, sbUrl); - // forward all queryParams from original request request.getQueryParams().forEach(uriBuilder::queryParam); - response.setStatusCode(HttpStatus.FOUND); response.getHeaders().setLocation(URI.create(uriBuilder.build().encode().toString())); return response.setComplete(); } - /** - * Openapi json map. - * - * @param request the request - * @return the map - */ - protected Map openapiJson(ServerHttpRequest request) { - SwaggerUiConfigParameters swaggerUiConfigParameters = new SwaggerUiConfigParameters(swaggerUiConfig); - buildFromCurrentContextPath(swaggerUiConfigParameters, request); - return swaggerUiConfigParameters.getConfigParameters(); - } - @Override protected void calculateOauth2RedirectUrl(SwaggerUiConfigParameters swaggerUiConfigParameters, UriComponentsBuilder uriComponentsBuilder) { if (StringUtils.isBlank(swaggerUiConfig.getOauth2RedirectUrl()) || !swaggerUiConfigParameters.isValidUrl(swaggerUiConfig.getOauth2RedirectUrl())) { - swaggerUiConfigParameters.setOauth2RedirectUrl(uriComponentsBuilder - .path(swaggerUiConfigParameters.getUiRootPath()) - .path(getOauth2RedirectUrl()).build().toString()); + String webjarsPrefix = springDocConfigProperties.getWebjars().getPrefix(); + String additionalPath = DEFAULT_WEB_JARS_PREFIX_URL.equals(webjarsPrefix) ? "" : webjarsPrefix; + swaggerUiConfigParameters.setOauth2RedirectUrl( + uriComponentsBuilder + .path(swaggerUiConfigParameters.getUiRootPath()) + .path(additionalPath) + .path(getOauth2RedirectUrl()) + .build() + .toString() + ); } } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java index a5d62e29a..912999bb3 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java @@ -27,6 +27,7 @@ import org.springdoc.core.utils.Constants; import org.springdoc.webflux.core.configuration.SpringDocWebFluxConfiguration; import org.springdoc.webflux.ui.SwaggerConfig; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.test.context.ContextConfiguration; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java index 240ef7b1d..1a16f01e3 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app18/SpringDocApp18Test.java @@ -26,6 +26,9 @@ import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractCommonTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -33,8 +36,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.web.reactive.function.client.WebClient; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractCommonTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; @@ -44,7 +45,8 @@ properties = { "spring.webflux.base-path=/test", "server.port=9218", "springdoc.swagger-ui.path=/documentation/swagger-ui.html", - "springdoc.api-docs.path=/documentation/v3/api-docs"}) + "springdoc.api-docs.path=/documentation/v3/api-docs", + "springdoc.webjars.prefix= /webjars-pref" }) class SpringDocApp18Test extends AbstractCommonTest { @LocalServerPort @@ -64,7 +66,7 @@ void testIndex() throws Exception { .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); - httpStatusMono = webClient.get().uri("/test/documentation/swagger-ui/index.html") + httpStatusMono = webClient.get().uri("/test/documentation/webjars-pref/swagger-ui/index.html") .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.OK); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java index f59021214..c93d0744d 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectWithPrefixTest.java @@ -20,14 +20,16 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.path=/documentation/swagger-ui.html", - "springdoc.api-docs.path=/documentation/v3/api-docs" + "springdoc.api-docs.path=/documentation/v3/api-docs", + "springdoc.webjars.prefix= /webjars-pref" }) public class SpringDocApp3RedirectWithPrefixTest extends AbstractSpringDocTest { @@ -36,8 +38,8 @@ void shouldRedirectWithPrefix() { WebTestClient.ResponseSpec responseSpec = webTestClient.get().uri("/documentation/swagger-ui.html").exchange() .expectStatus().isFound(); responseSpec.expectHeader() - .value("Location", Matchers.is("/documentation/swagger-ui/index.html")); - webTestClient.get().uri("/documentation/swagger-ui/index.html").exchange() + .value("Location", Matchers.is("/documentation/webjars-pref/swagger-ui/index.html")); + webTestClient.get().uri("/documentation/webjars-pref/swagger-ui/index.html").exchange() .expectStatus().isOk(); webTestClient.get().uri("/documentation/v3/api-docs/swagger-config").exchange() .expectStatus().isOk().expectBody().jsonPath("$.validatorUrl").isEqualTo(""); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java index bc3daf005..5023cae02 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java @@ -40,7 +40,8 @@ "server.forward-headers-strategy=framework", "server.port=9318", "springdoc.swagger-ui.path=/documentation/swagger-ui.html", - "springdoc.api-docs.path=/documentation/v3/api-docs"}) + "springdoc.api-docs.path=/documentation/v3/api-docs", + "springdoc.webjars.prefix= /webjars-pref" }) @Import(SpringDocConfig.class) public class SpringDocBehindProxyBasePathTest extends AbstractCommonTest { @@ -66,7 +67,7 @@ void testIndex() throws Exception { .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND); - httpStatusMono = webClient.get().uri(WEBFLUX_BASE_PATH + "/documentation/swagger-ui/index.html") + httpStatusMono = webClient.get().uri(WEBFLUX_BASE_PATH+"/documentation/webjars-pref/swagger-ui/index.html") .header("X-Forwarded-Prefix", X_FORWARD_PREFIX) .exchangeToMono(clientResponse -> Mono.just(clientResponse.statusCode())).block(); assertThat(httpStatusMono).isEqualTo(HttpStatus.OK); diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app18-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app18-1.json index 305529a92..e9cf64c6e 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app18-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app18-1.json @@ -1,6 +1,6 @@ { "configUrl": "/test/documentation/v3/api-docs/swagger-config", - "oauth2RedirectUrl": "http://localhost:9218/test/documentation/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9218/test/documentation/webjars-pref/swagger-ui/oauth2-redirect.html", "urls": [ { "url": "/test/documentation/v3/api-docs/users", diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json index f811db83f..c6f06f1f6 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app32-1.json @@ -1,6 +1,6 @@ { "configUrl": "/path/prefix/documentation/v3/api-docs/swagger-config", - "oauth2RedirectUrl": "http://localhost:9318/path/prefix/documentation/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9318/path/prefix/documentation/webjars-pref/swagger-ui/oauth2-redirect.html", "url": "/path/prefix/documentation/v3/api-docs", "validatorUrl": "" } diff --git a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json index eef083258..9d03a31f8 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json +++ b/springdoc-openapi-starter-webflux-ui/src/test/resources/results/app33.json @@ -1,6 +1,6 @@ { "configUrl": "/path/prefix/test/documentation/v3/api-docs/swagger-config", - "oauth2RedirectUrl": "http://localhost:9318/path/prefix/test/documentation/swagger-ui/oauth2-redirect.html", + "oauth2RedirectUrl": "http://localhost:9318/path/prefix/test/documentation/webjars-pref/swagger-ui/oauth2-redirect.html", "url": "/path/prefix/test/documentation/v3/api-docs", "validatorUrl": "" } diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java index 51f6bde2d..e64e17e4d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/core/providers/SpringWebMvcProvider.java @@ -25,10 +25,17 @@ */ package org.springdoc.webmvc.core.providers; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; + import org.apache.commons.lang3.StringUtils; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.providers.SpringWebProvider; -import org.springdoc.core.utils.Constants; + import org.springframework.util.CollectionUtils; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.handler.AbstractHandlerMethodMapping; @@ -37,13 +44,6 @@ import org.springframework.web.servlet.mvc.method.RequestMappingInfo; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.stream.Collectors; - /** * The type Spring web mvc provider. * @@ -65,8 +65,8 @@ public String findPathPrefix(SpringDocConfigProperties springDocConfigProperties Set patterns = getActivePatterns(requestMappingInfo); if (!CollectionUtils.isEmpty(patterns)) { for (String operationPath : patterns) { - if (operationPath.endsWith(Constants.DEFAULT_API_DOCS_URL)) - return operationPath.replace(Constants.DEFAULT_API_DOCS_URL, StringUtils.EMPTY); + if (operationPath.endsWith(springDocConfigProperties.getApiDocs().getPath())) + return operationPath.replace(springDocConfigProperties.getApiDocs().getPath(), StringUtils.EMPTY); } } } diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java index bdd48be0b..8d5eb953c 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java @@ -26,6 +26,8 @@ package org.springdoc.webmvc.ui; +import java.util.Optional; + import org.springdoc.core.configuration.SpringDocConfiguration; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigProperties; @@ -34,6 +36,7 @@ import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.providers.SpringWebProvider; import org.springdoc.webmvc.core.providers.SpringWebMvcProvider; + import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType; @@ -48,8 +51,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; -import java.util.Optional; - import static org.springdoc.core.utils.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; import static org.springdoc.core.utils.Constants.SPRINGDOC_USE_MANAGEMENT_PORT; import static org.springdoc.core.utils.Constants.SPRINGDOC_USE_ROOT_PATH; @@ -152,9 +153,8 @@ SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUi @ConditionalOnMissingBean @Lazy(false) SwaggerWebMvcConfigurer swaggerWebMvcConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, - SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, - Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { - return new SwaggerWebMvcConfigurer(swaggerUiConfigProperties, springDocConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); + SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { + return new SwaggerWebMvcConfigurer(swaggerUiConfigProperties, swaggerIndexTransformer, actuatorProvider, swaggerResourceResolver); } /** diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java index c83403a3d..1399e0857 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java @@ -26,9 +26,12 @@ package org.springdoc.webmvc.ui; -import org.springdoc.core.properties.SpringDocConfigProperties; +import java.util.List; +import java.util.Optional; + import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.ActuatorProvider; + import org.springframework.format.FormatterRegistry; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.lang.Nullable; @@ -48,11 +51,9 @@ import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import java.util.List; -import java.util.Optional; - -import static org.springdoc.core.utils.Constants.ALL_PATTERN; import static org.springdoc.core.utils.Constants.CLASSPATH_RESOURCE_LOCATION; +import static org.springdoc.core.utils.Constants.DEFAULT_WEB_JARS_PREFIX_URL; +import static org.springdoc.core.utils.Constants.SWAGGER_INITIALIZER_JS; import static org.springdoc.core.utils.Constants.SWAGGER_UI_PREFIX; import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; @@ -83,29 +84,21 @@ public class SwaggerWebMvcConfigurer implements WebMvcConfigurer { */ private final SwaggerResourceResolver swaggerResourceResolver; - /** - * The Spring doc config properties. - */ - private final SpringDocConfigProperties springDocConfigProperties; - /** * Instantiates a new Swagger web mvc configurer. * * @param swaggerUiConfigProperties the swagger ui calculated config - * @param springDocConfigProperties * @param swaggerIndexTransformer the swagger index transformer * @param actuatorProvider the actuator provider * @param swaggerResourceResolver the swagger resource resolver */ public SwaggerWebMvcConfigurer(SwaggerUiConfigProperties swaggerUiConfigProperties, - SpringDocConfigProperties springDocConfigProperties, SwaggerIndexTransformer swaggerIndexTransformer, Optional actuatorProvider, SwaggerResourceResolver swaggerResourceResolver) { this.swaggerIndexTransformer = swaggerIndexTransformer; this.actuatorProvider = actuatorProvider; this.swaggerResourceResolver = swaggerResourceResolver; this.swaggerUiConfigProperties = swaggerUiConfigProperties; - this.springDocConfigProperties = springDocConfigProperties; } @Override @@ -117,12 +110,18 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) { if (actuatorProvider.isPresent() && actuatorProvider.get().isUseManagementPort()) uiRootPath.append(actuatorProvider.get().getBasePath()); - registry.addResourceHandler(uiRootPath + SWAGGER_UI_PREFIX + ALL_PATTERN) - .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + springDocConfigProperties.getWebjars().getPrefix() + DEFAULT_PATH_SEPARATOR) + registry.addResourceHandler(uiRootPath + SWAGGER_UI_PREFIX + "*/*" + SWAGGER_INITIALIZER_JS) + .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + DEFAULT_WEB_JARS_PREFIX_URL + DEFAULT_PATH_SEPARATOR) .setCachePeriod(0) .resourceChain(false) .addResolver(swaggerResourceResolver) .addTransformer(swaggerIndexTransformer); + + registry.addResourceHandler(uiRootPath + SWAGGER_UI_PREFIX + "*/**") + .addResourceLocations(CLASSPATH_RESOURCE_LOCATION + DEFAULT_WEB_JARS_PREFIX_URL + DEFAULT_PATH_SEPARATOR) + .resourceChain(false) + .addResolver(swaggerResourceResolver) + .addTransformer(swaggerIndexTransformer); } @Override diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java index de248dea0..00f485938 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java +++ b/springdoc-openapi-starter-webmvc-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWelcomeWebMvc.java @@ -33,6 +33,7 @@ import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.SpringWebProvider; import org.springdoc.core.utils.SpringDocUtils; + import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; @@ -106,11 +107,7 @@ protected void buildApiDocUrl(SwaggerUiConfigParameters swaggerUiConfigParameter protected String buildUrlWithContextPath(SwaggerUiConfigParameters swaggerUiConfigParameters, String swaggerUiUrl) { if (swaggerUiConfigParameters.getPathPrefix() == null) swaggerUiConfigParameters.setPathPrefix(springWebProvider.findPathPrefix(springDocConfigProperties)); - if (swaggerUiUrl.startsWith(swaggerUiConfigParameters.getPathPrefix())) { - return buildUrl(swaggerUiConfigParameters.getContextPath(), swaggerUiUrl); - } else { - return buildUrl(swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getPathPrefix(), swaggerUiUrl); - } + return buildUrl(swaggerUiConfigParameters.getContextPath() + swaggerUiConfigParameters.getPathPrefix(), swaggerUiUrl); } @Override From ee1bfa2e1a9427ac057b47268d948c7632b1030c Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 24 Jan 2025 22:26:05 +0100 Subject: [PATCH 173/226] upgrade spring-cloud-function to 4.2.1 upgrade spring-boot to 3.4.2 --- pom.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 097b61f46..4edfe5efd 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.1 + 3.4.2 @@ -65,11 +65,8 @@ 1.13.1 0.9.1 0.15.0 - 4.2.0 + 4.2.1 1.4.0 - 2.1.0 - 1.9 - 1.9 From 9043140e2bf5beb3eb9aa1783f8c27c4be04d7de Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 24 Jan 2025 22:58:01 +0100 Subject: [PATCH 174/226] Exception logged when generating schema for delete method of Spring Data repository. Fixes #2869 --- .../core/utils/SpringDocAnnotationsUtils.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java index d9b151cb5..0fe880c91 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.utils; @@ -128,6 +128,7 @@ public static Schema resolveSchemaFromType(Class schemaImplementation, Compon * @return the schema */ public static Schema extractSchema(Components components, Type returnType, JsonView jsonView, Annotation[] annotations, SpecVersion specVersion) { + if (returnType == null) return null; Schema schemaN = null; ResolvedSchema resolvedSchema; boolean openapi31 = SpecVersion.V31 == specVersion; @@ -161,9 +162,9 @@ public static Schema extractSchema(Components components, Type returnType, JsonV else if (componentSchemas.containsKey(entry.getKey()) && schemaMap.containsKey(entry.getKey())) { // Check to merge polymorphic types Set existingAllOf = new LinkedHashSet<>(); - if(existingSchema.getAllOf() != null) + if (existingSchema.getAllOf() != null) existingAllOf.addAll(existingSchema.getAllOf()); - if (schemaMap.get(entry.getKey()).getAllOf() != null){ + if (schemaMap.get(entry.getKey()).getAllOf() != null) { existingAllOf.addAll(schemaMap.get(entry.getKey()).getAllOf()); existingSchema.setAllOf(new ArrayList<>(existingAllOf)); } @@ -179,9 +180,9 @@ else if (componentSchemas.containsKey(entry.getKey()) && schemaMap.containsKey(e schemaN = resolvedSchema.schema; } } - if(openapi31) + if (openapi31) handleSchemaTypes(schemaN); - + return schemaN; } From 12e7fdaf181c73594db14f4d6067430774cb83eb Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 24 Jan 2025 23:09:31 +0100 Subject: [PATCH 175/226] updates packages for #2871 --- .../test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt | 2 +- .../test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt | 2 +- .../kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt | 2 +- .../kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt | 2 +- .../kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt | 2 +- .../kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt | 2 +- .../kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt | 2 +- .../kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt | 2 +- .../kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt | 2 +- .../kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt index b753c3037..1901221d3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app10 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest class SpringDocApp10Test : AbstractKotlinSpringDocTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt index b9e740b8b..16c0dbc41 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app11 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest class SpringDocApp11Test : AbstractKotlinSpringDocTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt index 222137f6d..aedad830e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app2 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest class SpringDocApp2Test : AbstractKotlinSpringDocTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt index eb475f349..7ab94d826 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app3 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest class SpringDocApp3Test : AbstractKotlinSpringDocTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt index f56c9576e..c00a73e19 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app4 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest class SpringDocApp4Test : AbstractKotlinSpringDocTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt index 34fe86409..917ddba5c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app5 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest class SpringDocApp5Test : AbstractKotlinSpringDocTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt index 8c8a7c5aa..da84544bb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app6 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest class SpringDocApp6Test : AbstractKotlinSpringDocTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt index 8dc8915c9..40917aa41 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt @@ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan import org.springframework.context.support.GenericApplicationContext -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest class SpringDocApp7Test : AbstractKotlinSpringDocTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt index aef6d155d..57e83ac3a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt @@ -25,7 +25,7 @@ import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan import org.springframework.context.support.GenericApplicationContext import org.springframework.test.context.TestPropertySource -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest @TestPropertySource(properties = [Constants.SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED+"=false"]) class SpringDocApp8Test : AbstractKotlinSpringDocTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt index 207740f45..e4c9501c9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app9 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocTest class SpringDocApp9Test : AbstractKotlinSpringDocTest() { From 2cdc31f83aae8ab259e3226c9b04d23e571d0093 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 24 Jan 2025 23:26:10 +0100 Subject: [PATCH 176/226] updates packages for #2871 --- .../api/v31/AbstractKotlinSpringDocMVCTest.kt | 1 - .../api/v31/app10/SpringDocApp10Test.kt | 2 +- .../api/v31/app11/SpringDocApp11Test.kt | 2 +- .../api/v31/app12/SpringDocApp12Test.kt | 2 +- .../api/v31/app13/SpringDocApp13Test.kt | 2 +- .../api/v31/app14/SpringDocApp14Test.kt | 2 +- .../api/v31/app2/SpringDocApp2Test.kt | 2 +- .../api/v31/app3/SpringDocApp3Test.kt | 2 +- .../api/v31/app4/SpringDocApp4Test.kt | 2 +- .../api/v31/app5/SpringDocApp5Test.kt | 2 +- .../api/v31/app6/SpringDocApp6Test.kt | 2 +- .../api/v31/app7/SpringDocApp7Test.kt | 2 +- .../api/v31/app8/SpringDocApp8Test.kt | 2 +- .../api/v31/app9/SpringDocApp9Test.kt | 2 +- .../test/resources/results/3.1.0/app11.json | 58 +++++++++---------- .../test/resources/results/3.1.0/app14.json | 52 +++++++++-------- 16 files changed, 70 insertions(+), 67 deletions(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt index bf7f9e4f7..bf2c51b8c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt @@ -44,7 +44,6 @@ import java.nio.file.Paths @SpringBootTest @AutoConfigureMockMvc @ActiveProfiles("test") -@TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_0"]) abstract class AbstractKotlinSpringDocMVCTest { @Autowired diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt index 07eab19ac..30e49e29e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app10/SpringDocApp10Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app10 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp10Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt index 32c35f763..cdcfe0296 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app11/SpringDocApp11Test.kt @@ -21,7 +21,7 @@ package test.org.springdoc.api.v31.app11 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan import org.springframework.test.context.TestPropertySource -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest @TestPropertySource(properties = ["springdoc.trim-kotlin-indent=true"]) class SpringDocApp11Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt index a5c7ad736..059fee262 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app12 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp12Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/SpringDocApp13Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/SpringDocApp13Test.kt index eedc437f3..c071c8a3a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/SpringDocApp13Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app13/SpringDocApp13Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app13 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.test.context.TestPropertySource -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest @TestPropertySource(properties = ["springdoc.api-docs.version=openapi_3_1"]) class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/SpringDocApp14Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/SpringDocApp14Test.kt index 0a039c9b4..2c0a975a4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/SpringDocApp14Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app14/SpringDocApp14Test.kt @@ -19,7 +19,7 @@ package test.org.springdoc.api.v31.app14 import org.springframework.boot.autoconfigure.SpringBootApplication -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp14Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt index 2bce75616..a3ab6df6b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app2/SpringDocApp2Test.kt @@ -19,7 +19,7 @@ package test.org.springdoc.api.v31.app2 import org.springframework.boot.autoconfigure.SpringBootApplication -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp2Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt index d6d36c472..5f7f1ea8f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app3/SpringDocApp3Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app3 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp3Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt index 2759ab955..b40ca1cfe 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app4/SpringDocApp4Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app4 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp4Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt index 33358bcc5..3b59395ae 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app5/SpringDocApp5Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app5 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp5Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt index e09f33a0e..17d7b8574 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app6/SpringDocApp6Test.kt @@ -20,7 +20,7 @@ package test.org.springdoc.api.v31.app6 import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.ComponentScan -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp6Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt index 6841c4503..908d27eb6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app7/SpringDocApp7Test.kt @@ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan import org.springframework.context.support.GenericApplicationContext -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp7Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt index a8251dbc2..e1f7fd977 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app8/SpringDocApp8Test.kt @@ -25,7 +25,7 @@ import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan import org.springframework.context.support.GenericApplicationContext import org.springframework.test.context.TestPropertySource -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest @TestPropertySource(properties = [Constants.SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED+"=false"]) class SpringDocApp8Test : AbstractKotlinSpringDocMVCTest() { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt index bef0623e6..7c2a4b0fe 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app9/SpringDocApp9Test.kt @@ -1,7 +1,7 @@ package test.org.springdoc.api.v31.app9 import org.springframework.boot.autoconfigure.SpringBootApplication -import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest +import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest class SpringDocApp9Test: AbstractKotlinSpringDocMVCTest() { @SpringBootApplication diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app11.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app11.json index a15b4ed94..a1446d1d0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app11.json +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app11.json @@ -49,16 +49,16 @@ "example-controller-2" ], "operationId": "readFoo_1", - "parameters": [ - { - "name": "request", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/foo request" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/foo request" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", @@ -77,36 +77,33 @@ "components": { "schemas": { "FooResponse": { - "required": [ - "name" - ], "type": "object", "properties": { "name": { "type": "string" } - } + }, + "required": [ + "name" + ] }, "foo request": { - "required": [ - "age" - ], "type": "object", + "description": "\nfoo request class description\nwith kotlin indent\n", "properties": { "age": { "type": "integer", - "description": "\nfoo request field with kotlin indent\n", - "format": "int32" + "format": "int32", + "description": "\nfoo request field with kotlin indent\n" } }, - "description": "\nfoo request class description\nwith kotlin indent\n" + "required": [ + "age" + ] }, "foo response": { - "required": [ - "name", - "subFoo" - ], "type": "object", + "description": "\nfoo response class description\nwith kotlin indent\n", "properties": { "name": { "type": "string", @@ -116,21 +113,24 @@ "$ref": "#/components/schemas/sub foo response" } }, - "description": "\nfoo response class description\nwith kotlin indent\n" + "required": [ + "name", + "subFoo" + ] }, "sub foo response": { - "required": [ - "subName" - ], "type": "object", + "description": "\nsub foo response class description\nwith kotlin indent\n", "properties": { "subName": { "type": "string", "description": "\nsub foo response fields with kotlin indent\n" } }, - "description": "\nsub foo response class description\nwith kotlin indent\n" + "required": [ + "subName" + ] } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app14.json b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app14.json index 987ebdff3..f75ac4189 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app14.json +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.1.0/app14.json @@ -38,43 +38,47 @@ "components": { "schemas": { "KeyValue": { - "required": [ - "key", - "value" - ], "type": "object", "description": "Generic description", - "allOf": [ - { - "$ref": "#/components/schemas/KeyValue" + "properties": { + "key": { + "type": "string" }, - { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } + "value": { + "type": "string" } + }, + "required": [ + "key", + "value" ] }, "SomeDTO": { - "required": [ - "field_a", - "field_b" - ], "type": "object", "properties": { "field_a": { - "$ref": "#/components/schemas/KeyValue" + "$ref": "#/components/schemas/KeyValue", + "allOf": [ + { + "$ref": "#/components/schemas/KeyValue" + } + ], + "description": "Description A" }, "field_b": { - "$ref": "#/components/schemas/KeyValue" + "$ref": "#/components/schemas/KeyValue", + "allOf": [ + { + "$ref": "#/components/schemas/KeyValue" + } + ], + "description": "Description B" } - } + }, + "required": [ + "field_a", + "field_b" + ] } } } From c585c231cd7a57033c56476a6d498aa88cb5fe3d Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 25 Jan 2025 13:32:43 +0100 Subject: [PATCH 177/226] Springdoc 2.8.x + Spring Boot 3.4.1 breaks native image support #2870 --- .../configuration/hints/SpringDocHints.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java index ab3661b17..c50197b0d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java @@ -28,6 +28,7 @@ import java.util.Arrays; +import com.fasterxml.jackson.databind.BeanDescription; import io.swagger.v3.core.converter.ModelConverter; import io.swagger.v3.core.filter.SpecFilter; import io.swagger.v3.core.jackson.ApiResponsesSerializer; @@ -38,6 +39,7 @@ import io.swagger.v3.core.jackson.mixin.Discriminator31Mixin; import io.swagger.v3.core.jackson.mixin.ExampleMixin; import io.swagger.v3.core.jackson.mixin.ExtensionsMixin; +import io.swagger.v3.core.jackson.mixin.Info31Mixin; import io.swagger.v3.core.jackson.mixin.MediaTypeMixin; import io.swagger.v3.core.jackson.mixin.OpenAPI31Mixin; import io.swagger.v3.core.jackson.mixin.OpenAPIMixin; @@ -60,6 +62,7 @@ import io.swagger.v3.oas.models.media.EncodingProperty; import io.swagger.v3.oas.models.media.FileSchema; import io.swagger.v3.oas.models.media.IntegerSchema; +import io.swagger.v3.oas.models.media.JsonSchema; import io.swagger.v3.oas.models.media.MapSchema; import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.media.NumberSchema; @@ -129,10 +132,6 @@ public class SpringDocHints implements RuntimeHintsRegistrar { OpenAPIMixin.class, OperationMixin.class, SchemaMixin.class, - Schema31Mixin.class, - Components31Mixin.class, - OpenAPI31Mixin.class, - Discriminator31Mixin.class, Paths.class, XML.class, UUIDSchema.class, @@ -165,12 +164,22 @@ public class SpringDocHints implements RuntimeHintsRegistrar { DateSchemaMixin.class, ExampleMixin.class, MediaTypeMixin.class, + //oas 3.1 + Schema31Mixin.class, + Components31Mixin.class, + OpenAPI31Mixin.class, + Discriminator31Mixin.class, + Info31Mixin.class, + Schema31Mixin.TypeSerializer.class, + JsonSchema.class, //springdoc classes org.springdoc.core.annotations.ParameterObject.class, org.springdoc.core.converters.models.Pageable.class, org.springdoc.core.extractor.DelegatingMethodParameter.class, // spring - org.springframework.core.MethodParameter.class + org.springframework.core.MethodParameter.class, + // jackson + BeanDescription.class, }; @Override From b3f7b19c94f88f006f4715107b14971afdd64595 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 25 Jan 2025 16:42:20 +0100 Subject: [PATCH 178/226] fixes #2862. --- .../SpringDocUIConfiguration.java | 97 ------------------- .../configuration/hints/SpringDocHints.java | 4 +- .../properties/SwaggerUiConfigProperties.java | 37 ++++++- .../org/springdoc/core/utils/Constants.java | 5 + .../springdoc/webflux/ui/SwaggerConfig.java | 6 +- .../webflux/ui/SwaggerWelcomeActuator.java | 7 +- .../webflux/ui/SwaggerWelcomeWebFlux.java | 3 +- ...ot.autoconfigure.AutoConfiguration.imports | 3 +- .../springdoc/ui/AbstractSpringDocTest.java | 3 +- .../app1/SpringDocApp1RedirecFilterTest.java | 3 +- .../SpringDocApp1RedirectConfigUrlTest.java | 3 +- .../SpringDocApp1RedirectDefaultTest.java | 3 +- .../app1/SpringDocApp1RedirectLayoutTest.java | 3 +- .../SpringDocApp1RedirectWithConfigTest.java | 3 +- .../ui/app13/SpringDocApp13Test.java | 5 +- .../ui/app14/SpringDocApp14Test.java | 5 +- .../ui/app15/SpringDocApp15Test.java | 5 +- .../ui/app16/SpringDocApp16Test.java | 5 +- .../ui/app17/SpringDocApp17Test.java | 3 +- .../ui/app19/SpringDocApp19Test.java | 5 +- .../ui/app20/SpringDocApp20Test.java | 5 +- .../ui/app24/SpringDocApp24Test.java | 3 +- .../SpringDocApp3RedirectDefaultTest.java | 3 +- .../springdoc/ui/app3/SpringDocApp3Test.java | 3 +- .../ui/app32/SpringDocBehindProxyTest.java | 9 +- ...ingDocBehindProxyWithCustomUIPathTest.java | 3 +- ...dProxyWithCustomUIPathWithApiDocsTest.java | 3 +- .../SpringDocBehindProxyBasePathTest.java | 5 +- .../ui/app4/SpringDocOauthPathsTest.java | 3 +- ...ingDocOauthRedirectUrlRecalculateTest.java | 3 +- .../app4/SpringDocOauthServletPathsTest.java | 3 +- .../springdoc/ui/app6/SpringDocApp6Test.java | 3 +- .../springdoc/ui/app7/SpringDocApp7Test.java | 3 +- ...ot.autoconfigure.AutoConfiguration.imports | 3 +- .../SpringDocAppRedirectWithPrefixTest.java | 3 +- .../ui/app21/SpringDocApp21Test.java | 3 +- .../api/v31/AbstractKotlinSpringDocMVCTest.kt | 1 - 37 files changed, 115 insertions(+), 152 deletions(-) delete mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java deleted file mode 100644 index e4b4babe2..000000000 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocUIConfiguration.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * - * * - * * * - * * * * - * * * * * - * * * * * * Copyright 2019-2025 the original author or authors. - * * * * * * - * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); - * * * * * * you may not use this file except in compliance with the License. - * * * * * * You may obtain a copy of the License at - * * * * * * - * * * * * * https://www.apache.org/licenses/LICENSE-2.0 - * * * * * * - * * * * * * Unless required by applicable law or agreed to in writing, software - * * * * * * distributed under the License is distributed on an "AS IS" BASIS, - * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * * * * * See the License for the specific language governing permissions and - * * * * * * limitations under the License. - * * * * * - * * * * - * * * - * * - * - */ - -package org.springdoc.core.configuration; - -import java.io.IOException; -import java.util.Optional; -import java.util.Properties; - -import org.apache.commons.lang3.StringUtils; -import org.springdoc.core.properties.SwaggerUiConfigProperties; - -import org.springframework.beans.factory.InitializingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Lazy; -import org.springframework.core.io.ClassPathResource; -import org.springframework.core.io.Resource; -import org.springframework.core.io.support.PropertiesLoaderUtils; -import org.springframework.util.AntPathMatcher; - -/** - * The type Spring doc Native Configuration. - * - * @author bnasslahsen - */ -@Lazy(false) -@ConditionalOnWebApplication -@Configuration(proxyBeanMethods = false) -@ConditionalOnBean(SpringDocConfiguration.class) -public class SpringDocUIConfiguration implements InitializingBean { - - /** - * The constant SPRINGDOC_CONFIG_PROPERTIES. - */ - public static final String SPRINGDOC_CONFIG_PROPERTIES = "springdoc.config.properties"; - - /** - * The constant SPRINGDOC_SWAGGERUI_VERSION. - */ - private static final String SPRINGDOC_SWAGGERUI_VERSION = "springdoc.swagger-ui.version"; - - /** - * The Swagger ui config properties. - */ - private final Optional optionalSwaggerUiConfigProperties; - - /** - * Instantiates a new Spring doc hints. - * - * @param optionalSwaggerUiConfigProperties the swagger ui config properties - */ - public SpringDocUIConfiguration(Optional optionalSwaggerUiConfigProperties) { - this.optionalSwaggerUiConfigProperties = optionalSwaggerUiConfigProperties; - } - - @Override - public void afterPropertiesSet() { - optionalSwaggerUiConfigProperties.ifPresent(swaggerUiConfigProperties -> { - if (StringUtils.isEmpty(swaggerUiConfigProperties.getVersion())) { - try { - Resource resource = new ClassPathResource(AntPathMatcher.DEFAULT_PATH_SEPARATOR + SPRINGDOC_CONFIG_PROPERTIES); - Properties props = PropertiesLoaderUtils.loadProperties(resource); - swaggerUiConfigProperties.setVersion(props.getProperty(SPRINGDOC_SWAGGERUI_VERSION)); - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - }); - } -} - diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java index c50197b0d..37e457135 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java @@ -78,8 +78,8 @@ import io.swagger.v3.oas.models.security.Scopes; import io.swagger.v3.oas.models.servers.ServerVariables; import org.apache.commons.lang3.reflect.FieldUtils; -import org.springdoc.core.configuration.SpringDocUIConfiguration; import org.springdoc.core.properties.SpringDocConfigProperties.ModelConverters; +import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springframework.aot.hint.MemberCategory; import org.springframework.aot.hint.RuntimeHints; @@ -206,7 +206,7 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) { //springdoc hints.reflection().registerField(FieldUtils.getDeclaredField(io.swagger.v3.core.converter.ModelConverters.class, "converters", true)); hints.reflection().registerType(org.springdoc.core.utils.Constants.class, hint -> hint.withMembers(MemberCategory.DECLARED_FIELDS)); - hints.resources().registerPattern(SpringDocUIConfiguration.SPRINGDOC_CONFIG_PROPERTIES) + hints.resources().registerPattern(SwaggerUiConfigProperties.SPRINGDOC_CONFIG_PROPERTIES) .registerResourceBundle("sun.util.resources.LocaleNames"); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java index 1be9ba363..b2e21e843 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java @@ -26,6 +26,8 @@ package org.springdoc.core.properties; +import java.io.IOException; +import java.util.Properties; import java.util.Set; import java.util.stream.Collectors; @@ -33,13 +35,19 @@ import org.springdoc.core.configuration.SpringDocConfiguration; import org.springdoc.core.utils.Constants; +import org.springframework.beans.factory.InitializingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PropertiesLoaderUtils; +import static org.springdoc.core.utils.Constants.SPRINGDOC_SWAGGER_PREFIX; import static org.springdoc.core.utils.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; +import static org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR; /** @@ -49,17 +57,16 @@ */ @Lazy(false) @Configuration(proxyBeanMethods = false) -@ConfigurationProperties(prefix = "springdoc.swagger-ui") +@ConfigurationProperties(prefix = SPRINGDOC_SWAGGER_PREFIX) @ConditionalOnProperty(name = SPRINGDOC_SWAGGER_UI_ENABLED, matchIfMissing = true) @ConditionalOnBean(SpringDocConfiguration.class) -public class SwaggerUiConfigProperties extends AbstractSwaggerUiConfigProperties { +public class SwaggerUiConfigProperties extends AbstractSwaggerUiConfigProperties implements InitializingBean { /** * The Disable swagger default url. */ private boolean disableSwaggerDefaultUrl; - /** * The Swagger ui version. */ @@ -85,6 +92,30 @@ public class SwaggerUiConfigProperties extends AbstractSwaggerUiConfigProperties */ private boolean useRootPath; + /** + * The constant SPRINGDOC_SWAGGERUI_VERSION. + */ + private static final String SPRINGDOC_SWAGGER_VERSION = SPRINGDOC_SWAGGER_PREFIX+".version"; + + /** + * The constant SPRINGDOC_CONFIG_PROPERTIES. + */ + public static final String SPRINGDOC_CONFIG_PROPERTIES = "springdoc.config.properties"; + + + @Override + public void afterPropertiesSet() { + if (StringUtils.isEmpty(version)) { + try { + Resource resource = new ClassPathResource(DEFAULT_PATH_SEPARATOR + SPRINGDOC_CONFIG_PROPERTIES); + Properties props = PropertiesLoaderUtils.loadProperties(resource); + setVersion(props.getProperty(SPRINGDOC_SWAGGER_VERSION)); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + } /** * Gets swagger ui version. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java index e8dbf962e..20f9124ab 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java @@ -42,6 +42,11 @@ public final class Constants { */ public static final String SPRINGDOC_PREFIX = "springdoc"; + /** + * The constant SPRINGDOC_SWAGGER_PREFIX. + */ + public static final String SPRINGDOC_SWAGGER_PREFIX =SPRINGDOC_PREFIX+".swagger-ui"; + /** * The constant DEFAULT_API_DOCS_URL. */ diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java index 885beae47..8b919af0e 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java @@ -26,6 +26,8 @@ package org.springdoc.webflux.ui; +import java.util.Optional; + import org.springdoc.core.configuration.SpringDocConfiguration; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigProperties; @@ -34,10 +36,10 @@ import org.springdoc.core.providers.ObjectMapperProvider; import org.springdoc.core.providers.SpringWebProvider; import org.springdoc.webflux.core.providers.SpringWebFluxProvider; + import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType; -import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties; import org.springframework.boot.actuate.endpoint.web.reactive.WebFluxEndpointHandlerMapping; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -51,8 +53,6 @@ import org.springframework.context.annotation.Lazy; import org.springframework.web.reactive.config.WebFluxConfigurer; -import java.util.Optional; - import static org.springdoc.core.utils.Constants.SPRINGDOC_SWAGGER_UI_ENABLED; import static org.springdoc.core.utils.Constants.SPRINGDOC_USE_MANAGEMENT_PORT; import static org.springdoc.core.utils.Constants.SPRINGDOC_USE_ROOT_PATH; diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java index b744b89e7..7ed11b5f1 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeActuator.java @@ -26,10 +26,14 @@ package org.springdoc.webflux.ui; +import java.util.Map; + import io.swagger.v3.oas.annotations.Operation; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; +import reactor.core.publisher.Mono; + import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpoint; import org.springframework.http.MediaType; @@ -37,9 +41,6 @@ import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; -import reactor.core.publisher.Mono; - -import java.util.Map; import static org.springdoc.core.utils.Constants.DEFAULT_API_DOCS_ACTUATOR_URL; import static org.springdoc.core.utils.Constants.DEFAULT_SWAGGER_UI_ACTUATOR_PATH; diff --git a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java index 8ee781d92..a4dcdb4e3 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java +++ b/springdoc-openapi-starter-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerWelcomeWebFlux.java @@ -31,11 +31,12 @@ import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; import org.springdoc.core.providers.SpringWebProvider; +import reactor.core.publisher.Mono; + import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; -import reactor.core.publisher.Mono; import static org.springdoc.core.utils.Constants.SWAGGER_CONFIG_FILE; import static org.springdoc.core.utils.Constants.SWAGGER_UI_PATH; diff --git a/springdoc-openapi-starter-webflux-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/springdoc-openapi-starter-webflux-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index f946e27b2..051cbd0ca 100644 --- a/springdoc-openapi-starter-webflux-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/springdoc-openapi-starter-webflux-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,4 +1,3 @@ org.springdoc.webflux.ui.SwaggerConfig org.springdoc.core.properties.SwaggerUiConfigProperties -org.springdoc.core.properties.SwaggerUiOAuthProperties -org.springdoc.core.configuration.SpringDocUIConfiguration \ No newline at end of file +org.springdoc.core.properties.SwaggerUiOAuthProperties \ No newline at end of file diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java index 912999bb3..a46a53f80 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocTest.java @@ -19,7 +19,6 @@ package test.org.springdoc.ui; import org.springdoc.core.configuration.SpringDocConfiguration; -import org.springdoc.core.configuration.SpringDocUIConfiguration; import org.springdoc.core.properties.SpringDocConfigProperties; import org.springdoc.core.properties.SwaggerUiConfigParameters; import org.springdoc.core.properties.SwaggerUiConfigProperties; @@ -41,7 +40,7 @@ @WebFluxTest @ContextConfiguration(classes = { SpringDocConfiguration.class, SpringDocConfigProperties.class, SpringDocWebFluxConfiguration.class, SwaggerUiConfigParameters.class, SwaggerUiConfigProperties.class, - SwaggerConfig.class, SwaggerUiOAuthProperties.class, SpringDocUIConfiguration.class }) + SwaggerConfig.class, SwaggerUiOAuthProperties.class }) public abstract class AbstractSpringDocTest extends AbstractCommonTest { private static final String DEFAULT_SWAGGER_INITIALIZER_URL = Constants.SWAGGER_INITIALIZER_URL; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java index 59c4a37e4..0a8974515 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirecFilterTest.java @@ -20,10 +20,11 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = "springdoc.swagger-ui.filter=false") diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java index 4ef6e58cf..7ef39597e 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectConfigUrlTest.java @@ -20,10 +20,11 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java index d1df612cd..9fa823945 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectDefaultTest.java @@ -20,9 +20,10 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.web.reactive.server.WebTestClient; -import test.org.springdoc.ui.AbstractSpringDocTest; public class SpringDocApp1RedirectDefaultTest extends AbstractSpringDocTest { diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java index 31ba1f13e..88ef7a407 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectLayoutTest.java @@ -20,10 +20,11 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = "springdoc.swagger-ui.layout=BaseLayout") diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java index 039d1e114..32f6f57a3 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocApp1RedirectWithConfigTest.java @@ -20,10 +20,11 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.validatorUrl=/foo/validate", diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java index c977787fd..1902acacb 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java @@ -25,13 +25,14 @@ package test.org.springdoc.ui.app13; import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.test.web.reactive.server.EntityExchangeResult; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java index 1752b16f4..7f5aaf45f 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java @@ -25,13 +25,14 @@ package test.org.springdoc.ui.app14; import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.test.web.reactive.server.EntityExchangeResult; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java index 743791d00..d944c945d 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java @@ -25,13 +25,14 @@ package test.org.springdoc.ui.app15; import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.test.web.reactive.server.EntityExchangeResult; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java index 7a81538d0..143b1ffd6 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java @@ -25,13 +25,14 @@ package test.org.springdoc.ui.app16; import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.test.web.reactive.server.EntityExchangeResult; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java index a3e0b520a..5c3a9f481 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app17/SpringDocApp17Test.java @@ -19,10 +19,11 @@ package test.org.springdoc.ui.app17; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocActuatorTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.web.reactive.server.EntityExchangeResult; -import test.org.springdoc.ui.AbstractSpringDocActuatorTest; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java index f1930b98c..0ef0b31e4 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app19/SpringDocApp19Test.java @@ -26,6 +26,9 @@ import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractCommonTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -33,8 +36,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.web.reactive.function.client.WebClient; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractCommonTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java index c3b692bb8..488fccad7 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app20/SpringDocApp20Test.java @@ -27,6 +27,9 @@ import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractCommonTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -34,8 +37,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.web.reactive.function.client.WebClient; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractCommonTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java index dcfb7aa98..dd2cd880a 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app24/SpringDocApp24Test.java @@ -19,10 +19,11 @@ package test.org.springdoc.ui.app24; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; import org.springframework.test.context.TestPropertySource; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.api-docs.enabled=false", diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java index f867d847e..bb9de5920 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3RedirectDefaultTest.java @@ -21,10 +21,11 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.WebTestClient; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java index 429a8e5f4..efc687688 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app3/SpringDocApp3Test.java @@ -19,9 +19,10 @@ package test.org.springdoc.ui.app3; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.path=/documentation/swagger-ui.html", diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java index 19e251bef..18f2b6cf8 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyTest.java @@ -18,14 +18,15 @@ package test.org.springdoc.ui.app32; +import java.util.concurrent.CompletableFuture; +import java.util.stream.IntStream; + import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; import org.springframework.test.context.TestPropertySource; -import test.org.springdoc.ui.AbstractSpringDocTest; - -import java.util.concurrent.CompletableFuture; -import java.util.stream.IntStream; import static org.assertj.core.api.Assertions.assertThat; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java index 0aab83865..f7003c711 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathTest.java @@ -19,10 +19,11 @@ package test.org.springdoc.ui.app32; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; import org.springframework.test.context.TestPropertySource; -import test.org.springdoc.ui.AbstractSpringDocTest; import static org.assertj.core.api.Assertions.assertThat; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java index 10163b7de..fa00a9860 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app32/SpringDocBehindProxyWithCustomUIPathWithApiDocsTest.java @@ -19,10 +19,11 @@ package test.org.springdoc.ui.app32; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; import org.springframework.test.context.TestPropertySource; -import test.org.springdoc.ui.AbstractSpringDocTest; import static org.assertj.core.api.Assertions.assertThat; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java index 5023cae02..32b2f2196 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app33/SpringDocBehindProxyBasePathTest.java @@ -20,6 +20,9 @@ import jakarta.annotation.PostConstruct; import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import test.org.springdoc.ui.AbstractCommonTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -28,8 +31,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.web.reactive.function.client.WebClient; -import reactor.core.publisher.Mono; -import test.org.springdoc.ui.AbstractCommonTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java index ec14f0ecf..6fe45330a 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthPathsTest.java @@ -19,9 +19,10 @@ package test.org.springdoc.ui.app4; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.SpringBootApplication; import test.org.springdoc.ui.AbstractSpringDocTest; +import org.springframework.boot.autoconfigure.SpringBootApplication; + public class SpringDocOauthPathsTest extends AbstractSpringDocTest { @Test diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java index 80137cf0b..8bcebbbf8 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthRedirectUrlRecalculateTest.java @@ -19,9 +19,10 @@ package test.org.springdoc.ui.app4; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "server.forward-headers-strategy=framework" }) public class SpringDocOauthRedirectUrlRecalculateTest extends AbstractSpringDocTest { diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java index c1fe1954f..1a22fc037 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app4/SpringDocOauthServletPathsTest.java @@ -19,9 +19,10 @@ package test.org.springdoc.ui.app4; import org.junit.jupiter.api.Test; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.path=/test/swagger.html" diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java index ef6e4fa62..83f667954 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app6/SpringDocApp6Test.java @@ -25,10 +25,11 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.EntityExchangeResult; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = { "springdoc.swagger-ui.oauth.clientId=myClientId", "springdoc.swagger-ui.disable-swagger-default-url=true" }) public class SpringDocApp6Test extends AbstractSpringDocTest { diff --git a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java index 2dab18e42..bb95daa59 100644 --- a/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java +++ b/springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app7/SpringDocApp7Test.java @@ -25,10 +25,11 @@ import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; import org.springframework.test.web.reactive.server.EntityExchangeResult; -import test.org.springdoc.ui.AbstractSpringDocTest; @TestPropertySource(properties = "springdoc.swagger-ui.disable-swagger-default-url=true") public class SpringDocApp7Test extends AbstractSpringDocTest { diff --git a/springdoc-openapi-starter-webmvc-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/springdoc-openapi-starter-webmvc-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 6ee14cfc1..d2185fec9 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/springdoc-openapi-starter-webmvc-ui/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,4 +1,3 @@ org.springdoc.webmvc.ui.SwaggerConfig org.springdoc.core.properties.SwaggerUiConfigProperties -org.springdoc.core.properties.SwaggerUiOAuthProperties -org.springdoc.core.configuration.SpringDocUIConfiguration \ No newline at end of file +org.springdoc.core.properties.SwaggerUiOAuthProperties \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java index 7ff2bf816..1d2164b02 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app1/SpringDocAppRedirectWithPrefixTest.java @@ -21,9 +21,10 @@ import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.Test; import org.springdoc.core.utils.Constants; +import test.org.springdoc.ui.AbstractSpringDocTest; + import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; -import test.org.springdoc.ui.AbstractSpringDocTest; import static org.hamcrest.CoreMatchers.equalTo; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; diff --git a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java index 492fe638f..acb8278d0 100644 --- a/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java +++ b/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app21/SpringDocApp21Test.java @@ -19,9 +19,10 @@ package test.org.springdoc.ui.app21; import org.junit.jupiter.api.Test; -import org.springframework.boot.autoconfigure.SpringBootApplication; import test.org.springdoc.ui.AbstractSpringDocTest; +import org.springframework.boot.autoconfigure.SpringBootApplication; + import static org.hamcrest.CoreMatchers.equalTo; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt index bf2c51b8c..3ef32aa6e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/AbstractKotlinSpringDocMVCTest.kt @@ -33,7 +33,6 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles -import org.springframework.test.context.TestPropertySource import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.request.MockMvcRequestBuilders import org.springframework.test.web.servlet.result.MockMvcResultMatchers From 29418330130059e0d8d647988482cacf6ece8691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Tarj=C3=A1nyi?= <17810336+martin-tarjanyi@users.noreply.github.com> Date: Sat, 25 Jan 2025 17:11:36 +0100 Subject: [PATCH 179/226] Provide option to set allowed locales #2836 --- .../api/AbstractOpenApiResource.java | 20 ++++- .../properties/SpringDocConfigProperties.java | 23 +++++ .../api/v30/app238/HelloLocaleController.java | 47 +++++++++++ .../api/v30/app238/SpringDocApp238Test.java | 83 ++++++++++++++++++ .../api/v31/app238/HelloLocaleController.java | 47 +++++++++++ .../api/v31/app238/SpringDocApp238Test.java | 84 +++++++++++++++++++ .../src/test/resources/messages_zh.properties | 1 + .../resources/results/3.0.1/app238-en-US.json | 65 ++++++++++++++ .../resources/results/3.0.1/app238-fr-CA.json | 65 ++++++++++++++ .../resources/results/3.0.1/app238-zh-CN.json | 65 ++++++++++++++ .../resources/results/3.1.0/app238-en-US.json | 65 ++++++++++++++ .../resources/results/3.1.0/app238-fr-CA.json | 65 ++++++++++++++ .../resources/results/3.1.0/app238-zh-CN.json | 65 ++++++++++++++ 13 files changed, 692 insertions(+), 3 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/HelloLocaleController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/SpringDocApp238Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app238/HelloLocaleController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app238/SpringDocApp238Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/messages_zh.properties create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-en-US.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-fr-CA.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-zh-CN.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-en-US.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-fr-CA.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-zh-CN.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index ea5046bba..91563d71d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -333,7 +333,7 @@ public static void setModelAndViewClass(Class modelAndViewClass) { * Gets open api. */ private void getOpenApi() { - this.getOpenApi(Locale.getDefault()); + this.getOpenApi(selectLocale(Locale.getDefault())); } /** @@ -346,7 +346,7 @@ protected OpenAPI getOpenApi(Locale locale) { this.reentrantLock.lock(); try { final OpenAPI openAPI; - final Locale finalLocale = locale == null ? Locale.getDefault() : locale; + final Locale finalLocale = selectLocale(locale); if (openAPIService.getCachedOpenAPI(finalLocale) == null || springDocConfigProperties.isCacheDisabled()) { Instant start = Instant.now(); openAPI = openAPIService.build(finalLocale); @@ -422,6 +422,20 @@ protected OpenAPI getOpenApi(Locale locale) { } } + private Locale selectLocale(Locale inputLocale) { + List allowedLocales = springDocConfigProperties.getAllowedLocales(); + if (!CollectionUtils.isEmpty(allowedLocales)) { + Locale bestMatchingAllowedLocale = Locale.lookup( + Locale.LanguageRange.parse(inputLocale.toLanguageTag()), + allowedLocales.stream().map(Locale::forLanguageTag).collect(Collectors.toList()) + ); + + return bestMatchingAllowedLocale == null ? Locale.forLanguageTag(allowedLocales.get(0)) : bestMatchingAllowedLocale; + } + + return inputLocale == null ? Locale.getDefault() : inputLocale; + } + /** * Indents are removed for properties that are mainly used as “explanations” using Open API. * @@ -1361,7 +1375,7 @@ else if (existingOperation != null) { * @param locale the locale */ protected void initOpenAPIBuilder(Locale locale) { - locale = locale == null ? Locale.getDefault() : locale; + locale = selectLocale(locale); if (openAPIService.getCachedOpenAPI(locale) != null && springDocConfigProperties.isCacheDisabled()) { openAPIService = openAPIBuilderObjectFactory.getObject(); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java index ba642ed81..25d76f1d2 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java @@ -184,6 +184,11 @@ public class SpringDocConfigProperties { */ private boolean useManagementPort; + /** + * Allowed locales for i18n. + */ + private List allowedLocales; + /** * The Disable i18n. */ @@ -985,6 +990,24 @@ public void setWriterWithDefaultPrettyPrinter(boolean writerWithDefaultPrettyPri this.writerWithDefaultPrettyPrinter = writerWithDefaultPrettyPrinter; } + /** + * List of allowed locales for i18n. + * + * @return the allowed locales + */ + public List getAllowedLocales() { + return allowedLocales; + } + + /** + * Sets allowed locales for i18n. + * + * @param allowedLocales the allowed locales + */ + public void setAllowedLocales(List allowedLocales) { + this.allowedLocales = allowedLocales; + } + /** * Is disable i 18 n boolean. * diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/HelloLocaleController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/HelloLocaleController.java new file mode 100644 index 000000000..879502b8e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/HelloLocaleController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app238; + +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.http.HttpEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Tag(name = "greeting", description = "test") +public class HelloLocaleController { + + @GetMapping("/persons") + public void persons(@Valid @NotBlank String name) { + } + + @GetMapping("/test") + public HttpEntity demo2() { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/SpringDocApp238Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/SpringDocApp238Test.java new file mode 100644 index 000000000..9c0f9d3de --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app238/SpringDocApp238Test.java @@ -0,0 +1,83 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app238; + +import java.util.Locale; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.OpenApiLocaleCustomizer; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.http.HttpHeaders; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = "springdoc.allowed-locales=en-US,fr-CA") +public class SpringDocApp238Test extends AbstractSpringDocV30Test { + + @Test + @Override + public void testApp() throws Exception { + testApp(Locale.US); + testApp(Locale.CANADA_FRENCH); + // resolves to en-US as Chinese locale is not allowed in properties + testApp(Locale.SIMPLIFIED_CHINESE); + } + + private void testApp(Locale locale) throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL).locale(locale).header(HttpHeaders.ACCEPT_LANGUAGE, locale.toLanguageTag())).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.0.1"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.0.1/app" + testNumber + "-" + locale.toLanguageTag() + ".json"); + assertEquals(expected, result, true); + } + + @SpringBootApplication + static class SpringDocTestApp { + + @Autowired + ResourceBundleMessageSource resourceBundleMessageSource; + + @Bean + public OpenApiLocaleCustomizer openApiLocaleCustomizer() { + return (openAPI, locale) + -> openAPI.getInfo().title(resourceBundleMessageSource.getMessage("test", null, locale)); + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app238/HelloLocaleController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app238/HelloLocaleController.java new file mode 100644 index 000000000..a2d0238c9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app238/HelloLocaleController.java @@ -0,0 +1,47 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app238; + +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; + +import org.springframework.http.HttpEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Tag(name = "greeting", description = "test") +public class HelloLocaleController { + + @GetMapping("/persons") + public void persons(@Valid @NotBlank String name) { + } + + @GetMapping("/test") + public HttpEntity demo2() { + return null; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app238/SpringDocApp238Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app238/SpringDocApp238Test.java new file mode 100644 index 000000000..ce4e03f1d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app238/SpringDocApp238Test.java @@ -0,0 +1,84 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app238; + +import java.util.Locale; + +import org.junit.jupiter.api.Test; +import org.springdoc.core.customizers.OpenApiLocaleCustomizer; +import org.springdoc.core.utils.Constants; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.http.HttpHeaders; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.web.servlet.MvcResult; + +import static org.hamcrest.Matchers.is; +import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@TestPropertySource(properties = "springdoc.allowed-locales=en-US,fr-CA") +public class SpringDocApp238Test extends AbstractSpringDocTest { + + @Test + @Override + public void testApp() throws Exception { + testApp(Locale.US); + testApp(Locale.CANADA_FRENCH); + // resolves to en-US as Chinese locale is not allowed in properties + testApp(Locale.SIMPLIFIED_CHINESE); + } + + private void testApp(Locale locale) throws Exception { + className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + MvcResult mockMvcResult = + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL).locale(locale).header(HttpHeaders.ACCEPT_LANGUAGE, locale.toLanguageTag())).andExpect(status().isOk()) + .andExpect(jsonPath("$.openapi", is("3.1.0"))).andReturn(); + String result = mockMvcResult.getResponse().getContentAsString(); + String expected = getContent("results/3.1.0/app" + testNumber + "-" + locale.toLanguageTag() + ".json"); + assertEquals(expected, result, true); + } + + @SpringBootApplication + static class SpringDocTestApp { + + @Autowired + ResourceBundleMessageSource resourceBundleMessageSource; + + @Bean + public OpenApiLocaleCustomizer openApiLocaleCustomizer() { + return (openAPI, locale) + -> openAPI.getInfo().title(resourceBundleMessageSource.getMessage("test", null, locale)); + } + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/messages_zh.properties b/springdoc-openapi-starter-webmvc-api/src/test/resources/messages_zh.properties new file mode 100644 index 000000000..7b055f37f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/messages_zh.properties @@ -0,0 +1 @@ +test=This is a test message[ZH] diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-en-US.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-en-US.json new file mode 100644 index 000000000..d65b8eca2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-en-US.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "This is a test message", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website!", + "description": "This is a test message" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-fr-CA.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-fr-CA.json new file mode 100644 index 000000000..d10b56632 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-fr-CA.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "This is a test message[FR]", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website![FR]", + "description": "This is a test message[FR]" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Hello! Welcome to our website![FR]" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website![FR]" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-zh-CN.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-zh-CN.json new file mode 100644 index 000000000..d65b8eca2 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-zh-CN.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "This is a test message", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website!", + "description": "This is a test message" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-en-US.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-en-US.json new file mode 100644 index 000000000..e32639950 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-en-US.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "This is a test message", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website!", + "description": "This is a test message" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-fr-CA.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-fr-CA.json new file mode 100644 index 000000000..37e48614e --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-fr-CA.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "This is a test message[FR]", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website![FR]", + "description": "This is a test message[FR]" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Hello! Welcome to our website![FR]" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website![FR]" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-zh-CN.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-zh-CN.json new file mode 100644 index 000000000..e32639950 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-zh-CN.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "This is a test message", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Hello! Welcome to our website!", + "description": "This is a test message" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "demo2", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/persons": { + "get": { + "tags": [ + "Hello! Welcome to our website!" + ], + "operationId": "persons", + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} From dfd58b4e94436b8dea4eda925e4e223964fcf57d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Tarj=C3=A1nyi?= <17810336+martin-tarjanyi@users.noreply.github.com> Date: Sat, 25 Jan 2025 17:21:27 +0100 Subject: [PATCH 180/226] Remove redundant selectLocale call --- .../main/java/org/springdoc/api/AbstractOpenApiResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 91563d71d..7c97a5e4c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -333,7 +333,7 @@ public static void setModelAndViewClass(Class modelAndViewClass) { * Gets open api. */ private void getOpenApi() { - this.getOpenApi(selectLocale(Locale.getDefault())); + this.getOpenApi(Locale.getDefault()); } /** From 6e6ccd77559f94f57350e05cce871a101aa1ff7b Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 25 Jan 2025 21:14:14 +0100 Subject: [PATCH 181/226] CHANGELOG.md update --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a099d201..41ba6e3c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.8.4] - 2025-01-25 + +### Added +- #2873 - Improve performance of getGenericMapResponse +- #2836 - Provide option to set allowed locales +- 2862 - Align Swagger-UI Prefix Path with Swagger-WebMvc Behavior + +### Changed +- Upgrade spring-boot to 3.4.2 +- Upgrade spring-cloud-function to 4.2.1 +- Upgrade swagger-core to 2.2.28 + +### Fixed +- #2870 - Springdoc 2.8.x + Spring Boot 3.4.1 breaks native image support +- #2869 - Exception logged when generating schema for delete method of Spring Data repository. +- #2856 - @JsonUnwrapped is ignored in new version of lib. +- #2852 - @Schema(types = "xxx") does not work for multipart param with enabled springdoc.default-support-form-data config option. + ## [2.8.3] - 2025-01-12 ### Added From 6b7c7eb2ba944a15c208dac2245ded593efed2aa Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 26 Jan 2025 17:57:59 +0000 Subject: [PATCH 182/226] [maven-release-plugin] prepare release v2.8.4 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 4edfe5efd..5f72a3e70 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.4-SNAPSHOT + 2.8.4 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.8.4 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 58ed856d9..b3bdef137 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4-SNAPSHOT + 2.8.4 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index fb8967a81..4f18fd6b7 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4-SNAPSHOT + 2.8.4 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 8bdb42cc6..ac8dd0c40 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4-SNAPSHOT + 2.8.4 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 9d1a65579..503d44926 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4-SNAPSHOT + 2.8.4 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 83c07aac4..f16b12bfa 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4-SNAPSHOT + 2.8.4 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 45bc2ea08..5ffc3b88e 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.4-SNAPSHOT + 2.8.4 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index d393a6d9e..2634306e0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4-SNAPSHOT + 2.8.4 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 0bd20ee75..8d35755c7 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4-SNAPSHOT + 2.8.4 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 0bb104c60..58dbf51bd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4-SNAPSHOT + 2.8.4 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index c3d441d6c..ae7b361d1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4-SNAPSHOT + 2.8.4 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index cbe3e9923..f956be798 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4-SNAPSHOT + 2.8.4 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index aa4e5f333..5597b2d91 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.4-SNAPSHOT + 2.8.4 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index a12191bed..5b6002f6c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4-SNAPSHOT + 2.8.4 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 4fb673014..a89128c99 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.4-SNAPSHOT + 2.8.4 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 9c7676dea..3b25490e3 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4-SNAPSHOT + 2.8.4 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 8239dc1e0..621449351 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4-SNAPSHOT + 2.8.4 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index d9426bf60..20a2f52a0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.4-SNAPSHOT + 2.8.4 springdoc-openapi-security-tests From 7af67d7b8529f8f6a14d32cc7052c811cd794d4f Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 26 Jan 2025 17:58:03 +0000 Subject: [PATCH 183/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 5f72a3e70..1858f60f0 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.4 + 2.8.5-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.8.4 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index b3bdef137..d1e0147af 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4 + 2.8.5-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 4f18fd6b7..597105442 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4 + 2.8.5-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index ac8dd0c40..30bec3793 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4 + 2.8.5-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 503d44926..9af76eee2 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4 + 2.8.5-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index f16b12bfa..ddc50f627 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.4 + 2.8.5-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 5ffc3b88e..0625c0801 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.4 + 2.8.5-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 2634306e0..a8c4d1846 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4 + 2.8.5-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 8d35755c7..cc666c836 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4 + 2.8.5-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 58dbf51bd..b44366a3d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4 + 2.8.5-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index ae7b361d1..b4f77c4af 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4 + 2.8.5-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index f956be798..ecd4ad9e1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4 + 2.8.5-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index 5597b2d91..49bbfe98d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.4 + 2.8.5-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 5b6002f6c..7dd6dfef0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4 + 2.8.5-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index a89128c99..40fe4a564 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.4 + 2.8.5-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 3b25490e3..96c136a14 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4 + 2.8.5-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 621449351..608b5f83f 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.4 + 2.8.5-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 20a2f52a0..bcde807d2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.4 + 2.8.5-SNAPSHOT springdoc-openapi-security-tests From 38b78d6ee7a110850127bff56e9fe1c81ee2c286 Mon Sep 17 00:00:00 2001 From: Petar Heyken Date: Fri, 31 Jan 2025 11:00:34 +0100 Subject: [PATCH 184/226] add test with expected result --- .../api/v31/app14/HelloController.java | 11 +++- .../test/resources/results/3.1.0/app14.json | 60 +++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java index 743ad62f6..282a794d0 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package test.org.springdoc.api.v31.app14; @@ -31,6 +31,8 @@ import org.springdoc.core.annotations.ParameterObject; import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.web.PageableDefault; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @@ -43,4 +45,11 @@ public ResponseEntity> getAllPets(@ParameterObject Pageable page return null; } + @GetMapping("/test1") + public String getPatientList1(@PageableDefault(size = 100, sort = { "someField", "someoTHER" }, + direction = Sort.Direction.DESC) + @ParameterObject Pageable pageable) { + return "bla"; + } + } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app14.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app14.json index a2e119230..471b990a2 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app14.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app14.json @@ -11,6 +11,66 @@ } ], "paths": { + "/test1": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "getPatientList1", + "parameters": [ + { + "name": "prefix_pages", + "in": "query", + "description": "One-based page index (1..N)", + "required": false, + "schema": { + "type": "integer", + "default": 1, + "minimum": 0 + } + }, + { + "name": "prefix_sizes", + "in": "query", + "description": "The size of the page to be returned", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "minimum": 1 + } + }, + { + "name": "sorts", + "in": "query", + "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required": false, + "schema": { + "type": "array", + "default": [ + "someField,DESC", + "someoTHER,DESC" + ], + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/search": { "get": { "tags": [ From 281c896f725542ab2b73d80a45d8e667e9245325 Mon Sep 17 00:00:00 2001 From: Petar Heyken Date: Fri, 31 Jan 2025 11:22:27 +0100 Subject: [PATCH 185/226] fix defaultValue when using @PageableDefault together with one-indexed-parameters --- .../DataRestDelegatingMethodParameterCustomizer.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java index 8a8ef92dc..1db18a182 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java @@ -64,6 +64,9 @@ /** * The type Data rest delegating method parameter customizer. + * + * @author bnasslahsen + * @author pheyken */ public class DataRestDelegatingMethodParameterCustomizer implements DelegatingMethodParameterCustomizer { @@ -1131,8 +1134,13 @@ else if (isSpringDataWebPropertiesPresent()) defaultValue = defaultSchemaVal; break; case "page": - if (pageableDefault != null) - defaultValue = String.valueOf(pageableDefault.page()); + if (pageableDefault != null) { + if (isSpringDataWebPropertiesPresent() && optionalSpringDataWebPropertiesProvider.get().getSpringDataWebProperties().getPageable().isOneIndexedParameters()) { + defaultValue = String.valueOf(pageableDefault.page() + 1); + } else { + defaultValue = String.valueOf(pageableDefault.page()); + } + } else if (isSpringDataWebPropertiesPresent() && optionalSpringDataWebPropertiesProvider.get().getSpringDataWebProperties().getPageable().isOneIndexedParameters()) defaultValue = "1"; else From 665d72356b6ed57c10e627e883d74c736127b8a9 Mon Sep 17 00:00:00 2001 From: ryan-dia Date: Thu, 6 Feb 2025 22:59:34 +0900 Subject: [PATCH 186/226] Refactor trimIndent method: streamline indentation removal and handle exceptions gracefully --- .../core/utils/PropertyResolverUtils.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java index 3178f1f6f..6eff3e174 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java @@ -32,7 +32,8 @@ import java.util.Map; import io.swagger.v3.oas.models.SpecVersion; -import org.apache.commons.lang3.StringUtils; +import java.util.stream.Collectors; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springdoc.core.properties.SpringDocConfigProperties; @@ -119,18 +120,17 @@ public String resolve(String parameterProperty, Locale locale) { * @return The string with leading indentation removed from each line. */ public String trimIndent(String text) { + if (text == null) { + return null; + } + final String newLine = "\n"; + String[] lines = text.split("\\r?\\n"); + int minIndent = resolveMinIndent(lines); try { - if (text == null) { - return null; - } - final String newLine = "\n"; - String[] lines = text.split(newLine); - int minIndent = resolveMinIndent(lines); return Arrays.stream(lines) - .map(line -> line.substring(Math.min(line.length(), minIndent))) - .reduce((a, b) -> a + newLine + b) - .orElse(StringUtils.EMPTY); - } catch (Exception ex){ + .map(line -> line.substring(Math.min(line.length(), minIndent))) + .collect(Collectors.joining(newLine)); + } catch (Exception ex) { LOGGER.warn(ex.getMessage()); return text; } @@ -239,4 +239,4 @@ public Map resolveExtensions(Locale locale, Map else return extensions; } -} \ No newline at end of file +} From f72a7fb2496454102bea366b9c1855764dc26790 Mon Sep 17 00:00:00 2001 From: ryan-dia Date: Thu, 6 Feb 2025 23:40:45 +0900 Subject: [PATCH 187/226] Improve documentation for trimIndent: add details on null input and return values --- .../org/springdoc/core/utils/PropertyResolverUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java index 6eff3e174..a98d7a5e3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java @@ -115,9 +115,11 @@ public String resolve(String parameterProperty, Locale locale) { * Returns a string where all leading indentation has been removed from each line. * It detects the smallest common indentation of all the lines in the input string, * and removes it. + * If the input text is {@code null}, the method returns {@code null}. * - * @param text The original string with possible leading indentation. - * @return The string with leading indentation removed from each line. + * @param text The original string with possible leading indentation. + * @return The string with the smallest common leading indentation removed from each line, + * or {@code null} if the input text is {@code null}. */ public String trimIndent(String text) { if (text == null) { From a9f338c2740cb32f9372d2e3f3ca6f97f6492549 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 6 Feb 2025 23:55:01 +0100 Subject: [PATCH 188/226] Sponsorship issue. Fixes #2892 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 180f3d560..117c32a85 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ This project is sponsored by + + +

# Table of Contents From 296beedff22a0dcfcfc6df08bed48f72a2d1121d Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 8 Feb 2025 13:41:40 +0100 Subject: [PATCH 189/226] Provide a better consistency for parameters and responses. Fixes #2888 --- .../QuerydslPredicateOperationCustomizer.java | 3 +- .../data/DataRestRouterOperationService.java | 5 ++- .../MethodParameterPojoExtractor.java | 3 +- .../properties/SwaggerUiConfigProperties.java | 3 +- .../core/service/GenericResponseService.java | 5 ++- .../core/service/OpenAPIService.java | 11 ++--- .../core/providers/SpringWebFluxProvider.java | 3 +- .../api/v30/app233/SpringDocApp233Test.java | 3 +- .../api/v31/app233/SpringDocApp233Test.java | 3 +- .../test/resources/results/3.0.1/app126.json | 12 +++--- .../test/resources/results/3.1.0/app126.json | 20 +++++----- .../test/resources/results/3.0.1/app24.json | 32 +++++++-------- .../test/resources/results/3.0.1/app30.json | 6 +-- .../test/resources/results/3.0.1/app5.json | 26 ++++++------ .../test/resources/results/3.1.0/app24.json | 40 +++++++++---------- .../test/resources/results/3.1.0/app30.json | 6 +-- .../test/resources/results/3.1.0/app5.json | 26 ++++++------ .../test/resources/results/3.0.1/app126.json | 22 +++++----- .../test/resources/results/3.1.0/app126.json | 34 ++++++++-------- 19 files changed, 136 insertions(+), 127 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java index dd6fc4e4d..7f86ea597 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/QuerydslPredicateOperationCustomizer.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Optional; @@ -112,7 +113,7 @@ public Operation customize(Operation operation, HandlerMethod handlerMethod) { QuerydslBindings bindings = extractQdslBindings(predicate); - Set fieldsToAdd = Arrays.stream(predicate.root().getDeclaredFields()).filter(field -> !Modifier.isStatic(field.getModifiers())).map(Field::getName).collect(Collectors.toSet()); + Set fieldsToAdd = Arrays.stream(predicate.root().getDeclaredFields()).filter(field -> !Modifier.isStatic(field.getModifiers())).map(Field::getName).collect(Collectors.toCollection(LinkedHashSet::new)); Map pathSpecMap = getPathSpec(bindings, "pathSpecs"); //remove blacklisted fields diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java index bd640ad95..41660655b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/data/DataRestRouterOperationService.java @@ -28,6 +28,7 @@ import java.util.Arrays; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -178,7 +179,7 @@ private void buildRouterOperationList(List routerOperationList, if (andCheck(resourceMetadata != null, !controllerType.equals(ControllerType.SEARCH))) { HttpMethods httpMethodsItem = resourceMetadata.getSupportedHttpMethods().getMethodsFor(ResourceType.ITEM); requestMethodsItem = requestMethods.stream().filter(requestMethod -> httpMethodsItem.contains(HttpMethod.valueOf(requestMethod.toString()))) - .collect(Collectors.toSet()); + .collect(Collectors.toCollection(LinkedHashSet::new)); buildRouterOperation(routerOperationList, resourceMetadata, dataRestRepository, openAPI, path, subPath, controllerType, methodResourceMapping, requestMappingInfo, handlerMethod, requestMethodsItem, ResourceType.ITEM); @@ -186,7 +187,7 @@ private void buildRouterOperationList(List routerOperationList, if (!ControllerType.PROPERTY.equals(controllerType)) { HttpMethods httpMethodsCollection = resourceMetadata.getSupportedHttpMethods().getMethodsFor(ResourceType.COLLECTION); requestMethodsCollection = requestMethods.stream().filter(requestMethod -> httpMethodsCollection.contains(HttpMethod.valueOf(requestMethod.toString()))) - .collect(Collectors.toSet()); + .collect(Collectors.toCollection(LinkedHashSet::new)); buildRouterOperation(routerOperationList, resourceMetadata, dataRestRepository, openAPI, path, subPath, controllerType, methodResourceMapping, requestMappingInfo, handlerMethod, requestMethodsCollection, ResourceType.COLLECTION); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index 1d51a5b4e..643c2d9fd 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -40,6 +40,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -361,7 +362,7 @@ private static boolean isNullable(Annotation[] fieldAnnotations) { Collection annotationSimpleNames = Arrays.stream(fieldAnnotations) .map(Annotation::annotationType) .map(Class::getSimpleName) - .collect(Collectors.toSet()); + .collect(Collectors.toCollection(LinkedHashSet::new)); return !hasNotNullAnnotation(annotationSimpleNames); } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java index b2e21e843..d4158bcc3 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SwaggerUiConfigProperties.java @@ -27,6 +27,7 @@ package org.springdoc.core.properties; import java.io.IOException; +import java.util.LinkedHashSet; import java.util.Properties; import java.util.Set; import java.util.stream.Collectors; @@ -239,7 +240,7 @@ public void setSyntaxHighlight(SyntaxHighlight syntaxHighlight) { * @return the set */ public Set cloneUrls() { - return this.urls.stream().map(swaggerUrl -> new SwaggerUrl(swaggerUrl.getName(), swaggerUrl.getUrl(), swaggerUrl.getDisplayName())).collect(Collectors.toSet()); + return this.urls.stream().map(swaggerUrl -> new SwaggerUrl(swaggerUrl.getName(), swaggerUrl.getUrl(), swaggerUrl.getDisplayName())).collect(Collectors.toCollection(LinkedHashSet::new)); } /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java index ea41fee6f..f26f4a90b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java @@ -36,6 +36,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -489,12 +490,12 @@ public Set getApiResponses( Set apiResponsesDoc = AnnotatedElementUtils .findAllMergedAnnotations(method, io.swagger.v3.oas.annotations.responses.ApiResponses.class); Set responses = apiResponsesDoc.stream() - .flatMap(x -> Stream.of(x.value())).collect(Collectors.toSet()); + .flatMap(x -> Stream.of(x.value())).collect(Collectors.toCollection(LinkedHashSet::new)); Set apiResponsesDocDeclaringClass = AnnotatedElementUtils .findAllMergedAnnotations(declaringClass, io.swagger.v3.oas.annotations.responses.ApiResponses.class); responses.addAll( - apiResponsesDocDeclaringClass.stream().flatMap(x -> Stream.of(x.value())).collect(Collectors.toSet())); + apiResponsesDocDeclaringClass.stream().flatMap(x -> Stream.of(x.value())).collect(Collectors.toCollection(LinkedHashSet::new))); Set apiResponseDoc = AnnotatedElementUtils .findMergedRepeatableAnnotations(method, io.swagger.v3.oas.annotations.responses.ApiResponse.class); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java index 596e61395..1d382c7db 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java @@ -33,6 +33,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -336,7 +337,7 @@ public Operation buildTags(HandlerMethod handlerMethod, Operation operation, Ope if (!CollectionUtils.isEmpty(tagsStr)) tagsStr = tagsStr.stream() .map(str -> propertyResolverUtils.resolve(str, locale)) - .collect(Collectors.toSet()); + .collect(Collectors.toCollection(LinkedHashSet::new)); if (springdocTags.containsKey(handlerMethod)) { io.swagger.v3.oas.models.tags.Tag tag = springdocTags.get(handlerMethod); @@ -407,10 +408,10 @@ private void buildTagsFromMethod(Method method, Set tagsSet = AnnotatedElementUtils .findAllMergedAnnotations(method, Tags.class); Set methodTags = tagsSet.stream() - .flatMap(x -> Stream.of(x.value())).collect(Collectors.toSet()); + .flatMap(x -> Stream.of(x.value())).collect(Collectors.toCollection(LinkedHashSet::new)); methodTags.addAll(AnnotatedElementUtils.findAllMergedAnnotations(method, Tag.class)); if (!CollectionUtils.isEmpty(methodTags)) { - tagsStr.addAll(methodTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toSet())); + tagsStr.addAll(methodTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toCollection(LinkedHashSet::new))); List allTags = new ArrayList<>(methodTags); addTags(allTags, tags, locale); } @@ -450,10 +451,10 @@ public void buildTagsFromClass(Class beanType, Set tagsSet = AnnotatedElementUtils .findAllMergedAnnotations(beanType, Tags.class); Set classTags = tagsSet.stream() - .flatMap(x -> Stream.of(x.value())).collect(Collectors.toSet()); + .flatMap(x -> Stream.of(x.value())).collect(Collectors.toCollection(LinkedHashSet::new)); classTags.addAll(AnnotatedElementUtils.findAllMergedAnnotations(beanType, Tag.class)); if (!CollectionUtils.isEmpty(classTags)) { - tagsStr.addAll(classTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toSet())); + tagsStr.addAll(classTags.stream().map(tag -> propertyResolverUtils.resolve(tag.name(), locale)).collect(Collectors.toCollection(LinkedHashSet::new))); allTags.addAll(classTags); addTags(allTags, tags, locale); } diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java index 2c2bd5bd1..2c5e92cd9 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/providers/SpringWebFluxProvider.java @@ -27,6 +27,7 @@ import java.util.Collection; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -84,7 +85,7 @@ public Set getActivePatterns(Object requestMapping) { RequestMappingInfo requestMappingInfo = (RequestMappingInfo) requestMapping; PatternsRequestCondition patternsRequestCondition = requestMappingInfo.getPatternsCondition(); return patternsRequestCondition.getPatterns().stream() - .map(PathPattern::getPatternString).collect(Collectors.toSet()); + .map(PathPattern::getPatternString).collect(Collectors.toCollection(LinkedHashSet::new)); } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java index 4480482d1..582cc60ca 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app233/SpringDocApp233Test.java @@ -27,6 +27,7 @@ package test.org.springdoc.api.v30.app233; import java.util.Collection; +import java.util.LinkedHashSet; import java.util.List; import java.util.Optional; import java.util.Set; @@ -167,7 +168,7 @@ private void verifySwaggerFieldRequirementsMatchJavaValidation(Collection field.getObjectName() + "." + field.getField()) - .collect(Collectors.toSet()); + .collect(Collectors.toCollection(LinkedHashSet::new)); assertThat(errorFields).containsExactlyElementsOf(expectedErrorFields); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java index 1636f52a4..21ca8c25e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app233/SpringDocApp233Test.java @@ -27,6 +27,7 @@ package test.org.springdoc.api.v31.app233; import java.util.Collection; +import java.util.LinkedHashSet; import java.util.List; import java.util.Optional; import java.util.Set; @@ -167,7 +168,7 @@ private void verifySwaggerFieldRequirementsMatchJavaValidation(Collection field.getObjectName() + "." + field.getField()) - .collect(Collectors.toSet()); + .collect(Collectors.toCollection(LinkedHashSet::new)); assertThat(errorFields).containsExactlyElementsOf(expectedErrorFields); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app126.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app126.json index 3bea48404..397f519eb 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app126.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app126.json @@ -20,12 +20,6 @@ "description": "Get all currencies", "operationId": "getAllCurrencies", "responses": { - "401": { - "$ref": "#/components/responses/http401NoToken" - }, - "403": { - "$ref": "#/components/responses/http403" - }, "200": { "description": "All currencies returned", "content": { @@ -38,6 +32,12 @@ } } } + }, + "401": { + "$ref": "#/components/responses/http401BadToken" + }, + "403": { + "$ref": "#/components/responses/http403" } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json index a20e02a5f..be22bf20b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app126.json @@ -20,12 +20,6 @@ "description": "Get all currencies", "operationId": "getAllCurrencies", "responses": { - "401": { - "$ref": "#/components/responses/http401NoToken" - }, - "403": { - "$ref": "#/components/responses/http403" - }, "200": { "description": "All currencies returned", "content": { @@ -38,6 +32,12 @@ } } } + }, + "401": { + "$ref": "#/components/responses/http401BadToken" + }, + "403": { + "$ref": "#/components/responses/http403" } } } @@ -62,15 +62,15 @@ "type": "object" } }, - "status": { - "type": "integer", - "format": "int32" - }, "title": { "type": "string" }, "detail": { "type": "string" + }, + "status": { + "type": "integer", + "format": "int32" } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app24.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app24.json index 33090dcc5..30ceb9d64 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app24.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app24.json @@ -27,14 +27,14 @@ } }, { - "name": "name", + "name": "email", "in": "query", "schema": { "type": "string" } }, { - "name": "email", + "name": "name", "in": "query", "schema": { "type": "string" @@ -90,6 +90,12 @@ "type": "integer", "format": "int64" }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, "size": { "type": "integer", "format": "int32" @@ -107,15 +113,9 @@ "sort": { "$ref": "#/components/schemas/SortObject" }, - "last": { - "type": "boolean" - }, "pageable": { "$ref": "#/components/schemas/PageableObject" }, - "first": { - "type": "boolean" - }, "numberOfElements": { "type": "integer", "format": "int32" @@ -135,6 +135,12 @@ "sort": { "$ref": "#/components/schemas/SortObject" }, + "unpaged": { + "type": "boolean" + }, + "paged": { + "type": "boolean" + }, "pageNumber": { "type": "integer", "format": "int32" @@ -142,12 +148,6 @@ "pageSize": { "type": "integer", "format": "int32" - }, - "paged": { - "type": "boolean" - }, - "unpaged": { - "type": "boolean" } } }, @@ -157,10 +157,10 @@ "empty": { "type": "boolean" }, - "sorted": { + "unsorted": { "type": "boolean" }, - "unsorted": { + "sorted": { "type": "boolean" } } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app30.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app30.json index 2cf234399..a1c4cc176 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app30.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app30.json @@ -19,14 +19,14 @@ "operationId": "testQueryDslAndSpringDoc", "parameters": [ { - "name": "name", + "name": "email", "in": "query", "schema": { "type": "string" } }, { - "name": "email", + "name": "name", "in": "query", "schema": { "type": "string" @@ -70,4 +70,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app5.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app5.json index 899554e82..932647c22 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app5.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app5.json @@ -34,10 +34,11 @@ } }, { - "name": "code", + "name": "id", "in": "query", "schema": { - "type": "string" + "type": "integer", + "format": "int64" } }, { @@ -48,36 +49,35 @@ } }, { - "name": "postCode", + "name": "shortName", "in": "query", "schema": { "type": "string" } }, { - "name": "id", + "name": "status", "in": "query", "schema": { - "type": "integer", - "format": "int64" + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] } }, { - "name": "shortName", + "name": "code", "in": "query", "schema": { "type": "string" } }, { - "name": "status", + "name": "postCode", "in": "query", "schema": { - "type": "string", - "enum": [ - "ACTIVE", - "INACTIVE" - ] + "type": "string" } } ], diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app24.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app24.json index 76b3a324f..1a901539e 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app24.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app24.json @@ -27,14 +27,14 @@ } }, { - "name": "name", + "name": "email", "in": "query", "schema": { "type": "string" } }, { - "name": "email", + "name": "name", "in": "query", "schema": { "type": "string" @@ -62,14 +62,14 @@ "type": "object", "properties": { "page": { - "minimum": 0, "type": "integer", - "format": "int32" + "format": "int32", + "minimum": 0 }, "size": { - "minimum": 1, "type": "integer", - "format": "int32" + "format": "int32", + "minimum": 1 }, "sort": { "type": "array", @@ -90,6 +90,12 @@ "type": "integer", "format": "int64" }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, "size": { "type": "integer", "format": "int32" @@ -107,15 +113,9 @@ "sort": { "$ref": "#/components/schemas/SortObject" }, - "last": { - "type": "boolean" - }, "pageable": { "$ref": "#/components/schemas/PageableObject" }, - "first": { - "type": "boolean" - }, "numberOfElements": { "type": "integer", "format": "int32" @@ -135,6 +135,12 @@ "sort": { "$ref": "#/components/schemas/SortObject" }, + "unpaged": { + "type": "boolean" + }, + "paged": { + "type": "boolean" + }, "pageNumber": { "type": "integer", "format": "int32" @@ -142,12 +148,6 @@ "pageSize": { "type": "integer", "format": "int32" - }, - "paged": { - "type": "boolean" - }, - "unpaged": { - "type": "boolean" } } }, @@ -157,10 +157,10 @@ "empty": { "type": "boolean" }, - "sorted": { + "unsorted": { "type": "boolean" }, - "unsorted": { + "sorted": { "type": "boolean" } } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app30.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app30.json index bbb90bbe9..62757da1a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app30.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app30.json @@ -19,14 +19,14 @@ "operationId": "testQueryDslAndSpringDoc", "parameters": [ { - "name": "name", + "name": "email", "in": "query", "schema": { "type": "string" } }, { - "name": "email", + "name": "name", "in": "query", "schema": { "type": "string" @@ -70,4 +70,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app5.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app5.json index e46116a9f..fe52268d8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app5.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app5.json @@ -34,10 +34,11 @@ } }, { - "name": "code", + "name": "id", "in": "query", "schema": { - "type": "string" + "type": "integer", + "format": "int64" } }, { @@ -48,36 +49,35 @@ } }, { - "name": "postCode", + "name": "shortName", "in": "query", "schema": { "type": "string" } }, { - "name": "id", + "name": "status", "in": "query", "schema": { - "type": "integer", - "format": "int64" + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] } }, { - "name": "shortName", + "name": "code", "in": "query", "schema": { "type": "string" } }, { - "name": "status", + "name": "postCode", "in": "query", "schema": { - "type": "string", - "enum": [ - "ACTIVE", - "INACTIVE" - ] + "type": "string" } } ], diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app126.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app126.json index 47ce6c5a7..ff6b88de5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app126.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app126.json @@ -26,12 +26,6 @@ "description": "Get all currencies", "operationId": "getAllCurrencies", "responses": { - "401": { - "$ref": "#/components/responses/http401NoToken" - }, - "403": { - "$ref": "#/components/responses/http403" - }, "200": { "description": "All currencies returned", "content": { @@ -44,6 +38,12 @@ } } } + }, + "401": { + "$ref": "#/components/responses/http401BadToken" + }, + "403": { + "$ref": "#/components/responses/http403" } } } @@ -71,6 +71,11 @@ }, "description": "Optional, additional attributes of the problem. Implementations can choose to ignore this in favor of concrete,\n typed fields." }, + "status": { + "type": "integer", + "description": "The HTTP status code generated by the origin server for this\n occurrence of the problem.", + "format": "int32" + }, "title": { "type": "string", "description": "A short, human-readable summary of the problem type. It SHOULD NOT\n change from occurrence to occurrence of the problem, except for\n purposes of localisation." @@ -78,11 +83,6 @@ "detail": { "type": "string", "description": "A human readable explanation specific to this occurrence of the problem." - }, - "status": { - "type": "integer", - "description": "The HTTP status code generated by the origin server for this\n occurrence of the problem.", - "format": "int32" } }, "description": "The interface Problem." diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app126.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app126.json index 074f383aa..57be66520 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app126.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app126.json @@ -26,12 +26,6 @@ "description": "Get all currencies", "operationId": "getAllCurrencies", "responses": { - "401": { - "$ref": "#/components/responses/http401NoToken" - }, - "403": { - "$ref": "#/components/responses/http403" - }, "200": { "description": "All currencies returned", "content": { @@ -44,6 +38,12 @@ } } } + }, + "401": { + "$ref": "#/components/responses/http401BadToken" + }, + "403": { + "$ref": "#/components/responses/http403" } } } @@ -53,16 +53,17 @@ "schemas": { "Problem": { "type": "object", + "description": "The interface Problem.", "properties": { "instance": { "type": "string", - "description": "An absolute URI that identifies the specific occurrence of the problem.\n It may or may not yield further information if dereferenced.", - "format": "uri" + "format": "uri", + "description": "An absolute URI that identifies the specific occurrence of the problem.\n It may or may not yield further information if dereferenced." }, "type": { "type": "string", - "description": "An absolute URI that identifies the problem type. When dereferenced,\n it SHOULD provide human-readable documentation for the problem type\n (e.g., using HTML). When this member is not present, its value is\n assumed to be \"about:blank\".", - "format": "uri" + "format": "uri", + "description": "An absolute URI that identifies the problem type. When dereferenced,\n it SHOULD provide human-readable documentation for the problem type\n (e.g., using HTML). When this member is not present, its value is\n assumed to be \"about:blank\"." }, "parameters": { "type": "object", @@ -71,6 +72,11 @@ }, "description": "Optional, additional attributes of the problem. Implementations can choose to ignore this in favor of concrete,\n typed fields." }, + "status": { + "type": "integer", + "format": "int32", + "description": "The HTTP status code generated by the origin server for this\n occurrence of the problem." + }, "title": { "type": "string", "description": "A short, human-readable summary of the problem type. It SHOULD NOT\n change from occurrence to occurrence of the problem, except for\n purposes of localisation." @@ -78,14 +84,8 @@ "detail": { "type": "string", "description": "A human readable explanation specific to this occurrence of the problem." - }, - "status": { - "type": "integer", - "description": "The HTTP status code generated by the origin server for this\n occurrence of the problem.", - "format": "int32" } - }, - "description": "The interface Problem." + } } }, "responses": { From 28c66e13da5ece50d2c154910ac3c36d7f3bcd3f Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 8 Feb 2025 13:42:46 +0100 Subject: [PATCH 190/226] upgrade swagger-ui to v5.18.3 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1858f60f0..0928cf38e 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.5.3 1.6.8 2.2.28 - 5.18.2 + 5.18.3 1.13.1 0.9.1 0.15.0 From 7060d3a11dff7dcfff4af3f74e62aa8f95c6fccf Mon Sep 17 00:00:00 2001 From: Illia Ovchynnikov Date: Sat, 8 Feb 2025 17:41:47 +0100 Subject: [PATCH 191/226] fix: respect @JsonUnwrapped & @Schema on props not fields only --- .../converters/PolymorphicModelConverter.java | 25 ++++++--- .../springdoc/api/v30/app239/RootModel.java | 27 ++++++++++ .../api/v30/app239/SpringDocApp239Test.java | 34 ++++++++++++ .../api/v30/app239/TestController.java | 15 ++++++ .../api/v30/app239/UnwrappedModel.java | 14 +++++ .../springdoc/api/v31/app224/RootModel.java | 2 +- .../springdoc/api/v31/app239/RootModel.java | 27 ++++++++++ .../api/v31/app239/SpringDocApp239Test.java | 34 ++++++++++++ .../api/v31/app239/TestController.java | 15 ++++++ .../api/v31/app239/UnwrappedModel.java | 14 +++++ .../test/resources/results/3.0.1/app239.json | 52 +++++++++++++++++++ .../test/resources/results/3.1.0/app239.json | 52 +++++++++++++++++++ 12 files changed, 304 insertions(+), 7 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/RootModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/UnwrappedModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/RootModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/SpringDocApp239Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/UnwrappedModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app239.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app239.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 8cdbd65a6..9a940d349 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -37,7 +37,9 @@ import java.util.Set; import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.databind.BeanDescription; import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition; import io.swagger.v3.core.converter.AnnotatedType; import io.swagger.v3.core.converter.ModelConverter; import io.swagger.v3.core.converter.ModelConverterContext; @@ -120,17 +122,28 @@ else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSi public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator chain) { JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); if (javaType != null) { - for (Field field : FieldUtils.getAllFields(javaType.getRawClass())) { - if (field.isAnnotationPresent(JsonUnwrapped.class)) { + BeanDescription javaTypeIntrospection = springDocObjectMapper.jsonMapper().getDeserializationConfig().introspect(javaType); + for (BeanPropertyDefinition property : javaTypeIntrospection.findProperties()) { + boolean isUnwrapped = (property.getField() != null && property.getField().hasAnnotation(JsonUnwrapped.class)) || + (property.getGetter() != null && property.getGetter().hasAnnotation(JsonUnwrapped.class)); + + if (isUnwrapped) { if (!TypeNameResolver.std.getUseFqn()) PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); else PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getName()); } - else if (field.isAnnotationPresent(io.swagger.v3.oas.annotations.media.Schema.class)) { - io.swagger.v3.oas.annotations.media.Schema declaredSchema = field.getDeclaredAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); - if (ArrayUtils.isNotEmpty(declaredSchema.oneOf()) || ArrayUtils.isNotEmpty(declaredSchema.allOf())) { - TYPES_TO_SKIP.add(field.getType().getSimpleName()); + else { + io.swagger.v3.oas.annotations.media.Schema declaredSchema = null; + if (property.getField() != null) { + declaredSchema = property.getField().getAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); + } else if (property.getGetter() != null) { + declaredSchema = property.getGetter().getAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); + } + + if (declaredSchema != null && + (ArrayUtils.isNotEmpty(declaredSchema.oneOf()) || ArrayUtils.isNotEmpty(declaredSchema.allOf()))) { + TYPES_TO_SKIP.add(property.getPrimaryType().getRawClass().getSimpleName()); } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/RootModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/RootModel.java new file mode 100644 index 000000000..cf2bd6039 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/RootModel.java @@ -0,0 +1,27 @@ +package test.org.springdoc.api.v30.app239; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; + +public class RootModel { + + private Integer rootProperty; + + private UnwrappedModel unwrappedModel; + + public Integer getRootProperty() { + return rootProperty; + } + + public void setRootProperty(Integer rootProperty) { + this.rootProperty = rootProperty; + } + + @JsonUnwrapped + public UnwrappedModel getUnwrappedModel() { + return unwrappedModel; + } + + public void setUnwrappedModel(UnwrappedModel unwrappedModel) { + this.unwrappedModel = unwrappedModel; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java new file mode 100644 index 000000000..122f279a5 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app239; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +public class SpringDocApp239Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/TestController.java new file mode 100644 index 000000000..a3f084691 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/TestController.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v30.app239; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class TestController { + + @GetMapping + public RootModel getRootModel() { + return new RootModel(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/UnwrappedModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/UnwrappedModel.java new file mode 100644 index 000000000..9ac5c2a48 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/UnwrappedModel.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v30.app239; + +public class UnwrappedModel { + + private Integer unwrappedProperty; + + public Integer getUnwrappedProperty() { + return unwrappedProperty; + } + + public void setUnwrappedProperty(Integer unwrappedProperty) { + this.unwrappedProperty = unwrappedProperty; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/RootModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/RootModel.java index 0df928bc6..8e4c9ce6a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/RootModel.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app224/RootModel.java @@ -6,7 +6,6 @@ public class RootModel { private Integer rootProperty; - @JsonUnwrapped private UnwrappedModel unwrappedModel; public Integer getRootProperty() { @@ -17,6 +16,7 @@ public void setRootProperty(Integer rootProperty) { this.rootProperty = rootProperty; } + @JsonUnwrapped public UnwrappedModel getUnwrappedModel() { return unwrappedModel; } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/RootModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/RootModel.java new file mode 100644 index 000000000..ea8b4261f --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/RootModel.java @@ -0,0 +1,27 @@ +package test.org.springdoc.api.v31.app239; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; + +public class RootModel { + + private Integer rootProperty; + + @JsonUnwrapped + private UnwrappedModel unwrappedModel; + + public Integer getRootProperty() { + return rootProperty; + } + + public void setRootProperty(Integer rootProperty) { + this.rootProperty = rootProperty; + } + + public UnwrappedModel getUnwrappedModel() { + return unwrappedModel; + } + + public void setUnwrappedModel(UnwrappedModel unwrappedModel) { + this.unwrappedModel = unwrappedModel; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/SpringDocApp239Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/SpringDocApp239Test.java new file mode 100644 index 000000000..efa593ebc --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/SpringDocApp239Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app239; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +public class SpringDocApp239Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/TestController.java new file mode 100644 index 000000000..623fbaefa --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/TestController.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v31.app239; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class TestController { + + @GetMapping + public RootModel getRootModel() { + return new RootModel(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/UnwrappedModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/UnwrappedModel.java new file mode 100644 index 000000000..ab4776f64 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/UnwrappedModel.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app239; + +public class UnwrappedModel { + + private Integer unwrappedProperty; + + public Integer getUnwrappedProperty() { + return unwrappedProperty; + } + + public void setUnwrappedProperty(Integer unwrappedProperty) { + this.unwrappedProperty = unwrappedProperty; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app239.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app239.json new file mode 100644 index 000000000..d83020e50 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app239.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api": { + "get": { + "tags": [ + "test-controller" + ], + "operationId": "getRootModel", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/RootModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "RootModel": { + "type": "object", + "properties": { + "rootProperty": { + "type": "integer", + "format": "int32" + }, + "unwrappedProperty": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app239.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app239.json new file mode 100644 index 000000000..0ef50ddff --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app239.json @@ -0,0 +1,52 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api": { + "get": { + "tags": [ + "test-controller" + ], + "operationId": "getRootModel", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/RootModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "RootModel": { + "type": "object", + "properties": { + "rootProperty": { + "type": "integer", + "format": "int32" + }, + "unwrappedProperty": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} From 7d4820eea14190e39f49e9dc3d1ba5413a17d273 Mon Sep 17 00:00:00 2001 From: Michael Clarke Date: Sat, 8 Feb 2025 20:31:07 +0000 Subject: [PATCH 192/226] Only filter out actuator endpoints with double asterisks. Fixes #2895 All endpoints that contain a double-asterisks in the path are currently being excluded from the output Swagger definition, rather than just excluding match-all actuator endpoints. The endpoint matching is therefore being altered to pre-filter the actuator endpoints to remove any that contain a double-asterisks in the path, and remove the subsequent filtering of double asterisks in the combined endpoints list so that non-actuator endpoints aren't dropped by the actuator filtering. --- .../api/AbstractOpenApiResource.java | 3 +- .../springdoc/webmvc/api/OpenApiResource.java | 5 +++ .../api/v31/app240/SpringDocApp240Test.java | 31 ++++++++++++++++ .../api/v31/app240/WildcardController.java | 34 +++++++++++++++++ .../test/resources/results/3.1.0/app240.json | 37 +++++++++++++++++++ 5 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/WildcardController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 7c97a5e4c..948a0e667 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -661,8 +661,7 @@ protected void calculatePath(HandlerMethod handlerMethod, RouterOperation router } PathItem pathItemObject = buildPathItem(requestMethod, operation, operationPath, paths); - if (!StringUtils.contains(operationPath, "**")) - paths.addPathItem(operationPath, pathItemObject); + paths.addPathItem(operationPath, pathItemObject); } } diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java index a1fcf1e16..c4557a5be 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java @@ -167,6 +167,11 @@ protected void getPaths(Map restControllers, Locale locale, Open Optional actuatorProviderOptional = springDocProviders.getActuatorProvider(); if (actuatorProviderOptional.isPresent() && springDocConfigProperties.isShowActuator()) { Map actuatorMap = actuatorProviderOptional.get().getMethods(); + List globMatchActuators = actuatorMap.keySet().stream() + .filter(requestMappingInfo -> requestMappingInfo.getPatternValues().stream() + .anyMatch(patternValues -> patternValues.contains("**"))) + .toList(); + globMatchActuators.forEach(actuatorMap::remove); this.openAPIService.addTag(new HashSet<>(actuatorMap.values()), getTag()); map.putAll(actuatorMap); } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java new file mode 100644 index 000000000..672be887b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java @@ -0,0 +1,31 @@ +/* + * + * * Copyright 2019-2025 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app240; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp240Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/WildcardController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/WildcardController.java new file mode 100644 index 000000000..98df2ccbb --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/WildcardController.java @@ -0,0 +1,34 @@ +/* + * + * * Copyright 2019-2025 the original author or authors. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * https://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package test.org.springdoc.api.v31.app240; + +import io.swagger.v3.oas.annotations.Operation; +import jakarta.servlet.http.HttpServletRequest; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class WildcardController { + @PostMapping("/**") + @Operation(summary = "My Wildcard Operation") + public String getItem(HttpServletRequest request) { + return request.getPathInfo(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json new file mode 100644 index 000000000..5a7391872 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/**": { + "post": { + "tags": [ + "wildcard-controller" + ], + "summary": "My Wildcard Operation", + "operationId": "getItem", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file From a9a2a2c2f01debb3851c489141ea33b11300eb3b Mon Sep 17 00:00:00 2001 From: lorenzbaier <64407215+lorenzbaier@users.noreply.github.com> Date: Tue, 11 Feb 2025 08:25:14 +0100 Subject: [PATCH 193/226] add needed runtime reflection hints for native image --- .../org/springdoc/core/configuration/hints/SpringDocHints.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java index 37e457135..dad4e1b11 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java @@ -113,6 +113,7 @@ public class SpringDocHints implements RuntimeHintsRegistrar { io.swagger.v3.oas.models.media.Schema.class, io.swagger.v3.oas.models.media.Content.class, io.swagger.v3.oas.models.media.ArraySchema.class, + io.swagger.v3.oas.models.media.JsonSchema.class, io.swagger.v3.oas.models.responses.ApiResponse.class, io.swagger.v3.oas.models.responses.ApiResponses.class, io.swagger.v3.oas.models.ExternalDocumentation.class, @@ -122,6 +123,7 @@ public class SpringDocHints implements RuntimeHintsRegistrar { io.swagger.v3.oas.models.Operation.class, io.swagger.v3.oas.models.headers.Header.class, ModelConverter.class, + io.swagger.v3.core.converter.ModelConverterContextImpl.class, ModelConverters.class, SpecFilter.class, MediaType.class, @@ -166,6 +168,7 @@ public class SpringDocHints implements RuntimeHintsRegistrar { MediaTypeMixin.class, //oas 3.1 Schema31Mixin.class, + Schema31Mixin.TypeSerializer.class, Components31Mixin.class, OpenAPI31Mixin.class, Discriminator31Mixin.class, From cce8e8b14ae3a7209334fa00619e905ba3111345 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 11 Feb 2025 21:57:40 +0100 Subject: [PATCH 194/226] img size update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 117c32a85..5b3618093 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ This project is sponsored by - +

From 0775180535a0b7f1fcd6b1f7c18100689ed1c1a0 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 15 Feb 2025 20:51:34 +0100 Subject: [PATCH 195/226] Restentpoints with same name get mix up. Fixes #2876 --- .../configuration/SpringDocConfiguration.java | 3 +- .../SpringDocHateoasConfiguration.java | 4 +- .../customizers/SpringDocCustomizers.java | 6 +- .../org/springdoc/core/utils/Constants.java | 7 +- .../SpringDocHateoasConfigurationTest.java | 16 +- .../api/v31/app240/DemoRestController.java | 48 ++++++ .../api/v31/app240/OpenApiConfig.java | 33 ++++ .../api/v31/app240/SpringDocApp240Test.java | 39 +++++ .../test/resources/results/3.1.0/app240.json | 151 ++++++++++++++++++ 9 files changed, 292 insertions(+), 15 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/DemoRestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/OpenApiConfig.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 4c39763c9..ca30d9355 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -126,6 +126,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.context.request.async.DeferredResult; +import static org.springdoc.core.utils.Constants.GLOBAL_OPEN_API_CUSTOMIZER; import static org.springdoc.core.utils.Constants.SPRINGDOC_DEPRECATING_CONVERTER_ENABLED; import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLED; import static org.springdoc.core.utils.Constants.SPRINGDOC_POLYMORPHIC_CONVERTER_ENABLED; @@ -654,7 +655,7 @@ ParameterObjectNamingStrategyCustomizer parameterObjectNamingStrategyCustomizer( * @return the global open api customizer */ @Bean - @ConditionalOnMissingBean + @ConditionalOnMissingBean(name = GLOBAL_OPEN_API_CUSTOMIZER) @Lazy(false) GlobalOpenApiCustomizer globalOpenApiCustomizer() { return new OperationIdCustomizer(); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java index 5c35852ba..17fb5c28a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocHateoasConfiguration.java @@ -101,8 +101,8 @@ CollectionModelContentConverter collectionModelContentConverter(HateoasHalProvid * @return the open api customizer * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider) */ - @Bean(Constants.LINKS_SCHEMA_CUSTOMISER) - @ConditionalOnMissingBean(name = Constants.LINKS_SCHEMA_CUSTOMISER) + @Bean(Constants.LINKS_SCHEMA_CUSTOMIZER) + @ConditionalOnMissingBean(name = Constants.LINKS_SCHEMA_CUSTOMIZER) @Lazy(false) GlobalOpenApiCustomizer linksSchemaCustomizer(HateoasHalProvider halProvider, SpringDocConfigProperties springDocConfigProperties) { if (!halProvider.isHalEnabled()) { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java index 577cf39ed..8acc651c7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/SpringDocCustomizers.java @@ -39,7 +39,7 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.util.CollectionUtils; -import static org.springdoc.core.utils.Constants.LINKS_SCHEMA_CUSTOMISER; +import static org.springdoc.core.utils.Constants.LINKS_SCHEMA_CUSTOMIZER; /** * The type Spring doc customizers. @@ -223,7 +223,7 @@ public Optional> getGlobalOpenApiMethodFilters() public void afterPropertiesSet() { //add the default customizers Map existingOpenApiCustomizers = context.getBeansOfType(OpenApiCustomizer.class); - if (!CollectionUtils.isEmpty(existingOpenApiCustomizers) && existingOpenApiCustomizers.containsKey(LINKS_SCHEMA_CUSTOMISER)) - this.openApiCustomizers.ifPresent(openApiCustomizersList -> openApiCustomizersList.add(existingOpenApiCustomizers.get(LINKS_SCHEMA_CUSTOMISER))); + if (!CollectionUtils.isEmpty(existingOpenApiCustomizers) && existingOpenApiCustomizers.containsKey(LINKS_SCHEMA_CUSTOMIZER)) + this.openApiCustomizers.ifPresent(openApiCustomizersList -> openApiCustomizersList.add(existingOpenApiCustomizers.get(LINKS_SCHEMA_CUSTOMIZER))); } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java index 20f9124ab..9453a832d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java @@ -407,7 +407,12 @@ public final class Constants { /** * The constant LINKS_SCHEMA_CUSTOMISER. */ - public static final String LINKS_SCHEMA_CUSTOMISER = "linksSchemaCustomizer"; + public static final String LINKS_SCHEMA_CUSTOMIZER = "linksSchemaCustomizer"; + + /** + * The constant GLOBAL_OPEN_API_CUSTOMIZER. + */ + public static final String GLOBAL_OPEN_API_CUSTOMIZER = "globalOpenApiCustomizer"; /** * The constant SPRINGDOC_SORT_CONVERTER_ENABLED. diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/configuration/SpringDocHateoasConfigurationTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/configuration/SpringDocHateoasConfigurationTest.java index 91e3029bb..35bd6c2f3 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/configuration/SpringDocHateoasConfigurationTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/core/configuration/SpringDocHateoasConfigurationTest.java @@ -12,7 +12,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -import static org.springdoc.core.utils.Constants.LINKS_SCHEMA_CUSTOMISER; +import static org.springdoc.core.utils.Constants.LINKS_SCHEMA_CUSTOMIZER; class SpringDocHateoasConfigurationTest { @@ -33,8 +33,8 @@ void linksSchemaCustomizerShouldBeRegistered() { .run(context -> { assertThat(context).getBeanNames(GlobalOpenApiCustomizer.class) .hasSize(2) - .contains(LINKS_SCHEMA_CUSTOMISER); - assertThat(context.getBean(LINKS_SCHEMA_CUSTOMISER)).isExactlyInstanceOf(OpenApiHateoasLinksCustomizer.class); + .contains(LINKS_SCHEMA_CUSTOMIZER); + assertThat(context.getBean(LINKS_SCHEMA_CUSTOMIZER)).isExactlyInstanceOf(OpenApiHateoasLinksCustomizer.class); }); } @@ -56,7 +56,7 @@ void linksSchemaCustomizerShouldBeRegisteredWithMultipleGlobalOpenApiCustomizer( .run(context -> { assertThat(context).getBeanNames(GlobalOpenApiCustomizer.class) .hasSize(2) - .containsExactlyInAnyOrder(LINKS_SCHEMA_CUSTOMISER, "globalOpenApiCustomizer"); + .containsExactlyInAnyOrder(LINKS_SCHEMA_CUSTOMIZER, "globalOpenApiCustomizer"); }); } @@ -74,12 +74,12 @@ void linksSchemaCustomizerShouldNotBeRegisteredIfBeanWithSameNameAlreadyExists() SpringDocConfigProperties.class, SpringDocHateoasConfiguration.class )) - .withBean(LINKS_SCHEMA_CUSTOMISER, GlobalOpenApiCustomizer.class, () -> mock(GlobalOpenApiCustomizer.class)) + .withBean(LINKS_SCHEMA_CUSTOMIZER, GlobalOpenApiCustomizer.class, () -> mock(GlobalOpenApiCustomizer.class)) .run(context -> { assertThat(context).getBeanNames(GlobalOpenApiCustomizer.class) - .hasSize(1) - .containsExactly(LINKS_SCHEMA_CUSTOMISER); - assertThat(context.getBean(LINKS_SCHEMA_CUSTOMISER)).isNotExactlyInstanceOf(OpenApiHateoasLinksCustomizer.class); + .hasSize(2) + .contains(LINKS_SCHEMA_CUSTOMIZER); + assertThat(context.getBean(LINKS_SCHEMA_CUSTOMIZER)).isNotExactlyInstanceOf(OpenApiHateoasLinksCustomizer.class); }); } } \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/DemoRestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/DemoRestController.java new file mode 100644 index 000000000..0a223c4e7 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/DemoRestController.java @@ -0,0 +1,48 @@ +package test.org.springdoc.api.v31.app240; + +import java.util.HashSet; +import java.util.Optional; +import java.util.Set; + +import io.swagger.v3.oas.annotations.Parameter; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/demo") +public class DemoRestController { + + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public Set getDemo( + @Parameter(required = false, description = "Very important description.") + @RequestParam(name = "darstellung", required = false) final Optional darstellung) { + return new HashSet<>(); + } + + @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity setDemo(@RequestBody final String str) { + return ResponseEntity.noContent().build(); + } + + @GetMapping(value = "/{vvpId}", produces = MediaType.APPLICATION_JSON_VALUE) + public String getDemo(@PathVariable("vvpId") final Long vvpId) { + return "Test"; + } + + @PatchMapping("/{vvpId}") + public ResponseEntity patchDemo(@PathVariable("vvpId") final Long idVerfahren, + @RequestBody() final String jsonPatch, + final Optional statusKinderAendern) { + return ResponseEntity.noContent().build(); + } + +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/OpenApiConfig.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/OpenApiConfig.java new file mode 100644 index 000000000..66bce186a --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/OpenApiConfig.java @@ -0,0 +1,33 @@ +package test.org.springdoc.api.v31.app240; + +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springdoc.core.customizers.ServerBaseUrlCustomizer; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpRequest; + +@Configuration +public class OpenApiConfig { + + @Bean + public OpenApiCustomizer openApiCustomiser() { + return openApi -> { + + }; + } + + @Bean + ServerBaseUrlCustomizer serverBaseUrlCustomizer() { + return new ServerBaseUrlCustomizer() { + + @Override + public String customize(final String serverBaseUrl, + final HttpRequest request) { + // TODO Auto-generated method stub + return null; + } + + }; + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java new file mode 100644 index 000000000..34b0c2a37 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app240; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true" ) +public class SpringDocApp240Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json new file mode 100644 index 000000000..0a9af7bf9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json @@ -0,0 +1,151 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "paths": { + "/demo": { + "get": { + "tags": [ + "demo-rest-controller" + ], + "operationId": "getDemo", + "parameters": [ + { + "name": "darstellung", + "in": "query", + "description": "Very important description.", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + } + } + } + } + }, + "post": { + "tags": [ + "demo-rest-controller" + ], + "operationId": "setDemo", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/demo/{vvpId}": { + "get": { + "tags": [ + "demo-rest-controller" + ], + "operationId": "getDemo_1", + "parameters": [ + { + "name": "vvpId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "patch": { + "tags": [ + "demo-rest-controller" + ], + "operationId": "patchDemo", + "parameters": [ + { + "name": "vvpId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "statusKinderAendern", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": {} +} From cdfaf63895773dd389027f8c5ad152abb326405f Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 15 Feb 2025 21:01:08 +0100 Subject: [PATCH 196/226] Restentpoints with same name get mix up. Fixes #2876 --- .../api/v31/app240/SpringDocApp240Test.java | 39 +++++++++++++++++ .../api/v31/app240/WildcardController.java | 42 +++++++++++++++++++ .../test/resources/results/3.1.0/app240.json | 37 ++++++++++++++++ .../test/resources/results/3.1.0/app241.json | 39 ----------------- 4 files changed, 118 insertions(+), 39 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/WildcardController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java new file mode 100644 index 000000000..39e9ac2c4 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app240; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp240Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/WildcardController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/WildcardController.java new file mode 100644 index 000000000..34c01dfb8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/WildcardController.java @@ -0,0 +1,42 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app240; + +import io.swagger.v3.oas.annotations.Operation; +import jakarta.servlet.http.HttpServletRequest; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class WildcardController { + @PostMapping("/**") + @Operation(summary = "My Wildcard Operation") + public String getItem(HttpServletRequest request) { + return request.getPathInfo(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json new file mode 100644 index 000000000..751bee35c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.json @@ -0,0 +1,37 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/**": { + "post": { + "tags": [ + "wildcard-controller" + ], + "summary": "My Wildcard Operation", + "operationId": "getItem", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app241.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app241.json index 0ccd3b537..0a9af7bf9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app241.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app241.json @@ -1,5 +1,4 @@ { -<<<<<<< HEAD "openapi": "3.1.0", "info": { "title": "OpenAPI definition", @@ -150,41 +149,3 @@ }, "components": {} } -======= - "openapi": "3.1.0", - "info": { - "title": "OpenAPI definition", - "version": "v0" - }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "paths": { - "/**": { - "post": { - "tags": [ - "wildcard-controller" - ], - "summary": "My Wildcard Operation", - "operationId": "getItem", - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - } - } - } - } - } - }, - "components": {} -} ->>>>>>> origin/main From a329910010b6186b894debdefed3c55bbd638377 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 16 Feb 2025 13:47:45 +0100 Subject: [PATCH 197/226] Schema replaced by String when using @ApiResponse with RepresentationModel (Hateoas links). Fixes #2902 --- .../converters/HateoasLinksConverter.java | 38 ++++-- .../api/v31/app11/SpringDocApp11Test.java | 39 ++++++ .../configuration/WebMvcConfiguration.java | 25 ++++ .../app11/controllers/BasicController.java | 41 ++++++ .../CustomOpenApiWebMvcResource.java | 27 ++++ .../springdoc/api/v31/app11/model/Cat.java | 24 ++++ .../test/resources/results/3.1.0/app11.json | 126 ++++++++++++++++++ 7 files changed, 307 insertions(+), 13 deletions(-) create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/configuration/WebMvcConfiguration.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/controllers/BasicController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/controllers/CustomOpenApiWebMvcResource.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/model/Cat.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app11.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java index 7fbfa420b..bcde9140c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/HateoasLinksConverter.java @@ -28,6 +28,7 @@ import java.util.Iterator; +import java.util.Optional; import com.fasterxml.jackson.databind.JavaType; import io.swagger.v3.core.converter.ModelConverter; @@ -43,7 +44,7 @@ /** * The type Hateoas links converter. - * + * * @author bnasslahsen */ public class HateoasLinksConverter implements ModelConverter { @@ -70,19 +71,30 @@ public Schema resolve( ) { JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); if (javaType != null && RepresentationModel.class.isAssignableFrom(javaType.getRawClass())) { - Schema schema = chain.next().resolve(type, context, chain); - String schemaName = schema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length()); - Schema original = context.getDefinedModels().get(schemaName); - Object links = original.getProperties().get("_links"); - if(links instanceof JsonSchema jsonSchema) { - jsonSchema.set$ref(AnnotationsUtils.COMPONENTS_REF + "Links"); - jsonSchema.setType(null); - jsonSchema.setItems(null); - jsonSchema.setTypes(null); - } else if (links instanceof ArraySchema arraySchema){ - arraySchema.set$ref(AnnotationsUtils.COMPONENTS_REF + "Links"); + Schema schema = chain.next().resolve(type, context, chain); + if (schema != null) { + String schemaName = Optional.ofNullable(schema.get$ref()) + .filter(ref -> ref.startsWith(Components.COMPONENTS_SCHEMAS_REF)) + .map(ref -> ref.substring(Components.COMPONENTS_SCHEMAS_REF.length())) + .orElse(schema.getName()); + if(schemaName != null) { + Schema original = context.getDefinedModels().get(schemaName); + if (original == null || original.getProperties() == null) { + return schema; + } + Object links = original.getProperties().get("_links"); + if (links instanceof JsonSchema jsonSchema) { + jsonSchema.set$ref(AnnotationsUtils.COMPONENTS_REF + "Links"); + jsonSchema.setType(null); + jsonSchema.setItems(null); + jsonSchema.setTypes(null); + } + else if (links instanceof ArraySchema arraySchema) { + arraySchema.set$ref(AnnotationsUtils.COMPONENTS_REF + "Links"); + } } - return schema; + } + return schema; } return chain.hasNext() ? chain.next().resolve(type, context, chain) : null; } diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java new file mode 100644 index 000000000..3e619a272 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/SpringDocApp11Test.java @@ -0,0 +1,39 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app11; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp11Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp { + } + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/configuration/WebMvcConfiguration.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/configuration/WebMvcConfiguration.java new file mode 100644 index 000000000..032eeeac7 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/configuration/WebMvcConfiguration.java @@ -0,0 +1,25 @@ +package test.org.springdoc.api.v31.app11.configuration; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; + +@Configuration +public class WebMvcConfiguration { + + @Bean + MappingJackson2HttpMessageConverter getMappingJacksonHttpMessageConverter() { + MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); + converter.setSupportedMediaTypes(List.of(MediaType.APPLICATION_JSON)); + converter.setObjectMapper(new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL) + ); + + return converter; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/controllers/BasicController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/controllers/BasicController.java new file mode 100644 index 000000000..7f6586f05 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/controllers/BasicController.java @@ -0,0 +1,41 @@ +package test.org.springdoc.api.v31.app11.controllers; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import test.org.springdoc.api.v31.app11.model.Cat; + +import org.springframework.hateoas.MediaTypes; +import org.springframework.hateoas.RepresentationModel; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(path = "/") +public class BasicController { + + @GetMapping("/cat") + @ResponseStatus(HttpStatus.OK) + @Operation(summary = "get", description = "Provides an animal.") + public String get(Cat cat) { + return cat != null ? cat.getName() : ""; + } + + @GetMapping("/test") + @ResponseStatus(HttpStatus.OK) + @Operation(summary = "get", description = "Provides a response.") + @ApiResponse(content = @Content(mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @io.swagger.v3.oas.annotations.media.Schema(implementation = Response.class)), + responseCode = "200") + public Response get() { + return new Response("value"); + } + + // dummy + public static class Response extends RepresentationModel { + public Response(String v) {} + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/controllers/CustomOpenApiWebMvcResource.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/controllers/CustomOpenApiWebMvcResource.java new file mode 100644 index 000000000..f88930430 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/controllers/CustomOpenApiWebMvcResource.java @@ -0,0 +1,27 @@ +package test.org.springdoc.api.v31.app11.controllers; + +import org.springdoc.core.customizers.SpringDocCustomizers; +import org.springdoc.core.properties.SpringDocConfigProperties; +import org.springdoc.core.providers.SpringDocProviders; +import org.springdoc.core.service.AbstractRequestService; +import org.springdoc.core.service.GenericResponseService; +import org.springdoc.core.service.OpenAPIService; +import org.springdoc.core.service.OperationService; +import org.springdoc.webmvc.api.OpenApiWebMvcResource; + +import org.springframework.beans.factory.ObjectFactory; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class CustomOpenApiWebMvcResource extends OpenApiWebMvcResource { + + public CustomOpenApiWebMvcResource(ObjectFactory openAPIBuilderObjectFactory, + AbstractRequestService requestBuilder, + GenericResponseService responseBuilder, + OperationService operationParser, + SpringDocConfigProperties springDocConfigProperties, + SpringDocProviders springDocProviders, + SpringDocCustomizers springDocCustomizers) { + super(openAPIBuilderObjectFactory, requestBuilder, responseBuilder, operationParser, springDocConfigProperties, springDocProviders, springDocCustomizers); + } +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/model/Cat.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/model/Cat.java new file mode 100644 index 000000000..95595b01a --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app11/model/Cat.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v31.app11.model; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "Represents a Cat class.") +public class Cat { + + @JsonUnwrapped + @Schema(description = "The name.", nullable = true) + private String name; + + public Cat(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app11.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app11.json new file mode 100644 index 000000000..a40b8cb0b --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app11.json @@ -0,0 +1,126 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/test": { + "get": { + "tags": [ + "basic-controller" + ], + "summary": "get", + "description": "Provides a response.", + "operationId": "get", + "responses": { + "200": { + "description": "OK", + "content": { + "application/hal+json": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + } + } + } + }, + "/cat": { + "get": { + "tags": [ + "basic-controller" + ], + "summary": "get", + "description": "Provides an animal.", + "operationId": "get_1", + "parameters": [ + { + "name": "cat", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Cat" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Response": { + "type": "object", + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } + } + }, + "Cat": { + "type": "object", + "description": "Represents a Cat class.", + "properties": { + "name": { + "type": "string", + "description": "The name." + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "hreflang": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string" + }, + "deprecation": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } +} From f4e632b5c51c4a700db02179ec44c9b5b39e022e Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 16 Feb 2025 14:29:51 +0100 Subject: [PATCH 198/226] Do not require JsonSubType annotation for sealed classes #2696 --- .../configuration/SpringDocSealedClassModule.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java index 37b7a7290..d0b27ad81 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java @@ -22,13 +22,14 @@ package org.springdoc.core.configuration; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import com.fasterxml.jackson.databind.introspect.Annotated; import com.fasterxml.jackson.databind.jsontype.NamedType; import com.fasterxml.jackson.databind.module.SimpleModule; import io.swagger.v3.core.jackson.SwaggerAnnotationIntrospector; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; /** * The type Spring doc sealed class module. @@ -51,7 +52,10 @@ private static class RespectSealedClassAnnotationIntrospector extends SwaggerAnn public List findSubtypes(Annotated annotated) { ArrayList subTypes = new ArrayList<>(); - if (annotated.getAnnotated() instanceof Class clazz && clazz.isSealed()) { + if (annotated.getAnnotated() instanceof Class clazz + && clazz.isSealed() + && !clazz.getPackage().getName().startsWith("java") + ) { Class[] permittedSubClasses = clazz.getPermittedSubclasses(); if (permittedSubClasses.length > 0) { Arrays.stream(permittedSubClasses).map(NamedType::new).forEach(subTypes::add); From 21869843f3c761e4bfe11468f18ff601a6548bfd Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 16 Feb 2025 14:49:47 +0100 Subject: [PATCH 199/226] CHANGELOG.md update for 2.8.5 --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41ba6e3c9..81c356a35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.8.5] - 2025-02-16 + +### Added +- #2696 - Do not require JsonSubType annotation for sealed classes +- #2898 - add needed runtime reflection hints for native image +- #2891 - Refactor trimIndent Method + +### Changed +- Upgrade swagger-ui to v5.18.3 + +### Fixed +- #2902 - Schema replaced by String when using @ApiResponse with RepresentationModel (Hateoas links) +- #2876 - Restentpoints with same name get mix up +- #2895 - Only filter out actuator endpoints with double asterisks. +- #2894 - respect @JsonUnwrapped & @Schema on props not fields only +- #2881 - fix defaultValue when using @PageableDefault together with one-indexed-parameters +- #2888 - Provide a better consistency for parameters and responses order. + ## [2.8.4] - 2025-01-25 ### Added From 9006225a449c9532a1dd6ef8a4fd428b0c6f95e8 Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 16 Feb 2025 14:06:19 +0000 Subject: [PATCH 200/226] [maven-release-plugin] prepare release v2.8.5 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 0928cf38e..dcda74974 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.5-SNAPSHOT + 2.8.5 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.8.5 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index d1e0147af..93483b2ac 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5-SNAPSHOT + 2.8.5 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 597105442..51ce89e9a 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5-SNAPSHOT + 2.8.5 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 30bec3793..76c31fc67 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5-SNAPSHOT + 2.8.5 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 9af76eee2..8c868d9b2 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5-SNAPSHOT + 2.8.5 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index ddc50f627..a02c5f0e4 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5-SNAPSHOT + 2.8.5 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 0625c0801..9c8e6964b 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.5-SNAPSHOT + 2.8.5 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index a8c4d1846..aec25732c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5-SNAPSHOT + 2.8.5 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index cc666c836..c7eaa8f48 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5-SNAPSHOT + 2.8.5 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index b44366a3d..689cce0c5 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5-SNAPSHOT + 2.8.5 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index b4f77c4af..6c0f31049 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5-SNAPSHOT + 2.8.5 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index ecd4ad9e1..a6d1f9e82 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5-SNAPSHOT + 2.8.5 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index 49bbfe98d..cc71b2f05 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.5-SNAPSHOT + 2.8.5 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index 7dd6dfef0..b8c863bd4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5-SNAPSHOT + 2.8.5 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 40fe4a564..127082932 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.5-SNAPSHOT + 2.8.5 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 96c136a14..a6b7c7394 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5-SNAPSHOT + 2.8.5 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 608b5f83f..6083259e1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5-SNAPSHOT + 2.8.5 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index bcde807d2..30183265d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.5-SNAPSHOT + 2.8.5 springdoc-openapi-security-tests From 165f0ebceb70da41165c3f3a5dc66cf72f88bdfa Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 16 Feb 2025 14:06:22 +0000 Subject: [PATCH 201/226] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index dcda74974..822b16b8b 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.5 + 2.8.6-SNAPSHOT pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - v2.8.5 + HEAD diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 93483b2ac..f0089a84e 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5 + 2.8.6-SNAPSHOT springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index 51ce89e9a..da678d450 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5 + 2.8.6-SNAPSHOT springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index 76c31fc67..a50268c98 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5 + 2.8.6-SNAPSHOT springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 8c868d9b2..fca9f5fbc 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5 + 2.8.6-SNAPSHOT springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index a02c5f0e4..11d82fda8 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.5 + 2.8.6-SNAPSHOT springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index 9c8e6964b..d7398f973 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.5 + 2.8.6-SNAPSHOT pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index aec25732c..336d94f91 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5 + 2.8.6-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index c7eaa8f48..549991d94 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5 + 2.8.6-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index 689cce0c5..aad43ce15 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5 + 2.8.6-SNAPSHOT 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index 6c0f31049..bba075327 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5 + 2.8.6-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index a6d1f9e82..20eb8c2d4 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5 + 2.8.6-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index cc71b2f05..387f3d047 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.5 + 2.8.6-SNAPSHOT springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index b8c863bd4..b680e25cf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5 + 2.8.6-SNAPSHOT 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index 127082932..c49cb6bf6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.5 + 2.8.6-SNAPSHOT 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index a6b7c7394..2f8b44219 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5 + 2.8.6-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index 6083259e1..b22d9ff96 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.5 + 2.8.6-SNAPSHOT 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index 30183265d..f6a527572 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.5 + 2.8.6-SNAPSHOT springdoc-openapi-security-tests From fc0d72a8aee2918b38d47c5baac9e88b2cb7c9a8 Mon Sep 17 00:00:00 2001 From: Illia Ovchynnikov Date: Wed, 19 Feb 2025 11:07:16 +0100 Subject: [PATCH 202/226] Check both SerDe bean definitions for @JsonUnwrapped/@Schema --- .../converters/PolymorphicModelConverter.java | 119 +++++++++++++++--- .../springdoc/api/v30/app242/RootModel.java | 41 ++++++ .../api/v30/app242/SpringDocApp242Test.java | 34 +++++ .../api/v30/app242/TestController.java | 15 +++ .../api/v30/app242/UnwrappedModelOne.java | 14 +++ .../api/v30/app242/UnwrappedModelTwo.java | 14 +++ .../springdoc/api/v31/app242/RootModel.java | 41 ++++++ .../api/v31/app242/SpringDocApp242Test.java | 34 +++++ .../api/v31/app242/TestController.java | 15 +++ .../api/v31/app242/UnwrappedModelOne.java | 14 +++ .../api/v31/app242/UnwrappedModelTwo.java | 14 +++ .../test/resources/results/3.0.1/app242.json | 56 +++++++++ .../test/resources/results/3.1.0/app242.json | 56 +++++++++ 13 files changed, 450 insertions(+), 17 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/RootModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/SpringDocApp242Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/UnwrappedModelOne.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/UnwrappedModelTwo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/RootModel.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/SpringDocApp242Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/TestController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/UnwrappedModelOne.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/UnwrappedModelTwo.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app242.json create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app242.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 9a940d349..8832027b7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -26,7 +26,7 @@ package org.springdoc.core.converters; -import java.lang.reflect.Field; +import java.lang.annotation.Annotation; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; @@ -34,10 +34,10 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Set; import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.fasterxml.jackson.databind.BeanDescription; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition; import io.swagger.v3.core.converter.AnnotatedType; @@ -50,9 +50,11 @@ import io.swagger.v3.oas.models.media.ObjectSchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.reflect.FieldUtils; import org.springdoc.core.providers.ObjectMapperProvider; +import static java.util.function.Function.identity; +import static java.util.stream.Collectors.toMap; + /** * The type Polymorphic model converter. * @@ -122,28 +124,18 @@ else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSi public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator chain) { JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); if (javaType != null) { - BeanDescription javaTypeIntrospection = springDocObjectMapper.jsonMapper().getDeserializationConfig().introspect(javaType); - for (BeanPropertyDefinition property : javaTypeIntrospection.findProperties()) { - boolean isUnwrapped = (property.getField() != null && property.getField().hasAnnotation(JsonUnwrapped.class)) || - (property.getGetter() != null && property.getGetter().hasAnnotation(JsonUnwrapped.class)); - - if (isUnwrapped) { + for (BeanPropertyBiDefinition propertyDef : introspectBeanProperties(javaType)) { + if (propertyDef.isAnyAnnotated(JsonUnwrapped.class)) { if (!TypeNameResolver.std.getUseFqn()) PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getSimpleName()); else PARENT_TYPES_TO_IGNORE.add(javaType.getRawClass().getName()); } else { - io.swagger.v3.oas.annotations.media.Schema declaredSchema = null; - if (property.getField() != null) { - declaredSchema = property.getField().getAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); - } else if (property.getGetter() != null) { - declaredSchema = property.getGetter().getAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); - } - + io.swagger.v3.oas.annotations.media.Schema declaredSchema = propertyDef.getAnyAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); if (declaredSchema != null && (ArrayUtils.isNotEmpty(declaredSchema.oneOf()) || ArrayUtils.isNotEmpty(declaredSchema.allOf()))) { - TYPES_TO_SKIP.add(property.getPrimaryType().getRawClass().getSimpleName()); + TYPES_TO_SKIP.add(propertyDef.getPrimaryType().getRawClass().getSimpleName()); } } } @@ -227,4 +219,97 @@ private boolean isConcreteClass(AnnotatedType type) { Class clazz = javaType.getRawClass(); return !Modifier.isAbstract(clazz.getModifiers()) && !clazz.isInterface(); } + + /** + * Introspects the properties of the given Java type based on serialization and deserialization configurations. + * This method identifies properties present in both JSON serialization and deserialization views, + * and pairs them into a list of {@code BeanPropertyBiDefinition}. + */ + private List introspectBeanProperties(JavaType javaType) { + Map forSerializationProps = + springDocObjectMapper.jsonMapper() + .getSerializationConfig() + .introspect(javaType) + .findProperties() + .stream() + .collect(toMap(BeanPropertyDefinition::getName, identity())); + Map forDeserializationProps = + springDocObjectMapper.jsonMapper() + .getDeserializationConfig() + .introspect(javaType) + .findProperties() + .stream() + .collect(toMap(BeanPropertyDefinition::getName, identity())); + + return forSerializationProps.keySet().stream() + .map(key -> new BeanPropertyBiDefinition(forSerializationProps.get(key), forDeserializationProps.get(key))) + .toList(); + } + + /** + * A record representing the bi-definition of a bean property, combining both + * serialization and deserialization property views. + */ + private record BeanPropertyBiDefinition(BeanPropertyDefinition forSerialization, + BeanPropertyDefinition forDeserialization) { + + /** + * Retrieves an annotation of the specified type from either the serialization or + * deserialization property definition (field, getter, setter), returning the first available match. + */ + public A getAnyAnnotation(Class acls) { + A anyForSerializationAnnotation = getAnyAnnotation(forSerialization, acls); + A anyForDeserializationAnnotation = getAnyAnnotation(forDeserialization, acls); + + return anyForSerializationAnnotation != null ? anyForSerializationAnnotation : anyForDeserializationAnnotation; + } + + /** + * Checks if any annotation of the specified type exists across serialization + * or deserialization property definitions. + */ + public boolean isAnyAnnotated(Class acls) { + return getAnyAnnotation(acls) != null; + } + + /** + * Type determined from the primary member for the property being built. + */ + public JavaType getPrimaryType() { + JavaType forSerializationType = null; + if (forSerialization != null) { + forSerializationType = forSerialization.getPrimaryType(); + } + + JavaType forDeserializationType = null; + if (forDeserialization != null) { + forDeserializationType = forDeserialization.getPrimaryType(); + } + + if (forSerializationType != null && forDeserializationType != null && forSerializationType != forDeserializationType) { + throw new IllegalStateException("The property " + forSerialization.getName() + " has different types for serialization and deserialization: " + + forSerializationType + " and " + forDeserializationType); + } + + return forSerializationType != null ? forSerializationType : forDeserializationType; + } + + private A getAnyAnnotation(BeanPropertyDefinition prop, Class acls) { + if (prop == null) { + return null; + } + + if (prop.getField() != null) { + return prop.getField().getAnnotation(acls); + } + if (prop.getGetter() != null) { + return prop.getGetter().getAnnotation(acls); + } + if (prop.getSetter() != null) { + return prop.getSetter().getAnnotation(acls); + } + + return null; + } + } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/RootModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/RootModel.java new file mode 100644 index 000000000..46db80488 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/RootModel.java @@ -0,0 +1,41 @@ +package test.org.springdoc.api.v30.app242; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonUnwrapped; + +public class RootModel { + + private Integer rootProperty; + + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + @JsonUnwrapped + private UnwrappedModelOne unwrappedModelOne; + + private UnwrappedModelTwo unwrappedModelTwo; + + public Integer getRootProperty() { + return rootProperty; + } + + public void setRootProperty(Integer rootProperty) { + this.rootProperty = rootProperty; + } + + public UnwrappedModelOne getUnwrappedModelOne() { + return unwrappedModelOne; + } + + public void setUnwrappedModelOne(UnwrappedModelOne unwrappedModelOne) { + this.unwrappedModelOne = unwrappedModelOne; + } + + public UnwrappedModelTwo getUnwrappedModelTwo() { + return unwrappedModelTwo; + } + + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + @JsonUnwrapped + public void setUnwrappedModelTwo(UnwrappedModelTwo unwrappedModelTwo) { + this.unwrappedModelTwo = unwrappedModelTwo; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/SpringDocApp242Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/SpringDocApp242Test.java new file mode 100644 index 000000000..deacc6533 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/SpringDocApp242Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app242; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +public class SpringDocApp242Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/TestController.java new file mode 100644 index 000000000..a55bbfb38 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/TestController.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v30.app242; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class TestController { + + @GetMapping + public RootModel getRootModel() { + return new RootModel(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/UnwrappedModelOne.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/UnwrappedModelOne.java new file mode 100644 index 000000000..d263ca0b0 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/UnwrappedModelOne.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v30.app242; + +public class UnwrappedModelOne { + + private Integer unwrappedOneProperty; + + public Integer getUnwrappedOneProperty() { + return unwrappedOneProperty; + } + + public void setUnwrappedOneProperty(Integer unwrappedOneProperty) { + this.unwrappedOneProperty = unwrappedOneProperty; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/UnwrappedModelTwo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/UnwrappedModelTwo.java new file mode 100644 index 000000000..4899e33a8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/UnwrappedModelTwo.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v30.app242; + +public class UnwrappedModelTwo { + + private Integer unwrappedTwoProperty; + + public Integer getUnwrappedTwoProperty() { + return unwrappedTwoProperty; + } + + public void setUnwrappedTwoProperty(Integer unwrappedTwoProperty) { + this.unwrappedTwoProperty = unwrappedTwoProperty; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/RootModel.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/RootModel.java new file mode 100644 index 000000000..d6d63eee9 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/RootModel.java @@ -0,0 +1,41 @@ +package test.org.springdoc.api.v31.app242; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonUnwrapped; + +public class RootModel { + + private Integer rootProperty; + + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + @JsonUnwrapped + private UnwrappedModelOne unwrappedModelOne; + + private UnwrappedModelTwo unwrappedModelTwo; + + public Integer getRootProperty() { + return rootProperty; + } + + public void setRootProperty(Integer rootProperty) { + this.rootProperty = rootProperty; + } + + public UnwrappedModelOne getUnwrappedModelOne() { + return unwrappedModelOne; + } + + public void setUnwrappedModelOne(UnwrappedModelOne unwrappedModelOne) { + this.unwrappedModelOne = unwrappedModelOne; + } + + public UnwrappedModelTwo getUnwrappedModelTwo() { + return unwrappedModelTwo; + } + + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + @JsonUnwrapped + public void setUnwrappedModelTwo(UnwrappedModelTwo unwrappedModelTwo) { + this.unwrappedModelTwo = unwrappedModelTwo; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/SpringDocApp242Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/SpringDocApp242Test.java new file mode 100644 index 000000000..f3646899c --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/SpringDocApp242Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app242; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +public class SpringDocApp242Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/TestController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/TestController.java new file mode 100644 index 000000000..afabf9601 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/TestController.java @@ -0,0 +1,15 @@ +package test.org.springdoc.api.v31.app242; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class TestController { + + @GetMapping + public RootModel getRootModel() { + return new RootModel(); + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/UnwrappedModelOne.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/UnwrappedModelOne.java new file mode 100644 index 000000000..75d6b82e6 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/UnwrappedModelOne.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app242; + +public class UnwrappedModelOne { + + private Integer unwrappedOneProperty; + + public Integer getUnwrappedOneProperty() { + return unwrappedOneProperty; + } + + public void setUnwrappedOneProperty(Integer unwrappedOneProperty) { + this.unwrappedOneProperty = unwrappedOneProperty; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/UnwrappedModelTwo.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/UnwrappedModelTwo.java new file mode 100644 index 000000000..f892dc776 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/UnwrappedModelTwo.java @@ -0,0 +1,14 @@ +package test.org.springdoc.api.v31.app242; + +public class UnwrappedModelTwo { + + private Integer unwrappedTwoProperty; + + public Integer getUnwrappedTwoProperty() { + return unwrappedTwoProperty; + } + + public void setUnwrappedTwoProperty(Integer unwrappedTwoProperty) { + this.unwrappedTwoProperty = unwrappedTwoProperty; + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app242.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app242.json new file mode 100644 index 000000000..2fcfa9cab --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app242.json @@ -0,0 +1,56 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api": { + "get": { + "tags": [ + "test-controller" + ], + "operationId": "getRootModel", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/RootModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "RootModel": { + "type": "object", + "properties": { + "rootProperty": { + "type": "integer", + "format": "int32" + }, + "unwrappedOneProperty": { + "type": "integer", + "format": "int32" + }, + "unwrappedTwoProperty": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app242.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app242.json new file mode 100644 index 000000000..91ab35ea8 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app242.json @@ -0,0 +1,56 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/api": { + "get": { + "tags": [ + "test-controller" + ], + "operationId": "getRootModel", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/RootModel" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "RootModel": { + "type": "object", + "properties": { + "rootProperty": { + "type": "integer", + "format": "int32" + }, + "unwrappedOneProperty": { + "type": "integer", + "format": "int32" + }, + "unwrappedTwoProperty": { + "type": "integer", + "format": "int32" + } + } + } + } + } +} From 6e434674285d370cb5199444235d4ff865938d8d Mon Sep 17 00:00:00 2001 From: Illia Ovchynnikov Date: Wed, 19 Feb 2025 11:29:20 +0100 Subject: [PATCH 203/226] format tabs --- .../converters/PolymorphicModelConverter.java | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 8832027b7..a1a8b814a 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -227,31 +227,33 @@ private boolean isConcreteClass(AnnotatedType type) { */ private List introspectBeanProperties(JavaType javaType) { Map forSerializationProps = - springDocObjectMapper.jsonMapper() - .getSerializationConfig() - .introspect(javaType) - .findProperties() - .stream() - .collect(toMap(BeanPropertyDefinition::getName, identity())); + springDocObjectMapper.jsonMapper() + .getSerializationConfig() + .introspect(javaType) + .findProperties() + .stream() + .collect(toMap(BeanPropertyDefinition::getName, identity())); Map forDeserializationProps = - springDocObjectMapper.jsonMapper() - .getDeserializationConfig() - .introspect(javaType) - .findProperties() - .stream() - .collect(toMap(BeanPropertyDefinition::getName, identity())); + springDocObjectMapper.jsonMapper() + .getDeserializationConfig() + .introspect(javaType) + .findProperties() + .stream() + .collect(toMap(BeanPropertyDefinition::getName, identity())); return forSerializationProps.keySet().stream() - .map(key -> new BeanPropertyBiDefinition(forSerializationProps.get(key), forDeserializationProps.get(key))) - .toList(); + .map(key -> new BeanPropertyBiDefinition(forSerializationProps.get(key), forDeserializationProps.get(key))) + .toList(); } /** * A record representing the bi-definition of a bean property, combining both * serialization and deserialization property views. */ - private record BeanPropertyBiDefinition(BeanPropertyDefinition forSerialization, - BeanPropertyDefinition forDeserialization) { + private record BeanPropertyBiDefinition( + BeanPropertyDefinition forSerialization, + BeanPropertyDefinition forDeserialization + ) { /** * Retrieves an annotation of the specified type from either the serialization or @@ -278,17 +280,17 @@ public boolean isAnyAnnotated(Class acls) { public JavaType getPrimaryType() { JavaType forSerializationType = null; if (forSerialization != null) { - forSerializationType = forSerialization.getPrimaryType(); - } + forSerializationType = forSerialization.getPrimaryType(); + } JavaType forDeserializationType = null; if (forDeserialization != null) { - forDeserializationType = forDeserialization.getPrimaryType(); - } + forDeserializationType = forDeserialization.getPrimaryType(); + } if (forSerializationType != null && forDeserializationType != null && forSerializationType != forDeserializationType) { throw new IllegalStateException("The property " + forSerialization.getName() + " has different types for serialization and deserialization: " - + forSerializationType + " and " + forDeserializationType); + + forSerializationType + " and " + forDeserializationType); } return forSerializationType != null ? forSerializationType : forDeserializationType; @@ -296,18 +298,18 @@ public JavaType getPrimaryType() { private A getAnyAnnotation(BeanPropertyDefinition prop, Class acls) { if (prop == null) { - return null; - } + return null; + } if (prop.getField() != null) { - return prop.getField().getAnnotation(acls); - } + return prop.getField().getAnnotation(acls); + } if (prop.getGetter() != null) { - return prop.getGetter().getAnnotation(acls); - } + return prop.getGetter().getAnnotation(acls); + } if (prop.getSetter() != null) { - return prop.getSetter().getAnnotation(acls); - } + return prop.getSetter().getAnnotation(acls); + } return null; } From d027e7c597b156aff84bafe5dccb5f9d3095d208 Mon Sep 17 00:00:00 2001 From: Oleksandr Berezkin Date: Thu, 20 Feb 2025 12:57:27 +0100 Subject: [PATCH 204/226] Update README.md Fixed broken href --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b3618093..278af66cc 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ This project is sponsored by - +

From 9e897860e6a5885d423d1e8357ddcc77a96c8d9f Mon Sep 17 00:00:00 2001 From: Badr NASS LAHSEN <13404829+bnasslahsen@users.noreply.github.com> Date: Tue, 25 Feb 2025 21:57:57 +0100 Subject: [PATCH 205/226] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 278af66cc..3d41986f1 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ project is now available for organizations that need support beyond 2023. For more details, feel free to reach out: [sales@springdoc.org](mailto:sales@springdoc.org) -``springdoc-openapi`` is on [Open Collective](https://opencollective.com/springdoc). If you ❤️ this project consider becoming -a [sponsor](https://github.com/sponsors/springdoc). +``springdoc-openapi`` is on [Open Collective](https://opencollective.com/springdoc). If you ❤️ this project consider becoming a [sponsor](https://github.com/sponsors/springdoc). This project is sponsored by From a3270f0a7306e462bdc29645e651f743fbe2602f Mon Sep 17 00:00:00 2001 From: Badr NASS LAHSEN <13404829+bnasslahsen@users.noreply.github.com> Date: Tue, 25 Feb 2025 21:59:21 +0100 Subject: [PATCH 206/226] Update README.md From 23dc5d44fae305955cad142a00ebdebfc97ec860 Mon Sep 17 00:00:00 2001 From: Badr NASS LAHSEN <13404829+bnasslahsen@users.noreply.github.com> Date: Tue, 25 Feb 2025 22:00:32 +0100 Subject: [PATCH 207/226] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 3d41986f1..81c2589fe 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,7 @@ This project is sponsored by - - - +

# Table of Contents From 49b3ab7760e06eb833679161bbccf825b49aecc2 Mon Sep 17 00:00:00 2001 From: Badr NASS LAHSEN <13404829+bnasslahsen@users.noreply.github.com> Date: Tue, 25 Feb 2025 22:00:54 +0100 Subject: [PATCH 208/226] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 81c2589fe..3d41986f1 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,9 @@ This project is sponsored by - + + +

# Table of Contents From f1a52a78140be27d66ce65f25143a8618f668dac Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 1 Mar 2025 14:50:08 +0100 Subject: [PATCH 209/226] swagger-ui upgrade to 5.20.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 822b16b8b..9f212ec5d 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.5.3 1.6.8 2.2.28 - 5.18.3 + 5.20.0 1.13.1 0.9.1 0.15.0 From f4bad4d6fafad86d49b4607d4ce12cc2ab5ca83c Mon Sep 17 00:00:00 2001 From: sahil-ramagiri Date: Sat, 1 Mar 2025 13:06:11 -0500 Subject: [PATCH 210/226] Bail sealed class subtype introspection on Schema or JacksonSubtypes annotation present --- .../SpringDocSealedClassModule.java | 14 +++ .../api/v30/app243/HelloController.java | 93 +++++++++++++++++++ .../api/v30/app243/SpringDocApp243Test.java | 34 +++++++ .../test/resources/results/3.0.1/app243.json | 90 ++++++++++++++++++ 4 files changed, 231 insertions(+) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/SpringDocApp243Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app243.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java index d0b27ad81..bac371559 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSealedClassModule.java @@ -26,10 +26,12 @@ import java.util.Arrays; import java.util.List; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.databind.introspect.Annotated; import com.fasterxml.jackson.databind.jsontype.NamedType; import com.fasterxml.jackson.databind.module.SimpleModule; import io.swagger.v3.core.jackson.SwaggerAnnotationIntrospector; +import io.swagger.v3.oas.annotations.media.Schema; /** * The type Spring doc sealed class module. @@ -56,6 +58,18 @@ public List findSubtypes(Annotated annotated) { && clazz.isSealed() && !clazz.getPackage().getName().startsWith("java") ) { + + Schema schema = clazz.getAnnotation(Schema.class); + if (schema != null && schema.oneOf().length > 0) { + return new ArrayList<>(); + } + + JsonSubTypes jsonSubTypes = clazz.getAnnotation(JsonSubTypes.class); + if (jsonSubTypes != null && jsonSubTypes.value().length > 0) { + return new ArrayList<>(); + } + + Class[] permittedSubClasses = clazz.getPermittedSubclasses(); if (permittedSubClasses.length > 0) { Arrays.stream(permittedSubClasses).map(NamedType::new).forEach(subTypes::add); diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/HelloController.java new file mode 100644 index 000000000..021fdf4ee --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/HelloController.java @@ -0,0 +1,93 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app243; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import io.swagger.v3.oas.annotations.media.DiscriminatorMapping; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/parent") + public void parentEndpoint(@RequestBody SuperClass parent) { + + } + +} + +@Schema(name = SuperClass.SCHEMA_NAME, + discriminatorProperty = "type", + oneOf = { + FirstChildClass.class, + SecondChildClass.class + }, + discriminatorMapping = { + @DiscriminatorMapping(value = FirstChildClass.SCHEMA_NAME, schema = FirstChildClass.class), + @DiscriminatorMapping(value = SecondChildClass.SCHEMA_NAME, schema = SecondChildClass.class) + } +) +sealed class SuperClass { + + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) + public String getType() { + return type; + } + + public String type; + + public static final String SCHEMA_NAME = "SuperClass"; +} + +@Schema(name = FirstChildClass.SCHEMA_NAME) +final class FirstChildClass extends SuperClass { + + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) + public String getType() { + return type; + } + + public String type; + + public static final String SCHEMA_NAME = "Image"; +} + +@Schema(name = SecondChildClass.SCHEMA_NAME) +final class SecondChildClass extends SuperClass { + + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) + public String getType() { + return type; + } + + public String type; + + public static final String SCHEMA_NAME = "Mail"; +} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/SpringDocApp243Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/SpringDocApp243Test.java new file mode 100644 index 000000000..f6ceacf4d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/SpringDocApp243Test.java @@ -0,0 +1,34 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2025 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app243; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; + +public class SpringDocApp243Test extends AbstractSpringDocV30Test { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app243.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app243.json new file mode 100644 index 000000000..edb12ee9d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app243.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/parent": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "parentEndpoint", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuperClass" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": { + "schemas": { + "Image": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "type": "string" + } + } + }, + "Mail": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "type": "string" + } + } + }, + "SuperClass": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "Image": "#/components/schemas/Image", + "Mail": "#/components/schemas/Mail" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/Image" + }, + { + "$ref": "#/components/schemas/Mail" + } + ] + } + } + } +} \ No newline at end of file From 4c3c51e31cb6a099dace7d7b6eb43f4fceac2810 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 2 Mar 2025 13:05:14 +0100 Subject: [PATCH 211/226] code review --- .../main/java/org/springdoc/api/AbstractOpenApiResource.java | 2 +- .../springdoc/core/converters/PolymorphicModelConverter.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 948a0e667..ff078da72 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -427,7 +427,7 @@ private Locale selectLocale(Locale inputLocale) { if (!CollectionUtils.isEmpty(allowedLocales)) { Locale bestMatchingAllowedLocale = Locale.lookup( Locale.LanguageRange.parse(inputLocale.toLanguageTag()), - allowedLocales.stream().map(Locale::forLanguageTag).collect(Collectors.toList()) + allowedLocales.stream().map(Locale::forLanguageTag).toList() ); return bestMatchingAllowedLocale == null ? Locale.forLanguageTag(allowedLocales.get(0)) : bestMatchingAllowedLocale; diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index a1a8b814a..07f304548 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -135,7 +135,9 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato io.swagger.v3.oas.annotations.media.Schema declaredSchema = propertyDef.getAnyAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); if (declaredSchema != null && (ArrayUtils.isNotEmpty(declaredSchema.oneOf()) || ArrayUtils.isNotEmpty(declaredSchema.allOf()))) { - TYPES_TO_SKIP.add(propertyDef.getPrimaryType().getRawClass().getSimpleName()); + if (propertyDef.getPrimaryType() != null && propertyDef.getPrimaryType().getRawClass() != null) { + TYPES_TO_SKIP.add(propertyDef.getPrimaryType().getRawClass().getSimpleName()); + } } } } From 9d7265ec06c275ef7871b0fbafe2192b0c6750fe Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 3 Mar 2025 10:54:04 +0100 Subject: [PATCH 212/226] code review --- .../core/converters/PolymorphicModelConverter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java index 07f304548..e068eec16 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PolymorphicModelConverter.java @@ -134,10 +134,10 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato else { io.swagger.v3.oas.annotations.media.Schema declaredSchema = propertyDef.getAnyAnnotation(io.swagger.v3.oas.annotations.media.Schema.class); if (declaredSchema != null && - (ArrayUtils.isNotEmpty(declaredSchema.oneOf()) || ArrayUtils.isNotEmpty(declaredSchema.allOf()))) { - if (propertyDef.getPrimaryType() != null && propertyDef.getPrimaryType().getRawClass() != null) { - TYPES_TO_SKIP.add(propertyDef.getPrimaryType().getRawClass().getSimpleName()); - } + (ArrayUtils.isNotEmpty(declaredSchema.oneOf()) || ArrayUtils.isNotEmpty(declaredSchema.allOf())) && + propertyDef.getPrimaryType() != null && + propertyDef.getPrimaryType().getRawClass() != null) { + TYPES_TO_SKIP.add(propertyDef.getPrimaryType().getRawClass().getSimpleName()); } } } From 7a3b957c0a767378f25d9ac3d6bcc4c4e1963950 Mon Sep 17 00:00:00 2001 From: John Niang Date: Tue, 4 Mar 2025 15:14:07 +0800 Subject: [PATCH 213/226] Add missing builder methods in SchemaBuilder --- .../core/fn/builders/schema/Builder.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java index fe7bbaff0..d3bafada6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/schema/Builder.java @@ -837,6 +837,50 @@ public Builder schemaResolution(SchemaResolution schemaResolution) { return this; } + /** + * Dependent required map builder. + * + * @param dependentRequiredMap the dependent required map + * @return the builder + */ + public Builder dependentRequiredMap(DependentRequired[] dependentRequiredMap) { + this.dependentRequiredMap = dependentRequiredMap; + return this; + } + + /** + * Dependent schemas builder. + * + * @param dependentSchemas the dependent schemas + * @return the builder + */ + public Builder dependentSchemas(StringToClassMapItem[] dependentSchemas) { + this.dependentSchemas = dependentSchemas; + return this; + } + + /** + * Pattern properties builder. + * + * @param patternProperties the pattern properties + * @return the builder + */ + public Builder patternProperties(StringToClassMapItem[] patternProperties) { + this.patternProperties = patternProperties; + return this; + } + + /** + * Properties builder. + * + * @param properties the properties + * @return the builder + */ + public Builder properties(StringToClassMapItem[] properties) { + this.properties = properties; + return this; + } + /** * Additional properties builder. * From 50b2fa8c2192f3dabc814929eb559b44d929154d Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 20 Mar 2025 10:44:00 +0100 Subject: [PATCH 214/226] swagger-core upgrade to 2.2.29 --- pom.xml | 2 +- ...stDelegatingMethodParameterCustomizer.java | 5 + .../core/fn/builders/parameter/Builder.java | 10 + .../core/service/GenericParameterService.java | 5 + .../test/resources/results/3.0.1/app102.json | 1 + .../test/resources/results/3.0.1/app3.json | 171 ++++++++--------- .../test/resources/results/3.0.1/app5.json | 39 ++-- .../test/resources/results/3.0.1/app66.json | 27 ++- .../test/resources/results/3.0.1/app68.json | 11 +- .../test/resources/results/3.0.1/app72.json | 3 +- .../test/resources/results/3.0.1/app85.json | 3 +- .../test/resources/results/3.0.1/app90.json | 3 +- .../test/resources/results/3.1.0/app102.json | 3 +- .../test/resources/results/3.1.0/app3.json | 181 +++++++++--------- .../test/resources/results/3.1.0/app5.json | 49 +++-- .../test/resources/results/3.1.0/app66.json | 37 ++-- .../test/resources/results/3.1.0/app68.json | 21 +- .../test/resources/results/3.1.0/app72.json | 13 +- .../test/resources/results/3.1.0/app85.json | 13 +- .../test/resources/results/3.1.0/app90.json | 13 +- .../test/resources/results/3.0.1/app102.json | 1 + .../resources/results/3.0.1/app105-4.json | 1 + .../test/resources/results/3.0.1/app121.json | 5 +- .../test/resources/results/3.0.1/app14.json | 1 + .../resources/results/3.0.1/app171-en-GB.json | 1 + .../resources/results/3.0.1/app171-en-US.json | 1 + .../resources/results/3.0.1/app171-fr-FR.json | 1 + .../test/resources/results/3.0.1/app18.json | 46 +++-- .../test/resources/results/3.0.1/app19.json | 25 +-- .../test/resources/results/3.0.1/app206.json | 1 - .../test/resources/results/3.0.1/app209.json | 47 +++-- .../test/resources/results/3.0.1/app21.json | 1 + .../test/resources/results/3.0.1/app23.json | 1 + .../resources/results/3.0.1/app238-en-US.json | 1 + .../resources/results/3.0.1/app238-fr-CA.json | 1 + .../resources/results/3.0.1/app238-zh-CN.json | 1 + .../test/resources/results/3.0.1/app24.json | 1 + .../test/resources/results/3.1.0/app102.json | 3 +- .../resources/results/3.1.0/app105-4.json | 3 +- .../test/resources/results/3.1.0/app121.json | 9 +- .../test/resources/results/3.1.0/app14.json | 3 +- .../resources/results/3.1.0/app171-en-GB.json | 4 +- .../resources/results/3.1.0/app171-en-US.json | 3 +- .../resources/results/3.1.0/app171-fr-FR.json | 4 +- .../test/resources/results/3.1.0/app18.json | 54 +++--- .../test/resources/results/3.1.0/app19.json | 29 +-- .../test/resources/results/3.1.0/app206.json | 21 +- .../test/resources/results/3.1.0/app209.json | 54 +++--- .../test/resources/results/3.1.0/app21.json | 3 +- .../test/resources/results/3.1.0/app23.json | 3 +- .../resources/results/3.1.0/app238-en-US.json | 3 +- .../resources/results/3.1.0/app238-fr-CA.json | 3 +- .../resources/results/3.1.0/app238-zh-CN.json | 3 +- .../test/resources/results/3.1.0/app24.json | 3 +- .../test/resources/results/3.0.1/app68-4.json | 1 + .../test/resources/results/3.1.0/app68-4.json | 3 +- .../test/resources/results/3.0.1/app18.json | 6 +- .../test/resources/results/3.0.1/app23.json | 61 +++--- .../test/resources/results/3.1.0/app18.json | 20 +- .../test/resources/results/3.1.0/app23.json | 85 ++++---- .../test/resources/results/3.0.1/app102.json | 3 +- .../resources/results/3.0.1/app105-4.json | 13 +- .../test/resources/results/3.0.1/app121.json | 59 +++--- .../test/resources/results/3.0.1/app14.json | 3 +- .../test/resources/results/3.0.1/app18.json | 54 +++--- .../test/resources/results/3.0.1/app19.json | 29 +-- .../test/resources/results/3.0.1/app21.json | 3 +- .../test/resources/results/3.0.1/app23.json | 3 +- .../test/resources/results/3.0.1/app24.json | 3 +- .../test/resources/results/3.1.0/app102.json | 7 +- .../resources/results/3.1.0/app105-4.json | 15 +- .../test/resources/results/3.1.0/app121.json | 11 +- .../test/resources/results/3.1.0/app14.json | 49 ++--- .../test/resources/results/3.1.0/app18.json | 64 ++++--- .../test/resources/results/3.1.0/app19.json | 31 +-- .../test/resources/results/3.1.0/app21.json | 9 +- .../test/resources/results/3.1.0/app23.json | 5 +- .../test/resources/results/3.1.0/app24.json | 13 +- 78 files changed, 791 insertions(+), 710 deletions(-) diff --git a/pom.xml b/pom.xml index 9f212ec5d..7454cf98f 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.6 2.5.3 1.6.8 - 2.2.28 + 2.2.29 5.20.0 1.13.1 0.9.1 diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java index 1db18a182..3a96dcb9d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/DataRestDelegatingMethodParameterCustomizer.java @@ -1029,6 +1029,11 @@ public Extension[] extensions() { public String ref() { return parameter.ref(); } + + @Override + public Class[] validationGroups() { + return new Class[0]; + } }; return Optional.of(parameterNew); } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java index 8c02e861e..1e82b9451 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/fn/builders/parameter/Builder.java @@ -132,6 +132,11 @@ public class Builder { */ private String ref = ""; + /** + * The Validation groups. + */ + private Class[] validationGroups = {}; + /** * Instantiates a new Parameter builder. @@ -454,6 +459,11 @@ public Extension[] extensions() { public String ref() { return ref; } + + @Override + public Class[] validationGroups() { + return validationGroups; + } }; } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java index f29c91198..d2a9dcaa8 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericParameterService.java @@ -715,6 +715,11 @@ public Extension[] extensions() { public String ref() { return schema.ref(); } + + @Override + public Class[] validationGroups() { + return new Class[0]; + } }; } diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app102.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app102.json index d7479b41b..e77bbf251 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app102.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app102.json @@ -32,6 +32,7 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { + "minLength": 1, "type": "string" } }, diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app3.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app3.json index 18bfb0e31..59fdb9448 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app3.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app3.json @@ -15,15 +15,25 @@ } ], "paths": { - "/tweets": { + "/tweets/{id}": { "get": { "tags": [ "tweet-controller" ], - "operationId": "getAllTweets", + "operationId": "getTweetById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { - "404": { - "description": "Not Found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -32,8 +42,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "tweet not found", "content": { "*/*": { "schema": { @@ -43,25 +53,32 @@ } }, "200": { - "description": "get All Tweets", + "description": "get Tweet By Id", "content": { "*/*": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TweetDTO" - } + "$ref": "#/components/schemas/TweetDTO" } } } } } }, - "post": { + "put": { "tags": [ "tweet-controller" ], - "operationId": "createTweets", + "operationId": "updateTweet", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { @@ -73,8 +90,8 @@ "required": true }, "responses": { - "404": { - "description": "Not Found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -83,8 +100,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "tweet not found", "content": { "*/*": { "schema": { @@ -94,7 +111,7 @@ } }, "200": { - "description": "create Tweets", + "description": "update Tweet", "content": { "*/*": { "schema": { @@ -104,14 +121,12 @@ } } } - } - }, - "/tweets/{id}": { - "get": { + }, + "delete": { "tags": [ "tweet-controller" ], - "operationId": "getTweetById", + "operationId": "deleteTweet", "parameters": [ { "name": "id", @@ -123,8 +138,8 @@ } ], "responses": { - "404": { - "description": "tweet not found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -133,8 +148,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "tweet not found", "content": { "*/*": { "schema": { @@ -144,45 +159,20 @@ } }, "200": { - "description": "get Tweet By Id", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/TweetDTO" - } - } - } + "description": "delete Tweet" } } - }, - "put": { + } + }, + "/tweets": { + "get": { "tags": [ "tweet-controller" ], - "operationId": "updateTweet", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TweetDTO" - } - } - }, - "required": true - }, + "operationId": "getAllTweets", "responses": { - "404": { - "description": "tweet not found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -191,8 +181,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "Not Found", "content": { "*/*": { "schema": { @@ -202,35 +192,38 @@ } }, "200": { - "description": "update Tweet", + "description": "get All Tweets", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/TweetDTO" + "type": "array", + "items": { + "$ref": "#/components/schemas/TweetDTO" + } } } } } } }, - "delete": { + "post": { "tags": [ "tweet-controller" ], - "operationId": "deleteTweet", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" + "operationId": "createTweets", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TweetDTO" + } } - } - ], + }, + "required": true + }, "responses": { - "404": { - "description": "tweet not found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -239,8 +232,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "Not Found", "content": { "*/*": { "schema": { @@ -250,7 +243,14 @@ } }, "200": { - "description": "delete Tweet" + "description": "create Tweets", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/TweetDTO" + } + } + } } } } @@ -263,8 +263,8 @@ "description": "Tweets are Sent to the client as Server Sent Events", "operationId": "streamAllTweets", "responses": { - "404": { - "description": "Not Found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -273,8 +273,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "Not Found", "content": { "*/*": { "schema": { @@ -304,8 +304,7 @@ "schemas": { "TweetDTO": { "required": [ - "createdAt", - "text" + "createdAt" ], "type": "object", "properties": { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app5.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app5.json index 5e2b55c07..dbc95395e 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app5.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app5.json @@ -15,19 +15,29 @@ } ], "paths": { - "/test": { - "get": { + "/tweets/does-not-work": { + "post": { "tags": [ "hello-controller" ], - "operationId": "demo2", + "operationId": "postNotWorks", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tweet" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Tweet" } } } @@ -35,29 +45,19 @@ } } }, - "/tweets/does-not-work": { - "post": { + "/test": { + "get": { "tags": [ "hello-controller" ], - "operationId": "postNotWorks", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Tweet" - } - } - }, - "required": true - }, + "operationId": "demo2", "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/Tweet" + "type": "string" } } } @@ -70,8 +70,7 @@ "schemas": { "Tweet": { "required": [ - "createdAt", - "text" + "createdAt" ], "type": "object", "properties": { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app66.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app66.json index 8f59a64b5..5147abedc 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app66.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app66.json @@ -23,15 +23,12 @@ "description": "Tweets are Sent to the client as Server Sent Events", "operationId": "streamAllTweets", "responses": { - "200": { - "description": "stream All Tweets", + "409": { + "description": "Conflict", "content": { - "text/event-stream": { + "*/*": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TweetDTO" - } + "type": "string" } } } @@ -46,12 +43,15 @@ } } }, - "409": { - "description": "Conflict", + "200": { + "description": "stream All Tweets", "content": { - "*/*": { + "text/event-stream": { "schema": { - "type": "string" + "type": "array", + "items": { + "$ref": "#/components/schemas/TweetDTO" + } } } } @@ -64,8 +64,7 @@ "schemas": { "TweetDTO": { "required": [ - "createdAt", - "text" + "createdAt" ], "type": "object", "properties": { @@ -91,4 +90,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app68.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app68.json index 67e1dadca..5147abedc 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app68.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app68.json @@ -23,8 +23,8 @@ "description": "Tweets are Sent to the client as Server Sent Events", "operationId": "streamAllTweets", "responses": { - "404": { - "description": "Not Found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -33,8 +33,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "Not Found", "content": { "*/*": { "schema": { @@ -64,8 +64,7 @@ "schemas": { "TweetDTO": { "required": [ - "createdAt", - "text" + "createdAt" ], "type": "object", "properties": { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app72.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app72.json index b1103c0b3..553d457b8 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app72.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app72.json @@ -269,8 +269,7 @@ }, "Position": { "required": [ - "createdAt", - "positionName" + "createdAt" ], "type": "object", "properties": { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app85.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app85.json index b1103c0b3..553d457b8 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app85.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app85.json @@ -269,8 +269,7 @@ }, "Position": { "required": [ - "createdAt", - "positionName" + "createdAt" ], "type": "object", "properties": { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app90.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app90.json index ec997c6c6..0380ac8ad 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app90.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.0.1/app90.json @@ -549,8 +549,7 @@ }, "Position": { "required": [ - "createdAt", - "positionName" + "createdAt" ], "type": "object", "properties": { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app102.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app102.json index f43ac6133..2a6c70e57 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app102.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app102.json @@ -32,7 +32,8 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } }, { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app3.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app3.json index af92076cd..7caa61e95 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app3.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app3.json @@ -15,15 +15,25 @@ } ], "paths": { - "/tweets": { + "/tweets/{id}": { "get": { "tags": [ "tweet-controller" ], - "operationId": "getAllTweets", + "operationId": "getTweetById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { - "404": { - "description": "Not Found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -32,8 +42,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "tweet not found", "content": { "*/*": { "schema": { @@ -43,25 +53,32 @@ } }, "200": { - "description": "get All Tweets", + "description": "get Tweet By Id", "content": { "*/*": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TweetDTO" - } + "$ref": "#/components/schemas/TweetDTO" } } } } } }, - "post": { + "put": { "tags": [ "tweet-controller" ], - "operationId": "createTweets", + "operationId": "updateTweet", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { @@ -73,8 +90,8 @@ "required": true }, "responses": { - "404": { - "description": "Not Found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -83,8 +100,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "tweet not found", "content": { "*/*": { "schema": { @@ -94,7 +111,7 @@ } }, "200": { - "description": "create Tweets", + "description": "update Tweet", "content": { "*/*": { "schema": { @@ -104,14 +121,12 @@ } } } - } - }, - "/tweets/{id}": { - "get": { + }, + "delete": { "tags": [ "tweet-controller" ], - "operationId": "getTweetById", + "operationId": "deleteTweet", "parameters": [ { "name": "id", @@ -123,8 +138,8 @@ } ], "responses": { - "404": { - "description": "tweet not found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -133,8 +148,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "tweet not found", "content": { "*/*": { "schema": { @@ -144,45 +159,20 @@ } }, "200": { - "description": "get Tweet By Id", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/TweetDTO" - } - } - } + "description": "delete Tweet" } } - }, - "put": { + } + }, + "/tweets": { + "get": { "tags": [ "tweet-controller" ], - "operationId": "updateTweet", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TweetDTO" - } - } - }, - "required": true - }, + "operationId": "getAllTweets", "responses": { - "404": { - "description": "tweet not found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -191,8 +181,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "Not Found", "content": { "*/*": { "schema": { @@ -202,35 +192,38 @@ } }, "200": { - "description": "update Tweet", + "description": "get All Tweets", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/TweetDTO" + "type": "array", + "items": { + "$ref": "#/components/schemas/TweetDTO" + } } } } } } }, - "delete": { + "post": { "tags": [ "tweet-controller" ], - "operationId": "deleteTweet", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" + "operationId": "createTweets", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TweetDTO" + } } - } - ], + }, + "required": true + }, "responses": { - "404": { - "description": "tweet not found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -239,8 +232,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "Not Found", "content": { "*/*": { "schema": { @@ -250,7 +243,14 @@ } }, "200": { - "description": "delete Tweet" + "description": "create Tweets", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/TweetDTO" + } + } + } } } } @@ -263,8 +263,8 @@ "description": "Tweets are Sent to the client as Server Sent Events", "operationId": "streamAllTweets", "responses": { - "404": { - "description": "Not Found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -273,8 +273,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "Not Found", "content": { "*/*": { "schema": { @@ -303,25 +303,24 @@ "components": { "schemas": { "TweetDTO": { - "required": [ - "createdAt", - "text" - ], "type": "object", "properties": { "id": { "type": "string" }, "text": { + "type": "string", "maxLength": 140, - "minLength": 0, - "type": "string" + "minLength": 0 }, "createdAt": { "type": "string", "format": "date-time" } - } + }, + "required": [ + "createdAt" + ] } }, "securitySchemes": { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app5.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app5.json index 8981c818b..0222120cb 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app5.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app5.json @@ -15,19 +15,29 @@ } ], "paths": { - "/test": { - "get": { + "/tweets/does-not-work": { + "post": { "tags": [ "hello-controller" ], - "operationId": "demo2", + "operationId": "postNotWorks", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tweet" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Tweet" } } } @@ -35,29 +45,19 @@ } } }, - "/tweets/does-not-work": { - "post": { + "/test": { + "get": { "tags": [ "hello-controller" ], - "operationId": "postNotWorks", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Tweet" - } - } - }, - "required": true - }, + "operationId": "demo2", "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/Tweet" + "type": "string" } } } @@ -69,25 +69,24 @@ "components": { "schemas": { "Tweet": { - "required": [ - "createdAt", - "text" - ], "type": "object", "properties": { "id": { "type": "string" }, "text": { + "type": "string", "maxLength": 140, - "minLength": 0, - "type": "string" + "minLength": 0 }, "createdAt": { "type": "string", "format": "date-time" } - } + }, + "required": [ + "createdAt" + ] } }, "securitySchemes": { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app66.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app66.json index afd650cbe..8c847aaac 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app66.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app66.json @@ -23,15 +23,12 @@ "description": "Tweets are Sent to the client as Server Sent Events", "operationId": "streamAllTweets", "responses": { - "200": { - "description": "stream All Tweets", + "409": { + "description": "Conflict", "content": { - "text/event-stream": { + "*/*": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TweetDTO" - } + "type": "string" } } } @@ -46,12 +43,15 @@ } } }, - "409": { - "description": "Conflict", + "200": { + "description": "stream All Tweets", "content": { - "*/*": { + "text/event-stream": { "schema": { - "type": "string" + "type": "array", + "items": { + "$ref": "#/components/schemas/TweetDTO" + } } } } @@ -63,25 +63,24 @@ "components": { "schemas": { "TweetDTO": { - "required": [ - "createdAt", - "text" - ], "type": "object", "properties": { "id": { "type": "string" }, "text": { + "type": "string", "maxLength": 140, - "minLength": 0, - "type": "string" + "minLength": 0 }, "createdAt": { "type": "string", "format": "date-time" } - } + }, + "required": [ + "createdAt" + ] } }, "securitySchemes": { @@ -91,4 +90,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app68.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app68.json index cba35f247..8c847aaac 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app68.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app68.json @@ -23,8 +23,8 @@ "description": "Tweets are Sent to the client as Server Sent Events", "operationId": "streamAllTweets", "responses": { - "404": { - "description": "Not Found", + "409": { + "description": "Conflict", "content": { "*/*": { "schema": { @@ -33,8 +33,8 @@ } } }, - "409": { - "description": "Conflict", + "404": { + "description": "Not Found", "content": { "*/*": { "schema": { @@ -63,25 +63,24 @@ "components": { "schemas": { "TweetDTO": { - "required": [ - "createdAt", - "text" - ], "type": "object", "properties": { "id": { "type": "string" }, "text": { + "type": "string", "maxLength": 140, - "minLength": 0, - "type": "string" + "minLength": 0 }, "createdAt": { "type": "string", "format": "date-time" } - } + }, + "required": [ + "createdAt" + ] } }, "securitySchemes": { diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app72.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app72.json index 0d6ca8afb..c635b23f4 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app72.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app72.json @@ -268,19 +268,15 @@ } }, "Position": { - "required": [ - "createdAt", - "positionName" - ], "type": "object", "properties": { "id": { "type": "string" }, "positionName": { + "type": "string", "maxLength": 140, - "minLength": 0, - "type": "string" + "minLength": 0 }, "description": { "type": "string" @@ -289,7 +285,10 @@ "type": "string", "format": "date-time" } - } + }, + "required": [ + "createdAt" + ] } } } diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app85.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app85.json index 0d6ca8afb..c635b23f4 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app85.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app85.json @@ -268,19 +268,15 @@ } }, "Position": { - "required": [ - "createdAt", - "positionName" - ], "type": "object", "properties": { "id": { "type": "string" }, "positionName": { + "type": "string", "maxLength": 140, - "minLength": 0, - "type": "string" + "minLength": 0 }, "description": { "type": "string" @@ -289,7 +285,10 @@ "type": "string", "format": "date-time" } - } + }, + "required": [ + "createdAt" + ] } } } diff --git a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app90.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app90.json index 1197cd09e..46554c671 100644 --- a/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app90.json +++ b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app90.json @@ -548,19 +548,15 @@ } }, "Position": { - "required": [ - "createdAt", - "positionName" - ], "type": "object", "properties": { "id": { "type": "string" }, "positionName": { + "type": "string", "maxLength": 140, - "minLength": 0, - "type": "string" + "minLength": 0 }, "description": { "type": "string" @@ -569,7 +565,10 @@ "type": "string", "format": "date-time" } - } + }, + "required": [ + "createdAt" + ] }, "Quote": { "type": "object", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app102.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app102.json index 0f17e72f0..1981b04bf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app102.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app102.json @@ -32,6 +32,7 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { + "minLength": 1, "type": "string" } }, diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app105-4.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app105-4.json index 76d34675f..9fe3e74ae 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app105-4.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app105-4.json @@ -35,6 +35,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app121.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app121.json index 9375efe11..f910ff79d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app121.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app121.json @@ -32,6 +32,7 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { + "minLength": 1, "type": "string" } }, @@ -147,9 +148,6 @@ } }, "InheritedRequestParams": { - "required": [ - "childParam" - ], "type": "object", "properties": { "stringParam": { @@ -182,6 +180,7 @@ } }, "childParam": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app14.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app14.json index 9bd24ef37..235e0fe82 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app14.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app14.json @@ -50,6 +50,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-en-GB.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-en-GB.json index 90ea79632..978d6dd12 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-en-GB.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-en-GB.json @@ -49,6 +49,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-en-US.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-en-US.json index d65b8eca2..7e6decf59 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-en-US.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-en-US.json @@ -49,6 +49,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-fr-FR.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-fr-FR.json index d10b56632..4c7e59f54 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-fr-FR.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app171-fr-FR.json @@ -49,6 +49,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app18.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app18.json index 52c543602..66a05b228 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app18.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app18.json @@ -11,19 +11,19 @@ } ], "paths": { - "/persons3": { + "/persons": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons3", + "operationId": "persons", "parameters": [ { "name": "name", "in": "query", - "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -42,21 +42,21 @@ } } }, - "/persons5": { + "/persons6": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons5", + "operationId": "persons6", "parameters": [ { - "name": "age", + "name": "name", "in": "query", + "description": "persons name", "required": true, "schema": { - "maximum": 0, - "type": "integer", - "format": "int32" + "minLength": 1, + "type": "string" } } ], @@ -74,19 +74,19 @@ } } }, - "/persons4": { + "/persons5": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons4", + "operationId": "persons5", "parameters": [ { "name": "age", "in": "query", "required": true, "schema": { - "minimum": 0, + "maximum": 0, "type": "integer", "format": "int32" } @@ -106,20 +106,21 @@ } } }, - "/persons2": { + "/persons4": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons2", + "operationId": "persons4", "parameters": [ { - "name": "name", + "name": "age", "in": "query", - "description": "persons name", "required": true, "schema": { - "type": "string" + "minimum": 0, + "type": "integer", + "format": "int32" } } ], @@ -137,12 +138,12 @@ } } }, - "/persons6": { + "/persons3": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons6", + "operationId": "persons3", "parameters": [ { "name": "name", @@ -150,6 +151,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -168,18 +170,20 @@ } } }, - "/persons": { + "/persons2": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons", + "operationId": "persons2", "parameters": [ { "name": "name", "in": "query", + "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app19.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app19.json index c96b10c50..5cbef60a5 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app19.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app19.json @@ -11,22 +11,21 @@ } ], "paths": { - "/persons3": { + "/persons": { "post": { "tags": [ "hello-controller" ], - "operationId": "persons3", + "operationId": "persons", "requestBody": { - "description": "requestBody inside operation annotation", + "description": "requestBody description as parameter", "content": { "application/json": { "schema": { "type": "string" } } - }, - "required": true + } }, "responses": { "200": { @@ -42,21 +41,23 @@ } } }, - "/persons2": { + "/persons3": { "post": { "tags": [ "hello-controller" ], - "operationId": "persons2", + "operationId": "persons3", "requestBody": { - "description": "requestBody description outside", + "description": "requestBody inside operation annotation", "content": { "application/json": { "schema": { + "minLength": 1, "type": "string" } } - } + }, + "required": true }, "responses": { "200": { @@ -72,14 +73,14 @@ } } }, - "/persons": { + "/persons2": { "post": { "tags": [ "hello-controller" ], - "operationId": "persons", + "operationId": "persons2", "requestBody": { - "description": "requestBody description as parameter", + "description": "requestBody description outside", "content": { "application/json": { "schema": { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json index 15af3c649..6d32d81fc 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app206.json @@ -84,7 +84,6 @@ "required": [ "age", "email", - "firstName", "lastName" ], "type": "object", diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app209.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app209.json index 52c543602..b93993fbf 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app209.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app209.json @@ -11,19 +11,19 @@ } ], "paths": { - "/persons3": { + "/persons": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons3", + "operationId": "persons", "parameters": [ { "name": "name", "in": "query", - "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -42,21 +42,21 @@ } } }, - "/persons5": { + "/persons6": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons5", + "operationId": "persons6", "parameters": [ { - "name": "age", + "name": "name", "in": "query", + "description": "persons name", "required": true, "schema": { - "maximum": 0, - "type": "integer", - "format": "int32" + "minLength": 1, + "type": "string" } } ], @@ -74,19 +74,19 @@ } } }, - "/persons4": { + "/persons5": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons4", + "operationId": "persons5", "parameters": [ { "name": "age", "in": "query", "required": true, "schema": { - "minimum": 0, + "maximum": 0, "type": "integer", "format": "int32" } @@ -106,20 +106,21 @@ } } }, - "/persons2": { + "/persons4": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons2", + "operationId": "persons4", "parameters": [ { - "name": "name", + "name": "age", "in": "query", - "description": "persons name", "required": true, "schema": { - "type": "string" + "minimum": 0, + "type": "integer", + "format": "int32" } } ], @@ -137,12 +138,12 @@ } } }, - "/persons6": { + "/persons3": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons6", + "operationId": "persons3", "parameters": [ { "name": "name", @@ -150,6 +151,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -168,18 +170,20 @@ } } }, - "/persons": { + "/persons2": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons", + "operationId": "persons2", "parameters": [ { "name": "name", "in": "query", + "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -201,3 +205,4 @@ }, "components": {} } + \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app21.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app21.json index 2d53bffbf..db5cde3ab 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app21.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app21.json @@ -24,6 +24,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app23.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app23.json index 22902fadc..4cb10bb74 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app23.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app23.json @@ -24,6 +24,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-en-US.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-en-US.json index d65b8eca2..7e6decf59 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-en-US.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-en-US.json @@ -49,6 +49,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-fr-CA.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-fr-CA.json index d10b56632..4c7e59f54 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-fr-CA.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-fr-CA.json @@ -49,6 +49,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-zh-CN.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-zh-CN.json index d65b8eca2..7e6decf59 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-zh-CN.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app238-zh-CN.json @@ -49,6 +49,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app24.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app24.json index 885b7d457..181e3bf01 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app24.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app24.json @@ -30,6 +30,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app102.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app102.json index 35eeb5ea9..ed29774ae 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app102.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app102.json @@ -32,7 +32,8 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } }, { diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json index f393a5154..ccf0baf41 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app105-4.json @@ -35,7 +35,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app121.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app121.json index 372afd5c5..57b1c43d0 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app121.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app121.json @@ -32,7 +32,8 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } }, { @@ -147,9 +148,6 @@ } }, "InheritedRequestParams": { - "required": [ - "childParam" - ], "type": "object", "properties": { "stringParam": { @@ -182,7 +180,8 @@ } }, "childParam": { - "type": "string" + "type": "string", + "minLength": 1 } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app14.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app14.json index e2bb2165d..141b2f485 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app14.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app14.json @@ -50,7 +50,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-GB.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-GB.json index f84f883a3..3c110703e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-GB.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-GB.json @@ -49,7 +49,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -63,3 +64,4 @@ }, "components": {} } + \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-US.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-US.json index e32639950..e36a4f0f6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-US.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-en-US.json @@ -49,7 +49,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-fr-FR.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-fr-FR.json index 37e48614e..ffc7ce523 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-fr-FR.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app171-fr-FR.json @@ -49,7 +49,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -63,3 +64,4 @@ }, "components": {} } + \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app18.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app18.json index 7381cc07d..8cb518c8f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app18.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app18.json @@ -11,20 +11,20 @@ } ], "paths": { - "/persons3": { + "/persons": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons3", + "operationId": "persons", "parameters": [ { "name": "name", "in": "query", - "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -42,21 +42,21 @@ } } }, - "/persons5": { + "/persons6": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons5", + "operationId": "persons6", "parameters": [ { - "name": "age", + "name": "name", "in": "query", + "description": "persons name", "required": true, "schema": { - "maximum": 0, - "type": "integer", - "format": "int32" + "type": "string", + "minLength": 1 } } ], @@ -74,21 +74,21 @@ } } }, - "/persons4": { + "/persons5": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons4", + "operationId": "persons5", "parameters": [ { "name": "age", "in": "query", "required": true, "schema": { - "minimum": 0, "type": "integer", - "format": "int32" + "format": "int32", + "maximum": 0 } } ], @@ -106,20 +106,21 @@ } } }, - "/persons2": { + "/persons4": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons2", + "operationId": "persons4", "parameters": [ { - "name": "name", + "name": "age", "in": "query", - "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32", + "minimum": 0 } } ], @@ -137,12 +138,12 @@ } } }, - "/persons6": { + "/persons3": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons6", + "operationId": "persons3", "parameters": [ { "name": "name", @@ -150,7 +151,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -168,19 +170,21 @@ } } }, - "/persons": { + "/persons2": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons", + "operationId": "persons2", "parameters": [ { "name": "name", "in": "query", + "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app19.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app19.json index c67f34545..3114a411b 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app19.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app19.json @@ -11,22 +11,21 @@ } ], "paths": { - "/persons3": { + "/persons": { "post": { "tags": [ "hello-controller" ], - "operationId": "persons3", + "operationId": "persons", "requestBody": { - "description": "requestBody inside operation annotation", + "description": "requestBody description as parameter", "content": { "application/json": { "schema": { "type": "string" } } - }, - "required": true + } }, "responses": { "200": { @@ -42,21 +41,23 @@ } } }, - "/persons2": { + "/persons3": { "post": { "tags": [ "hello-controller" ], - "operationId": "persons2", + "operationId": "persons3", "requestBody": { - "description": "requestBody description outside", + "description": "requestBody inside operation annotation", "content": { "application/json": { "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } - } + }, + "required": true }, "responses": { "200": { @@ -72,14 +73,14 @@ } } }, - "/persons": { + "/persons2": { "post": { "tags": [ "hello-controller" ], - "operationId": "persons", + "operationId": "persons2", "requestBody": { - "description": "requestBody description as parameter", + "description": "requestBody description outside", "content": { "application/json": { "schema": { @@ -104,4 +105,4 @@ } }, "components": {} -} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app206.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app206.json index 17534ca8c..a1c242a19 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app206.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app206.json @@ -40,9 +40,9 @@ "in": "query", "required": true, "schema": { + "type": "string", "maxLength": 10, - "minLength": 0, - "type": "string" + "minLength": 0 } }, { @@ -81,12 +81,6 @@ "components": { "schemas": { "PersonResponse": { - "required": [ - "age", - "email", - "firstName", - "lastName" - ], "type": "object", "properties": { "id": { @@ -94,9 +88,9 @@ "format": "int64" }, "firstName": { + "type": "string", "maxLength": 10, - "minLength": 0, - "type": "string" + "minLength": 0 }, "lastName": { "type": "string" @@ -108,7 +102,12 @@ "type": "integer", "format": "int32" } - } + }, + "required": [ + "age", + "email", + "lastName" + ] } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app209.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app209.json index 7381cc07d..8cb518c8f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app209.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app209.json @@ -11,20 +11,20 @@ } ], "paths": { - "/persons3": { + "/persons": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons3", + "operationId": "persons", "parameters": [ { "name": "name", "in": "query", - "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -42,21 +42,21 @@ } } }, - "/persons5": { + "/persons6": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons5", + "operationId": "persons6", "parameters": [ { - "name": "age", + "name": "name", "in": "query", + "description": "persons name", "required": true, "schema": { - "maximum": 0, - "type": "integer", - "format": "int32" + "type": "string", + "minLength": 1 } } ], @@ -74,21 +74,21 @@ } } }, - "/persons4": { + "/persons5": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons4", + "operationId": "persons5", "parameters": [ { "name": "age", "in": "query", "required": true, "schema": { - "minimum": 0, "type": "integer", - "format": "int32" + "format": "int32", + "maximum": 0 } } ], @@ -106,20 +106,21 @@ } } }, - "/persons2": { + "/persons4": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons2", + "operationId": "persons4", "parameters": [ { - "name": "name", + "name": "age", "in": "query", - "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32", + "minimum": 0 } } ], @@ -137,12 +138,12 @@ } } }, - "/persons6": { + "/persons3": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons6", + "operationId": "persons3", "parameters": [ { "name": "name", @@ -150,7 +151,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -168,19 +170,21 @@ } } }, - "/persons": { + "/persons2": { "get": { "tags": [ "hello-controller" ], - "operationId": "persons", + "operationId": "persons2", "parameters": [ { "name": "name", "in": "query", + "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app21.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app21.json index 136b34d94..75fb1e617 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app21.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app21.json @@ -24,7 +24,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app23.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app23.json index 25d752698..7f16dc76e 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app23.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app23.json @@ -24,7 +24,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-en-US.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-en-US.json index e32639950..e36a4f0f6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-en-US.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-en-US.json @@ -49,7 +49,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-fr-CA.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-fr-CA.json index 37e48614e..222aa1548 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-fr-CA.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-fr-CA.json @@ -49,7 +49,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-zh-CN.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-zh-CN.json index e32639950..e36a4f0f6 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-zh-CN.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app238-zh-CN.json @@ -49,7 +49,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app24.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app24.json index fd8082586..5ca1729ba 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app24.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app24.json @@ -30,7 +30,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-4.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-4.json index 76d34675f..9fe3e74ae 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-4.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app68-4.json @@ -35,6 +35,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-4.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-4.json index f393a5154..ccf0baf41 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-4.json +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.1.0/app68-4.json @@ -35,7 +35,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app18.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app18.json index 0ed04df2c..dc876fa6a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app18.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app18.json @@ -25,6 +25,7 @@ "description": "Description for abc", "required": true, "schema": { + "minLength": 1, "type": "string" }, "example": "def" @@ -69,6 +70,7 @@ "description": "Description for abc", "required": true, "schema": { + "minLength": 1, "type": "string" }, "example": "def" @@ -104,12 +106,12 @@ "schemas": { "HelloWorldModel": { "required": [ - "abc", "thisDate" ], "type": "object", "properties": { "abc": { + "minLength": 1, "type": "string" }, "thisDate": { @@ -120,4 +122,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app23.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app23.json index 3b2dd10aa..4b297655c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app23.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.0.1/app23.json @@ -839,15 +839,28 @@ } } }, - "Links": { + "RepresentationModelObject": { "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" + "properties": { + "_links": { + "$ref": "#/components/schemas/Links" + } } }, - "RepresentationModelObject": { + "CollectionModelEntityModelDoctor": { "type": "object", "properties": { + "_embedded": { + "type": "object", + "properties": { + "doctors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityModelDoctor" + } + } + } + }, "_links": { "$ref": "#/components/schemas/Links" } @@ -861,16 +874,16 @@ } } }, - "CollectionModelEntityModelDoctor": { + "CollectionModelObject": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "doctors": { + "objects": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityModelDoctor" + "type": "object" } } } @@ -899,16 +912,16 @@ } } }, - "CollectionModelObject": { + "CollectionModelEntityModelClinic": { "type": "object", "properties": { "_embedded": { "type": "object", "properties": { - "objects": { + "clinics": { "type": "array", "items": { - "type": "object" + "$ref": "#/components/schemas/EntityModelClinic" } } } @@ -925,6 +938,7 @@ "type": "object", "properties": { "name": { + "minLength": 1, "type": "string" }, "_links": { @@ -932,25 +946,6 @@ } } }, - "CollectionModelEntityModelClinic": { - "type": "object", - "properties": { - "_embedded": { - "type": "object", - "properties": { - "clinics": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityModelClinic" - } - } - } - }, - "_links": { - "$ref": "#/components/schemas/Links" - } - } - }, "ClinicRequestBody": { "required": [ "name" @@ -962,6 +957,7 @@ "format": "int64" }, "name": { + "minLength": 1, "type": "string" } } @@ -988,6 +984,7 @@ "type": "object", "properties": { "name": { + "minLength": 1, "type": "string" } } @@ -1020,6 +1017,12 @@ "type": "boolean" } } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app18.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app18.json index fa8936163..69d1fef51 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app18.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app18.json @@ -25,7 +25,8 @@ "description": "Description for abc", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 }, "example": "def" }, @@ -69,7 +70,8 @@ "description": "Description for abc", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 }, "example": "def" }, @@ -103,21 +105,21 @@ "components": { "schemas": { "HelloWorldModel": { - "required": [ - "abc", - "thisDate" - ], "type": "object", "properties": { "abc": { - "type": "string" + "type": "string", + "minLength": 1 }, "thisDate": { "type": "string", "format": "date" } - } + }, + "required": [ + "thisDate" + ] } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app23.json b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app23.json index 232b86a03..0ee3baa85 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app23.json +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app23.json @@ -839,12 +839,6 @@ } } }, - "Links": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - } - }, "RepresentationModelObject": { "type": "object", "properties": { @@ -853,14 +847,6 @@ } } }, - "EntityModelDoctor": { - "type": "object", - "properties": { - "_links": { - "$ref": "#/components/schemas/Links" - } - } - }, "CollectionModelEntityModelDoctor": { "type": "object", "properties": { @@ -880,20 +866,9 @@ } } }, - "CollectionModelClinic": { + "EntityModelDoctor": { "type": "object", "properties": { - "_embedded": { - "type": "object", - "properties": { - "clinics": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ClinicResponse" - } - } - } - }, "_links": { "$ref": "#/components/schemas/Links" } @@ -918,14 +893,19 @@ } } }, - "EntityModelClinic": { - "required": [ - "name" - ], + "CollectionModelClinic": { "type": "object", "properties": { - "name": { - "type": "string" + "_embedded": { + "type": "object", + "properties": { + "clinics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClinicResponse" + } + } + } }, "_links": { "$ref": "#/components/schemas/Links" @@ -951,10 +931,22 @@ } } }, - "ClinicRequestBody": { + "EntityModelClinic": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "_links": { + "$ref": "#/components/schemas/Links" + } + }, "required": [ "name" - ], + ] + }, + "ClinicRequestBody": { "type": "object", "properties": { "id": { @@ -962,9 +954,13 @@ "format": "int64" }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } - } + }, + "required": [ + "name" + ] }, "DoctorRequestBody": { "type": "object", @@ -982,15 +978,16 @@ } }, "ClinicResponse": { - "required": [ - "name" - ], "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "minLength": 1 } - } + }, + "required": [ + "name" + ] }, "Link": { "type": "object", @@ -1020,6 +1017,12 @@ "type": "boolean" } } + }, + "Links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app102.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app102.json index 83c8687ea..9ed338d4d 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app102.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app102.json @@ -41,6 +41,7 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { + "minLength": 1, "type": "string" } }, @@ -157,4 +158,4 @@ } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-4.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-4.json index bb0a3df90..9b586f2bb 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-4.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app105-4.json @@ -38,14 +38,12 @@ "description": "the name", "required": true, "schema": { + "minLength": 1, "type": "string" } } ], "responses": { - "200": { - "description": "OK" - }, "400": { "description": "the map", "content": { @@ -58,6 +56,9 @@ } } } + }, + "200": { + "description": "OK" } } } @@ -75,12 +76,12 @@ "implicit": { "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", "scopes": { - "read:pets": "read your pets", - "write:pets": "modify pets in your account" + "write:pets": "modify pets in your account", + "read:pets": "read your pets" } } } } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app121.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app121.json index c315da65e..4f801212c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app121.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app121.json @@ -41,6 +41,7 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { + "minLength": 1, "type": "string" } }, @@ -148,38 +149,13 @@ }, "components": { "schemas": { - "Nested": { - "type": "object", - "properties": { - "param1": { - "type": "string", - "description": "The Param 1." - }, - "param2": { - "type": "integer", - "description": "The Param 2." - } - }, - "description": "The type Nested." - }, "InheritedRequestParams": { - "required": [ - "childParam" - ], "type": "object", "properties": { - "stringParam": { - "type": "string", - "description": "The String param." - }, - "stringParam1": { - "type": "string", - "description": "The String param 1.", - "deprecated": true - }, - "stringParam2": { + "childParam": { + "minLength": 1, "type": "string", - "description": "The String param 2." + "description": "parameter from child of RequestParams" }, "intParam": { "type": "integer", @@ -204,12 +180,35 @@ "$ref": "#/components/schemas/Nested" } }, - "childParam": { + "stringParam": { "type": "string", - "description": "parameter from child of RequestParams" + "description": "The String param." + }, + "stringParam1": { + "type": "string", + "description": "The String param 1.", + "deprecated": true + }, + "stringParam2": { + "type": "string", + "description": "The String param 2." } }, "description": "The type Inherited request params." + }, + "Nested": { + "type": "object", + "properties": { + "param1": { + "type": "string", + "description": "The Param 1." + }, + "param2": { + "type": "integer", + "description": "The Param 2." + } + }, + "description": "The type Nested." } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app14.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app14.json index 44127638b..433ad8c2c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app14.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app14.json @@ -54,6 +54,7 @@ "description": "the name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -67,4 +68,4 @@ } }, "components": {} -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app18.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app18.json index 8e2d55683..f36a238f9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app18.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app18.json @@ -32,6 +32,7 @@ "description": "the name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -50,14 +51,14 @@ } } }, - "/persons6": { + "/persons2": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 6 string.", - "description": "Persons 6 string.", - "operationId": "persons6", + "summary": "Persons 2 string.", + "description": "Persons 2 string.", + "operationId": "persons2", "parameters": [ { "name": "name", @@ -65,6 +66,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -83,24 +85,23 @@ } } }, - "/persons5": { + "/persons3": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 5 string.", - "description": "Persons 5 string.", - "operationId": "persons5", + "summary": "Persons 3 string.", + "description": "Persons 3 string.", + "operationId": "persons3", "parameters": [ { - "name": "age", + "name": "name", "in": "query", - "description": "the age", + "description": "persons name", "required": true, "schema": { - "maximum": 0, - "type": "integer", - "format": "int32" + "minLength": 1, + "type": "string" } } ], @@ -153,22 +154,24 @@ } } }, - "/persons3": { + "/persons5": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 3 string.", - "description": "Persons 3 string.", - "operationId": "persons3", + "summary": "Persons 5 string.", + "description": "Persons 5 string.", + "operationId": "persons5", "parameters": [ { - "name": "name", + "name": "age", "in": "query", - "description": "persons name", + "description": "the age", "required": true, "schema": { - "type": "string" + "maximum": 0, + "type": "integer", + "format": "int32" } } ], @@ -186,14 +189,14 @@ } } }, - "/persons2": { + "/persons6": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 2 string.", - "description": "Persons 2 string.", - "operationId": "persons2", + "summary": "Persons 6 string.", + "description": "Persons 6 string.", + "operationId": "persons6", "parameters": [ { "name": "name", @@ -201,6 +204,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -221,4 +225,4 @@ } }, "components": {} -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app19.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app19.json index 3dd1c963f..dd2dc29cd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app19.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app19.json @@ -49,24 +49,23 @@ } } }, - "/persons3": { + "/persons2": { "post": { "tags": [ "hello-controller" ], - "summary": "Persons 3 string.", - "description": "Persons 3 string.", - "operationId": "persons3", + "summary": "Persons 2 string.", + "description": "Persons 2 string.", + "operationId": "persons2", "requestBody": { - "description": "requestBody inside operation annotation", + "description": "requestBody description outside", "content": { "application/json": { "schema": { "type": "string" } } - }, - "required": true + } }, "responses": { "200": { @@ -82,23 +81,25 @@ } } }, - "/persons2": { + "/persons3": { "post": { "tags": [ "hello-controller" ], - "summary": "Persons 2 string.", - "description": "Persons 2 string.", - "operationId": "persons2", + "summary": "Persons 3 string.", + "description": "Persons 3 string.", + "operationId": "persons3", "requestBody": { - "description": "requestBody description outside", + "description": "requestBody inside operation annotation", "content": { "application/json": { "schema": { + "minLength": 1, "type": "string" } } - } + }, + "required": true }, "responses": { "200": { @@ -116,4 +117,4 @@ } }, "components": {} -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app21.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app21.json index b1ba1592c..2a345c798 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app21.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app21.json @@ -26,6 +26,7 @@ "description": "the name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -62,4 +63,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app23.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app23.json index 4065f7c35..5da3d64e8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app23.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app23.json @@ -32,6 +32,7 @@ "description": "the name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -59,4 +60,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app24.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app24.json index fefdd6375..aa7195855 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app24.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app24.json @@ -38,6 +38,7 @@ "description": "the name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -86,4 +87,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app102.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app102.json index c5b2139dd..debffb3ed 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app102.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app102.json @@ -41,7 +41,8 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } }, { @@ -143,6 +144,7 @@ "schemas": { "Nested": { "type": "object", + "description": "The type Nested.", "properties": { "param1": { "type": "string", @@ -152,8 +154,7 @@ "type": "integer", "description": "The Param 2." } - }, - "description": "The type Nested." + } } } } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-4.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-4.json index c5a35a361..437cc19b9 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-4.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app105-4.json @@ -38,14 +38,12 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], "responses": { - "200": { - "description": "OK" - }, "400": { "description": "the map", "content": { @@ -58,6 +56,9 @@ } } } + }, + "200": { + "description": "OK" } } } @@ -75,12 +76,12 @@ "implicit": { "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", "scopes": { - "read:pets": "read your pets", - "write:pets": "modify pets in your account" + "write:pets": "modify pets in your account", + "read:pets": "read your pets" } } } } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app121.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app121.json index ee3fc16e2..c6e907d00 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app121.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app121.json @@ -41,7 +41,8 @@ "description": "parameter from child of RequestParams", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } }, { @@ -154,7 +155,8 @@ "properties": { "childParam": { "type": "string", - "description": "parameter from child of RequestParams" + "description": "parameter from child of RequestParams", + "minLength": 1 }, "intParam": { "type": "integer", @@ -193,10 +195,7 @@ "type": "string", "description": "The String param 2." } - }, - "required": [ - "childParam" - ] + } }, "Nested": { "type": "object", diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app14.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app14.json index cae257649..1c0c724dd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app14.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app14.json @@ -17,28 +17,6 @@ } ], "paths": { - "/test": { - "get": { - "tags": [ - "hello-controller" - ], - "summary": "Demo 2 http entity.", - "description": "Demo 2 http entity.", - "operationId": "demo2", - "responses": { - "200": { - "description": "the http entity", - "content": { - "*/*": { - "schema": { - "type": "string" - } - } - } - } - } - } - }, "/persons": { "get": { "tags": [ @@ -54,7 +32,8 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -64,7 +43,29 @@ } } } + }, + "/test": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Demo 2 http entity.", + "description": "Demo 2 http entity.", + "operationId": "demo2", + "responses": { + "200": { + "description": "the http entity", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } } }, "components": {} -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app18.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app18.json index af987cb87..336311b8c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app18.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app18.json @@ -32,7 +32,8 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -50,14 +51,14 @@ } } }, - "/persons6": { + "/persons2": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 6 string.", - "description": "Persons 6 string.", - "operationId": "persons6", + "summary": "Persons 2 string.", + "description": "Persons 2 string.", + "operationId": "persons2", "parameters": [ { "name": "name", @@ -65,7 +66,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -83,24 +85,23 @@ } } }, - "/persons5": { + "/persons3": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 5 string.", - "description": "Persons 5 string.", - "operationId": "persons5", + "summary": "Persons 3 string.", + "description": "Persons 3 string.", + "operationId": "persons3", "parameters": [ { - "name": "age", + "name": "name", "in": "query", - "description": "the age", + "description": "persons name", "required": true, "schema": { - "maximum": 0, - "type": "integer", - "format": "int32" + "type": "string", + "minLength": 1 } } ], @@ -133,9 +134,9 @@ "description": "the age", "required": true, "schema": { - "minimum": 0, "type": "integer", - "format": "int32" + "format": "int32", + "minimum": 0 } } ], @@ -153,22 +154,24 @@ } } }, - "/persons3": { + "/persons5": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 3 string.", - "description": "Persons 3 string.", - "operationId": "persons3", + "summary": "Persons 5 string.", + "description": "Persons 5 string.", + "operationId": "persons5", "parameters": [ { - "name": "name", + "name": "age", "in": "query", - "description": "persons name", + "description": "the age", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32", + "maximum": 0 } } ], @@ -186,14 +189,14 @@ } } }, - "/persons2": { + "/persons6": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 2 string.", - "description": "Persons 2 string.", - "operationId": "persons2", + "summary": "Persons 6 string.", + "description": "Persons 6 string.", + "operationId": "persons6", "parameters": [ { "name": "name", @@ -201,7 +204,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -221,4 +225,4 @@ } }, "components": {} -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app19.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app19.json index 615738628..05f18e453 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app19.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app19.json @@ -49,24 +49,23 @@ } } }, - "/persons3": { + "/persons2": { "post": { "tags": [ "hello-controller" ], - "summary": "Persons 3 string.", - "description": "Persons 3 string.", - "operationId": "persons3", + "summary": "Persons 2 string.", + "description": "Persons 2 string.", + "operationId": "persons2", "requestBody": { - "description": "requestBody inside operation annotation", + "description": "requestBody description outside", "content": { "application/json": { "schema": { "type": "string" } } - }, - "required": true + } }, "responses": { "200": { @@ -82,23 +81,25 @@ } } }, - "/persons2": { + "/persons3": { "post": { "tags": [ "hello-controller" ], - "summary": "Persons 2 string.", - "description": "Persons 2 string.", - "operationId": "persons2", + "summary": "Persons 3 string.", + "description": "Persons 3 string.", + "operationId": "persons3", "requestBody": { - "description": "requestBody description outside", + "description": "requestBody inside operation annotation", "content": { "application/json": { "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } - } + }, + "required": true }, "responses": { "200": { @@ -116,4 +117,4 @@ } }, "components": {} -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app21.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app21.json index 75ef58948..b38e15f4b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app21.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app21.json @@ -26,7 +26,8 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -54,12 +55,12 @@ "implicit": { "authorizationUrl": "http://personstore.swagger.io/oauth/dialog", "scopes": { - "write:persons": "modify persons in your account", - "read:persons": "read your persons" + "read:persons": "read your persons", + "write:persons": "modify persons in your account" } } } } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app23.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app23.json index 88155203a..bbe23f4d1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app23.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app23.json @@ -32,7 +32,8 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -59,4 +60,4 @@ } } } -} \ No newline at end of file +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app24.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app24.json index 7575323f0..7a11db8b8 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app24.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app24.json @@ -38,7 +38,8 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -74,16 +75,16 @@ } }, "securitySchemes": { - "basicScheme": { - "type": "http", - "scheme": "basic" - }, "Authorization": { "type": "apiKey", "description": "A core-auth Bearer token", "name": "Authorization", "in": "header" + }, + "basicScheme": { + "type": "http", + "scheme": "basic" } } } -} \ No newline at end of file +} From 569d4ff3633843553736c7ecf537c49d66243bf9 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 20 Mar 2025 10:49:17 +0100 Subject: [PATCH 215/226] swagger-ui upgrade to 5.20.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7454cf98f..3b4aec626 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.5.3 1.6.8 2.2.29 - 5.20.0 + 5.20.1 1.13.1 0.9.1 0.15.0 From 4412fd04ea20d8796f619cbaeee2f553456d8048 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 20 Mar 2025 12:49:01 +0100 Subject: [PATCH 216/226] spring-cloud-function upgrade to 4.2.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3b4aec626..a2b000f6b 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 1.13.1 0.9.1 0.15.0 - 4.2.1 + 4.2.2 1.4.0
From c07093cf1bc3bf1a7cd2b5195b5eaa0bfb842ed6 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Thu, 20 Mar 2025 14:36:14 +0100 Subject: [PATCH 217/226] ModelResolver.enumAsRef = true result in invalid openapi with actuator using enum param #2905 --- .../api/AbstractOpenApiResource.java | 14 +- .../ActuatorOperationCustomizer.java | 44 +- .../GlobalOperationComponentsCustomizer.java | 52 + .../api/v30/app187/SpringDocApp187Test.java | 51 + .../test/resources/results/3.0.1/app187.json | 894 ++++++++++++++++++ 5 files changed, 1034 insertions(+), 21 deletions(-) create mode 100644 springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationComponentsCustomizer.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app187.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index ff078da72..e403ea34d 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -86,6 +86,7 @@ import org.slf4j.LoggerFactory; import org.springdoc.core.annotations.RouterOperations; import org.springdoc.core.customizers.DataRestRouterOperationCustomizer; +import org.springdoc.core.customizers.GlobalOperationComponentsCustomizer; import org.springdoc.core.customizers.OpenApiLocaleCustomizer; import org.springdoc.core.customizers.OperationCustomizer; import org.springdoc.core.customizers.RouterOperationCustomizer; @@ -649,7 +650,7 @@ protected void calculatePath(HandlerMethod handlerMethod, RouterOperation router buildCallbacks(openAPI, methodAttributes, operation, apiCallbacks); // allow for customisation - operation = customizeOperation(operation, handlerMethod); + operation = customizeOperation(operation, components, handlerMethod); if (StringUtils.contains(operationPath, "*")) { Matcher matcher = pathPattern.matcher(operationPath); @@ -1011,15 +1012,20 @@ protected Set getDefaultAllowedHttpMethods() { * Customise operation. * * @param operation the operation + * @param components * @param handlerMethod the handler method * @return the operation */ - protected Operation customizeOperation(Operation operation, HandlerMethod handlerMethod) { + protected Operation customizeOperation(Operation operation, Components components, HandlerMethod handlerMethod) { Optional> optionalOperationCustomizers = springDocCustomizers.getOperationCustomizers(); if (optionalOperationCustomizers.isPresent()) { Set operationCustomizerList = optionalOperationCustomizers.get(); - for (OperationCustomizer operationCustomizer : operationCustomizerList) - operation = operationCustomizer.customize(operation, handlerMethod); + for (OperationCustomizer operationCustomizer : operationCustomizerList) { + if (operationCustomizer instanceof GlobalOperationComponentsCustomizer globalOperationComponentsCustomizer) + operation = globalOperationComponentsCustomizer.customize(operation, components, handlerMethod); + else + operation = operationCustomizer.customize(operation, handlerMethod); + } } return operation; } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java index df37c2b43..98e83c24c 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/ActuatorOperationCustomizer.java @@ -21,7 +21,7 @@ * * * * * * * * * - * + * */ package org.springdoc.core.customizers; @@ -31,6 +31,7 @@ import io.swagger.v3.core.util.AnnotationsUtils; import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Content; import io.swagger.v3.oas.models.media.MediaType; @@ -61,7 +62,7 @@ * * @author bnasslahsen */ -public class ActuatorOperationCustomizer implements GlobalOperationCustomizer { +public class ActuatorOperationCustomizer implements GlobalOperationComponentsCustomizer { /** * The constant OPERATION. @@ -94,11 +95,11 @@ public ActuatorOperationCustomizer(SpringDocConfigProperties springDocConfigProp } @Override - public Operation customize(Operation operation, HandlerMethod handlerMethod) { + public Operation customize(Operation operation, Components components, HandlerMethod handlerMethod) { if (operationHasValidTag(operation)) { Field operationField = FieldUtils.getDeclaredField(handlerMethod.getBean().getClass(), OPERATION,true); if (operationField != null) { - processOperationField(handlerMethod, operation, operationField); + processOperationField(handlerMethod, operation, components, operationField); } setOperationSummary(operation, handlerMethod); } @@ -120,16 +121,17 @@ private boolean operationHasValidTag(Operation operation) { * * @param handlerMethod the handler method * @param operation the operation + * @param components the components * @param operationField the operation field */ - private void processOperationField(HandlerMethod handlerMethod, Operation operation, Field operationField) { + private void processOperationField(HandlerMethod handlerMethod, Operation operation, Components components, Field operationField) { try { Object actuatorOperation = operationField.get(handlerMethod.getBean()); Field actuatorOperationField = FieldUtils.getDeclaredField(actuatorOperation.getClass(), OPERATION, true); if (actuatorOperationField != null) { AbstractDiscoveredOperation discoveredOperation = (AbstractDiscoveredOperation) actuatorOperationField.get(actuatorOperation); - handleOperationMethod(discoveredOperation.getOperationMethod(), operation); + handleOperationMethod(discoveredOperation.getOperationMethod(), components, operation); } } catch (IllegalAccessException e) { @@ -141,25 +143,26 @@ private void processOperationField(HandlerMethod handlerMethod, Operation operat * Handle operation method. * * @param operationMethod the operation method + * @param components the components * @param operation the operation */ - private void handleOperationMethod(OperationMethod operationMethod, Operation operation) { + private void handleOperationMethod(OperationMethod operationMethod, Components components, Operation operation) { String operationId = operationMethod.getMethod().getName(); operation.setOperationId(operationId); switch (operationMethod.getOperationType()) { case READ: - addParameters(operationMethod, operation, ParameterIn.QUERY); + addParameters(operationMethod, operation, components, ParameterIn.QUERY); break; case WRITE: - addWriteParameters(operationMethod, operation); + addWriteParameters(operationMethod,components, operation); operation.setResponses(new ApiResponses() .addApiResponse(String.valueOf(HttpStatus.NO_CONTENT.value()), new ApiResponse().description(HttpStatus.NO_CONTENT.getReasonPhrase())) .addApiResponse(String.valueOf(HttpStatus.BAD_REQUEST.value()), new ApiResponse().description(HttpStatus.BAD_REQUEST.getReasonPhrase()))); break; case DELETE: operation.setResponses(new ApiResponses().addApiResponse(String.valueOf(HttpStatus.NO_CONTENT.value()), new ApiResponse().description(HttpStatus.NO_CONTENT.getReasonPhrase()))); - addParameters(operationMethod, operation, ParameterIn.QUERY); + addParameters(operationMethod, operation, components, ParameterIn.QUERY); break; default: break; @@ -171,13 +174,14 @@ private void handleOperationMethod(OperationMethod operationMethod, Operation op * * @param operationMethod the operation method * @param operation the operation + * @param components the components * @param parameterIn the parameter in */ - private void addParameters(OperationMethod operationMethod, Operation operation, ParameterIn parameterIn) { + private void addParameters(OperationMethod operationMethod, Operation operation, Components components, ParameterIn parameterIn) { for (OperationParameter operationParameter : operationMethod.getParameters()) { Parameter parameter = getParameterFromField(operationParameter); if(parameter == null) continue; - Schema schema = resolveSchema(parameter); + Schema schema = resolveSchema(parameter, components); if (parameter.getAnnotation(Selector.class) != null) { operation.addParametersItem(new io.swagger.v3.oas.models.parameters.PathParameter() .name(parameter.getName()) @@ -197,13 +201,14 @@ else if (isValidParameterType(parameter)) { * Add write parameters. * * @param operationMethod the operation method + * @param components the components * @param operation the operation */ - private void addWriteParameters(OperationMethod operationMethod, Operation operation) { + private void addWriteParameters(OperationMethod operationMethod, Components components, Operation operation) { for (OperationParameter operationParameter : operationMethod.getParameters()) { Parameter parameter = getParameterFromField(operationParameter); if(parameter == null) continue; - Schema schema = resolveSchema(parameter); + Schema schema = resolveSchema(parameter, components); if (parameter.getAnnotation(Selector.class) != null) { operation.addParametersItem(new io.swagger.v3.oas.models.parameters.PathParameter() .name(parameter.getName()) @@ -237,11 +242,12 @@ private Parameter getParameterFromField(OperationParameter operationParameter) { /** * Resolve schema schema. * - * @param parameter the parameter + * @param parameter the parameter + * @param components * @return the schema */ - private Schema resolveSchema(Parameter parameter) { - Schema schema = AnnotationsUtils.resolveSchemaFromType(parameter.getType(), null, null, springDocConfigProperties.isOpenapi31()); + private Schema resolveSchema(Parameter parameter, Components components) { + Schema schema = AnnotationsUtils.resolveSchemaFromType(parameter.getType(), components, null, springDocConfigProperties.isOpenapi31()); if(springDocConfigProperties.isOpenapi31()) handleSchemaTypes(schema); return schema; } @@ -271,4 +277,8 @@ private void setOperationSummary(Operation operation, HandlerMethod handlerMetho } } + @Override + public Operation customize(Operation operation, HandlerMethod handlerMethod) { + return this.customize(operation, null, handlerMethod); + } } diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationComponentsCustomizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationComponentsCustomizer.java new file mode 100644 index 000000000..b63ad3f33 --- /dev/null +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/customizers/GlobalOperationComponentsCustomizer.java @@ -0,0 +1,52 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package org.springdoc.core.customizers; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.Operation; + +import org.springframework.web.method.HandlerMethod; + +/** + * Implement and register a bean of type {@link GlobalOperationComponentsCustomizer} to + * customize an operation based on the components and handler method input on default OpenAPI + * description and groups + * + * @author christophejan + * @see OperationCustomizer operations on default OpenAPI description but not groups + */ +public interface GlobalOperationComponentsCustomizer extends GlobalOperationCustomizer { + + /** + * Customize operation. + * + * @param operation input operation + * @param handlerMethod original handler method + * @return customized operation + */ + Operation customize(Operation operation, Components components, HandlerMethod handlerMethod); +} diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java new file mode 100644 index 000000000..d7ce2c38e --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api/v30/app187/SpringDocApp187Test.java @@ -0,0 +1,51 @@ +/* + * + * * + * * * + * * * * + * * * * * Copyright 2019-2024 the original author or authors. + * * * * * + * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * you may not use this file except in compliance with the License. + * * * * * You may obtain a copy of the License at + * * * * * + * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * + * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * See the License for the specific language governing permissions and + * * * * * limitations under the License. + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v30.app187; + +import org.junit.jupiter.api.AfterAll; +import test.org.springdoc.api.v30.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +@TestPropertySource(properties = { "springdoc.show-actuator=true", + "management.endpoints.web.exposure.include=*", + "management.endpoints.enabled-by-default=true", + "management.endpoints.web.exposure.exclude=functions, shutdown" }) +public class SpringDocApp187Test extends AbstractSpringDocTest { + + static { + io.swagger.v3.core.jackson.ModelResolver.enumsAsRef = true; + } + + @AfterAll + static void restore() { + io.swagger.v3.core.jackson.ModelResolver.enumsAsRef = false; + } + + @SpringBootApplication + static class SpringDocTestApp {} + +} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app187.json b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app187.json new file mode 100644 index 000000000..570e9ddce --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/src/test/resources/results/3.0.1/app187.json @@ -0,0 +1,894 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + } + ], + "paths": { + "/actuator/loggers/{name}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggerLevels", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "configureLogLevel", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LogLevel" + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + } + } + } + }, + "/actuator": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + } + } + } + } + } + }, + "/actuator/threaddump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threadDump", + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/scheduledtasks": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'scheduledtasks'", + "operationId": "scheduledTasks", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/sbom": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom'", + "operationId": "sboms", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/sbom/{id}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'sbom-id'", + "operationId": "sbom", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/metrics": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics'", + "operationId": "listNames", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/metrics/{requiredMetricName}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metric", + "parameters": [ + { + "name": "requiredMetricName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/mappings": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'mappings'", + "operationId": "mappings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/loggers": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/info": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/heapdump": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapDump", + "parameters": [ + { + "name": "live", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/health": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/env": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env'", + "operationId": "environment", + "parameters": [ + { + "name": "pattern", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/env/{toMatch}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'env-toMatch'", + "operationId": "environmentEntry", + "parameters": [ + { + "name": "toMatch", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/configprops": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops'", + "operationId": "configurationProperties", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/configprops/{prefix}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'configprops-prefix'", + "operationId": "configurationPropertiesWithPrefix", + "parameters": [ + { + "name": "prefix", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/conditions": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'conditions'", + "operationId": "conditions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + }, + "/actuator/caches": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "caches", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches'", + "operationId": "clearCaches", + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/actuator/caches/{cache}": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "cache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'caches-cache'", + "operationId": "clearCache", + "parameters": [ + { + "name": "cache", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cacheManager", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/actuator/beans": { + "get": { + "tags": [ + "Actuator" + ], + "summary": "Actuator web endpoint 'beans'", + "operationId": "beans", + "responses": { + "200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": { + "schema": { + "type": "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json": { + "schema": { + "type": "object" + } + }, + "application/json": { + "schema": { + "type": "object" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "LogLevel": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + } + } + } + } +} From 65ae8ba90445283f26369f84b76b5cf4713db9e5 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 22 Mar 2025 12:16:29 +0100 Subject: [PATCH 218/226] Add Future to ignored response wrappers. Fixes #2917. --- .../configuration/SpringDocConfiguration.java | 4 +- .../api/v31/app129/HelloController.java | 9 ++++ .../test/resources/results/3.1.0/app129.json | 46 +++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index 58c7ad34d..a8de59cbe 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -34,6 +34,7 @@ import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.concurrent.Future; import com.fasterxml.jackson.databind.node.ObjectNode; import com.querydsl.core.types.Predicate; @@ -153,7 +154,8 @@ public class SpringDocConfiguration { static { getConfig().replaceWithSchema(ObjectNode.class, new ObjectSchema()) .replaceWithClass(Charset.class, String.class) - .addResponseWrapperToIgnore(DeferredResult.class); + .addResponseWrapperToIgnore(DeferredResult.class) + .addResponseWrapperToIgnore(Future.class); } /** diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java index a52df52e7..18c4e838c 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app129/HelloController.java @@ -24,6 +24,8 @@ package test.org.springdoc.api.v31.app129; +import java.util.concurrent.CompletableFuture; + import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; @@ -43,4 +45,11 @@ public DeferredResult> update( @RequestBody ActualReturnedEntity entity) throws Exception { return null; } + + @PostMapping("/test2") + @ApiResponses({ @ApiResponse(responseCode = "200") }) + public CompletableFuture> update2( + @RequestBody ActualReturnedEntity entity) throws Exception { + return null; + } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app129.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app129.json index d6e5547d1..45758749f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app129.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app129.json @@ -56,6 +56,52 @@ } } } + }, + "/api/test2": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "update2", + "parameters": [ + { + "name": "userId", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "registrationId", + "in": "header", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActualReturnedEntity" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/OperationResponseActualReturnedEntity" + } + } + } + } + } + } } }, "components": { From c32a017aeb74cf41baef81f07e659e0343dcc8e7 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 22 Mar 2025 14:21:57 +0100 Subject: [PATCH 219/226] OpenAPIService serverBaseUrl is not thread safe. Fixes #2931 --- .../api/AbstractOpenApiResource.java | 11 +++-- .../core/service/OpenAPIService.java | 17 +++----- .../core/utils/PropertyResolverUtils.java | 3 +- .../api/AbstractOpenApiResourceTest.java | 40 +++++++++---------- .../webflux/api/OpenApiActuatorResource.java | 4 +- .../webflux/api/OpenApiResource.java | 12 +++--- .../springdoc/webmvc/api/OpenApiResource.java | 13 +++--- .../api/v30/app239/SpringDocApp239Test.java | 3 +- .../api/v30/app242/SpringDocApp242Test.java | 3 +- .../api/v30/app243/HelloController.java | 2 +- .../api/v30/app243/SpringDocApp243Test.java | 3 +- .../api/v31/app239/SpringDocApp239Test.java | 3 +- .../api/v31/app242/SpringDocApp242Test.java | 3 +- 13 files changed, 58 insertions(+), 59 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index e403ea34d..1961ed1f7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -256,7 +256,7 @@ protected AbstractOpenApiResource(String groupName, ObjectFactory this.getOpenApi(Locale.forLanguageTag(locale))); + Executors.newSingleThreadExecutor().execute(() -> this.getOpenApi(null, Locale.forLanguageTag(locale))); } } } @@ -334,7 +334,7 @@ public static void setModelAndViewClass(Class modelAndViewClass) { * Gets open api. */ private void getOpenApi() { - this.getOpenApi(Locale.getDefault()); + this.getOpenApi(null, Locale.getDefault()); } /** @@ -343,7 +343,7 @@ private void getOpenApi() { * @param locale the locale * @return the open api */ - protected OpenAPI getOpenApi(Locale locale) { + protected OpenAPI getOpenApi(String serverBaseUrl, Locale locale) { this.reentrantLock.lock(); try { final OpenAPI openAPI; @@ -384,7 +384,7 @@ protected OpenAPI getOpenApi(Locale locale) { openAPIService.setServersPresent(true); else openAPIService.setServersPresent(false); - openAPIService.updateServers(openAPI); + openAPIService.updateServers(serverBaseUrl, openAPI); if (springDocConfigProperties.isRemoveBrokenReferenceDefinitions()) this.removeBrokenReferenceDefinitions(openAPI); @@ -413,9 +413,8 @@ protected OpenAPI getOpenApi(Locale locale) { else { LOGGER.debug("Fetching openApi document from cache"); openAPI = openAPIService.getCachedOpenAPI(finalLocale); - openAPIService.updateServers(openAPI); + openAPIService.updateServers(serverBaseUrl, openAPI); } - openAPIService.updateServers(openAPI); return openAPI; } finally { diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java index 1d382c7db..81da0f0ea 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OpenAPIService.java @@ -174,11 +174,6 @@ public class OpenAPIService implements ApplicationContextAware { */ private boolean isServersPresent; - /** - * The Server base url. - */ - private String serverBaseUrl; - /** * Instantiates a new Open api builder. * @@ -296,9 +291,10 @@ private void initializeHiddenRestController() { /** * Update servers open api. * - * @param openAPI the open api + * @param serverBaseUrl the server base url + * @param openAPI the open api */ - public void updateServers(OpenAPI openAPI) { + public void updateServers(String serverBaseUrl, OpenAPI openAPI) { if (!isServersPresent && serverBaseUrl != null) // default server value { Server server = new Server().url(serverBaseUrl).description(DEFAULT_SERVER_DESCRIPTION); @@ -493,18 +489,17 @@ public Schema resolveProperties(Schema schema, Locale locale) { * * @param serverBaseUrl the server base url * @param httpRequest the http request + * @return the string */ - public void setServerBaseUrl(String serverBaseUrl, HttpRequest httpRequest) { + public String calculateServerBaseUrl(String serverBaseUrl, HttpRequest httpRequest) { String customServerBaseUrl = serverBaseUrl; - if (serverBaseUrlCustomizers.isPresent()) { for (ServerBaseUrlCustomizer customizer : serverBaseUrlCustomizers.get()) { customServerBaseUrl = customizer.customize(customServerBaseUrl, httpRequest); } } - this.serverBaseUrl = customServerBaseUrl; - + return customServerBaseUrl; } /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java index a98d7a5e3..741179df7 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/PropertyResolverUtils.java @@ -30,10 +30,9 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; - -import io.swagger.v3.oas.models.SpecVersion; import java.util.stream.Collectors; +import io.swagger.v3.oas.models.SpecVersion; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springdoc.core.properties.SpringDocConfigProperties; diff --git a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java index 202711f48..6dda9c0c2 100644 --- a/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java +++ b/springdoc-openapi-starter-common/src/test/java/org/springdoc/api/AbstractOpenApiResourceTest.java @@ -167,7 +167,7 @@ springDocProviders,new SpringDocCustomizers(Optional.empty(),Optional.empty(),Op resource.calculatePath(routerOperation, Locale.getDefault(), this.openAPI); - final List parameters = resource.getOpenApi(Locale.getDefault()).getPaths().get(PATH+"/{"+PARAMETER_WITH_NUMBER_SCHEMA_NAME+"}").getGet().getParameters(); + final List parameters = resource.getOpenApi(null, Locale.getDefault()).getPaths().get(PATH+"/{"+PARAMETER_WITH_NUMBER_SCHEMA_NAME+"}").getGet().getParameters(); assertThat(parameters.size(), is(3)); assertThat(parameters, containsInAnyOrder(refParameter, numberParameterInPath, parameterWithoutSchema)); @@ -189,10 +189,10 @@ springDocProviders,new SpringDocCustomizers(Optional.empty(),Optional.empty(),Op @Test void preLoadingModeShouldNotOverwriteServers() throws InterruptedException { - doCallRealMethod().when(openAPIService).updateServers(any()); + doCallRealMethod().when(openAPIService).updateServers(any(), any()); when(openAPIService.getCachedOpenAPI(any())).thenCallRealMethod(); doAnswer(new CallsRealMethods()).when(openAPIService).setServersPresent(true); - doAnswer(new CallsRealMethods()).when(openAPIService).setServerBaseUrl(any(), any()); + doAnswer(new CallsRealMethods()).when(openAPIService).calculateServerBaseUrl(any(), any()); doAnswer(new CallsRealMethods()).when(openAPIService).setCachedOpenAPI(any(), any()); String customUrl = "https://custom.com"; @@ -214,19 +214,19 @@ properties, springDocProviders, new SpringDocCustomizers(Optional.of(singleton(o Thread.sleep(1_000); // emulate generating base url - openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); - openAPIService.updateServers(openAPI); + String serverBaseUrl = openAPIService.calculateServerBaseUrl(generatedUrl, new MockClientHttpRequest()); + openAPIService.updateServers(serverBaseUrl, openAPI); Locale locale = Locale.US; - OpenAPI after = resource.getOpenApi(locale); + OpenAPI after = resource.getOpenApi(serverBaseUrl,locale); assertThat(after.getServers().get(0).getUrl(), is(customUrl)); } @Test void serverBaseUrlCustomisersTest() throws InterruptedException { - doCallRealMethod().when(openAPIService).updateServers(any()); + doCallRealMethod().when(openAPIService).updateServers(any(), any()); when(openAPIService.getCachedOpenAPI(any())).thenCallRealMethod(); - doAnswer(new CallsRealMethods()).when(openAPIService).setServerBaseUrl(any(), any()); + doAnswer(new CallsRealMethods()).when(openAPIService).calculateServerBaseUrl(any(), any()); doAnswer(new CallsRealMethods()).when(openAPIService).setCachedOpenAPI(any(), any()); SpringDocConfigProperties properties = new SpringDocConfigProperties(); @@ -249,9 +249,9 @@ springDocProviders, new SpringDocCustomizers(Optional.empty(),Optional.empty(),O // Test that setting generated URL works fine with no customizers present String generatedUrl = "https://generated-url.com/context-path"; - openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); - openAPIService.updateServers(openAPI); - OpenAPI after = resource.getOpenApi(locale); + String serverUrl = openAPIService.calculateServerBaseUrl(generatedUrl, new MockClientHttpRequest()); + openAPIService.updateServers(serverUrl, openAPI); + OpenAPI after = resource.getOpenApi(serverUrl, locale); assertThat(after.getServers().get(0).getUrl(), is(generatedUrl)); // Test that adding a serverBaseUrlCustomizer has the desired effect @@ -260,9 +260,9 @@ springDocProviders, new SpringDocCustomizers(Optional.empty(),Optional.empty(),O serverBaseUrlCustomizerList.add(serverBaseUrlCustomizer); ReflectionTestUtils.setField(openAPIService, "serverBaseUrlCustomizers", Optional.of(serverBaseUrlCustomizerList)); - openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); - openAPIService.updateServers(openAPI); - after = resource.getOpenApi(locale); + serverUrl = openAPIService.calculateServerBaseUrl(generatedUrl, new MockClientHttpRequest()); + openAPIService.updateServers(serverUrl, openAPI); + after = resource.getOpenApi(serverUrl, locale); assertThat(after.getServers().get(0).getUrl(), is("https://generated-url.com")); // Test that serverBaseUrlCustomisers are performed in order @@ -270,18 +270,18 @@ springDocProviders, new SpringDocCustomizers(Optional.empty(),Optional.empty(),O ServerBaseUrlCustomizer serverBaseUrlCustomiser2 = (serverBaseUrl, request) -> serverBaseUrl.replace("/context-path/second-path", ""); serverBaseUrlCustomizerList.add(serverBaseUrlCustomiser2); - openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); - openAPIService.updateServers(openAPI); - after = resource.getOpenApi(locale); + serverUrl = openAPIService.calculateServerBaseUrl(generatedUrl, new MockClientHttpRequest()); + openAPIService.updateServers(serverUrl, openAPI); + after = resource.getOpenApi(serverUrl, locale); assertThat(after.getServers().get(0).getUrl(), is("https://generated-url.com/second-path")); // Test that all serverBaseUrlCustomisers in the List are performed ServerBaseUrlCustomizer serverBaseUrlCustomiser3 = (serverBaseUrl, request) -> serverBaseUrl.replace("/second-path", ""); serverBaseUrlCustomizerList.add(serverBaseUrlCustomiser3); - openAPIService.setServerBaseUrl(generatedUrl, new MockClientHttpRequest()); - openAPIService.updateServers(openAPI); - after = resource.getOpenApi(locale); + serverUrl = openAPIService.calculateServerBaseUrl(generatedUrl, new MockClientHttpRequest()); + openAPIService.updateServers(serverUrl, openAPI); + after = resource.getOpenApi(serverUrl, locale); assertThat(after.getServers().get(0).getUrl(), is("https://generated-url.com")); } diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java index 715cb0c90..f9bc6c95a 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiActuatorResource.java @@ -131,10 +131,10 @@ public Mono openapiYaml(ServerHttpRequest serverHttpRequest, Locale loca } @Override - protected void calculateServerUrl(ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) { + protected String calculateServerUrl(ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) { super.initOpenAPIBuilder(locale); URI uri = getActuatorURI(serverHttpRequest.getURI().getScheme(), serverHttpRequest.getURI().getHost()); - openAPIService.setServerBaseUrl(uri.toString(), serverHttpRequest); + return openAPIService.calculateServerBaseUrl(uri.toString(), serverHttpRequest); } @Override diff --git a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java index da2e12e21..aa1a1a836 100644 --- a/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/api/OpenApiResource.java @@ -119,8 +119,8 @@ protected OpenApiResource(ObjectFactory openAPIBuilderObjectFact */ protected Mono openapiJson(ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) throws JsonProcessingException { - calculateServerUrl(serverHttpRequest, apiDocsUrl, locale); - OpenAPI openAPI = this.getOpenApi(locale); + String serverBaseUrl= calculateServerUrl(serverHttpRequest, apiDocsUrl, locale); + OpenAPI openAPI = this.getOpenApi(serverBaseUrl, locale); return Mono.just(writeJsonValue(openAPI)); } @@ -135,8 +135,8 @@ protected Mono openapiJson(ServerHttpRequest serverHttpRequest, String a */ protected Mono openapiYaml(ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) throws JsonProcessingException { - calculateServerUrl(serverHttpRequest, apiDocsUrl, locale); - OpenAPI openAPI = this.getOpenApi(locale); + String serverBaseUrl = calculateServerUrl(serverHttpRequest, apiDocsUrl, locale); + OpenAPI openAPI = this.getOpenApi(serverBaseUrl, locale); return Mono.just(writeYamlValue(openAPI)); } @@ -233,10 +233,10 @@ protected void getWebFluxRouterFunctionPaths(Locale locale, OpenAPI openAPI) { * @param apiDocsUrl the api docs url * @param locale the locale */ - protected void calculateServerUrl(ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) { + protected String calculateServerUrl(ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) { initOpenAPIBuilder(locale); String serverUrl = getServerUrl(serverHttpRequest, apiDocsUrl); - openAPIService.setServerBaseUrl(serverUrl, serverHttpRequest); + return openAPIService.calculateServerBaseUrl(serverUrl, serverHttpRequest); } /** diff --git a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java index c4557a5be..0069e9a5d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java +++ b/springdoc-openapi-starter-webmvc-api/src/main/java/org/springdoc/webmvc/api/OpenApiResource.java @@ -123,8 +123,8 @@ protected OpenApiResource(ObjectFactory openAPIBuilderObjectFact public byte[] openapiJson(HttpServletRequest request, String apiDocsUrl, Locale locale) throws JsonProcessingException { - calculateServerUrl(request, apiDocsUrl, locale); - OpenAPI openAPI = this.getOpenApi(locale); + String serverBaseUrl=calculateServerUrl(request, apiDocsUrl, locale); + OpenAPI openAPI = this.getOpenApi(serverBaseUrl,locale); return writeJsonValue(openAPI); } @@ -140,8 +140,8 @@ public byte[] openapiJson(HttpServletRequest request, public byte[] openapiYaml(HttpServletRequest request, String apiDocsUrl, Locale locale) throws JsonProcessingException { - calculateServerUrl(request, apiDocsUrl, locale); - OpenAPI openAPI = this.getOpenApi(locale); + String serverBaseUrl=calculateServerUrl(request, apiDocsUrl, locale); + OpenAPI openAPI = this.getOpenApi(serverBaseUrl, locale); return writeYamlValue(openAPI); } @@ -248,12 +248,13 @@ private Comparator byReversedRequestMappingInfos() { * @param request the request * @param apiDocsUrl the api docs url * @param locale the locale + * @return the string */ - protected void calculateServerUrl(HttpServletRequest request, String apiDocsUrl, Locale locale) { + protected String calculateServerUrl(HttpServletRequest request, String apiDocsUrl, Locale locale) { super.initOpenAPIBuilder(locale); String calculatedUrl = getServerUrl(request, apiDocsUrl); ServletServerHttpRequest serverRequest = request != null ? new ServletServerHttpRequest(request) : null; - openAPIService.setServerBaseUrl(calculatedUrl, serverRequest); + return openAPIService.calculateServerBaseUrl(calculatedUrl, serverRequest); } /** diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java index 122f279a5..056aab387 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app239/SpringDocApp239Test.java @@ -24,9 +24,10 @@ package test.org.springdoc.api.v30.app239; -import org.springframework.boot.autoconfigure.SpringBootApplication; import test.org.springdoc.api.v30.AbstractSpringDocV30Test; +import org.springframework.boot.autoconfigure.SpringBootApplication; + public class SpringDocApp239Test extends AbstractSpringDocV30Test { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/SpringDocApp242Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/SpringDocApp242Test.java index deacc6533..5f3e8fed4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/SpringDocApp242Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app242/SpringDocApp242Test.java @@ -24,9 +24,10 @@ package test.org.springdoc.api.v30.app242; -import org.springframework.boot.autoconfigure.SpringBootApplication; import test.org.springdoc.api.v30.AbstractSpringDocV30Test; +import org.springframework.boot.autoconfigure.SpringBootApplication; + public class SpringDocApp242Test extends AbstractSpringDocV30Test { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/HelloController.java index 021fdf4ee..8220f7aab 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/HelloController.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/HelloController.java @@ -26,9 +26,9 @@ package test.org.springdoc.api.v30.app243; -import com.fasterxml.jackson.annotation.JsonSubTypes; import io.swagger.v3.oas.annotations.media.DiscriminatorMapping; import io.swagger.v3.oas.annotations.media.Schema; + import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/SpringDocApp243Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/SpringDocApp243Test.java index f6ceacf4d..d7af04c6f 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/SpringDocApp243Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app243/SpringDocApp243Test.java @@ -24,9 +24,10 @@ package test.org.springdoc.api.v30.app243; -import org.springframework.boot.autoconfigure.SpringBootApplication; import test.org.springdoc.api.v30.AbstractSpringDocV30Test; +import org.springframework.boot.autoconfigure.SpringBootApplication; + public class SpringDocApp243Test extends AbstractSpringDocV30Test { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/SpringDocApp239Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/SpringDocApp239Test.java index efa593ebc..39043b27d 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/SpringDocApp239Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app239/SpringDocApp239Test.java @@ -24,9 +24,10 @@ package test.org.springdoc.api.v31.app239; -import org.springframework.boot.autoconfigure.SpringBootApplication; import test.org.springdoc.api.v31.AbstractSpringDocTest; +import org.springframework.boot.autoconfigure.SpringBootApplication; + public class SpringDocApp239Test extends AbstractSpringDocTest { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/SpringDocApp242Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/SpringDocApp242Test.java index f3646899c..0479825a4 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/SpringDocApp242Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app242/SpringDocApp242Test.java @@ -24,9 +24,10 @@ package test.org.springdoc.api.v31.app242; -import org.springframework.boot.autoconfigure.SpringBootApplication; import test.org.springdoc.api.v30.AbstractSpringDocV30Test; +import org.springframework.boot.autoconfigure.SpringBootApplication; + public class SpringDocApp242Test extends AbstractSpringDocV30Test { @SpringBootApplication From 7e45bea29590349c0e86e7326624a69e75573295 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 22 Mar 2025 16:01:54 +0100 Subject: [PATCH 220/226] Wrong schema generation with PagedModel generated VIA_DTO and wrapped in ResponseEntity. Fixes #2933 --- .../core/converters/PageOpenAPIConverter.java | 14 ++-- .../api/v30/app10/HelloController.java | 10 +++ .../resources/results/3.0.1/app10-direct.json | 77 +++++++++++++++++++ .../results/3.0.1/app10-via_dto.json | 45 +++++++++++ 4 files changed, 138 insertions(+), 8 deletions(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java index 34e7e7f3a..4b4f3d8f6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/PageOpenAPIConverter.java @@ -26,7 +26,6 @@ package org.springdoc.core.converters; -import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.Iterator; @@ -94,7 +93,7 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato Class cls = javaType.getRawClass(); if (replacePageWithPagedModel && PAGE_TO_REPLACE.equals(cls.getCanonicalName())) { if (!type.isSchemaProperty()) - type = resolvePagedModelType(type); + type = resolvePagedModelType(javaType); else type.name(getParentTypeName(type, cls)); } @@ -108,13 +107,12 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato * @param type the type * @return the annotated type */ - private AnnotatedType resolvePagedModelType(AnnotatedType type) { - Type pageType = type.getType(); - if (pageType instanceof ParameterizedType) { - Type argumentType = ((ParameterizedType) type.getType()).getActualTypeArguments()[0]; + private AnnotatedType resolvePagedModelType(JavaType type) { + if(type.hasGenericTypes()){ + JavaType innerType = type.containedType(0); Type pagedModelType = ResolvableType - .forClassWithGenerics(PagedModel.class, ResolvableType.forType(argumentType)) - .getType(); + .forClassWithGenerics(PagedModel.class, ResolvableType.forType(innerType)) + .getType(); return new AnnotatedType(pagedModelType).resolveAsRef(true); } else { diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java index ae53b9bcc..d01a83557 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app10/HelloController.java @@ -31,6 +31,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.web.PagedModel; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @@ -43,6 +44,11 @@ public Page pageSimple() { return pageImpl("test"); } + @GetMapping("/page-simple-response") + public ResponseEntity> pageSimpleResponse() { + return null; + } + @GetMapping("/paged-model-simple") public PagedModel pagedModelSimple() { return pagedModel("test"); @@ -76,4 +82,8 @@ private Page pageImpl(T value) { return new PageImpl<>(List.of(value)); } + public record UserDto( + String id, + String email + ) {} } diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-direct.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-direct.json index e755bde7a..d234570e6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-direct.json +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-direct.json @@ -91,6 +91,26 @@ } } }, + "/page-simple-response": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageSimpleResponse", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PageUserDto" + } + } + } + } + } + } + }, "/page-raw": { "get": { "tags": [ @@ -294,6 +314,63 @@ } } }, + "PageUserDto": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "$ref": "#/components/schemas/SortObject" + }, + "pageable": { + "$ref": "#/components/schemas/PageableObject" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "empty": { + "type": "boolean" + } + } + }, + "UserDto": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "email": { + "type": "string" + } + } + }, "Page": { "type": "object", "properties": { diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-via_dto.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-via_dto.json index 44350a658..6b4da9192 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-via_dto.json +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app10-via_dto.json @@ -91,6 +91,26 @@ } } }, + "/page-simple-response": { + "get": { + "tags": [ + "hello-controller" + ], + "operationId": "pageSimpleResponse", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PagedModelUserDto" + } + } + } + } + } + } + }, "/page-raw": { "get": { "tags": [ @@ -207,6 +227,31 @@ "$ref": "#/components/schemas/PageMetadata" } } + }, + "PagedModelUserDto": { + "type": "object", + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + }, + "page": { + "$ref": "#/components/schemas/PageMetadata" + } + } + }, + "UserDto": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "email": { + "type": "string" + } + } } } } From ec43ffbd6e316aa8fb359552f41fe2913a629fad Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 22 Mar 2025 20:32:52 +0100 Subject: [PATCH 221/226] LocalTime, YearMonth, MonthDay are not serialized correctly in ISO 8601 format. Fixes #2938 --- .../configuration/SpringDocConfiguration.java | 9 +++ .../MethodParameterPojoExtractor.java | 20 ++++- .../properties/SpringDocConfigProperties.java | 23 ++++++ .../org/springdoc/core/utils/Constants.java | 5 ++ .../springdoc/core/utils/SpringDocUtils.java | 57 ++++++++++++++ .../app115/JavaTimeOperationCustomizer.java | 1 - .../api/v30/app115/SpringDocApp115Test.java | 3 + .../api/v31/app115/SpringDocApp115Test.java | 17 ++++ .../api/v31/app243/HelloController.java | 26 +++++++ .../api/v31/app243/SpringDocApp243Test.java | 37 +++++++++ .../test/resources/results/3.0.1/app115.json | 2 +- .../test/resources/results/3.1.0/app243.json | 78 +++++++++++++++++++ .../api/v30/app115/SpringDocApp115Test.java | 16 ++++ .../api/v31/app115/SpringDocApp115Test.java | 17 ++++ 14 files changed, 308 insertions(+), 3 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app243/HelloController.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app243/SpringDocApp243Test.java create mode 100644 springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app243.json diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java index a8de59cbe..7a90d21d9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java @@ -130,6 +130,7 @@ import static org.springdoc.core.utils.Constants.GLOBAL_OPEN_API_CUSTOMIZER; import static org.springdoc.core.utils.Constants.SPRINGDOC_DEPRECATING_CONVERTER_ENABLED; import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLED; +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_EXTRA_SCHEMAS; import static org.springdoc.core.utils.Constants.SPRINGDOC_POLYMORPHIC_CONVERTER_ENABLED; import static org.springdoc.core.utils.Constants.SPRINGDOC_SCHEMA_RESOLVE_PROPERTIES; import static org.springdoc.core.utils.Constants.SPRINGDOC_SHOW_ACTUATOR; @@ -158,6 +159,14 @@ public class SpringDocConfiguration { .addResponseWrapperToIgnore(Future.class); } + @Bean + @Lazy(false) + @ConditionalOnProperty(name = SPRINGDOC_ENABLE_EXTRA_SCHEMAS, matchIfMissing = true) + Object initExtraSchemas() { + getConfig().initExtraSchemas(); + return null; + } + /** * Springdoc bean factory post processor bean factory post processor. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java index 643c2d9fd..715ef1b59 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/extractor/MethodParameterPojoExtractor.java @@ -35,7 +35,15 @@ import java.lang.reflect.TypeVariable; import java.nio.charset.Charset; import java.time.Duration; +import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.LocalTime; +import java.time.MonthDay; +import java.time.OffsetTime; +import java.time.Period; +import java.time.Year; +import java.time.YearMonth; +import java.time.ZoneOffset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -49,6 +57,7 @@ import java.util.OptionalInt; import java.util.OptionalLong; import java.util.Set; +import java.util.TimeZone; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Predicate; @@ -96,8 +105,17 @@ public class MethodParameterPojoExtractor { SIMPLE_TYPES.add(Iterable.class); SIMPLE_TYPES.add(Duration.class); SIMPLE_TYPES.add(LocalTime.class); + SIMPLE_TYPES.add(LocalDateTime.class); + SIMPLE_TYPES.add(LocalDate.class); + SIMPLE_TYPES.add(YearMonth.class); + SIMPLE_TYPES.add(MonthDay.class); + SIMPLE_TYPES.add(Year.class); SIMPLE_TYPES.add(Class.class); - + SIMPLE_TYPES.add(Period.class); + SIMPLE_TYPES.add(OffsetTime.class); + SIMPLE_TYPES.add(ZoneOffset.class); + SIMPLE_TYPES.add(TimeZone.class); + SIMPLE_TYPE_PREDICATES.add(Class::isPrimitive); SIMPLE_TYPE_PREDICATES.add(Class::isEnum); SIMPLE_TYPE_PREDICATES.add(Class::isArray); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java index 25d76f1d2..73cdf9f6e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/properties/SpringDocConfigProperties.java @@ -274,6 +274,29 @@ public class SpringDocConfigProperties { */ private OpenAPI OpenApi; + /** + * The Enable extra schemas resolution. + */ + private boolean enableExtraSchemas; + + /** + * Is enable additional schemas resolution boolean. + * + * @return the boolean + */ + public boolean isEnableExtraSchemas() { + return enableExtraSchemas; + } + + /** + * Sets enable additional schemas resolution. + * + * @param enableExtraSchemas the enable additional schemas resolution + */ + public void setEnableExtraSchemas(boolean enableExtraSchemas) { + this.enableExtraSchemas = enableExtraSchemas; + } + /** * Gets open api. * diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java index 9453a832d..9ab905af6 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/Constants.java @@ -424,6 +424,11 @@ public final class Constants { */ public static final String SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED = "springdoc.nullable-request-parameter-enabled"; + /** + * The constant SPRINGDOC_ENABLE_ADDITIONAL_SCHEMAS_RESOLUTION. + */ + public static final String SPRINGDOC_ENABLE_EXTRA_SCHEMAS = "springdoc.enable-extra-schemas"; + /** * Instantiates a new Constants. */ diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java index 7b6a8f718..7ea76e19e 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocUtils.java @@ -27,13 +27,26 @@ package org.springdoc.core.utils; import java.lang.annotation.Annotation; +import java.nio.charset.Charset; +import java.time.Duration; +import java.time.LocalTime; +import java.time.MonthDay; +import java.time.OffsetTime; +import java.time.Period; +import java.time.Year; +import java.time.YearMonth; +import java.time.ZoneId; +import java.time.ZoneOffset; import java.util.ArrayList; import java.util.List; +import java.util.Locale; +import java.util.TimeZone; import java.util.function.Predicate; import io.swagger.v3.core.converter.AnnotatedType; import io.swagger.v3.oas.models.media.Content; import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; @@ -356,6 +369,19 @@ public SpringDocUtils removeFromSchemaMap(Class clazz) { return this; } + /** + * Remove from schema map spring doc utils. + * + * @param classes the clazz + * @return the spring doc utils + */ + public SpringDocUtils removeFromSchemaMap(Class... classes) { + for (Class aClass : classes) { + AdditionalModelsConverter.removeFromSchemaMap(aClass); + } + return this; + } + /** * Remove from schema class spring doc utils. * @@ -502,5 +528,36 @@ public static void handleSchemaTypes(Content content) { }); } } + + /** + * Init extra schemas. + */ + public SpringDocUtils initExtraSchemas() { + replaceWithSchema(LocalTime.class, new StringSchema().example("14:30:00")); + replaceWithSchema(YearMonth.class, new StringSchema().example("2025-03")); + replaceWithSchema(MonthDay.class, new StringSchema().example("--03-22")); + replaceWithSchema(Year.class, new StringSchema().example("2025")); + replaceWithSchema(Duration.class, new StringSchema().example("PT2H30M")); + replaceWithSchema(Period.class, new StringSchema().example("P2Y3M")); + replaceWithSchema(OffsetTime.class, new StringSchema().example("14:30:00+01:00")); + replaceWithSchema(ZoneId.class, new StringSchema().example("Europe/Paris")); + replaceWithSchema(ZoneOffset.class, new StringSchema().example("+01:00")); + replaceWithSchema(TimeZone.class, new StringSchema().example("GMT")); + replaceWithSchema(Charset.class, new StringSchema().example("UTF-8")); + replaceWithSchema(Locale.class, new StringSchema().example("en-US")); + return this; + } + + /** + * Reset extra schemas spring doc utils. + * + * @return the spring doc utils + */ + public SpringDocUtils resetExtraSchemas() { + SpringDocUtils.getConfig().removeFromSchemaMap(LocalTime.class,YearMonth.class, + MonthDay.class, Year.class, Duration.class, Period.class, OffsetTime.class, + ZoneId.class, ZoneOffset.class, TimeZone.class, Charset.class, Locale.class); + return this; + } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java index 44564e9b6..30b00e3f7 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/JavaTimeOperationCustomizer.java @@ -46,7 +46,6 @@ public Operation customize(Operation operation, HandlerMethod handlerMethod) { Content content = response.getContent(); if (content.containsKey(MediaType.APPLICATION_JSON_VALUE)) { Schema schema = content.get(MediaType.APPLICATION_JSON_VALUE).getSchema(); - schema.getProperties().clear(); schema.setType("string"); } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java index b4ad1cf6b..07df36bd3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java @@ -27,8 +27,11 @@ import test.org.springdoc.api.v30.AbstractSpringDocV30Test; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_EXTRA_SCHEMAS; +@TestPropertySource(properties = SPRINGDOC_ENABLE_EXTRA_SCHEMAS + "=true") public class SpringDocApp115Test extends AbstractSpringDocV30Test { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java index d399eb272..7174c0e7a 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java @@ -24,13 +24,30 @@ package test.org.springdoc.api.v31.app115; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_EXTRA_SCHEMAS; +import static org.springdoc.core.utils.SpringDocUtils.getConfig; +@TestPropertySource(properties = SPRINGDOC_ENABLE_EXTRA_SCHEMAS + "=false") public class SpringDocApp115Test extends AbstractSpringDocTest { + @BeforeAll + public static void clear() { + getConfig().resetExtraSchemas(); + } + + @AfterAll + public static void restore() { + getConfig().initExtraSchemas(); + } + + @SpringBootApplication static class SpringDocTestApp {} diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app243/HelloController.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app243/HelloController.java new file mode 100644 index 000000000..82fb7016b --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app243/HelloController.java @@ -0,0 +1,26 @@ +package test.org.springdoc.api.v31.app243; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.MonthDay; +import java.time.Year; +import java.time.YearMonth; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + + @PostMapping("/time1") + public TimeDtoNoAnnotations postTime1(@RequestBody TimeDtoNoAnnotations timeDto) { + return timeDto; + } + + public record TimeDtoNoAnnotations (LocalDateTime localDateTime, + LocalDate localDate, LocalTime localTime, + YearMonth yearMonth, MonthDay monthDay, Year year) { + } +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app243/SpringDocApp243Test.java b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app243/SpringDocApp243Test.java new file mode 100644 index 000000000..a0c1cf782 --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app243/SpringDocApp243Test.java @@ -0,0 +1,37 @@ +/* + * + * * + * * * + * * * * + * * * * * + * * * * * * Copyright 2019-2025 the original author or authors. + * * * * * * + * * * * * * Licensed under the Apache License, Version 2.0 (the "License"); + * * * * * * you may not use this file except in compliance with the License. + * * * * * * You may obtain a copy of the License at + * * * * * * + * * * * * * https://www.apache.org/licenses/LICENSE-2.0 + * * * * * * + * * * * * * Unless required by applicable law or agreed to in writing, software + * * * * * * distributed under the License is distributed on an "AS IS" BASIS, + * * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * * * * * See the License for the specific language governing permissions and + * * * * * * limitations under the License. + * * * * * + * * * * + * * * + * * + * + */ + +package test.org.springdoc.api.v31.app243; + +import test.org.springdoc.api.v31.AbstractSpringDocTest; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +public class SpringDocApp243Test extends AbstractSpringDocTest { + + @SpringBootApplication + static class SpringDocTestApp {} +} \ No newline at end of file diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app115.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app115.json index 05aae2c64..a76d233d9 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app115.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app115.json @@ -24,7 +24,7 @@ "application/json": { "schema": { "type": "string", - "properties": {} + "example": "PT2H30M" } } } diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app243.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app243.json new file mode 100644 index 000000000..90905938d --- /dev/null +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app243.json @@ -0,0 +1,78 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/time1": { + "post": { + "tags": [ + "hello-controller" + ], + "operationId": "postTime1", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TimeDtoNoAnnotations" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/TimeDtoNoAnnotations" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TimeDtoNoAnnotations": { + "type": "object", + "properties": { + "localDateTime": { + "type": "string", + "format": "date-time" + }, + "localDate": { + "type": "string", + "format": "date" + }, + "localTime": { + "type": "string", + "example": "14:30:00" + }, + "yearMonth": { + "type": "string", + "example": "2025-03" + }, + "monthDay": { + "type": "string", + "example": "--03-22" + }, + "year": { + "type": "string", + "example": "2025" + } + } + } + } + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java index 49347f219..85d9a16e1 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v30/app115/SpringDocApp115Test.java @@ -26,16 +26,32 @@ package test.org.springdoc.api.v30.app115; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import test.org.springdoc.api.v30.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_EXTRA_SCHEMAS; +import static org.springdoc.core.utils.SpringDocUtils.getConfig; /** * The type Spring doc app 115 test. */ +@TestPropertySource(properties = SPRINGDOC_ENABLE_EXTRA_SCHEMAS + "=false") class SpringDocApp115Test extends AbstractSpringDocTest { + @BeforeAll + public static void clear() { + getConfig().resetExtraSchemas(); + } + + @AfterAll + public static void restore() { + getConfig().initExtraSchemas(); + } /** * The type Spring doc test app. */ diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java index 3565fd02f..8e2e3dfcd 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/v31/app115/SpringDocApp115Test.java @@ -26,16 +26,33 @@ package test.org.springdoc.api.v31.app115; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import test.org.springdoc.api.v31.AbstractSpringDocTest; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.TestPropertySource; + +import static org.springdoc.core.utils.Constants.SPRINGDOC_ENABLE_EXTRA_SCHEMAS; +import static org.springdoc.core.utils.SpringDocUtils.getConfig; /** * The type Spring doc app 115 test. */ +@TestPropertySource(properties = SPRINGDOC_ENABLE_EXTRA_SCHEMAS + "=false") class SpringDocApp115Test extends AbstractSpringDocTest { + @BeforeAll + public static void clear() { + getConfig().resetExtraSchemas(); + } + + @AfterAll + public static void restore() { + getConfig().initExtraSchemas(); + } + /** * The type Spring doc test app. */ From 34213052e112853cd0faa4ebd82b1ac3c756fb16 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 22 Mar 2025 21:28:38 +0100 Subject: [PATCH 222/226] Duplicate ModelConverter registration with Spring Boot DevTools. Fixes #2939 --- .../org/springdoc/core/converters/ModelConverterRegistrar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java index 8a363c93b..c2bdce87b 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/converters/ModelConverterRegistrar.java @@ -99,6 +99,6 @@ private boolean isSameConverter(ModelConverter modelConverter1, ModelConverter m // comparing by the converter type Class modelConverter1Class = modelConverter1.getClass(); Class modelConverter2Class = modelConverter2.getClass(); - return modelConverter1Class.equals(modelConverter2Class); + return modelConverter1Class.getName().equals(modelConverter2Class.getName()); } } From e18565465ce94effb9ea33ac3d871e84b62740f6 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sat, 22 Mar 2025 21:54:32 +0100 Subject: [PATCH 223/226] Upgrade spring-boot to version 3.4.4 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2b000f6b..f8fd4277d 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.2 + 3.4.4 From 20e5eecd3283a45b01fe4e2b20df88eb051e2496 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 23 Mar 2025 00:52:12 +0100 Subject: [PATCH 224/226] SpringBoot native fails /v3/api-docs when using a Map as an http entity field. Fixes #2941 --- .../springdoc/core/configuration/hints/SpringDocHints.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java index dad4e1b11..2a9cdd4bb 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/hints/SpringDocHints.java @@ -196,7 +196,9 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) { MemberCategory.INVOKE_DECLARED_METHODS)) .registerType(java.lang.ModuleLayer.class, MemberCategory.INVOKE_DECLARED_METHODS) .registerType(java.lang.module.Configuration.class, MemberCategory.INVOKE_DECLARED_METHODS) - .registerType(java.lang.module.ResolvedModule.class, MemberCategory.INVOKE_DECLARED_METHODS); + .registerType(java.lang.module.ResolvedModule.class, MemberCategory.INVOKE_DECLARED_METHODS) + .registerType(java.lang.invoke.MethodHandles.class, MemberCategory.DECLARED_CLASSES) + .registerType(java.lang.invoke.MethodHandles.Lookup.class); //swagger-models Arrays.stream(typesToRegister).forEach(aClass -> hints.reflection().registerType(aClass, From c047b12fffcf950f1e7e1bc5c9af8261dc1c3b27 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 23 Mar 2025 16:16:11 +0100 Subject: [PATCH 225/226] CHANGELOG.md update for the next release 2.8.6 --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81c356a35..bd9abdf91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,34 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.8.6] - 2025-03-23 + +### Added +- #2909 - Check both SerDe BeanPropertyDefinition for @JsonUnwrapped/@Schema +- #2927 - Bail sealed class subtype introspection on Schema +- #2917 - Add Future to ignored response wrappers +- #2938 - Add out of the box support for LocalTime, YearMonth, MonthDay + +### Changed +- Upgrade swagger-ui to v5.20.1 +- Upgrade swagger-core to 2.2.29 +- Upgrade spring-cloud-function to 4.2.2 +- Upgrade spring-boot to version 3.4.4 + +### Fixed +- #2928 - Add missing builder methods in SchemaBuilder +- #2905 - ModelResolver.enumAsRef = true result in invalid openapi with actuator using enum param +- #2939 - Duplicate ModelConverter registration with Spring Boot DevTools +- #2941 - SpringBoot native fails /v3/api-docs when using a Map as an http entity field + ## [2.8.5] - 2025-02-16 ### Added - #2696 - Do not require JsonSubType annotation for sealed classes - #2898 - add needed runtime reflection hints for native image - #2891 - Refactor trimIndent Method +- #2931 - OpenAPIService serverBaseUrl is not thread safe +- #2933 - Wrong schema generation with PagedModel generated VIA_DTO and wrapped in ResponseEntity ### Changed - Upgrade swagger-ui to v5.18.3 From 3cf77ca83993812a7fc713b11023913931fc6e29 Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 23 Mar 2025 15:38:30 +0000 Subject: [PATCH 226/226] [maven-release-plugin] prepare release v2.8.6 --- pom.xml | 4 ++-- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-ui/pom.xml | 2 +- springdoc-openapi-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-actuator-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-data-rest-tests/pom.xml | 2 +- .../springdoc-openapi-function-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-function-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-groovy-tests/pom.xml | 2 +- .../springdoc-openapi-hateoas-tests/pom.xml | 2 +- .../springdoc-openapi-javadoc-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webflux-tests/pom.xml | 2 +- .../springdoc-openapi-kotlin-webmvc-tests/pom.xml | 2 +- .../springdoc-openapi-security-tests/pom.xml | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index f8fd4277d..face97266 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 2.8.6-SNAPSHOT + 2.8.6 pom Spring openapi documentation Spring openapi documentation @@ -35,7 +35,7 @@ scm:git:git@github.com:springdoc/springdoc-openapi.git scm:git:git@github.com:springdoc/springdoc-openapi.git - HEAD + v2.8.6 diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index f0089a84e..e1c2478ef 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.6-SNAPSHOT + 2.8.6 springdoc-openapi-starter-common diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index da678d450..d8561a1a1 100644 --- a/springdoc-openapi-starter-webflux-api/pom.xml +++ b/springdoc-openapi-starter-webflux-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.6-SNAPSHOT + 2.8.6 springdoc-openapi-starter-webflux-api diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index a50268c98..bab8b9300 100644 --- a/springdoc-openapi-starter-webflux-ui/pom.xml +++ b/springdoc-openapi-starter-webflux-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.6-SNAPSHOT + 2.8.6 springdoc-openapi-starter-webflux-ui diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index fca9f5fbc..7d5d4d9d6 100644 --- a/springdoc-openapi-starter-webmvc-api/pom.xml +++ b/springdoc-openapi-starter-webmvc-api/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.6-SNAPSHOT + 2.8.6 springdoc-openapi-starter-webmvc-api diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index 11d82fda8..7ed29e781 100644 --- a/springdoc-openapi-starter-webmvc-ui/pom.xml +++ b/springdoc-openapi-starter-webmvc-ui/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 2.8.6-SNAPSHOT + 2.8.6 springdoc-openapi-starter-webmvc-ui diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index d7398f973..ba5baae2d 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 2.8.6-SNAPSHOT + 2.8.6 pom 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml index 336d94f91..70561b053 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.6-SNAPSHOT + 2.8.6 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml index 549991d94..37c744f5a 100644 --- a/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-actuator-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.6-SNAPSHOT + 2.8.6 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml index aad43ce15..d62b2c529 100644 --- a/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-data-rest-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.6-SNAPSHOT + 2.8.6 4.0.0 springdoc-openapi-data-rest-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml index bba075327..64ff3beba 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.6-SNAPSHOT + 2.8.6 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml index 20eb8c2d4..7d7df798b 100644 --- a/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.6-SNAPSHOT + 2.8.6 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml index 387f3d047..d4e6d6b63 100644 --- a/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-groovy-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.6-SNAPSHOT + 2.8.6 springdoc-openapi-groovy-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index b680e25cf..987a24006 100644 --- a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.6-SNAPSHOT + 2.8.6 4.0.0 springdoc-openapi-hateoas-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml index c49cb6bf6..6491c9963 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/pom.xml @@ -2,7 +2,7 @@ org.springdoc springdoc-openapi-tests - 2.8.6-SNAPSHOT + 2.8.6 4.0.0 diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml index 2f8b44219..ead2ee893 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webflux-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.6-SNAPSHOT + 2.8.6 4.0.0 springdoc-openapi-kotlin-webflux-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml index b22d9ff96..08245a8bf 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi-tests org.springdoc - 2.8.6-SNAPSHOT + 2.8.6 4.0.0 springdoc-openapi-kotlin-webmvc-tests diff --git a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml index f6a527572..5bbb39b2c 100644 --- a/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml +++ b/springdoc-openapi-tests/springdoc-openapi-security-tests/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi-tests - 2.8.6-SNAPSHOT + 2.8.6 springdoc-openapi-security-tests